From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 00:42:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B7A42698; Sun, 30 Jun 2013 00:42:51 +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 A98AA1B92; Sun, 30 Jun 2013 00:42:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U0gp4U076135; Sun, 30 Jun 2013 00:42:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U0gpqr076134; Sun, 30 Jun 2013 00:42:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306300042.r5U0gpqr076134@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 30 Jun 2013 00:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252397 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 00:42:51 -0000 Author: pfg Date: Sun Jun 30 00:42:51 2013 New Revision: 252397 URL: http://svnweb.freebsd.org/changeset/base/252397 Log: ext2fs: Use the complete random() range in i_gen. i_gen is unsigned in ext2fs so we can handle the complete 32 bits. MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sat Jun 29 23:58:16 2013 (r252396) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Jun 30 00:42:51 2013 (r252397) @@ -979,7 +979,7 @@ ext2_vget(struct mount *mp, ino_t ino, i * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = random() / 2 + 1; + ip->i_gen = random() + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) ip->i_flag |= IN_MODIFIED; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 01:05:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC372A85; Sun, 30 Jun 2013 01:05:24 +0000 (UTC) (envelope-from hiren@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 BE50A1BF1; Sun, 30 Jun 2013 01:05:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U15Oit082320; Sun, 30 Jun 2013 01:05:24 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U15OkY082319; Sun, 30 Jun 2013 01:05:24 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201306300105.r5U15OkY082319@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 30 Jun 2013 01:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252399 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 01:05:24 -0000 Author: hiren Date: Sun Jun 30 01:05:24 2013 New Revision: 252399 URL: http://svnweb.freebsd.org/changeset/base/252399 Log: Fixing incorrect id for Intel Centrino Wireless-N 130. PR: kern/180094 Submitted by: Cedric Approved by: sbruno (mentor) MFC after: 3 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Jun 30 00:48:48 2013 (r252398) +++ head/sys/dev/iwn/if_iwn.c Sun Jun 30 01:05:24 2013 (r252399) @@ -94,7 +94,7 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, - { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 01:21:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B450D87; Sun, 30 Jun 2013 01:21:00 +0000 (UTC) (envelope-from hiren@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 1E4C51C5F; Sun, 30 Jun 2013 01:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U1L0f8087876; Sun, 30 Jun 2013 01:21:00 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U1KxCO087875; Sun, 30 Jun 2013 01:20:59 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201306300120.r5U1KxCO087875@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 30 Jun 2013 01:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252400 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 01:21:00 -0000 Author: hiren Date: Sun Jun 30 01:20:59 2013 New Revision: 252400 URL: http://svnweb.freebsd.org/changeset/base/252400 Log: Adding myself to the calendar! Approved by: sbruno (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Jun 30 01:05:24 2013 (r252399) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Jun 30 01:20:59 2013 (r252400) @@ -62,6 +62,7 @@ 02/14 Manolis Kiagias born in Chania, Greece, 1970 02/14 Erwin Lansing born in 's-Hertogenbosch, the Netherlands, 1975 02/14 Martin Blapp born in Olten, Switzerland, 1976 +02/15 Hiren Panchasara born in Ahmedabad, Gujarat, India, 1984 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 05:10:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D7B8ECF; Sun, 30 Jun 2013 05:10:33 +0000 (UTC) (envelope-from rpaulo@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 8B2671204; Sun, 30 Jun 2013 05:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U5AXeC055127; Sun, 30 Jun 2013 05:10:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U5AXL5055126; Sun, 30 Jun 2013 05:10:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201306300510.r5U5AXL5055126@svn.freebsd.org> From: Rui Paulo Date: Sun, 30 Jun 2013 05:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252401 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 05:10:33 -0000 Author: rpaulo Date: Sun Jun 30 05:10:33 2013 New Revision: 252401 URL: http://svnweb.freebsd.org/changeset/base/252401 Log: Fix a reference count bug in urtwn_ra_init(). Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 01:20:59 2013 (r252400) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 05:10:33 2013 (r252401) @@ -1253,6 +1253,7 @@ urtwn_ra_init(struct urtwn_softc *sc) cmd.mask = htole32(mode << 28 | basicrates); error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd)); if (error != 0) { + ieee80211_free_node(ni); device_printf(sc->sc_dev, "could not add broadcast station\n"); return (error); @@ -1267,6 +1268,7 @@ urtwn_ra_init(struct urtwn_softc *sc) cmd.mask = htole32(mode << 28 | rates); error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd)); if (error != 0) { + ieee80211_free_node(ni); device_printf(sc->sc_dev, "could not add BSS station\n"); return (error); } @@ -1277,6 +1279,8 @@ urtwn_ra_init(struct urtwn_softc *sc) /* Indicate highest supported rate. */ ni->ni_txrate = rs->rs_nrates - 1; + ieee80211_free_node(ni); + return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 05:12:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D364E6; Sun, 30 Jun 2013 05:12:19 +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 2F4181218; Sun, 30 Jun 2013 05:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U5CJdQ055604; Sun, 30 Jun 2013 05:12:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U5CIQL055599; Sun, 30 Jun 2013 05:12:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201306300512.r5U5CIQL055599@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 30 Jun 2013 05:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252402 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 05:12:19 -0000 Author: yongari Date: Sun Jun 30 05:12:18 2013 New Revision: 252402 URL: http://svnweb.freebsd.org/changeset/base/252402 Log: Fix triggering false watchdog timeout when controller is in PAUSE state. Previously it used to check if controller has sent a PAUSE frame to the remote peer. Reported by: David Imhoff via Brad Smith Submitted by: davidch (initial version) Reviewed by: davidch, David Imhoff Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Sun Jun 30 05:10:33 2013 (r252401) +++ head/sys/dev/bce/if_bce.c Sun Jun 30 05:12:18 2013 (r252402) @@ -2077,10 +2077,12 @@ bce_miibus_statchg(device_t dev) DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); + sc->bce_flags |= BCE_USING_RX_FLOW_CONTROL; } else { DBPRINT(sc, BCE_INFO_PHY, "%s(): Disabling RX flow control.\n", __FUNCTION__); BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); + sc->bce_flags &= ~BCE_USING_RX_FLOW_CONTROL; } if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) { @@ -7828,18 +7830,42 @@ bce_ioctl(struct ifnet *ifp, u_long comm static void bce_watchdog(struct bce_softc *sc) { + uint32_t status; + DBENTER(BCE_EXTREME_SEND); BCE_LOCK_ASSERT(sc); + status = 0; /* If the watchdog timer hasn't expired then just exit. */ if (sc->watchdog_timer == 0 || --sc->watchdog_timer) goto bce_watchdog_exit; + status = REG_RD(sc, BCE_EMAC_RX_STATUS); /* If pause frames are active then don't reset the hardware. */ - /* ToDo: Should we reset the timer here? */ - if (REG_RD(sc, BCE_EMAC_TX_STATUS) & BCE_EMAC_TX_STATUS_XOFFED) - goto bce_watchdog_exit; + if ((sc->bce_flags & BCE_USING_RX_FLOW_CONTROL) != 0) { + if ((status & BCE_EMAC_RX_STATUS_FFED) != 0) { + /* + * If link partner has us in XOFF state then wait for + * the condition to clear. + */ + sc->watchdog_timer = BCE_TX_TIMEOUT; + goto bce_watchdog_exit; + } else if ((status & BCE_EMAC_RX_STATUS_FF_RECEIVED) != 0 && + (status & BCE_EMAC_RX_STATUS_N_RECEIVED) != 0) { + /* + * If we're not currently XOFF'ed but have recently + * been XOFF'd/XON'd then assume that's delaying TX + * this time around. + */ + sc->watchdog_timer = BCE_TX_TIMEOUT; + goto bce_watchdog_exit; + } + /* + * Any other condition is unexpected and the controller + * should be reset. + */ + } BCE_PRINTF("%s(%d): Watchdog timeout occurred, resetting!\n", __FILE__, __LINE__); @@ -7863,6 +7889,7 @@ bce_watchdog(struct bce_softc *sc) sc->bce_ifp->if_oerrors++; bce_watchdog_exit: + REG_WR(sc, BCE_EMAC_RX_STATUS, status); DBEXIT(BCE_EXTREME_SEND); } Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Sun Jun 30 05:10:33 2013 (r252401) +++ head/sys/dev/bce/if_bcereg.h Sun Jun 30 05:12:18 2013 (r252402) @@ -6465,6 +6465,7 @@ struct bce_softc #define BCE_USING_MSIX_FLAG 0x00000100 #define BCE_PCIE_FLAG 0x00000200 #define BCE_USING_TX_FLOW_CONTROL 0x00000400 +#define BCE_USING_RX_FLOW_CONTROL 0x00000800 /* Controller capability flags. */ u32 bce_cap_flags; From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 05:25:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 77F5148C; Sun, 30 Jun 2013 05:25:25 +0000 (UTC) (envelope-from rpaulo@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 66CB01275; Sun, 30 Jun 2013 05:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U5PPSo058813; Sun, 30 Jun 2013 05:25:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U5PP6s058812; Sun, 30 Jun 2013 05:25:25 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201306300525.r5U5PP6s058812@svn.freebsd.org> From: Rui Paulo Date: Sun, 30 Jun 2013 05:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252403 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 05:25:25 -0000 Author: rpaulo Date: Sun Jun 30 05:25:24 2013 New Revision: 252403 URL: http://svnweb.freebsd.org/changeset/base/252403 Log: Fix the ni_txrate calculation. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 05:12:18 2013 (r252402) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 05:25:24 2013 (r252403) @@ -1278,7 +1278,7 @@ urtwn_ra_init(struct urtwn_softc *sc) maxrate); /* Indicate highest supported rate. */ - ni->ni_txrate = rs->rs_nrates - 1; + ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; ieee80211_free_node(ni); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 05:56:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00ACA6AF; Sun, 30 Jun 2013 05:56:13 +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 CD50012DA; Sun, 30 Jun 2013 05:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U5uDDb067154; Sun, 30 Jun 2013 05:56:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U5uDYM067152; Sun, 30 Jun 2013 05:56:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201306300556.r5U5uDYM067152@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 30 Jun 2013 05:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252404 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 05:56:14 -0000 Author: yongari Date: Sun Jun 30 05:56:13 2013 New Revision: 252404 URL: http://svnweb.freebsd.org/changeset/base/252404 Log: Fix triggering false watchdog timeout as done in bce(4) when controller is in PAUSE state. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Jun 30 05:25:24 2013 (r252403) +++ head/sys/dev/bge/if_bge.c Sun Jun 30 05:56:13 2013 (r252404) @@ -5271,7 +5271,7 @@ bge_start_locked(struct ifnet *ifp) /* * Set a timeout in case the chip goes out to lunch. */ - sc->bge_timer = 5; + sc->bge_timer = BGE_TX_TIMEOUT; } } @@ -5776,12 +5776,40 @@ static void bge_watchdog(struct bge_softc *sc) { struct ifnet *ifp; + uint32_t status; BGE_LOCK_ASSERT(sc); if (sc->bge_timer == 0 || --sc->bge_timer) return; + /* If pause frames are active then don't reset the hardware. */ + if ((CSR_READ_4(sc, BGE_RX_MODE) & BGE_RXMODE_FLOWCTL_ENABLE) != 0) { + status = CSR_READ_4(sc, BGE_RX_STS); + if ((status & BGE_RXSTAT_REMOTE_XOFFED) != 0) { + /* + * If link partner has us in XOFF state then wait for + * the condition to clear. + */ + CSR_WRITE_4(sc, BGE_RX_STS, status); + sc->bge_timer = BGE_TX_TIMEOUT; + return; + } else if ((status & BGE_RXSTAT_RCVD_XOFF) != 0 && + (status & BGE_RXSTAT_RCVD_XON) != 0) { + /* + * If link partner has us in XOFF state then wait for + * the condition to clear. + */ + CSR_WRITE_4(sc, BGE_RX_STS, status); + sc->bge_timer = BGE_TX_TIMEOUT; + return; + } + /* + * Any other condition is unexpected and the controller + * should be reset. + */ + } + ifp = sc->bge_ifp; if_printf(ifp, "watchdog timeout -- resetting\n"); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sun Jun 30 05:25:24 2013 (r252403) +++ head/sys/dev/bge/if_bgereg.h Sun Jun 30 05:56:13 2013 (r252404) @@ -2918,6 +2918,7 @@ struct bge_dmamap_arg { #define BGE_HWREV_TIGON_II 0x02 #define BGE_TIMEOUT 100000 #define BGE_TXCONS_UNSET 0xFFFF /* impossible value */ +#define BGE_TX_TIMEOUT 5 struct bge_bcom_hack { int reg; From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 06:04:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 36A8184D; Sun, 30 Jun 2013 06:04:01 +0000 (UTC) (envelope-from rpaulo@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 2831012F6; Sun, 30 Jun 2013 06:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U641bD069905; Sun, 30 Jun 2013 06:04:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U641cZ069904; Sun, 30 Jun 2013 06:04:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201306300604.r5U641cZ069904@svn.freebsd.org> From: Rui Paulo Date: Sun, 30 Jun 2013 06:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252405 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 06:04:01 -0000 Author: rpaulo Date: Sun Jun 30 06:04:00 2013 New Revision: 252405 URL: http://svnweb.freebsd.org/changeset/base/252405 Log: Fix the RSSI calculation. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 05:56:13 2013 (r252404) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 06:04:00 2013 (r252405) @@ -80,6 +80,7 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu "Debug level"); #endif +#define URTWN_RSSI((r)) (r) - 110 #define IEEE80211_HAS_ADDR4(wh) \ (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) @@ -610,6 +611,11 @@ urtwn_rx_frame(struct urtwn_softc *sc, u rssi = urtwn_get_rssi(sc, rate, &stat[1]); /* Update our average RSSI. */ urtwn_update_avgrssi(sc, rate, rssi); + /* + * Convert the RSSI to a range that will be accepted + * by net80211. + */ + rssi = URTWN_RSSI(rssi); } m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 06:05:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 697309C8; Sun, 30 Jun 2013 06:05:33 +0000 (UTC) (envelope-from rpaulo@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 5AD4B12FE; Sun, 30 Jun 2013 06:05:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U65XP7070193; Sun, 30 Jun 2013 06:05:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U65XtL070192; Sun, 30 Jun 2013 06:05:33 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201306300605.r5U65XtL070192@svn.freebsd.org> From: Rui Paulo Date: Sun, 30 Jun 2013 06:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252406 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 06:05:33 -0000 Author: rpaulo Date: Sun Jun 30 06:05:32 2013 New Revision: 252406 URL: http://svnweb.freebsd.org/changeset/base/252406 Log: Fix a typo. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 06:04:00 2013 (r252405) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Jun 30 06:05:32 2013 (r252406) @@ -80,7 +80,7 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu "Debug level"); #endif -#define URTWN_RSSI((r)) (r) - 110 +#define URTWN_RSSI(r) (r) - 110 #define IEEE80211_HAS_ADDR4(wh) \ (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 07:37:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 618D1175; Sun, 30 Jun 2013 07:37:32 +0000 (UTC) (envelope-from hrs@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 52D92163D; Sun, 30 Jun 2013 07:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U7bWG3096071; Sun, 30 Jun 2013 07:37:32 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U7bWkB096070; Sun, 30 Jun 2013 07:37:32 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306300737.r5U7bWkB096070@svn.freebsd.org> From: Hiroki Sato Date: Sun, 30 Jun 2013 07:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252408 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 07:37:32 -0000 Author: hrs Date: Sun Jun 30 07:37:31 2013 New Revision: 252408 URL: http://svnweb.freebsd.org/changeset/base/252408 Log: Do not display a warning message in a jail without AF_INET6 support. MFC after: 3 days Modified: head/sbin/ifconfig/af_nd6.c Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Sun Jun 30 06:44:31 2013 (r252407) +++ head/sbin/ifconfig/af_nd6.c Sun Jun 30 07:37:31 2013 (r252408) @@ -148,7 +148,7 @@ nd6_status(int s) memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - if (errno != EAFNOSUPPORT) + if (errno != EAFNOSUPPORT && error != EPROTONOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); return; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 07:46:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F10B1452; Sun, 30 Jun 2013 07:46:23 +0000 (UTC) (envelope-from hrs@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 E337A167B; Sun, 30 Jun 2013 07:46:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U7kN7A098762; Sun, 30 Jun 2013 07:46:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U7kNRw098760; Sun, 30 Jun 2013 07:46:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306300746.r5U7kNRw098760@svn.freebsd.org> From: Hiroki Sato Date: Sun, 30 Jun 2013 07:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252409 - in head: crypto/heimdal/lib/gssapi/gssapi include/gssapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 07:46:24 -0000 Author: hrs Date: Sun Jun 30 07:46:22 2013 New Revision: 252409 URL: http://svnweb.freebsd.org/changeset/base/252409 Log: Fix gssapi/gssapi_krb5.h after Heimdal 1.5.1 import. Reviewed by: dfr Modified: head/crypto/heimdal/lib/gssapi/gssapi/gssapi_krb5.h head/include/gssapi/gssapi.h Modified: head/crypto/heimdal/lib/gssapi/gssapi/gssapi_krb5.h ============================================================================== --- head/crypto/heimdal/lib/gssapi/gssapi/gssapi_krb5.h Sun Jun 30 07:37:31 2013 (r252408) +++ head/crypto/heimdal/lib/gssapi/gssapi/gssapi_krb5.h Sun Jun 30 07:46:22 2013 (r252409) @@ -36,7 +36,7 @@ #ifndef GSSAPI_KRB5_H_ #define GSSAPI_KRB5_H_ -#include +#include GSSAPI_CPP_START Modified: head/include/gssapi/gssapi.h ============================================================================== --- head/include/gssapi/gssapi.h Sun Jun 30 07:37:31 2013 (r252408) +++ head/include/gssapi/gssapi.h Sun Jun 30 07:46:22 2013 (r252409) @@ -44,6 +44,33 @@ typedef __ssize_t ssize_t; #define _SSIZE_T_DECLARED #endif +/* Compatibility with Heimdal 1.5.1 */ +#ifndef GSSAPI_CPP_START +#ifdef __cplusplus +#define GSSAPI_CPP_START extern "C" { +#define GSSAPI_CPP_END } +#else +#define GSSAPI_CPP_START +#define GSSAPI_CPP_END +#endif +#endif + +/* Compatibility with Heimdal 1.5.1 */ +#ifndef BUILD_GSSAPI_LIB +#define GSSAPI_LIB_FUNCTION +#define GSSAPI_LIB_CALL +#define GSSAPI_LIB_VARIABLE +#endif + +/* Compatibility with Heimdal 1.5.1 */ +#ifndef GSSAPI_DEPRECATED_FUNCTION +#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 ))) +#define GSSAPI_DEPRECATED_FUNCTION(X) __attribute__((deprecated)) +#else +#define GSSAPI_DEPRECATED_FUNCTION(X) +#endif +#endif + #if 0 /* * If the platform supports the xom.h header file, it should be From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 08:36:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62C9ABD4; Sun, 30 Jun 2013 08:36:20 +0000 (UTC) (envelope-from trociny@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 5361017CC; Sun, 30 Jun 2013 08:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U8aKDS013265; Sun, 30 Jun 2013 08:36:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U8aKfe013264; Sun, 30 Jun 2013 08:36:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201306300836.r5U8aKfe013264@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 30 Jun 2013 08:36: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: r252410 - stable/9/lib/libprocstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 08:36:20 -0000 Author: trociny Date: Sun Jun 30 08:36:19 2013 New Revision: 252410 URL: http://svnweb.freebsd.org/changeset/base/252410 Log: MFC r250378: Make errbuf optional, so if a caller is not interested in an error message she can pass NULL (procstat(1) already does this). Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Sun Jun 30 07:46:22 2013 (r252409) +++ stable/9/lib/libprocstat/libprocstat.c Sun Jun 30 08:36:19 2013 (r252410) @@ -902,7 +902,8 @@ procstat_get_pipe_info(struct procstat * return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -931,7 +932,8 @@ procstat_get_pipe_info_kvm(kvm_t *kd, st return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -967,7 +969,8 @@ procstat_get_pts_info(struct procstat *p return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -995,7 +998,8 @@ procstat_get_pts_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1030,7 +1034,8 @@ procstat_get_sem_info(struct procstat *p return (procstat_get_sem_info_sysctl(fst, sem, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1076,7 +1081,8 @@ procstat_get_sem_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1111,7 +1117,8 @@ procstat_get_shm_info(struct procstat *p return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1157,7 +1164,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1192,7 +1200,8 @@ procstat_get_vnode_info(struct procstat return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1264,7 +1273,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s break; } if (i == NTYPES) { - snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); return (1); } vn->vn_mntdir = getmnton(kd, vnode.v_mount); @@ -1278,7 +1288,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1359,7 +1370,10 @@ procstat_get_vnode_info_sysctl(struct fi if (vntype == PS_FST_VTYPE_VNON || vntype == PS_FST_VTYPE_VBAD) return (0); if ((status & KF_ATTR_VALID) == 0) { - snprintf(errbuf, _POSIX2_LINE_MAX, "? (no info available)"); + if (errbuf != NULL) { + snprintf(errbuf, _POSIX2_LINE_MAX, + "? (no info available)"); + } return (1); } if (path && *path) { @@ -1400,7 +1414,8 @@ procstat_get_socket_info(struct procstat return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1498,7 +1513,8 @@ procstat_get_socket_info_kvm(kvm_t *kd, return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 08:54:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1146DEC4; Sun, 30 Jun 2013 08:54:42 +0000 (UTC) (envelope-from ed@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 E8BCE1821; Sun, 30 Jun 2013 08:54:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U8sftY018721; Sun, 30 Jun 2013 08:54:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U8sfYS018720; Sun, 30 Jun 2013 08:54:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306300854.r5U8sfYS018720@svn.freebsd.org> From: Ed Schouten Date: Sun, 30 Jun 2013 08:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252411 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 08:54:42 -0000 Author: ed Date: Sun Jun 30 08:54:41 2013 New Revision: 252411 URL: http://svnweb.freebsd.org/changeset/base/252411 Log: Make various fixes to . - According to the standard, memory_order is a type. Use a typedef. - atomic_*_fence() and atomic_flag_*() are described by the standard as functions. Use inline functions to implement them. - Only expose the atomic_*_explicit() functions in kernel space. We should not use the short-hand functions, as they will always use memory_order_seq_cst. Modified: head/sys/sys/stdatomic.h Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Sun Jun 30 08:36:19 2013 (r252410) +++ head/sys/sys/stdatomic.h Sun Jun 30 08:54:41 2013 (r252411) @@ -122,33 +122,44 @@ * atomic operations. */ -enum memory_order { +typedef enum { memory_order_relaxed = __ATOMIC_RELAXED, memory_order_consume = __ATOMIC_CONSUME, memory_order_acquire = __ATOMIC_ACQUIRE, memory_order_release = __ATOMIC_RELEASE, memory_order_acq_rel = __ATOMIC_ACQ_REL, memory_order_seq_cst = __ATOMIC_SEQ_CST -}; +} memory_order; /* * 7.17.4 Fences. */ +static __inline void +atomic_thread_fence(memory_order __order __unused) +{ + #ifdef __CLANG_ATOMICS -#define atomic_thread_fence(order) __c11_atomic_thread_fence(order) -#define atomic_signal_fence(order) __c11_atomic_signal_fence(order) + __c11_atomic_thread_fence(__order); #elif defined(__GNUC_ATOMICS) -#define atomic_thread_fence(order) __atomic_thread_fence(order) -#define atomic_signal_fence(order) __atomic_signal_fence(order) + __atomic_thread_fence(__order); #else -#define atomic_thread_fence(order) ((void)(order), __sync_synchronize()) -#define atomic_signal_fence(order) __extension__ ({ \ - (void)(order); \ - __asm volatile ("" ::: "memory"); \ - (void)0; \ -}) + __sync_synchronize(); #endif +} + +static __inline void +atomic_signal_fence(memory_order __order __unused) +{ + +#ifdef __CLANG_ATOMICS + __c11_atomic_signal_fence(__order); +#elif defined(__GNUC_ATOMICS) + __atomic_signal_fence(__order); +#else + __asm volatile ("" ::: "memory"); +#endif +} /* * 7.17.5 Lock-free property. @@ -319,8 +330,12 @@ __extension__ ({ \ /* * Convenience functions. + * + * Don't provide these in kernel space. In kernel space, we should be + * disciplined enough to always provide explicit barriers. */ +#ifndef _KERNEL #define atomic_compare_exchange_strong(object, expected, desired) \ atomic_compare_exchange_strong_explicit(object, expected, \ desired, memory_order_seq_cst, memory_order_seq_cst) @@ -343,23 +358,54 @@ __extension__ ({ \ atomic_load_explicit(object, memory_order_seq_cst) #define atomic_store(object, desired) \ atomic_store_explicit(object, desired, memory_order_seq_cst) +#endif /* !_KERNEL */ /* * 7.17.8 Atomic flag type and operations. + * + * XXX: Assume atomic_bool can be used as an atomic_flag. Is there some + * kind of compiler built-in type we could use? */ -typedef atomic_bool atomic_flag; - -#define ATOMIC_FLAG_INIT ATOMIC_VAR_INIT(0) - -#define atomic_flag_clear_explicit(object, order) \ - atomic_store_explicit(object, 0, order) -#define atomic_flag_test_and_set_explicit(object, order) \ - atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) - -#define atomic_flag_clear(object) \ - atomic_flag_clear_explicit(object, memory_order_seq_cst) -#define atomic_flag_test_and_set(object) \ - atomic_flag_test_and_set_explicit(object, memory_order_seq_cst) +typedef struct { + atomic_bool __flag; +} atomic_flag; + +#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(0) } + +static __inline _Bool +atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, + memory_order __order) +{ + _Bool __expected; + + __expected = 0; + return (atomic_compare_exchange_strong_explicit(&__object->__flag, + &__expected, 1, __order, __order)); +} + +static __inline void +atomic_flag_clear_explicit(volatile atomic_flag *__object, memory_order __order) +{ + + atomic_store_explicit(&__object->__flag, 0, __order); +} + +#ifndef _KERNEL +static __inline _Bool +atomic_flag_test_and_set(volatile atomic_flag *__object) +{ + + return (atomic_flag_test_and_set_explicit(__object, + memory_order_seq_cst)); +} + +static __inline void +atomic_flag_clear(volatile atomic_flag *__object) +{ + + atomic_flag_clear_explicit(__object, memory_order_seq_cst); +} +#endif /* !_KERNEL */ #endif /* !_STDATOMIC_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 08:59:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 568E3125; Sun, 30 Jun 2013 08:59:34 +0000 (UTC) (envelope-from ed@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 48ED81843; Sun, 30 Jun 2013 08:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U8xYkC019327; Sun, 30 Jun 2013 08:59:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U8xYUf019326; Sun, 30 Jun 2013 08:59:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306300859.r5U8xYUf019326@svn.freebsd.org> From: Ed Schouten Date: Sun, 30 Jun 2013 08:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252412 - head/lib/librt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 08:59:34 -0000 Author: ed Date: Sun Jun 30 08:59:33 2013 New Revision: 252412 URL: http://svnweb.freebsd.org/changeset/base/252412 Log: Convert this piece of code to use C11 atomics. As mentioned before, we should at least aim to have one piece of code in both user space and kernel space that uses C11 atomics, to get some coverage. This piece of code can be migrated trivially, so it's a good candidate. Modified: head/lib/librt/sigev_thread.c Modified: head/lib/librt/sigev_thread.c ============================================================================== --- head/lib/librt/sigev_thread.c Sun Jun 30 08:54:41 2013 (r252411) +++ head/lib/librt/sigev_thread.c Sun Jun 30 08:59:33 2013 (r252412) @@ -28,13 +28,13 @@ */ #include -#include #include "namespace.h" #include #include #include #include +#include #include #include #include @@ -51,7 +51,7 @@ LIST_HEAD(sigev_list_head, sigev_node); static struct sigev_list_head sigev_hash[HASH_QUEUES]; static struct sigev_list_head sigev_all; static LIST_HEAD(,sigev_thread) sigev_threads; -static unsigned int sigev_generation; +static atomic_int sigev_generation; static pthread_mutex_t *sigev_list_mtx; static pthread_once_t sigev_once = PTHREAD_ONCE_INIT; static pthread_once_t sigev_once_default = PTHREAD_ONCE_INIT; @@ -196,7 +196,8 @@ __sigev_alloc(int type, const struct sig if (sn != NULL) { sn->sn_value = evp->sigev_value; sn->sn_func = evp->sigev_notify_function; - sn->sn_gen = atomic_fetchadd_int(&sigev_generation, 1); + sn->sn_gen = atomic_fetch_add_explicit(&sigev_generation, 1, + memory_order_relaxed); sn->sn_type = type; _pthread_attr_init(&sn->sn_attr); _pthread_attr_setdetachstate(&sn->sn_attr, PTHREAD_CREATE_DETACHED); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 10:38:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2FA56EE8; Sun, 30 Jun 2013 10:38:21 +0000 (UTC) (envelope-from ed@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 083F71AA5; Sun, 30 Jun 2013 10:38:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UAcKs9048232; Sun, 30 Jun 2013 10:38:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UAcKbX048231; Sun, 30 Jun 2013 10:38:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201306301038.r5UAcKbX048231@svn.freebsd.org> From: Ed Schouten Date: Sun, 30 Jun 2013 10:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252413 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 10:38:21 -0000 Author: ed Date: Sun Jun 30 10:38:20 2013 New Revision: 252413 URL: http://svnweb.freebsd.org/changeset/base/252413 Log: Make atomic_fetch_add() and atomic_fetch_sub() work for pointers with GCC 4.2. According to the standard, atomic_fetch_*() has to behave identical to regular arithmetic. This means that for pointer types, we have to apply the stride when doing addition/subtraction. The GCC documentation seems to imply this is done for __sync_*() as well. Unfortunately, both tests and Googling seems to reveal this is not really the case. Fix this by performing the multiplication with the stride manually. Modified: head/sys/sys/stdatomic.h Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Sun Jun 30 08:59:33 2013 (r252412) +++ head/sys/sys/stdatomic.h Sun Jun 30 10:38:20 2013 (r252413) @@ -281,6 +281,8 @@ typedef _Atomic(__uintmax_t) atomic_uin #define atomic_store_explicit(object, desired, order) \ __atomic_store_n(&(object)->__val, desired, order) #else +#define __atomic_apply_stride(object, operand) \ + (((__typeof__((object)->__val))0) + (operand)) #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) __extension__ ({ \ __typeof__(expected) __ep = (expected); \ @@ -313,13 +315,15 @@ __extension__ ({ \ }) #endif #define atomic_fetch_add_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, operand)) + ((void)(order), __sync_fetch_and_add(&(object)->__val, \ + __atomic_apply_stride(object, operand))) #define atomic_fetch_and_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) #define atomic_fetch_or_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) #define atomic_fetch_sub_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_sub(&(object)->__val, operand)) + ((void)(order), __sync_fetch_and_sub(&(object)->__val, \ + __atomic_apply_stride(object, operand))) #define atomic_fetch_xor_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) #define atomic_load_explicit(object, order) \ From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 11:10:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69205469; Sun, 30 Jun 2013 11:10:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 3EFB71B6F; Sun, 30 Jun 2013 11:10:20 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-226-51.lns20.per1.internode.on.net [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r5UBAF5H072674 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 30 Jun 2013 04:10:18 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <51D01211.2030408@freebsd.org> Date: Sun, 30 Jun 2013 19:10:09 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r252346 - head/share/man/man9 References: <201306281633.r5SGXjFU017827@svn.freebsd.org> <51CEDE2B.60204@freebsd.org> <51CEE326.2010903@freebsd.org> <20130629140206.GA25876@stack.nl> In-Reply-To: <20130629140206.GA25876@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 11:10:21 -0000 On 6/29/13 10:02 PM, Jilles Tjoelker wrote: > On Sat, Jun 29, 2013 at 09:37:42PM +0800, Julian Elischer wrote: >> On 6/29/13 9:16 PM, Julian Elischer wrote: >>>> -If the owner is not currently actually running then the spin step >>>> is skipped. >>>> +then a thread attempting to acquire the mutex will spin rather >>>> than yielding >>>> +the processor. >> Am I wrong in thinking that it will only spin for a short while, >> eventually yielding? >> The original text said this but the new text implies it will spin >> forever. > The code actually spins until the state of the lock changes or the > owning thread is no longer running. either way I think this needs clarification. > From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 13:14:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BCA2A14; Sun, 30 Jun 2013 13:14:46 +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 7E02E1E50; Sun, 30 Jun 2013 13:14:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UDEkwj094096; Sun, 30 Jun 2013 13:14:46 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UDEkqT094095; Sun, 30 Jun 2013 13:14:46 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201306301314.r5UDEkqT094095@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 30 Jun 2013 13:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252414 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 13:14:46 -0000 Author: mjg Date: Sun Jun 30 13:14:46 2013 New Revision: 252414 URL: http://svnweb.freebsd.org/changeset/base/252414 Log: truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC MFC after: 3 days Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sun Jun 30 10:38:20 2013 (r252413) +++ head/usr.bin/truss/syscalls.c Sun Jun 30 13:14:46 2013 (r252414) @@ -343,7 +343,7 @@ static struct xlat open_flags[] = { X(O_RDONLY) X(O_WRONLY) X(O_RDWR) X(O_ACCMODE) X(O_NONBLOCK) X(O_APPEND) X(O_SHLOCK) X(O_EXLOCK) X(O_ASYNC) X(O_FSYNC) X(O_NOFOLLOW) X(O_CREAT) X(O_TRUNC) X(O_EXCL) X(O_NOCTTY) - X(O_DIRECT) XEND + X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) XEND }; static struct xlat shutdown_arg[] = { From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 13:17:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8CDCEBAE; Sun, 30 Jun 2013 13:17:37 +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 7E5671E66; Sun, 30 Jun 2013 13:17:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UDHbv9094480; Sun, 30 Jun 2013 13:17:37 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UDHbje094479; Sun, 30 Jun 2013 13:17:37 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201306301317.r5UDHbje094479@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 30 Jun 2013 13:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252415 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 13:17:37 -0000 Author: mjg Date: Sun Jun 30 13:17:37 2013 New Revision: 252415 URL: http://svnweb.freebsd.org/changeset/base/252415 Log: acct: reduce code duplication by using acct_disable as cleanup for failed kproc_create MFC after: 1 week Modified: head/sys/kern/kern_acct.c Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Sun Jun 30 13:14:46 2013 (r252414) +++ head/sys/kern/kern_acct.c Sun Jun 30 13:17:37 2013 (r252415) @@ -284,12 +284,7 @@ sys_acct(struct thread *td, struct acct_ error = kproc_create(acct_thread, NULL, NULL, 0, 0, "accounting"); if (error) { - (void) vn_close(acct_vp, acct_flags, acct_cred, td); - crfree(acct_cred); - acct_configured = 0; - acct_vp = NULL; - acct_cred = NULL; - acct_flags = 0; + (void) acct_disable(td, 0); sx_xunlock(&acct_sx); log(LOG_NOTICE, "Unable to start accounting thread\n"); return (error); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 13:23:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C575D54; Sun, 30 Jun 2013 13:23:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 03D231E86; Sun, 30 Jun 2013 13:23:37 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::24f7:45d:f2c2:a5d] (unknown [IPv6:2001:7b8:3a7:0:24f7:45d:f2c2:a5d]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6C0F75C43; Sun, 30 Jun 2013 15:23:32 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252376 - head/lib/libutil From: Dimitry Andric In-Reply-To: <20130629161914.GD91021@kib.kiev.ua> Date: Sun, 30 Jun 2013 15:23:31 +0200 Content-Transfer-Encoding: 7bit Message-Id: <65B29369-2B3C-4018-AFEA-AC57E86404A3@FreeBSD.org> References: <201306291552.r5TFqnLV022460@svn.freebsd.org> <20130629161914.GD91021@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, "dt71@gmx.com" , svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 13:23:37 -0000 On Jun 29, 2013, at 18:19, Konstantin Belousov wrote: > On Sat, Jun 29, 2013 at 03:52:49PM +0000, Tim Kientzle wrote: >> Author: kientzle >> Date: Sat Jun 29 15:52:48 2013 >> New Revision: 252376 >> URL: http://svnweb.freebsd.org/changeset/base/252376 >> >> Log: >> Fix -Wunsequenced warning > What is this ? From the name of the warning, it sounds as if the problem > is in the lack of sequence point between two modifications of the same > variable in the expression ? > > But, there function' argument evaluation and function call are separated > by seq point, AFAIR. Could you, please, clarify ? Yes, a function call is a sequence point. The -Wunsequenced warning was made too aggressive in this trunk upstream commit: I pointed out the problem to the author, and he fixed it in: -Dimitry From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 15:00:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03BA7D9D; Sun, 30 Jun 2013 15:00:09 +0000 (UTC) (envelope-from sjg@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 EA9EF10EF; Sun, 30 Jun 2013 15:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UF08WG025775; Sun, 30 Jun 2013 15:00:08 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UF08SM025773; Sun, 30 Jun 2013 15:00:08 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201306301500.r5UF08SM025773@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sun, 30 Jun 2013 15:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252419 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 15:00:09 -0000 Author: sjg Date: Sun Jun 30 15:00:07 2013 New Revision: 252419 URL: http://svnweb.freebsd.org/changeset/base/252419 Log: Use && rather than ; when success of previous job matters. Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 30 13:41:21 2013 (r252418) +++ head/Makefile.inc1 Sun Jun 30 15:00:07 2013 (r252419) @@ -1131,11 +1131,11 @@ legacy: .endif .for _tool in tools/build ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ - cd ${.CURDIR}/${_tool}; \ - ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ - ${MAKE} DIRPRFX=${_tool}/ all; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1264,10 +1264,10 @@ bootstrap-tools: ${_crunch} \ ${_nmtree} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool}; \ - ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ - ${MAKE} DIRPRFX=${_tool}/ all; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1305,16 +1305,16 @@ build-tools: usr.bin/mkesdb_static \ usr.bin/mkcsmapper_static ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ - cd ${.CURDIR}/${_tool}; \ - ${MAKE} DIRPRFX=${_tool}/ obj; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ ${_gcc_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool}; \ - ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ ${MAKE} DIRPRFX=${_tool}/ all .endfor @@ -1363,10 +1363,10 @@ cross-tools: ${_crunchide} \ ${_kgzip} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool}; \ - ${MAKE} DIRPRFX=${_tool}/ obj; \ - ${MAKE} DIRPRFX=${_tool}/ depend; \ - ${MAKE} DIRPRFX=${_tool}/ all; \ + cd ${.CURDIR}/${_tool} && \ + ${MAKE} DIRPRFX=${_tool}/ obj && \ + ${MAKE} DIRPRFX=${_tool}/ depend && \ + ${MAKE} DIRPRFX=${_tool}/ all && \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install .endfor @@ -1545,10 +1545,10 @@ lib/libradius__L: lib/libmd__L ${_lib}__PL: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib}; \ - ${MAKE} DIRPRFX=${_lib}/ obj; \ - ${MAKE} DIRPRFX=${_lib}/ depend; \ - ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \ + cd ${.CURDIR}/${_lib} && \ + ${MAKE} DIRPRFX=${_lib}/ obj && \ + ${MAKE} DIRPRFX=${_lib}/ depend && \ + ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all && \ ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install .endif .endfor @@ -1557,10 +1557,10 @@ ${_lib}__PL: .PHONY ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib}; \ - ${MAKE} DIRPRFX=${_lib}/ obj; \ - ${MAKE} DIRPRFX=${_lib}/ depend; \ - ${MAKE} DIRPRFX=${_lib}/ all; \ + cd ${.CURDIR}/${_lib} && \ + ${MAKE} DIRPRFX=${_lib}/ obj && \ + ${MAKE} DIRPRFX=${_lib}/ depend && \ + ${MAKE} DIRPRFX=${_lib}/ all && \ ${MAKE} DIRPRFX=${_lib}/ install .endif .endfor @@ -1570,10 +1570,10 @@ ${_lib}__L: .PHONY # modules. lib/libpam__L: .PHONY ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ - cd ${.CURDIR}/lib/libpam; \ - ${MAKE} DIRPRFX=lib/libpam/ obj; \ - ${MAKE} DIRPRFX=lib/libpam/ depend; \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ + cd ${.CURDIR}/lib/libpam && \ + ${MAKE} DIRPRFX=lib/libpam/ obj && \ + ${MAKE} DIRPRFX=lib/libpam/ depend && \ + ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all && \ ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install _prereq_libs: ${_prereq_libs:S/$/__PL/} @@ -1584,7 +1584,7 @@ _generic_libs: ${_generic_libs:S/$/__L/} .for __target in all clean cleandepend cleandir depend includes obj .for entry in ${SUBDIR} ${entry}.${__target}__D: .PHONY - ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ + ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ edir=${entry}.${MACHINE_ARCH}; \ cd ${.CURDIR}/$${edir}; \ @@ -1822,10 +1822,10 @@ _xb-bootstrap-tools: .for _tool in \ ${_clang_tblgen} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool}; \ - ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - ${CDMAKE} DIRPRFX=${_tool}/ depend; \ - ${CDMAKE} DIRPRFX=${_tool}/ all; \ + cd ${.CURDIR}/${_tool} && \ + ${CDMAKE} DIRPRFX=${_tool}/ obj && \ + ${CDMAKE} DIRPRFX=${_tool}/ depend && \ + ${CDMAKE} DIRPRFX=${_tool}/ all && \ ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install .endfor @@ -1841,9 +1841,9 @@ _xb-cross-tools: ${_clang_libs} \ ${_clang} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool}; \ - ${CDMAKE} DIRPRFX=${_tool}/ obj; \ - ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + cd ${.CURDIR}/${_tool} && \ + ${CDMAKE} DIRPRFX=${_tool}/ obj && \ + ${CDMAKE} DIRPRFX=${_tool}/ depend && \ ${CDMAKE} DIRPRFX=${_tool}/ all .endfor Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jun 30 13:41:21 2013 (r252418) +++ head/UPDATING Sun Jun 30 15:00:07 2013 (r252419) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130629: + Fix targets that run multiple make's to use && rather than ; + so that subsequent steps depend on success of previous. + + NOTE: if building 'universe' with -j* on stable/8 or stable/9 + it would be better to start the build using bmake, to avoid + overloading the machine. + 20130618: Fix a bug that allowed a tracing process (e.g. gdb) to write to a memory-mapped file in the traced process's address space From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 16:02:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6892B764; Sun, 30 Jun 2013 16:02:43 +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 5AB41127B; Sun, 30 Jun 2013 16:02:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UG2hAu043811; Sun, 30 Jun 2013 16:02:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UG2hQg043810; Sun, 30 Jun 2013 16:02:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306301602.r5UG2hQg043810@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 30 Jun 2013 16:02:43 +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: r252420 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 16:02:43 -0000 Author: pfg Date: Sun Jun 30 16:02:42 2013 New Revision: 252420 URL: http://svnweb.freebsd.org/changeset/base/252420 Log: MFC r252259: Minor sort. Modified: stable/9/sys/fs/ext2fs/ext2_extern.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extern.h Sun Jun 30 15:00:07 2013 (r252419) +++ stable/9/sys/fs/ext2fs/ext2_extern.h Sun Jun 30 16:02:42 2013 (r252420) @@ -60,8 +60,8 @@ void ext2_dirbad(struct inode *ip, doff_ void ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *); void ext2_i2ei(struct inode *, struct ext2fs_dinode *); -int ext2_reallocblks(struct vop_reallocblks_args *); void ext2_itimes(struct vnode *vp); +int ext2_reallocblks(struct vop_reallocblks_args *); int ext2_reclaim(struct vop_reclaim_args *); void ext2_setblock(struct m_ext2fs *, u_char *, int32_t); int ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 17:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5158E805; Sun, 30 Jun 2013 17:59:41 +0000 (UTC) (envelope-from schweikh@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 420EE16FC; Sun, 30 Jun 2013 17:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UHxfSZ076520; Sun, 30 Jun 2013 17:59:41 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UHxfp8076519; Sun, 30 Jun 2013 17:59:41 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201306301759.r5UHxfp8076519@svn.freebsd.org> From: Jens Schweikhardt Date: Sun, 30 Jun 2013 17:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252421 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 17:59:41 -0000 Author: schweikh Date: Sun Jun 30 17:59:40 2013 New Revision: 252421 URL: http://svnweb.freebsd.org/changeset/base/252421 Log: Correct some grammar. Modified: head/sbin/hastd/hastd.8 Modified: head/sbin/hastd/hastd.8 ============================================================================== --- head/sbin/hastd/hastd.8 Sun Jun 30 16:02:42 2013 (r252420) +++ head/sbin/hastd/hastd.8 Sun Jun 30 17:59:40 2013 (r252421) @@ -70,18 +70,18 @@ hastd: () .Pp If (and only if) .Nm -operates in primary role for the given resource, corresponding +operates in primary role for the given resource, a corresponding .Pa /dev/hast/ disk-like device (GEOM provider) is created. File systems and applications can use this provider to send I/O requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and replicated to the remote (secondary) node if it -is available. +is sent to the local component and replicated on the remote (secondary) node +if it is available. Read operations .Dv ( BIO_READ ) -are handled locally unless I/O error occurs or local version of the data +are handled locally unless an I/O error occurs or the local version of the data is not up-to-date yet (synchronization is in progress). .Pp The @@ -100,38 +100,38 @@ The connection between two .Nm daemons is always initiated from the one running as primary to the one running as secondary. -When primary +When the primary .Nm -is unable to connect or connection fails, it will try to re-establish -connection every few seconds. -Once connection is established, primary +is unable to connect or the connection fails, it will try to re-establish +the connection every few seconds. +Once the connection is established, the primary .Nm will synchronize every extent that was modified during connection outage to the secondary .Nm . .Pp -It is possible that in case of connection outage between the nodes +It is possible that in the case of a connection outage between the nodes the .Nm primary role for the given resource will be configured on both nodes. This in turn leads to incompatible data modifications. -Such condition is called split-brain and cannot be automatically +Such a condition is called a split-brain and cannot be automatically resolved by the .Nm -daemon as this will lead most likely to data corruption or lost of +daemon as this will lead most likely to data corruption or loss of important changes. Even though it cannot be fixed by .Nm -itself, it will be detected and further connection between independently +itself, it will be detected and a further connection between independently modified nodes will not be possible. -Once this situation is manually resolved by an administrator, resource +Once this situation is manually resolved by an administrator, the resource on one of the nodes can be initialized (erasing local data), which makes -connection to the remote node possible again. -Connection of freshly initialized component will trigger full resource +a connection to the remote node possible again. +Connection of the freshly initialized component will trigger full resource synchronization. .Pp -The +A .Nm -daemon itself never picks his role up automatically. +daemon never picks its role automatically. The role has to be configured with the .Xr hastctl 8 control utility by additional software like @@ -139,7 +139,7 @@ control utility by additional software l or .Nm heartbeat that can reliably manage role separation and switch secondary node to -primary role in case of original primary failure. +primary role in case of the primary's failure. .Pp The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 18:42:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 903FF373; Sun, 30 Jun 2013 18:42:40 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id B01AD1861; Sun, 30 Jun 2013 18:42:39 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUGALt60FFR8aFy/2dsb2JhbABagwkyg1C8Dn0XdIIjAQEFIzMiARALFAQJFgsCAgkDAgECASceBg0BBwEBiA8IqiWQR49NEQeCUYEWA5AIgS2HPJAcgxM6 Received: from 114.161-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.161.114]) by relay.skynet.be with ESMTP; 30 Jun 2013 20:42:30 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r5UIgTFk003087; Sun, 30 Jun 2013 20:42:29 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51D07C10.2000509@coosemans.org> Date: Sun, 30 Jun 2013 20:42:24 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r252411 - head/sys/sys References: <201306300854.r5U8sfYS018720@svn.freebsd.org> In-Reply-To: <201306300854.r5U8sfYS018720@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ILACXFUOGTUTVWQQNEPG" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 18:42:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ILACXFUOGTUTVWQQNEPG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-06-30 10:54, Ed Schouten wrote: > Author: ed > Date: Sun Jun 30 08:54:41 2013 > New Revision: 252411 > URL: http://svnweb.freebsd.org/changeset/base/252411 >=20 > Log: > Make various fixes to . > =20 > - According to the standard, memory_order is a type. Use a typedef. > =20 > - atomic_*_fence() and atomic_flag_*() are described by the standard = as > functions. Use inline functions to implement them. > =20 > - Only expose the atomic_*_explicit() functions in kernel space. We > should not use the short-hand functions, as they will always use > memory_order_seq_cst. >=20 > Modified: > head/sys/sys/stdatomic.h >=20 > Modified: head/sys/sys/stdatomic.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/stdatomic.h Sun Jun 30 08:36:19 2013 (r252410) > +++ head/sys/sys/stdatomic.h Sun Jun 30 08:54:41 2013 (r252411) > @@ -122,33 +122,44 @@ > * atomic operations. > */ > =20 > -enum memory_order { > +typedef enum { > memory_order_relaxed =3D __ATOMIC_RELAXED, > memory_order_consume =3D __ATOMIC_CONSUME, > memory_order_acquire =3D __ATOMIC_ACQUIRE, > memory_order_release =3D __ATOMIC_RELEASE, > memory_order_acq_rel =3D __ATOMIC_ACQ_REL, > memory_order_seq_cst =3D __ATOMIC_SEQ_CST > -}; > +} memory_order; > =20 > /* > * 7.17.4 Fences. > */ > =20 > +static __inline void > +atomic_thread_fence(memory_order __order __unused) I don't think you can use static inline. Standard library functions need to have external linkage, which means you have to implement them in libc.= What you can do is declare the function in the header and then define a macro implementation of it. > * 7.17.8 Atomic flag type and operations. > + * > + * XXX: Assume atomic_bool can be used as an atomic_flag. Is there som= e > + * kind of compiler built-in type we could use? I think you can just use unsigned char. Only the test-and-set and clear operations need to be atomic. Anything else (like copy-assignment) doesn't have to be atomic. Both clang and gcc have __atomic_test_and_set and __atomic_clear built-ins. ------enig2ILACXFUOGTUTVWQQNEPG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHQfBQACgkQfoCS2CCgtiva1gD/e65/WqdD1WKrF0cKgoPZD8sx O7SuZ5m9QhfKSsGlvHYA/0RK+GIOHckP5uxeamAzkbQzBXDbxHTb8GpPgHS0kzOQ =LVim -----END PGP SIGNATURE----- ------enig2ILACXFUOGTUTVWQQNEPG-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:08:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1215D71E; Sun, 30 Jun 2013 19:08:07 +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 DD6F318E7; Sun, 30 Jun 2013 19:08:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJ86mr096905; Sun, 30 Jun 2013 19:08:06 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJ86nB096904; Sun, 30 Jun 2013 19:08:06 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201306301908.r5UJ86nB096904@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 30 Jun 2013 19:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252422 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:08:07 -0000 Author: mjg Date: Sun Jun 30 19:08:06 2013 New Revision: 252422 URL: http://svnweb.freebsd.org/changeset/base/252422 Log: acct: create a special plimit object and set it for exiting processes instead of allocating new one each time All limits are set to RLIM_INFINITY which sould be ok (even though we care only about RLIMT_FSIZE in this case). MFC after: 1 week Modified: head/sys/kern/kern_acct.c Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Sun Jun 30 17:59:40 2013 (r252421) +++ head/sys/kern/kern_acct.c Sun Jun 30 19:08:06 2013 (r252422) @@ -133,6 +133,7 @@ static int acct_configured; static int acct_suspended; static struct vnode *acct_vp; static struct ucred *acct_cred; +static struct plimit *acct_limit; static int acct_flags; static struct sx acct_sx; @@ -196,7 +197,7 @@ int sys_acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, replacing; + int error, flags, i, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -267,6 +268,15 @@ sys_acct(struct thread *td, struct acct_ } /* + * Create our own plimit object without limits. It will be assigned + * to exiting processes. + */ + acct_limit = lim_alloc(); + for (i = 0; i < RLIM_NLIMITS; i++) + acct_limit->pl_rlimit[i].rlim_cur = + acct_limit->pl_rlimit[i].rlim_max = RLIM_INFINITY; + + /* * Save the new accounting file vnode, and schedule the new * free space watcher. */ @@ -309,6 +319,7 @@ acct_disable(struct thread *td, int logg sx_assert(&acct_sx, SX_XLOCKED); error = vn_close(acct_vp, acct_flags, acct_cred, td); crfree(acct_cred); + lim_free(acct_limit); acct_configured = 0; acct_vp = NULL; acct_cred = NULL; @@ -329,7 +340,7 @@ acct_process(struct thread *td) { struct acctv2 acct; struct timeval ut, st, tmp; - struct plimit *newlim, *oldlim; + struct plimit *oldlim; struct proc *p; struct rusage ru; int t, ret; @@ -405,7 +416,6 @@ acct_process(struct thread *td) /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flagx = p->p_acflag; - PROC_UNLOCK(p); /* Setup ancillary structure fields. */ acct.ac_flagx |= ANVER; @@ -414,14 +424,10 @@ acct_process(struct thread *td) acct.ac_len = acct.ac_len2 = sizeof(acct); /* - * Eliminate any file size rlimit. + * Eliminate rlimits (file size limit in particular). */ - newlim = lim_alloc(); - PROC_LOCK(p); oldlim = p->p_limit; - lim_copy(newlim, oldlim); - newlim->pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; - p->p_limit = newlim; + p->p_limit = lim_hold(acct_limit); PROC_UNLOCK(p); lim_free(oldlim); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:33:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 441CAC0A; Sun, 30 Jun 2013 19:33:08 +0000 (UTC) (envelope-from bjk@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 1C62C195C; Sun, 30 Jun 2013 19:33:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJX8s6005263; Sun, 30 Jun 2013 19:33:08 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJX7e2005262; Sun, 30 Jun 2013 19:33:07 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201306301933.r5UJX7e2005262@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 30 Jun 2013 19:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252423 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:33:08 -0000 Author: bjk (doc committer) Date: Sun Jun 30 19:33:07 2013 New Revision: 252423 URL: http://svnweb.freebsd.org/changeset/base/252423 Log: Grammar tweaks for locking.9 Reviewed by: jhb Approved by: hrs (mentor) Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Sun Jun 30 19:08:06 2013 (r252422) +++ head/share/man/man9/locking.9 Sun Jun 30 19:33:07 2013 (r252423) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 22, 2013 +.Dd June 30, 2013 .Dt LOCKING 9 .Os .Sh NAME @@ -55,8 +55,7 @@ for details. Spin mutexes are a variation of basic mutexes; the main difference between the two is that spin mutexes never block. Instead, they spin while waiting for the lock to be released. -Note that a thread that holds a spin mutex must never yield its CPU to -avoid deadlock. +To avoid deadlock, a thread that holds a spin mutex must never yield its CPU. Unlike ordinary mutexes, spin mutexes disable interrupts when acquired. Since disabling interrupts can be expensive, they are generally slower to acquire and release. @@ -140,7 +139,7 @@ and in the buffer cache They have features other lock types do not have such as sleep timeouts, blocking upgrades, writer starvation avoidance, draining, and an interlock mutex, -but this makes them complicated to both use and implement; +but this makes them complicated both to use and to implement; for this reason, they should be avoided. .Pp See @@ -183,7 +182,7 @@ and .Fn wakeup_one also handle event-based thread blocking. Unlike condition variables, -arbitrary addresses may be used as wait channels and an dedicated +arbitrary addresses may be used as wait channels and a dedicated structure does not need to be allocated. However, care must be taken to ensure that wait channel addresses are unique to an event. @@ -280,21 +279,23 @@ they can and can not be combined. Many of these rules are checked by .Xr witness 4 . .Ss Bounded vs. Unbounded Sleep -A bounded sleep -.Pq or blocking -is a sleep where the only resource needed to resume execution of a thread +In a bounded sleep +.Po also referred to as +.Dq blocking +.Pc +the only resource needed to resume execution of a thread is CPU time for the owner of a lock that the thread is waiting to acquire. -An unbounded sleep +In an unbounded sleep .Po often referred to as simply .Dq sleeping .Pc -is a sleep where a thread is waiting for an external event or for a condition +a thread waits for an external event or for a condition to become true. In particular, -since there is always CPU time available, a dependency chain of threads in bounded sleeps should always make forward -progress. +progress, +since there is always CPU time available. This requires that no thread in a bounded sleep is waiting for a lock held by a thread in an unbounded sleep. To avoid priority inversions, From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:36:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D2D56D8F; Sun, 30 Jun 2013 19:36:17 +0000 (UTC) (envelope-from cognet@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 C44BB1969; Sun, 30 Jun 2013 19:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJaHuN005655; Sun, 30 Jun 2013 19:36:17 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJaH2V005654; Sun, 30 Jun 2013 19:36:17 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201306301936.r5UJaH2V005654@svn.freebsd.org> From: Olivier Houchard Date: Sun, 30 Jun 2013 19:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252424 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:36:17 -0000 Author: cognet Date: Sun Jun 30 19:36:17 2013 New Revision: 252424 URL: http://svnweb.freebsd.org/changeset/base/252424 Log: In generic_bs_map(), use kmem_alloc_nofault() instead of kmem_alloc(), as we only need virtual addresses. Submitted by: alc Modified: head/sys/arm/arm/bus_space_generic.c Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Sun Jun 30 19:33:07 2013 (r252423) +++ head/sys/arm/arm/bus_space_generic.c Sun Jun 30 19:36:17 2013 (r252424) @@ -73,7 +73,7 @@ generic_bs_map(void *t, bus_addr_t bpa, offset = bpa & PAGE_MASK; startpa = trunc_page(bpa); - va = kmem_alloc(kernel_map, endpa - startpa); + va = kmem_alloc_nofault(kernel_map, endpa - startpa); if (va == 0) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:44:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D895108; Sun, 30 Jun 2013 19:44:57 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [IPv6:2607:f8b0:400c:c02::235]) by mx1.freebsd.org (Postfix) with ESMTP id F133B19A9; Sun, 30 Jun 2013 19:44:56 +0000 (UTC) Received: by mail-vb0-f53.google.com with SMTP id p12so2983982vbe.26 for ; Sun, 30 Jun 2013 12:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=c9JNL5xkBPFoRQhuWpJU7HDbh/mOpMMZ1+jWaV4NG00=; b=ylSn3HvMpsQHBbIxOWanDLtQ6LKjuCICQ7YyEJMXIpApte+7COCP8FM9yDZ6/elsV/ FYs7V2YY81FB4TN0khdGaG0nF5Ez0mHf1l3uehpZvzLgjgqilhb/2FEtfRl9x0lRPTFF Owr9W6otqM4ZAthumNS04yFAu2dyzZIEr+RVfP/JWWE4DlWJu00A36owpng5uoQPqCoN xFIF1SClH5GoV+6T+e/jnPUIF/Vg1RhNoWU6tiJgkkz7xjpHnveWg2WOMQO2hmsykupj Y6PV9NKTWzTFciMgkN9bQFbZyAGb/xYi2+QHGFcZX0hzAaMnXOH0lEhNIosIq9u7RbNI MpEQ== MIME-Version: 1.0 X-Received: by 10.52.120.77 with SMTP id la13mr7207261vdb.23.1372621496475; Sun, 30 Jun 2013 12:44:56 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.107.139 with HTTP; Sun, 30 Jun 2013 12:44:56 -0700 (PDT) In-Reply-To: <51D07C10.2000509@coosemans.org> References: <201306300854.r5U8sfYS018720@svn.freebsd.org> <51D07C10.2000509@coosemans.org> Date: Sun, 30 Jun 2013 21:44:56 +0200 X-Google-Sender-Auth: wKvPpTNjfVvfVGgZtDYc7X2BnS8 Message-ID: Subject: Re: svn commit: r252411 - head/sys/sys From: Ed Schouten To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:44:57 -0000 Hi Tijl, 2013/6/30 Tijl Coosemans : > I don't think you can use static inline. Standard library functions need > to have external linkage, which means you have to implement them in libc. First of all, I could be mistaken, so please correct me if I say something wrong here. If my memory serves me right, this requirement is part of POSIX -- not ISO C. As this is interface is not yet part of any version of POSIX and at least I am not in the possession of a draft of POSIX that specified these functions, I think it would be unwise to add this to the C library. I think there is nothing that would forbid us to use static inline functions. As C11 merely names these things "functions", I think using a static inline function would currently be the wisest thing to do. To my knowledge the current version of the code at least complies with the standards at hand. > I think you can just use unsigned char. Only the test-and-set and clear > operations need to be atomic. Anything else (like copy-assignment) > doesn't have to be atomic. Both clang and gcc have __atomic_test_and_set > and __atomic_clear built-ins. Ah, nice. I was unaware of the existence of these functions. I'll see if I can switch our header to use that instead. Still, I think it's a bit weird that the API provided by both Clang and GCC provides such a poor abstraction. For example, if it weren't for our implementation of Restartable Atomic Sequences, even unsigned char would not have been a lockless type on ARMv5. -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:52:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F02E52D8; Sun, 30 Jun 2013 19:52:41 +0000 (UTC) (envelope-from ray@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 C72C819D3; Sun, 30 Jun 2013 19:52:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJqfv3010874; Sun, 30 Jun 2013 19:52:41 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJqfwf010873; Sun, 30 Jun 2013 19:52:41 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201306301952.r5UJqfwf010873@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 30 Jun 2013 19:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252425 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:52:42 -0000 Author: ray Date: Sun Jun 30 19:52:41 2013 New Revision: 252425 URL: http://svnweb.freebsd.org/changeset/base/252425 Log: Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg. Submitted by: Ruslan Bukin Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Jun 30 19:36:17 2013 (r252424) +++ head/sys/arm/arm/generic_timer.c Sun Jun 30 19:52:41 2013 (r252425) @@ -66,7 +66,22 @@ __FBSDID("$FreeBSD$"); #define GENERIC_TIMER_REG_CTRL 0 #define GENERIC_TIMER_REG_TVAL 1 -#define CNTPSIRQ 29 +#define GENERIC_TIMER_CNTKCTL_PL0PTEN (1 << 9) /* Physical timer registers + access from PL0 */ +#define GENERIC_TIMER_CNTKCTL_PL0VTEN (1 << 8) /* Virtual timer registers + access from PL0 */ +#define GENERIC_TIMER_CNTKCTL_EVNTI (1 << 4) /* Virtual counter + event bits */ +#define GENERIC_TIMER_CNTKCTL_EVNTDIR (1 << 3) /* Virtual counter + event transition */ +#define GENERIC_TIMER_CNTKCTL_EVNTEN (1 << 2) /* Enables events from + the virtual counter */ +#define GENERIC_TIMER_CNTKCTL_PL0VCTEN (1 << 1) /* CNTVCT and CNTFRQ + access from PL0 */ +#define GENERIC_TIMER_CNTKCTL_PL0PCTEN (1 << 0) /* CNTPCT and CNTFRQ + access from PL0 */ + +#define GENERIC_TIMER_CNTPSIRQ 29 struct arm_tmr_softc { struct resource *irq_res; @@ -167,7 +182,11 @@ disable_user_access(void) uint32_t cntkctl; __asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); - cntkctl &= ~((3 << 8) | (7 << 0)); + cntkctl &= ~(GENERIC_TIMER_CNTKCTL_PL0PTEN | + GENERIC_TIMER_CNTKCTL_PL0VTEN | + GENERIC_TIMER_CNTKCTL_EVNTEN | + GENERIC_TIMER_CNTKCTL_PL0VCTEN | + GENERIC_TIMER_CNTKCTL_PL0PCTEN); __asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); isb(); } @@ -270,7 +289,8 @@ arm_tmr_attach(device_t dev) rid = 0; sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - CNTPSIRQ, CNTPSIRQ, 1, RF_SHAREABLE | RF_ACTIVE); + GENERIC_TIMER_CNTPSIRQ, GENERIC_TIMER_CNTPSIRQ, + 1, RF_SHAREABLE | RF_ACTIVE); arm_tmr_sc = sc; From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:52:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C9DE2D9; Sun, 30 Jun 2013 19:52:46 +0000 (UTC) (envelope-from hrs@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 09B9719D4; Sun, 30 Jun 2013 19:52:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJqjch010919; Sun, 30 Jun 2013 19:52:45 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJqjUD010918; Sun, 30 Jun 2013 19:52:45 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306301952.r5UJqjUD010918@svn.freebsd.org> From: Hiroki Sato Date: Sun, 30 Jun 2013 19:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252426 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:52:46 -0000 Author: hrs Date: Sun Jun 30 19:52:45 2013 New Revision: 252426 URL: http://svnweb.freebsd.org/changeset/base/252426 Log: Add "ether" and "link" to ifconfig_alias{es,N}. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Jun 30 19:52:41 2013 (r252425) +++ head/etc/network.subr Sun Jun 30 19:52:45 2013 (r252426) @@ -164,6 +164,9 @@ ifconfig_up() fi fi + ifalias $1 link alias + ifalias $1 ether alias + if [ ${_cfg} -eq 0 ]; then ${IFCONFIG_CMD} $1 up fi @@ -432,6 +435,9 @@ afexists() return 1 fi ;; + link|ether) + return 0 + ;; *) err 1 "afexists(): Unsupported address family: $_af" ;; @@ -700,7 +706,7 @@ ifalias() afexists $2 || return $_ret case "$2" in - inet|inet6) + inet|inet6|link|ether) ifalias_af_common $1 $2 $3 && _ret=0 ;; esac @@ -907,6 +913,11 @@ ifalias_af_common_handler() *) return ;; esac + # link(ether) does not support address removal. + case $_af:$_action in + link:-alias|ether:-alias) return ;; + esac + _tmpargs= for _c in $_args; do case $_c in @@ -965,6 +976,8 @@ ifalias_af_common() inet\ *) _iaf=inet ;; inet6\ *) _iaf=inet6 ;; ipx\ *) _iaf=ipx ;; + link\ *) _iaf=link ;; + ether\ *) _iaf=ether ;; esac case ${_af}:${_action}:${_iaf}:"${ifconfig_args}" in @@ -1012,7 +1025,7 @@ ifalias_af_common() _tmpargs= for _c in `get_if_var $_if ifconfig_IF_aliases` $_aliasn; do case $_c in - inet|inet6|ipx) + inet|inet6|ipx|link|ether) case $_tmpargs in ${_af}\ *) eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0 From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 19:53:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85B205C0; Sun, 30 Jun 2013 19:53:52 +0000 (UTC) (envelope-from ray@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 77E0C19DE; Sun, 30 Jun 2013 19:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UJrqrW011120; Sun, 30 Jun 2013 19:53:52 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UJrq7F011119; Sun, 30 Jun 2013 19:53:52 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201306301953.r5UJrq7F011119@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 30 Jun 2013 19:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252427 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:53:52 -0000 Author: ray Date: Sun Jun 30 19:53:52 2013 New Revision: 252427 URL: http://svnweb.freebsd.org/changeset/base/252427 Log: Replace some spaces to tab. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Jun 30 19:52:45 2013 (r252426) +++ head/sys/arm/arm/generic_timer.c Sun Jun 30 19:53:52 2013 (r252427) @@ -241,7 +241,7 @@ arm_tmr_intr(void *arg) sc = (struct arm_tmr_softc *)arg; ctrl = get_ctrl(); if (ctrl & GENERIC_TIMER_CTRL_INT_STAT) { - ctrl |= GENERIC_TIMER_CTRL_INT_MASK; + ctrl |= GENERIC_TIMER_CTRL_INT_MASK; set_ctrl(ctrl); } @@ -305,7 +305,7 @@ arm_tmr_attach(device_t dev) set_freq(sc->clkfreq); disable_user_access(); - arm_tmr_timecount.tc_frequency = sc->clkfreq; + arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); sc->et.et_name = "ARM MPCore Eventtimer"; @@ -358,7 +358,7 @@ DELAY(int usec) /* * Check the timers are setup, if not just * use a for loop for the meantime - */ + */ if (arm_tmr_sc == NULL) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) @@ -371,7 +371,7 @@ DELAY(int usec) } /* Get the number of times to count */ - counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); + counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); /* * Clamp the timeout at a maximum value (about 32 seconds with From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 20:09:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 620FB8DF; Sun, 30 Jun 2013 20:09:11 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay003.isp.belgacom.be (mailrelay003.isp.belgacom.be [195.238.6.53]) by mx1.freebsd.org (Postfix) with ESMTP id AD9B51A34; Sun, 30 Jun 2013 20:09:09 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoYGADSO0FFR8aFy/2dsb2JhbABagwmEArwOfRd0giMBAQUjMyMQCxgJIQICDwIoHgYNAQUCAQGID6ovkEePXgeCUYEWA5AIgS2XWIMTOg Received: from 114.161-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.161.114]) by relay.skynet.be with ESMTP; 30 Jun 2013 22:08:00 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r5UK7wli006970; Sun, 30 Jun 2013 22:07:59 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51D09019.50101@coosemans.org> Date: Sun, 30 Jun 2013 22:07:53 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r252411 - head/sys/sys References: <201306300854.r5U8sfYS018720@svn.freebsd.org> <51D07C10.2000509@coosemans.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2FDKUDABQUBTHOJNBRGWK" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 20:09:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2FDKUDABQUBTHOJNBRGWK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-06-30 21:44, Ed Schouten wrote: > 2013/6/30 Tijl Coosemans : >> I don't think you can use static inline. Standard library functions ne= ed >> to have external linkage, which means you have to implement them in li= bc. >=20 > First of all, I could be mistaken, so please correct me if I say > something wrong here. >=20 > If my memory serves me right, this requirement is part of POSIX -- not > ISO C. As this is interface is not yet part of any version of POSIX > and at least I am not in the possession of a draft of POSIX that > specified these functions, I think it would be unwise to add this to > the C library. I think there is nothing that would forbid us to use > static inline functions. >=20 > As C11 merely names these things "functions", I think using a static > inline function would currently be the wisest thing to do. To my > knowledge the current version of the code at least complies with the > standards at hand. The N1570 draft of C11 7.1.2 point 6 says: Any declaration of a library function shall have external linkage. ------enig2FDKUDABQUBTHOJNBRGWK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHQkB4ACgkQfoCS2CCgtiseFgD+M8ngvKmavtxg8QbbugwqXLAy ZVgDDV6EKgY+aXkXKsEA/Rbn+iFHbLfqYbJo1yKFjxFf5scurerjxdzPmnIeDn6m =8jPs -----END PGP SIGNATURE----- ------enig2FDKUDABQUBTHOJNBRGWK-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 20:27:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 40E21C94; Sun, 30 Jun 2013 20:27:33 +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 19A1E1AD0; Sun, 30 Jun 2013 20:27:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UKRWMi021222; Sun, 30 Jun 2013 20:27:32 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UKRW3Q021220; Sun, 30 Jun 2013 20:27:32 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201306302027.r5UKRW3Q021220@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 30 Jun 2013 20:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252428 - head/usr.bin/killall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 20:27:33 -0000 Author: mjg Date: Sun Jun 30 20:27:31 2013 New Revision: 252428 URL: http://svnweb.freebsd.org/changeset/base/252428 Log: killall: add -q flag to suppress error message when no processes are matched Man-page text provided by wblock. PR: bin/30542 Submitted by: Tony Finch (original version) MFC after: 1 week Modified: head/usr.bin/killall/killall.1 head/usr.bin/killall/killall.c Modified: head/usr.bin/killall/killall.1 ============================================================================== --- head/usr.bin/killall/killall.1 Sun Jun 30 19:53:52 2013 (r252427) +++ head/usr.bin/killall/killall.1 Sun Jun 30 20:27:31 2013 (r252428) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd June 30, 2013 .Dt KILLALL 1 .Os .Sh NAME @@ -110,6 +110,8 @@ the specified Limit potentially matching processes to those matching the specified .Ar procname . +.It Fl q +Suppress error message if no processes are matched. .It Fl z Do not skip zombies. This should not have any effect except to print a few error messages Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sun Jun 30 19:53:52 2013 (r252427) +++ head/usr.bin/killall/killall.c Sun Jun 30 20:27:31 2013 (r252428) @@ -53,7 +53,7 @@ static void __dead2 usage(void) { - fprintf(stderr, "usage: killall [-delmsvz] [-help] [-I] [-j jail]\n"); + fprintf(stderr, "usage: killall [-delmsqvz] [-help] [-I] [-j jail]\n"); fprintf(stderr, " [-u user] [-t tty] [-c cmd] [-SIGNAL] [cmd]...\n"); fprintf(stderr, "At least one option or argument to specify processes must be given.\n"); @@ -101,6 +101,7 @@ main(int ac, char **av) char *user = NULL; char *tty = NULL; char *cmd = NULL; + int qflag = 0; int vflag = 0; int sflag = 0; int dflag = 0; @@ -191,6 +192,9 @@ main(int ac, char **av) errx(1, "must specify procname"); cmd = *av; break; + case 'q': + qflag++; + break; case 'v': vflag++; break; @@ -417,8 +421,9 @@ main(int ac, char **av) } } if (killed == 0) { - fprintf(stderr, "No matching processes %swere found\n", - getuid() != 0 ? "belonging to you " : ""); + if (!qflag) + fprintf(stderr, "No matching processes %swere found\n", + getuid() != 0 ? "belonging to you " : ""); errors = 1; } exit(errors); From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 20:29:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EBB6CEAC; Sun, 30 Jun 2013 20:29:31 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [IPv6:2607:f8b0:400c:c02::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 8A3351AFF; Sun, 30 Jun 2013 20:29:31 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p14so3022327vbm.4 for ; Sun, 30 Jun 2013 13:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=RaPKk4sGYEnWWFtrdpOnyOyFUS/80t9tXRzaye5b1yQ=; b=ht7PUpWjbWCSWMw710GbAroxqjxruj3R/ZsboCdcCZjxVo1XuJ/JsGOGOsrRE9r5E7 xLA3qydcV/mMSVfAT9fGrRt68GzPTTnQsE5d04z44FpYuFDFjji83NfHrQ2jiQxMg7Oa rt3vcXlRoNhWLiQDWQIPdt8xVYdRt8RoR9t7kzH4pBG08acPozDnOv9NiwkdDNzs7rF+ dnOe5LXOw49IxD8Cf41zVWKEOZ9Aq0nCjyEXTx6+jHk18RDNBu9gBloiR7XiIDfTzgXJ LZdEoNpgK955OEW5GNNt3kgkBFnBjrXL83Ha8XwdjrSesPqSDJ/CqtnRKOfgRbn9T9KH 9jWg== MIME-Version: 1.0 X-Received: by 10.52.32.133 with SMTP id j5mr7248858vdi.103.1372624170497; Sun, 30 Jun 2013 13:29:30 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.220.107.139 with HTTP; Sun, 30 Jun 2013 13:29:30 -0700 (PDT) In-Reply-To: <51D09019.50101@coosemans.org> References: <201306300854.r5U8sfYS018720@svn.freebsd.org> <51D07C10.2000509@coosemans.org> <51D09019.50101@coosemans.org> Date: Sun, 30 Jun 2013 22:29:30 +0200 X-Google-Sender-Auth: KUYenMlGgQUmSzbDjC4wKZ5DyJA Message-ID: Subject: Re: svn commit: r252411 - head/sys/sys From: Ed Schouten To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 20:29:32 -0000 2013/6/30 Tijl Coosemans : > The N1570 draft of C11 7.1.2 point 6 says: > Any declaration of a library function shall have external linkage. Then I think we are in serious troubles. For example, atomic_fetch_add() is described as a "generic function". Is a "generic function" a "library function"? If so, my guess is that it is impossible to derive a standards-compliant implementation of this header. -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 20:51:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C9E82E3; Sun, 30 Jun 2013 20:51:16 +0000 (UTC) (envelope-from jilles@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 3F1781B76; Sun, 30 Jun 2013 20:51:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UKpGow028966; Sun, 30 Jun 2013 20:51:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UKpFnL028964; Sun, 30 Jun 2013 20:51:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201306302051.r5UKpFnL028964@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 30 Jun 2013 20:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252429 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 20:51:16 -0000 Author: jilles Date: Sun Jun 30 20:51:15 2013 New Revision: 252429 URL: http://svnweb.freebsd.org/changeset/base/252429 Log: libc: Access _sigintr more efficiently. The variable _sigintr is not exported via the version script; therefore, tell the compiler that no indirection (to allow interposition) is needed. Modified: head/lib/libc/gen/siginterrupt.c head/lib/libc/gen/signal.c Modified: head/lib/libc/gen/siginterrupt.c ============================================================================== --- head/lib/libc/gen/siginterrupt.c Sun Jun 30 20:27:31 2013 (r252428) +++ head/lib/libc/gen/siginterrupt.c Sun Jun 30 20:51:15 2013 (r252429) @@ -46,7 +46,7 @@ int siginterrupt(sig, flag) int sig, flag; { - extern sigset_t _sigintr; + extern sigset_t _sigintr __hidden; struct sigaction sa; int ret; Modified: head/lib/libc/gen/signal.c ============================================================================== --- head/lib/libc/gen/signal.c Sun Jun 30 20:27:31 2013 (r252428) +++ head/lib/libc/gen/signal.c Sun Jun 30 20:51:15 2013 (r252429) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -sigset_t _sigintr; /* shared with siginterrupt */ +sigset_t _sigintr __hidden; /* shared with siginterrupt */ sig_t signal(s, a) From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 21:06:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7426965B; Sun, 30 Jun 2013 21:06:48 +0000 (UTC) (envelope-from kaiw@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 66B141BF6; Sun, 30 Jun 2013 21:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UL6mNV032836; Sun, 30 Jun 2013 21:06:48 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UL6mw9032834; Sun, 30 Jun 2013 21:06:48 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201306302106.r5UL6mw9032834@svn.freebsd.org> From: Kai Wang Date: Sun, 30 Jun 2013 21:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252430 - head/lib/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 21:06:48 -0000 Author: kaiw Date: Sun Jun 30 21:06:47 2013 New Revision: 252430 URL: http://svnweb.freebsd.org/changeset/base/252430 Log: When decoding SLEB128, make sure sign extension is performed for 64-bit integers. MFC after: 3 days Modified: head/lib/libdwarf/dwarf_init.c head/lib/libdwarf/dwarf_loc.c Modified: head/lib/libdwarf/dwarf_init.c ============================================================================== --- head/lib/libdwarf/dwarf_init.c Sun Jun 30 20:51:15 2013 (r252429) +++ head/lib/libdwarf/dwarf_init.c Sun Jun 30 21:06:47 2013 (r252430) @@ -192,7 +192,7 @@ dwarf_read_sleb128(Elf_Data **dp, uint64 shift += 7; } while ((b & 0x80) != 0); - if (shift < 32 && (b & 0x40) != 0) + if (shift < 64 && (b & 0x40) != 0) ret |= (-1 << shift); return ret; Modified: head/lib/libdwarf/dwarf_loc.c ============================================================================== --- head/lib/libdwarf/dwarf_loc.c Sun Jun 30 20:51:15 2013 (r252429) +++ head/lib/libdwarf/dwarf_loc.c Sun Jun 30 21:06:47 2013 (r252430) @@ -46,7 +46,7 @@ dwarf_decode_sleb128(uint8_t **dp) shift += 7; } while ((b & 0x80) != 0); - if (shift < 32 && (b & 0x40) != 0) + if (shift < 64 && (b & 0x40) != 0) ret |= (-1 << shift); *dp = src; From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 23:14:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0ECF9E7; Sun, 30 Jun 2013 23:14:57 +0000 (UTC) (envelope-from rmh@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 00A041F40; Sun, 30 Jun 2013 23:14:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UNEuVr070810; Sun, 30 Jun 2013 23:14:56 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UNEuwv070805; Sun, 30 Jun 2013 23:14:56 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201306302314.r5UNEuwv070805@svn.freebsd.org> From: Robert Millan Date: Sun, 30 Jun 2013 23:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252431 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 23:14:57 -0000 Author: rmh Date: Sun Jun 30 23:14:55 2013 New Revision: 252431 URL: http://svnweb.freebsd.org/changeset/base/252431 Log: Enable kernel-specific code for FreeBSD also on other systems that use the kernel of FreeBSD. Reviewed by: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h Sun Jun 30 21:06:47 2013 (r252430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h Sun Jun 30 23:14:55 2013 (r252431) @@ -71,7 +71,7 @@ extern void zvol_log_write_minor(void *m ssize_t resid, boolean_t sync); #endif /* sun */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern int zvol_create_minors(const char *name); extern void zvol_rename_minors(const char *oldname, const char *newname); #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sun Jun 30 21:06:47 2013 (r252430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sun Jun 30 23:14:55 2013 (r252431) @@ -1683,7 +1683,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla } else { acl_ids->z_fgid = zfs_fuid_create_cred(zfsvfs, ZFS_GROUP, cr, &acl_ids->z_fuidp); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ gid = acl_ids->z_fgid = dzp->z_gid; #else gid = crgetgid(cr); @@ -2374,7 +2374,7 @@ zfs_zaccess(znode_t *zp, int mode, int f is_attr = ((zp->z_pflags & ZFS_XATTR) && (ZTOV(zp)->v_type == VDIR)); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ /* * In FreeBSD, we don't care about permissions of individual ADS. * Note that not checking them is not just an optimization - without Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sun Jun 30 21:06:47 2013 (r252430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sun Jun 30 23:14:55 2013 (r252431) @@ -938,7 +938,7 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * * In FreeBSD, access checking for creating an EA is being done * in zfs_setextattr(), */ -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ if (error = zfs_zaccess(zp, ACE_WRITE_NAMED_ATTRS, 0, B_FALSE, cr)) return (error); #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Jun 30 21:06:47 2013 (r252430) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Jun 30 23:14:55 2013 (r252431) @@ -173,7 +173,7 @@ zfs_sync(vfs_t *vfsp, int waitfor) return (0); } -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ static int zfs_create_unique_device(dev_t *dev) { @@ -225,7 +225,7 @@ zfs_create_unique_device(dev_t *dev) return (0); } -#endif /* !__FreeBSD__ */ +#endif /* !__FreeBSD_kernel__ */ static void atime_changed_cb(void *arg, uint64_t newval) From owner-svn-src-all@FreeBSD.ORG Sun Jun 30 23:29:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 104D83B8; Sun, 30 Jun 2013 23:29:25 +0000 (UTC) (envelope-from rpaulo@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 00B911F96; Sun, 30 Jun 2013 23:29:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UNTOMD074131; Sun, 30 Jun 2013 23:29:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UNTO82074130; Sun, 30 Jun 2013 23:29:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201306302329.r5UNTO82074130@svn.freebsd.org> From: Rui Paulo Date: Sun, 30 Jun 2013 23:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252432 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 23:29:25 -0000 Author: rpaulo Date: Sun Jun 30 23:29:24 2013 New Revision: 252432 URL: http://svnweb.freebsd.org/changeset/base/252432 Log: Add INET6. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sun Jun 30 23:14:55 2013 (r252431) +++ head/sys/arm/conf/RPI-B Sun Jun 30 23:29:24 2013 (r252432) @@ -38,6 +38,7 @@ options HZ=100 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 00:14:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97209A71; Mon, 1 Jul 2013 00:14:22 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 2B02B1100; Mon, 1 Jul 2013 00:14:22 +0000 (UTC) Received: from [192.168.1.200] (p508F315D.dip0.t-ipconnect.de [80.143.49.93]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 07D811C0C0693; Mon, 1 Jul 2013 02:14:19 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252432 - head/sys/arm/conf From: Michael Tuexen In-Reply-To: <201306302329.r5UNTO82074130@svn.freebsd.org> Date: Mon, 1 Jul 2013 02:14:19 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <2DE43D68-33CD-42F9-B533-3DE93723CB5D@freebsd.org> References: <201306302329.r5UNTO82074130@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 00:14:22 -0000 On Jul 1, 2013, at 1:29 AM, Rui Paulo wrote: > Author: rpaulo > Date: Sun Jun 30 23:29:24 2013 > New Revision: 252432 > URL: http://svnweb.freebsd.org/changeset/base/252432 >=20 > Log: > Add INET6. >=20 > Modified: > head/sys/arm/conf/RPI-B >=20 > Modified: head/sys/arm/conf/RPI-B > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/conf/RPI-B Sun Jun 30 23:14:55 2013 = (r252431) > +++ head/sys/arm/conf/RPI-B Sun Jun 30 23:29:24 2013 = (r252432) > @@ -38,6 +38,7 @@ options HZ=3D100 >=20 > options SCHED_4BSD #4BSD scheduler > options INET #InterNETworking > +options INET6 #IPv6 communications protocols > options FFS #Berkeley Fast Filesystem > options SOFTUPDATES #Enable FFS soft updates support > options UFS_ACL #Support for access control = lists >=20 What about enabling SCTP? It works fine on arm and is enabled on other platforms, too. Best regards Michael= From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 01:56:38 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60F92CB6; Mon, 1 Jul 2013 01:56:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id DDD6915F8; Mon, 1 Jul 2013 01:56:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 39A861A3DAD; Mon, 1 Jul 2013 11:56:34 +1000 (EST) Date: Mon, 1 Jul 2013 11:56:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Aleksandr Rybalko Subject: Re: svn commit: r252425 - head/sys/arm/arm In-Reply-To: <201306301952.r5UJqfwf010873@svn.freebsd.org> Message-ID: <20130701113808.F894@besplex.bde.org> References: <201306301952.r5UJqfwf010873@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=tB-szSHScXMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=E11o_6pwCccA:10 a=i2sZn5OXAAAA:8 a=DWOTAInQcCBj81PfPZgA:9 a=CjuIK1q_8ugA:10 a=PObHtDWs1CoA:10 a=Eo4AgIMMjYkUubzM:21 a=2b1o89hOhl2EU1TR:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 01:56:38 -0000 On Sun, 30 Jun 2013, Aleksandr Rybalko wrote: > Log: > Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg. > > Submitted by: Ruslan Bukin > > Modified: > head/sys/arm/arm/generic_timer.c > > Modified: head/sys/arm/arm/generic_timer.c > ============================================================================== > --- head/sys/arm/arm/generic_timer.c Sun Jun 30 19:36:17 2013 (r252424) > +++ head/sys/arm/arm/generic_timer.c Sun Jun 30 19:52:41 2013 (r252425) > @@ -66,7 +66,22 @@ __FBSDID("$FreeBSD$"); > #define GENERIC_TIMER_REG_CTRL 0 > #define GENERIC_TIMER_REG_TVAL 1 > > -#define CNTPSIRQ 29 > +#define GENERIC_TIMER_CNTKCTL_PL0PTEN (1 << 9) /* Physical timer registers > + access from PL0 */ > +#define GENERIC_TIMER_CNTKCTL_PL0VTEN (1 << 8) /* Virtual timer registers With names like these, the magic numbers are better. The prefix name GENERIC_TIMER is especially bad. GT would be good. > ... > +#define GENERIC_TIMER_CNTPSIRQ 29 Here the interesting part CNTPSIRQ is fairly abbreviated, but its prefix is not. > > struct arm_tmr_softc { > struct resource *irq_res; > @@ -167,7 +182,11 @@ disable_user_access(void) > uint32_t cntkctl; > > __asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); > - cntkctl &= ~((3 << 8) | (7 << 0)); > + cntkctl &= ~(GENERIC_TIMER_CNTKCTL_PL0PTEN | > + GENERIC_TIMER_CNTKCTL_PL0VTEN | > + GENERIC_TIMER_CNTKCTL_EVNTEN | > + GENERIC_TIMER_CNTKCTL_PL0VCTEN | > + GENERIC_TIMER_CNTKCTL_PL0PCTEN); > __asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); > isb(); > } Using these verbose names takes about 15 times as much code as before (the statement is only 5 times longer, but the definitions macros are about 10 times longer), and looks like even more becayse the statement is misformatted with non-KNF indentation which then requires extra line spitting with only 1 name per line. > @@ -270,7 +289,8 @@ arm_tmr_attach(device_t dev) > > rid = 0; > sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, > - CNTPSIRQ, CNTPSIRQ, 1, RF_SHAREABLE | RF_ACTIVE); > + GENERIC_TIMER_CNTPSIRQ, GENERIC_TIMER_CNTPSIRQ, > + 1, RF_SHAREABLE | RF_ACTIVE); > > arm_tmr_sc = sc; For full uglyness, expand all the prefixes and names: - SYS -> SYSTEM - RES -> RESOURCE - IRQ -> INTERRUPT_REQUEST_NUMBER - SYS_RES_IRQ -> SYSTEM_RESOURCE_INTERRUPT_REQUEST_NUMBER - RF -> RESOURCE_FLAG - RF_SHAREABLE_RESOURCE_FLAG_SHAREABLE - RF_ACTIVE -> RESOURCE_FLAG_ACTIVE - CNTPSIRQ -> COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER (just guessing what PS means): sc->irq_res = bus_alloc_resource(dev, SYS_RES_INTERRUPT_REQUEST_NUMBER, &rid, GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER, GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER, 1, RESOURCE_FLAG_SHAREABLE | RESOURCE_FLAG_ACTIVE); Next, use non-KNF indentation: sc->irq_res = bus_alloc_resource(dev, SYS_RES_INTERRUPT_REQUEST_NUMBER, &rid, GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER, GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER, 1, RESOURCE_FLAG_SHAREABLE | RESOURCE_FLAG_ACTIVE); The names aren't even 80 characters long, so they actually fit on 1 line. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 02:07:41 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 5EF8DEDC; Mon, 1 Jul 2013 02:07:41 +0000 (UTC) Date: Mon, 1 Jul 2013 02:07:41 +0000 From: Alexey Dokuchaev To: Bruce Evans Subject: Re: svn commit: r252425 - head/sys/arm/arm Message-ID: <20130701020741.GD9325@FreeBSD.org> References: <201306301952.r5UJqfwf010873@svn.freebsd.org> <20130701113808.F894@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130701113808.F894@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 02:07:41 -0000 On Mon, Jul 01, 2013 at 11:56:25AM +1000, Bruce Evans wrote: > On Sun, 30 Jun 2013, Aleksandr Rybalko wrote: > >Log: > > Decrypt magic numbers - define names for fields of Generic Timer's > > CNTKCTL reg. > >... > >+#define GENERIC_TIMER_CNTPSIRQ 29 > > Here the interesting part CNTPSIRQ is fairly abbreviated, but its prefix > is not. [...] > > For full uglyness, expand all the prefixes and names: > - SYS -> SYSTEM > - RES -> RESOURCE > - IRQ -> INTERRUPT_REQUEST_NUMBER > - SYS_RES_IRQ -> SYSTEM_RESOURCE_INTERRUPT_REQUEST_NUMBER > - RF -> RESOURCE_FLAG > - RF_SHAREABLE_RESOURCE_FLAG_SHAREABLE - RF_ACTIVE -> > RESOURCE_FLAG_ACTIVE > - CNTPSIRQ -> COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER > (just guessing what PS means): [...] > > The names aren't even 80 characters long, so they actually fit on 1 line. LOL, nice write up Bruce. That's what usually happens when people are asked to address some issue, but actually they don't understand very well what's upsetting people. ;-) ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 02:48:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2248D616; Mon, 1 Jul 2013 02:48:29 +0000 (UTC) (envelope-from kib@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 13666173B; Mon, 1 Jul 2013 02:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r612mSI2032303; Mon, 1 Jul 2013 02:48:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r612mRxL032293; Mon, 1 Jul 2013 02:48:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307010248.r612mRxL032293@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 1 Jul 2013 02:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252434 - in head/sys: amd64/include arm/include i386/include ia64/include kern mips/include powerpc/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 02:48:29 -0000 Author: kib Date: Mon Jul 1 02:48:27 2013 New Revision: 252434 URL: http://svnweb.freebsd.org/changeset/base/252434 Log: Fix issues with zeroing and fetching the counters, on x86 and ppc64. Issues were noted by Bruce Evans and are present on all architectures. On i386, a counter fetch should use atomic read of 64bit value, otherwise carry from the increment on other CPU could be lost for the given fetch, making error of 2^32. If 64bit read (cmpxchg8b) is not available on the machine, it cannot be SMP and it is enough to disable preemption around read to avoid the split read. On x86 the counter increment is not atomic on purpose, which makes it possible for the store of the incremented result to override just zeroed per-cpu slot. The effect would be a counter going off by arbitrary value after zeroing. Perform the counter zeroing on the same processor which does the increments, making the operations mutually exclusive. On i386, same as for the fetching, if the cmpxchg8b is not available, machine is not SMP and we disable preemption for zeroing. PowerPC64 is treated the same as amd64. For other architectures, the changes made to allow the compilation to succeed, without fixing the issues with zeroing or fetching. It should be possible to handle them by using the 64bit loads and stores atomic WRT preemption (assuming the architectures also converted from using critical sections to proper asm). If architecture does not provide the facility, using global (spin) mutex would be non-optimal but working solution. Noted by: bde Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/include/counter.h head/sys/arm/include/counter.h head/sys/i386/include/counter.h head/sys/ia64/include/counter.h head/sys/kern/subr_counter.c head/sys/mips/include/counter.h head/sys/powerpc/include/counter.h head/sys/sparc64/include/counter.h Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/amd64/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -36,6 +36,44 @@ extern struct pcpu __pcpu[1]; #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) +#ifdef IN_SUBR_COUNTER_C +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, i) counter_u64_add(c, i) static inline void Modified: head/sys/arm/include/counter.h ============================================================================== --- head/sys/arm/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/arm/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -37,6 +37,46 @@ #define counter_enter() critical_enter() #define counter_exit() critical_exit() +#ifdef IN_SUBR_COUNTER_C +/* XXXKIB non-atomic 64bit read */ +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +/* XXXKIB non-atomic 64bit store, might interrupt increment */ +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, inc) do { \ CRITICAL_ASSERT(curthread); \ *(uint64_t *)zpcpu_get(c) += (inc); \ Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/i386/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -67,6 +67,93 @@ counter_64_inc_8b(uint64_t *p, int64_t i : "memory", "cc", "eax", "edx", "ebx", "ecx"); } +#ifdef IN_SUBR_COUNTER_C +static inline uint64_t +counter_u64_read_one_8b(uint64_t *p) +{ + uint32_t res_lo, res_high; + + __asm __volatile( + "movl %%eax,%%ebx\n\t" + "movl %%edx,%%ecx\n\t" + "cmpxchg8b (%2)" + : "=a" (res_lo), "=d"(res_high) + : "SD" (p) + : "cc", "ebx", "ecx"); + return (res_lo + ((uint64_t)res_high << 32)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t res; + int i; + + res = 0; + if ((cpu_feature & CPUID_CX8) == 0) { + /* + * The machines without cmpxchg8b are not SMP. + * Disabling the preemption provides atomicity of the + * counter reading, since update is done in the + * critical section as well. + */ + critical_enter(); + for (i = 0; i < mp_ncpus; i++) { + res += *(uint64_t *)((char *)p + + sizeof(struct pcpu) * i); + } + critical_exit(); + } else { + for (i = 0; i < mp_ncpus; i++) + res += counter_u64_read_one_8b((uint64_t *)((char *)p + + sizeof(struct pcpu) * i)); + } + return (res); +} + +static inline void +counter_u64_zero_one_8b(uint64_t *p) +{ + + __asm __volatile( + "movl (%0),%%eax\n\t" + "movl 4(%0),%%edx\n" + "xorl %%ebx,%%ebx\n\t" + "xorl %%ecx,%%ecx\n\t" +"1:\n\t" + "cmpxchg8b (%0)\n\t" + "jnz 1b" + : + : "SD" (p) + : "memory", "cc", "eax", "edx", "ebx", "ecx"); +} + +static void +counter_u64_zero_one_cpu(void *arg) +{ + uint64_t *p; + + p = (uint64_t *)((char *)arg + sizeof(struct pcpu) * PCPU_GET(cpuid)); + counter_u64_zero_one_8b(p); +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + int i; + + if ((cpu_feature & CPUID_CX8) == 0) { + critical_enter(); + for (i = 0; i < mp_ncpus; i++) + *(uint64_t *)((char *)c + sizeof(struct pcpu) * i) = 0; + critical_exit(); + } else { + smp_rendezvous(smp_no_rendevous_barrier, + counter_u64_zero_one_cpu, smp_no_rendevous_barrier, c); + } +} +#endif + #define counter_u64_add_protected(c, inc) do { \ if ((cpu_feature & CPUID_CX8) == 0) { \ CRITICAL_ASSERT(curthread); \ Modified: head/sys/ia64/include/counter.h ============================================================================== --- head/sys/ia64/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/ia64/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -37,6 +37,45 @@ #define counter_enter() critical_enter() #define counter_exit() critical_exit() +#ifdef IN_SUBR_COUNTER_C +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +/* XXXKIB might interrupt increment */ +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, inc) do { \ CRITICAL_ASSERT(curthread); \ *(uint64_t *)zpcpu_get(c) += (inc); \ Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/kern/subr_counter.c Mon Jul 1 02:48:27 2013 (r252434) @@ -29,34 +29,32 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include +#include +#include #include #include #include + +#define IN_SUBR_COUNTER_C +#include static uma_zone_t uint64_pcpu_zone; void counter_u64_zero(counter_u64_t c) { - int i; - for (i = 0; i < mp_ncpus; i++) - *(uint64_t *)((char *)c + sizeof(struct pcpu) * i) = 0; + counter_u64_zero_inline(c); } uint64_t counter_u64_fetch(counter_u64_t c) { - uint64_t r; - int i; - r = 0; - for (i = 0; i < mp_ncpus; i++) - r += *(uint64_t *)((char *)c + sizeof(struct pcpu) * i); - - return (r); + return (counter_u64_fetch_inline(c)); } counter_u64_t Modified: head/sys/mips/include/counter.h ============================================================================== --- head/sys/mips/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/mips/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -37,6 +37,46 @@ #define counter_enter() critical_enter() #define counter_exit() critical_exit() +#ifdef IN_SUBR_COUNTER_C +/* XXXKIB non-atomic 64bit read on 32bit */ +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +/* XXXKIB non-atomic 64bit store on 32bit, might interrupt increment */ +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, inc) do { \ CRITICAL_ASSERT(curthread); \ *(uint64_t *)zpcpu_get(c) += (inc); \ Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/powerpc/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -39,6 +39,44 @@ #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) +#ifdef IN_SUBR_COUNTER_C +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, i) counter_u64_add(c, i) extern struct pcpu __pcpu[MAXCPU]; @@ -65,6 +103,46 @@ counter_u64_add(counter_u64_t c, int64_t #define counter_enter() critical_enter() #define counter_exit() critical_exit() +#ifdef IN_SUBR_COUNTER_C +/* XXXKIB non-atomic 64bit read */ +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +/* XXXKIB non-atomic 64bit store, might interrupt increment */ +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, inc) do { \ CRITICAL_ASSERT(curthread); \ *(uint64_t *)zpcpu_get(c) += (inc); \ Modified: head/sys/sparc64/include/counter.h ============================================================================== --- head/sys/sparc64/include/counter.h Mon Jul 1 02:33:38 2013 (r252433) +++ head/sys/sparc64/include/counter.h Mon Jul 1 02:48:27 2013 (r252434) @@ -37,6 +37,45 @@ #define counter_enter() critical_enter() #define counter_exit() critical_exit() +#ifdef IN_SUBR_COUNTER_C +static inline uint64_t +counter_u64_read_one(uint64_t *p, int cpu) +{ + + return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); +} + +static inline uint64_t +counter_u64_fetch_inline(uint64_t *p) +{ + uint64_t r; + int i; + + r = 0; + for (i = 0; i < mp_ncpus; i++) + r += counter_u64_read_one((uint64_t *)p, i); + + return (r); +} + +/* XXXKIB might interrupt increment */ +static void +counter_u64_zero_one_cpu(void *arg) +{ + + *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + PCPU_GET(cpuid))) = 0; +} + +static inline void +counter_u64_zero_inline(counter_u64_t c) +{ + + smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, + smp_no_rendevous_barrier, c); +} +#endif + #define counter_u64_add_protected(c, inc) do { \ CRITICAL_ASSERT(curthread); \ *(uint64_t *)zpcpu_get(c) += (inc); \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 03:00:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 10C32915; Mon, 1 Jul 2013 03:00:17 +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 03E76179A; Mon, 1 Jul 2013 03:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6130G83035500; Mon, 1 Jul 2013 03:00:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6130GWT035496; Mon, 1 Jul 2013 03:00:16 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307010300.r6130GWT035496@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 1 Jul 2013 03:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252435 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 03:00:17 -0000 Author: pfg Date: Mon Jul 1 03:00:15 2013 New Revision: 252435 URL: http://svnweb.freebsd.org/changeset/base/252435 Log: Change i_gen in UFS to an unsigned type. In UFS, i_gen is a random generated value and there is not way for it to be negative. Actually, the value of i_gen is just used to match bit patterns and it is of not consequence if the values are signed or not. Following other filesystems, set it to unsigned and use it as such, Discussed by: mckusick Reviewed by: mckusick (previous version) MFC after: 4 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 02:48:27 2013 (r252434) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 03:00:15 2013 (r252435) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random() / 2 + 1; + ip->i_gen = arc4random() + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); Modified: head/sys/ufs/ufs/dinode.h ============================================================================== --- head/sys/ufs/ufs/dinode.h Mon Jul 1 02:48:27 2013 (r252434) +++ head/sys/ufs/ufs/dinode.h Mon Jul 1 03:00:15 2013 (r252435) @@ -138,7 +138,7 @@ struct ufs2_dinode { int32_t di_atimensec; /* 68: Last access time. */ int32_t di_ctimensec; /* 72: Last inode change time. */ int32_t di_birthnsec; /* 76: Inode creation time. */ - int32_t di_gen; /* 80: Generation number. */ + u_int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ int32_t di_extsize; /* 92: External attributes block. */ @@ -180,7 +180,7 @@ struct ufs1_dinode { ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ u_int32_t di_flags; /* 100: Status flags (chflags). */ int32_t di_blocks; /* 104: Blocks actually held. */ - int32_t di_gen; /* 108: Generation number. */ + u_int32_t di_gen; /* 108: Generation number. */ u_int32_t di_uid; /* 112: File owner. */ u_int32_t di_gid; /* 116: File group. */ u_int64_t di_modrev; /* 120: i_modrev for NFSv4 */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Mon Jul 1 02:48:27 2013 (r252434) +++ head/sys/ufs/ufs/inode.h Mon Jul 1 03:00:15 2013 (r252435) @@ -102,7 +102,7 @@ struct inode { int16_t i_nlink; /* File link count. */ u_int64_t i_size; /* File byte count. */ u_int32_t i_flags; /* Status flags (chflags). */ - int64_t i_gen; /* Generation number. */ + u_int64_t i_gen; /* Generation number. */ u_int32_t i_uid; /* File owner. */ u_int32_t i_gid; /* File group. */ /* Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 02:48:27 2013 (r252434) +++ head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 03:00:15 2013 (r252435) @@ -935,7 +935,7 @@ ufs_extattr_get(struct vnode *vp, int at * up by the next write or extattrctl clean. */ printf("ufs_extattr_get (%s): inode number inconsistency (%d, %jd)\n", - mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (intmax_t)ip->i_gen); + mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (uintmax_t)ip->i_gen); error = ENOATTR; goto vopunlock_exit; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 03:15:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20132DAC; Mon, 1 Jul 2013 03:15:01 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE82199F; Mon, 1 Jul 2013 03:15:00 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:59aa:f7dd:2eeb:e336] (unknown [IPv6:2601:9:4d00:119:59aa:f7dd:2eeb:e336]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 88A103982B; Sun, 30 Jun 2013 20:14:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252432 - head/sys/arm/conf From: Rui Paulo In-Reply-To: <2DE43D68-33CD-42F9-B533-3DE93723CB5D@freebsd.org> Date: Sun, 30 Jun 2013 20:14:53 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <221F5B6F-3758-41C5-947B-0C065A0B588D@freebsd.org> References: <201306302329.r5UNTO82074130@svn.freebsd.org> <2DE43D68-33CD-42F9-B533-3DE93723CB5D@freebsd.org> To: Michael Tuexen X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 03:15:01 -0000 On 30 Jun 2013, at 17:14, Michael Tuexen wrote: > On Jul 1, 2013, at 1:29 AM, Rui Paulo wrote: >=20 >> Author: rpaulo >> Date: Sun Jun 30 23:29:24 2013 >> New Revision: 252432 >> URL: http://svnweb.freebsd.org/changeset/base/252432 >>=20 >> Log: >> Add INET6. >>=20 >> Modified: >> head/sys/arm/conf/RPI-B >>=20 >> Modified: head/sys/arm/conf/RPI-B >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/arm/conf/RPI-B Sun Jun 30 23:14:55 2013 = (r252431) >> +++ head/sys/arm/conf/RPI-B Sun Jun 30 23:29:24 2013 = (r252432) >> @@ -38,6 +38,7 @@ options HZ=3D100 >>=20 >> options SCHED_4BSD #4BSD scheduler >> options INET #InterNETworking >> +options INET6 #IPv6 communications protocols >> options FFS #Berkeley Fast Filesystem >> options SOFTUPDATES #Enable FFS soft updates support >> options UFS_ACL #Support for access control = lists >>=20 > What about enabling SCTP? It works fine on arm and is enabled on > other platforms, too. It could be done, but I think I'd rather spend some time integrating it = with the standard GENERIC options. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 03:27:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30257164; Mon, 1 Jul 2013 03:27:15 +0000 (UTC) (envelope-from trociny@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 21C1E1A2E; Mon, 1 Jul 2013 03:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r613RFn5045151; Mon, 1 Jul 2013 03:27:15 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r613REG0045150; Mon, 1 Jul 2013 03:27:14 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307010327.r613REG0045150@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 1 Jul 2013 03:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252436 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 03:27:15 -0000 Author: trociny Date: Mon Jul 1 03:27:14 2013 New Revision: 252436 URL: http://svnweb.freebsd.org/changeset/base/252436 Log: Plug up the lock lock leakage when exporting to a short buffer. Reported by: Alexander Leidinger Submitted by: mjg MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Jul 1 03:00:15 2013 (r252435) +++ head/sys/kern/kern_descrip.c Mon Jul 1 03:27:14 2013 (r252436) @@ -3272,6 +3272,8 @@ export_fd_to_sb(void *data, int type, in if (efbuf->remainder < kif->kf_structsize) { /* Terminate export. */ efbuf->remainder = 0; + if (efbuf->fdp != NULL && !locked) + FILEDESC_SLOCK(efbuf->fdp); return (0); } efbuf->remainder -= kif->kf_structsize; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 03:31:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D38A54B8; Mon, 1 Jul 2013 03:31:19 +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 C65E91A8F; Mon, 1 Jul 2013 03:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r613VJYH047276; Mon, 1 Jul 2013 03:31:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r613VJ72047275; Mon, 1 Jul 2013 03:31:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307010331.r613VJ72047275@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 1 Jul 2013 03:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252437 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 03:31:19 -0000 Author: pfg Date: Mon Jul 1 03:31:19 2013 New Revision: 252437 URL: http://svnweb.freebsd.org/changeset/base/252437 Log: Change i_gen in UFS to an unsigned type. Missed format specifier. Reported by: mdf MFC after: 4 weeks Modified: head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 03:27:14 2013 (r252436) +++ head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 03:31:19 2013 (r252437) @@ -934,7 +934,7 @@ ufs_extattr_get(struct vnode *vp, int at * is to coerce this to undefined, and let it get cleaned * up by the next write or extattrctl clean. */ - printf("ufs_extattr_get (%s): inode number inconsistency (%d, %jd)\n", + printf("ufs_extattr_get (%s): inode number inconsistency (%d, %ju)\n", mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (uintmax_t)ip->i_gen); error = ENOATTR; goto vopunlock_exit; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 04:06:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8068D8DE; Mon, 1 Jul 2013 04:06:41 +0000 (UTC) (envelope-from gleb@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 62E641BC6; Mon, 1 Jul 2013 04:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6146eVV056488; Mon, 1 Jul 2013 04:06:40 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6146eUB056486; Mon, 1 Jul 2013 04:06:40 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201307010406.r6146eUB056486@svn.freebsd.org> From: Gleb Kurtsou Date: Mon, 1 Jul 2013 04:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252438 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 04:06:41 -0000 Author: gleb Date: Mon Jul 1 04:06:40 2013 New Revision: 252438 URL: http://svnweb.freebsd.org/changeset/base/252438 Log: Don't assume that UFS on-disk format of a directory is the same as defined by Always start parsing at DIRBLKSIZ aligned offset, skip first entries if uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too small for single entry. Preallocate buffer for cookies. Cookies will be replaced with d_off field in struct dirent at later point. Skip entries with zero inode number. Stop mangling dirent in ufs_extattr_iterate_directory(). Reviewed by: kib Sponsored by: Google Summer Of Code 2011 Modified: head/sys/ufs/ufs/ufs_extattr.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 03:31:19 2013 (r252437) +++ head/sys/ufs/ufs/ufs_extattr.c Mon Jul 1 04:06:40 2013 (r252438) @@ -399,20 +399,8 @@ ufs_extattr_iterate_directory(struct ufs return (error); } - /* - * XXXRW: While in UFS, we always get DIRBLKSIZ returns from - * the directory code on success, on other file systems this - * may not be the case. For portability, we should check the - * read length on return from ufs_readdir(). - */ - edp = (struct dirent *)&dirbuf[DIRBLKSIZ]; + edp = (struct dirent *)&dirbuf[DIRBLKSIZ - auio.uio_resid]; for (dp = (struct dirent *)dirbuf; dp < edp; ) { -#if (BYTE_ORDER == LITTLE_ENDIAN) - dp->d_type = dp->d_namlen; - dp->d_namlen = 0; -#else - dp->d_type = 0; -#endif if (dp->d_reclen == 0) break; error = ufs_extattr_lookup(dvp, UE_GETDIR_LOCKPARENT, Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Jul 1 03:31:19 2013 (r252437) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Jul 1 04:06:40 2013 (r252438) @@ -2161,12 +2161,6 @@ ufs_symlink(ap) /* * Vnode op for reading directories. - * - * The routine below assumes that the on-disk format of a directory - * is the same as that defined by . If the on-disk - * format changes, then it will be necessary to do a conversion - * from the on-disk format that read returns to the format defined - * by . */ int ufs_readdir(ap) @@ -2179,103 +2173,123 @@ ufs_readdir(ap) u_long **a_cookies; } */ *ap; { + struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; + struct buf *bp; struct inode *ip; + struct direct *dp, *edp; + u_long *cookies; + struct dirent dstdp; + off_t offset, startoffset; + size_t readcnt, skipcnt; + ssize_t startresid; + int ncookies; int error; - size_t count, lost; - off_t off; - if (ap->a_ncookies != NULL) - /* - * Ensure that the block is aligned. The caller can use - * the cookies to determine where in the block to start. - */ - uio->uio_offset &= ~(DIRBLKSIZ - 1); - ip = VTOI(ap->a_vp); + if (uio->uio_offset < 0) + return (EINVAL); + ip = VTOI(vp); if (ip->i_effnlink == 0) return (0); - off = uio->uio_offset; - count = uio->uio_resid; - /* Make sure we don't return partial entries. */ - if (count <= ((uio->uio_offset + count) & (DIRBLKSIZ -1))) - return (EINVAL); - count -= (uio->uio_offset + count) & (DIRBLKSIZ -1); - lost = uio->uio_resid - count; - uio->uio_resid = count; - uio->uio_iov->iov_len = count; -# if (BYTE_ORDER == LITTLE_ENDIAN) - if (ap->a_vp->v_mount->mnt_maxsymlinklen > 0) { - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); - } else { - struct dirent *dp, *edp; - struct uio auio; - struct iovec aiov; - caddr_t dirbuf; - int readcnt; - u_char tmp; - - auio = *uio; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_segflg = UIO_SYSSPACE; - aiov.iov_len = count; - dirbuf = malloc(count, M_TEMP, M_WAITOK); - aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); - if (error == 0) { - readcnt = count - auio.uio_resid; - edp = (struct dirent *)&dirbuf[readcnt]; - for (dp = (struct dirent *)dirbuf; dp < edp; ) { - tmp = dp->d_namlen; - dp->d_namlen = dp->d_type; - dp->d_type = tmp; - if (dp->d_reclen > 0) { - dp = (struct dirent *) - ((char *)dp + dp->d_reclen); - } else { - error = EIO; - break; - } - } - if (dp >= edp) - error = uiomove(dirbuf, readcnt, uio); + if (ap->a_ncookies != NULL) { + ncookies = uio->uio_resid; + if (uio->uio_offset >= ip->i_size) + ncookies = 0; + else if (ip->i_size - uio->uio_offset < ncookies) + ncookies = ip->i_size - uio->uio_offset; + ncookies = ncookies / (offsetof(struct direct, d_name) + 4) + 1; + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + *ap->a_ncookies = ncookies; + *ap->a_cookies = cookies; + } else { + ncookies = 0; + cookies = NULL; + } + offset = startoffset = uio->uio_offset; + startresid = uio->uio_resid; + error = 0; + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < ip->i_size) { + error = ffs_blkatoff(vp, uio->uio_offset, NULL, &bp); + if (error) + break; + if (bp->b_offset + bp->b_bcount > ip->i_size) + readcnt = ip->i_size - bp->b_offset; + else + readcnt = bp->b_bcount; + skipcnt = (size_t)(uio->uio_offset - bp->b_offset) & + ~(size_t)(DIRBLKSIZ - 1); + offset = bp->b_offset + skipcnt; + dp = (struct direct *)&bp->b_data[skipcnt]; + edp = (struct direct *)&bp->b_data[readcnt]; + while (error == 0 && uio->uio_resid > 0 && dp < edp) { + if (dp->d_reclen <= offsetof(struct direct, d_name) || + (caddr_t)dp + dp->d_reclen > (caddr_t)edp) { + error = EIO; + break; + } +#if BYTE_ORDER == LITTLE_ENDIAN + /* Old filesystem format. */ + if (vp->v_mount->mnt_maxsymlinklen <= 0) { + dstdp.d_namlen = dp->d_type; + dstdp.d_type = dp->d_namlen; + } else +#endif + { + dstdp.d_namlen = dp->d_namlen; + dstdp.d_type = dp->d_type; + } + if (offsetof(struct direct, d_name) + dstdp.d_namlen > + dp->d_reclen) { + error = EIO; + break; + } + if (offset < startoffset || dp->d_ino == 0) + goto nextentry; + dstdp.d_fileno = dp->d_ino; + dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); + bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); + dstdp.d_name[dstdp.d_namlen] = '\0'; + if (dstdp.d_reclen > uio->uio_resid) { + if (uio->uio_resid == startresid) + error = EINVAL; + else + error = EJUSTRETURN; + break; } - free(dirbuf, M_TEMP); + /* Advance dp. */ + error = uiomove((caddr_t)&dstdp, dstdp.d_reclen, uio); + if (error) + break; + if (cookies != NULL) { + KASSERT(ncookies > 0, + ("ufs_readdir: cookies buffer too small")); + *cookies = offset + dp->d_reclen; + cookies++; + ncookies--; + } +nextentry: + offset += dp->d_reclen; + dp = (struct direct *)((caddr_t)dp + dp->d_reclen); } -# else - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); -# endif - if (!error && ap->a_ncookies != NULL) { - struct dirent* dpStart; - struct dirent* dpEnd; - struct dirent* dp; - int ncookies; - u_long *cookies; - u_long *cookiep; - - if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) - panic("ufs_readdir: unexpected uio from NFS server"); - dpStart = (struct dirent *) - ((char *)uio->uio_iov->iov_base - (uio->uio_offset - off)); - dpEnd = (struct dirent *) uio->uio_iov->iov_base; - for (dp = dpStart, ncookies = 0; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) - ncookies++; - cookies = malloc(ncookies * sizeof(u_long), M_TEMP, - M_WAITOK); - for (dp = dpStart, cookiep = cookies; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) { - off += dp->d_reclen; - *cookiep++ = (u_long) off; + bqrelse(bp); + uio->uio_offset = offset; + } + /* We need to correct uio_offset. */ + uio->uio_offset = offset; + if (error == EJUSTRETURN) + error = 0; + if (ap->a_ncookies != NULL) { + if (error == 0) { + ap->a_ncookies -= ncookies; + } else { + free(*ap->a_cookies, M_TEMP); + *ap->a_ncookies = 0; + *ap->a_cookies = NULL; } - *ap->a_ncookies = ncookies; - *ap->a_cookies = cookies; } - uio->uio_resid += lost; - if (ap->a_eofflag) - *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; + if (error == 0 && ap->a_eofflag) + *ap->a_eofflag = ip->i_size <= uio->uio_offset; return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:01:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0D15DE8; Mon, 1 Jul 2013 05:01:01 +0000 (UTC) (envelope-from rpaulo@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 A338A1D6D; Mon, 1 Jul 2013 05:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61511Ca072831; Mon, 1 Jul 2013 05:01:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61511Lg072828; Mon, 1 Jul 2013 05:01:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307010501.r61511Lg072828@svn.freebsd.org> From: Rui Paulo Date: Mon, 1 Jul 2013 05:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252439 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:01:01 -0000 Author: rpaulo Date: Mon Jul 1 05:01:01 2013 New Revision: 252439 URL: http://svnweb.freebsd.org/changeset/base/252439 Log: Split bcm2835-rpi-b.dts into bcm2835.dtsi and rpi.dts. This DTS actually works on all R-Pi models because VideoCore binary patches it during boot. Reviewed by: gonzo Added: head/sys/boot/fdt/dts/bcm2835.dtsi (contents, props changed) head/sys/boot/fdt/dts/rpi.dts (contents, props changed) Deleted: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Added: head/sys/boot/fdt/dts/bcm2835.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/bcm2835.dtsi Mon Jul 1 05:01:01 2013 (r252439) @@ -0,0 +1,468 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + cpu@0 { + compatible = "arm,1176jzf-s"; + }; + }; + + + SOC: axi { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x20000000 0x01000000>; + ranges = <0 0x20000000 0x01000000>; + + intc: interrupt-controller { + compatible = "broadcom,bcm2835-armctrl-ic", + "broadcom,bcm2708-armctrl-ic"; + reg = <0xB200 0x200>; + + interrupt-controller; + #interrupt-cells = <1>; + + /* Bank 0 + * 0: ARM_TIMER + * 1: ARM_MAILBOX + * 2: ARM_DOORBELL_0 + * 3: ARM_DOORBELL_1 + * 4: VPU0_HALTED + * 5: VPU1_HALTED + * 6: ILLEGAL_TYPE0 + * 7: ILLEGAL_TYPE1 + */ + + /* Bank 1 + * 0: TIMER0 16: DMA0 + * 1: TIMER1 17: DMA1 + * 2: TIMER2 18: VC_DMA2 + * 3: TIMER3 19: VC_DMA3 + * 4: CODEC0 20: DMA4 + * 5: CODEC1 21: DMA5 + * 6: CODEC2 22: DMA6 + * 7: VC_JPEG 23: DMA7 + * 8: ISP 24: DMA8 + * 9: VC_USB 25: DMA9 + * 10: VC_3D 26: DMA10 + * 11: TRANSPOSER 27: DMA11 + * 12: MULTICORESYNC0 28: DMA12 + * 13: MULTICORESYNC1 29: AUX + * 14: MULTICORESYNC2 30: ARM + * 15: MULTICORESYNC3 31: VPUDMA + */ + + /* Bank 2 + * 0: HOSTPORT 16: SMI + * 1: VIDEOSCALER 17: GPIO0 + * 2: CCP2TX 18: GPIO1 + * 3: SDC 19: GPIO2 + * 4: DSI0 20: GPIO3 + * 5: AVE 21: VC_I2C + * 6: CAM0 22: VC_SPI + * 7: CAM1 23: VC_I2SPCM + * 8: HDMI0 24: VC_SDIO + * 9: HDMI1 25: VC_UART + * 10: PIXELVALVE1 26: SLIMBUS + * 11: I2CSPISLV 27: VEC + * 12: DSI1 28: CPG + * 13: PWA0 29: RNG + * 14: PWA1 30: VC_ARASANSDIO + * 15: CPR 31: AVSPMON + */ + }; + + timer { + compatible = "broadcom,bcm2835-system-timer", + "broadcom,bcm2708-system-timer"; + reg = <0x3000 0x1000>; + interrupts = <8 9 10 11>; + interrupt-parent = <&intc>; + + clock-frequency = <1000000>; + }; + + armtimer { + /* Not AMBA compatible */ + compatible = "broadcom,bcm2835-sp804", "arm,sp804"; + reg = <0xB400 0x24>; + interrupts = <0>; + interrupt-parent = <&intc>; + }; + + watchdog0 { + compatible = "broadcom,bcm2835-wdt", + "broadcom,bcm2708-wdt"; + reg = <0x10001c 0x0c>; /* 0x1c, 0x20, 0x24 */ + }; + + gpio: gpio { + compatible = "broadcom,bcm2835-gpio", + "broadcom,bcm2708-gpio"; + reg = <0x200000 0xb0>; + + /* Unusual arrangement of interrupts + * (determined by testing) + * 17: Bank 0 (GPIOs 0-31) + * 19: Bank 1 (GPIOs 32-53) + * 18: Bank 2 + * 20: All banks (GPIOs 0-53) + */ + interrupts = <57 59 58 60>; + interrupt-parent = <&intc>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <1>; + + pinctrl-names = "default"; + pinctrl-0 = <&pins_reserved>; + + /* Pins that can short 3.3V to GND in output mode: 46-47 + * Pins used by VideoCore: 48-53 + */ + broadcom,read-only = <46>, <47>, <48>, <49>, <50>, + <51>, <52>, <53>; + + /* BSC0 */ + pins_bsc0_a: bsc0_a { + broadcom,pins = <0>, <1>; + }; + + pins_bsc0_b: bsc0_b { + broadcom,pins = <28>, <29>; + }; + + pins_bsc0_c: bsc0_c { + broadcom,pins = <44>, <45>; + }; + + /* BSC1 */ + pins_bsc1_a: bsc1_a { + broadcom,pins = <2>, <3>; + }; + + pins_bsc1_b: bsc1_b { + broadcom,pins = <44>, <45>; + }; + + /* GPCLK0 */ + pins_gpclk0_a: gpclk0_a { + broadcom,pins = <4>; + }; + + pins_gpclk0_b: gpclk0_b { + broadcom,pins = <20>; + }; + + pins_gpclk0_c: gpclk0_c { + broadcom,pins = <32>; + }; + + pins_gpclk0_d: gpclk0_d { + broadcom,pins = <34>; + }; + + /* GPCLK1 */ + pins_gpclk1_a: gpclk1_a { + broadcom,pins = <5>; + }; + + pins_gpclk1_b: gpclk1_b { + broadcom,pins = <21>; + }; + + pins_gpclk1_c: gpclk1_c { + broadcom,pins = <42>; + }; + + pins_gpclk1_d: gpclk1_d { + broadcom,pins = <44>; + }; + + /* GPCLK2 */ + pins_gpclk2_a: gpclk2_a { + broadcom,pins = <6>; + }; + + pins_gpclk2_b: gpclk2_b { + broadcom,pins = <43>; + }; + + /* SPI0 */ + pins_spi0_a: spi0_a { + broadcom,pins = <7>, <8>, <9>, <10>, <11>; + }; + + pins_spi0_b: spi0_b { + broadcom,pins = <35>, <36>, <37>, <38>, <39>; + }; + + /* PWM */ + pins_pwm0_a: pwm0_a { + broadcom,pins = <12>; + }; + + pins_pwm0_b: pwm0_b { + broadcom,pins = <18>; + }; + + pins_pwm0_c: pwm0_c { + broadcom,pins = <40>; + }; + + pins_pwm1_a: pwm1_a { + broadcom,pins = <13>; + }; + + pins_pwm1_b: pwm1_b { + broadcom,pins = <19>; + }; + + pins_pwm1_c: pwm1_c { + broadcom,pins = <41>; + }; + + pins_pwm1_d: pwm1_d { + broadcom,pins = <45>; + }; + + /* UART0 */ + pins_uart0_a: uart0_a { + broadcom,pins = <14>, <15>; + }; + + pins_uart0_b: uart0_b { + broadcom,pins = <32>, <33>; + }; + + pins_uart0_c: uart0_c { + broadcom,pins = <36>, <37>; + }; + + pins_uart0_fc_a: uart0_fc_a { + broadcom,pins = <16>, <17>; + }; + + pins_uart0_fc_b: uart0_fc_b { + broadcom,pins = <30>, <31>; + }; + + pins_uart0_fc_c: uart0_fc_c { + broadcom,pins = <39>, <38>; + }; + + /* PCM */ + pins_pcm_a: pcm_a { + broadcom,pins = <18>, <19>, <20>, <21>; + }; + + pins_pcm_b: pcm_b { + broadcom,pins = <28>, <29>, <30>, <31>; + }; + + /* Secondary Address Bus */ + pins_sm_addr_a: sm_addr_a { + broadcom,pins = <5>, <4>, <3>, <2>, <1>, <0>; + }; + + pins_sm_addr_b: sm_addr_b { + broadcom,pins = <33>, <32>, <31>, <30>, <29>, + <28>; + }; + + pins_sm_ctl_a: sm_ctl_a { + broadcom,pins = <6>, <7>; + }; + + pins_sm_ctl_b: sm_ctl_b { + broadcom,pins = <34>, <35>; + }; + + pins_sm_data_8bit_a: sm_data_8bit_a { + broadcom,pins = <8>, <9>, <10>, <11>, <12>, + <13>, <14>, <15>; + }; + + pins_sm_data_8bit_b: sm_data_8bit_b { + broadcom,pins = <36>, <37>, <38>, <39>, <40>, + <41>, <42>, <43>; + }; + + pins_sm_data_16bit: sm_data_16bit { + broadcom,pins = <16>, <17>, <18>, <19>, <20>, + <21>, <22>, <23>; + }; + + pins_sm_data_18bit: sm_data_18bit { + broadcom,pins = <24>, <25>; + }; + + /* BSCSL */ + pins_bscsl: bscsl { + broadcom,pins = <18>, <19>; + }; + + /* SPISL */ + pins_spisl: spisl { + broadcom,pins = <18>, <19>, <20>, <21>; + }; + + /* SPI1 */ + pins_spi1: spi1 { + broadcom,pins = <16>, <17>, <18>, <19>, <20>, + <21>; + }; + + /* UART1 */ + pins_uart1_a: uart1_a { + broadcom,pins = <14>, <15>; + }; + + pins_uart1_b: uart1_b { + broadcom,pins = <32>, <33>; + }; + + pins_uart1_c: uart1_c { + broadcom,pins = <40>, <41>; + }; + + pins_uart1_fc_a: uart1_fc_a { + broadcom,pins = <16>, <17>; + }; + + pins_uart1_fc_b: uart1_fc_b { + broadcom,pins = <30>, <31>; + }; + + pins_uart1_fc_c: uart1_fc_c { + broadcom,pins = <43>, <42>; + }; + + /* SPI2 */ + pins_spi2: spi2 { + broadcom,pins = <40>, <41>, <42>, <43>, <44>, + <45>; + }; + + /* ARM JTAG */ + pins_arm_jtag_trst: arm_jtag_trst { + broadcom,pins = <22>; + }; + + pins_arm_jtag_a: arm_jtag_a { + broadcom,pins = <4>, <5>, <6>, <12>, <13>; + }; + + pins_arm_jtag_b: arm_jtag_b { + broadcom,pins = <23>, <24>, <25>, <26>, <27>; + }; + + /* Reserved */ + pins_reserved: reserved { + broadcom,pins = <48>, <49>, <50>, <51>, <52>, + <53>; + }; + }; + + dma: dma { + compatible = "broadcom,bcm2835-dma", + "broadcom,bcm2708-dma"; + reg = <0x7000 0x1000>, <0xE05000 0x1000>; + interrupts = <24 25 26 27 28 29 30 31 32 33 34 35 36>; + interrupt-parent = <&intc>; + + broadcom,channels = <0>; /* Set by VideoCore */ + }; + + vc_mbox: mbox { + compatible = "broadcom,bcm2835-mbox", + "broadcom,bcm2708-mbox"; + reg = <0xB880 0x40>; + interrupts = <1>; + interrupt-parent = <&intc>; + + /* Channels + * 0: Power + * 1: Frame buffer + * 2: Virtual UART + * 3: VCHIQ + * 4: LEDs + * 5: Buttons + * 6: Touch screen + */ + }; + + sdhci { + compatible = "broadcom,bcm2835-sdhci", + "broadcom,bcm2708-sdhci"; + reg = <0x300000 0x100>; + interrupts = <70>; + interrupt-parent = <&intc>; + + clock-frequency = <50000000>; /* Set by VideoCore */ + }; + + uart0: uart0 { + compatible = "broadcom,bcm2835-uart", + "broadcom,bcm2708-uart", "arm,pl011", + "arm,primecell"; + reg = <0x201000 0x1000>; + interrupts = <65>; + interrupt-parent = <&intc>; + + clock-frequency = <3000000>; /* Set by VideoCore */ + reg-shift = <2>; + }; + + vchiq { + compatible = "broadcom,bcm2835-vchiq"; + reg = <0xB800 0x50>; + interrupts = <2>; + interrupt-parent = <&intc>; + }; + + usb { + compatible = "broadcom,bcm2835-usb", + "broadcom,bcm2708-usb", + "synopsys,designware-hs-otg2"; + reg = <0x980000 0x20000>; + interrupts = <17>; + interrupt-parent = <&intc>; + #address-cells = <1>; + #size-cells = <0>; + }; + + }; +}; Added: head/sys/boot/fdt/dts/rpi.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/rpi.dts Mon Jul 1 05:01:01 2013 (r252439) @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +/dts-v1/; + +/include/ "bcm2835.dtsi" + +/memreserve/ 0x08000000 0x08000000; /* Set by VideoCore */ + +/ { + model = "Raspberry Pi (BCM2835)"; + compatible = "raspberrypi,model-a", "raspberrypi,model-b", + "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; + + memory { + device_type = "memory"; + reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ + + }; + + system { + revision = <0>; /* Set by VideoCore */ + serial = <0 0>; /* Set by VideoCore */ + }; + + axi { + gpio: gpio { + /* BSC0 */ + pins_bsc0_a: bsc0_a { + broadcom,function = "ALT0"; + }; + + pins_bsc0_b: bsc0_b { + broadcom,function = "ALT0"; + }; + + pins_bsc0_c: bsc0_c { + broadcom,function = "ALT1"; + }; + + /* BSC1 */ + pins_bsc1_a: bsc1_a { + broadcom,function = "ALT0"; + }; + + pins_bsc1_b: bsc1_b { + broadcom,function = "ALT2"; + }; + + /* GPCLK0 */ + pins_gpclk0_a: gpclk0_a { + broadcom,function = "ALT0"; + }; + + pins_gpclk0_b: gpclk0_b { + broadcom,function = "ALT5"; + }; + + pins_gpclk0_c: gpclk0_c { + broadcom,function = "ALT0"; + }; + + pins_gpclk0_d: gpclk0_d { + broadcom,function = "ALT0"; + }; + + /* GPCLK1 */ + pins_gpclk1_a: gpclk1_a { + broadcom,function = "ALT0"; + }; + + pins_gpclk1_b: gpclk1_b { + broadcom,function = "ALT5"; + }; + + pins_gpclk1_c: gpclk1_c { + broadcom,function = "ALT0"; + }; + + pins_gpclk1_d: gpclk1_d { + broadcom,function = "ALT0"; + }; + + /* GPCLK2 */ + pins_gpclk2_a: gpclk2_a { + broadcom,function = "ALT0"; + }; + + pins_gpclk2_b: gpclk2_b { + broadcom,function = "ALT0"; + }; + + /* SPI0 */ + pins_spi0_a: spi0_a { + broadcom,function = "ALT0"; + }; + + pins_spi0_b: spi0_b { + broadcom,function = "ALT0"; + }; + + /* PWM */ + pins_pwm0_a: pwm0_a { + broadcom,function = "ALT0"; + }; + + pins_pwm0_b: pwm0_b { + broadcom,function = "ALT5"; + }; + + pins_pwm0_c: pwm0_c { + broadcom,function = "ALT0"; + }; + + pins_pwm1_a: pwm1_a { + broadcom,function = "ALT0"; + }; + + pins_pwm1_b: pwm1_b { + broadcom,function = "ALT5"; + }; + + pins_pwm1_c: pwm1_c { + broadcom,function = "ALT0"; + }; + + pins_pwm1_d: pwm1_d { + broadcom,function = "ALT0"; + }; + + /* UART0 */ + pins_uart0_a: uart0_a { + broadcom,function = "ALT0"; + }; + + pins_uart0_b: uart0_b { + broadcom,function = "ALT3"; + }; + + pins_uart0_c: uart0_c { + broadcom,function = "ALT2"; + }; + + pins_uart0_fc_a: uart0_fc_a { + broadcom,function = "ALT3"; + }; + + pins_uart0_fc_b: uart0_fc_b { + broadcom,function = "ALT3"; + }; + + pins_uart0_fc_c: uart0_fc_c { + broadcom,function = "ALT2"; + }; + + /* PCM */ + pins_pcm_a: pcm_a { + broadcom,function = "ALT0"; + }; + + pins_pcm_b: pcm_b { + broadcom,function = "ALT2"; + }; + + /* Secondary Address Bus */ + pins_sm_addr_a: sm_addr_a { + broadcom,function = "ALT1"; + }; + + pins_sm_addr_b: sm_addr_b { + broadcom,function = "ALT1"; + }; + + pins_sm_ctl_a: sm_ctl_a { + broadcom,function = "ALT1"; + }; + + pins_sm_ctl_b: sm_ctl_b { + broadcom,function = "ALT1"; + }; + + pins_sm_data_8bit_a: sm_data_8bit_a { + broadcom,function = "ALT1"; + }; + + pins_sm_data_8bit_b: sm_data_8bit_b { + broadcom,function = "ALT1"; + }; + + pins_sm_data_16bit: sm_data_16bit { + broadcom,function = "ALT1"; + }; + + pins_sm_data_18bit: sm_data_18bit { + broadcom,function = "ALT1"; + }; + + /* BSCSL */ + pins_bscsl: bscsl { + broadcom,function = "ALT3"; + }; + + /* SPISL */ + pins_spisl: spisl { + broadcom,function = "ALT3"; + }; + + /* SPI1 */ + pins_spi1: spi1 { + broadcom,function = "ALT4"; + }; + + /* UART1 */ + pins_uart1_a: uart1_a { + broadcom,function = "ALT5"; + }; + + pins_uart1_b: uart1_b { + broadcom,function = "ALT5"; + }; + + pins_uart1_c: uart1_c { + broadcom,function = "ALT5"; + }; + + pins_uart1_fc_a: uart1_fc_a { + broadcom,function = "ALT5"; + }; + + pins_uart1_fc_b: uart1_fc_b { + broadcom,function = "ALT5"; + }; + + pins_uart1_fc_c: uart1_fc_c { + broadcom,function = "ALT5"; + }; + + /* SPI2 */ + pins_spi2: spi2 { + broadcom,function = "ALT4"; + }; + + /* ARM JTAG */ + pins_arm_jtag_trst: arm_jtag_trst { + broadcom,function = "ALT4"; + }; + + pins_arm_jtag_a: arm_jtag_a { + broadcom,function = "ALT5"; + }; + + pins_arm_jtag_b: arm_jtag_b { + broadcom,function = "ALT4"; + }; + + /* Reserved */ + pins_reserved: reserved { + broadcom,function = "ALT3"; + }; + }; + usb { + hub { + compatible = "usb,hub", "usb,device"; + reg = <0x00000001>; + #address-cells = <1>; + #size-cells = <0>; + ethernet { + compatible = "net,ethernet", + "usb,device"; + reg = <0x00000001>; + mac-address = [00 00 00 00 00 00]; + }; + }; + + }; + + + }; + + display { + compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; + + broadcom,vc-mailbox = <&vc_mbox>; + broadcom,vc-channel = <1>; + + broadcom,width = <0>; /* Set by VideoCore */ + broadcom,height = <0>; /* Set by VideoCore */ + broadcom,depth = <0>; /* Set by VideoCore */ + }; + + leds { + compatible = "gpio-leds"; + + ok { + label = "ok"; + gpios = <&gpio 16 1>; + + /* Don't change this - it configures + * how the led driver determines if + * the led is on or off when it loads. + */ + default-state = "keep"; + + /* This is the real default state. */ + linux,default-trigger = "default-on"; + }; + }; + + power: regulator { + compatible = "broadcom,bcm2835-power-mgr", + "broadcom,bcm2708-power-mgr", + "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + + broadcom,vc-mailbox = <&vc_mbox>; + broadcom,vc-channel = <0>; + + regulator-name = "VideoCore"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on = <1>; + + sd_card_power: regulator@0 { + compatible = "broadcom,bcm2835-power-dev", + "broadcom,bcm2708-power-dev"; + reg = <0>; + + vin-supply = <&power>; + regulator-name = "SD Card"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + /* This is for the controller itself, not the root port */ + usb_hcd_power: regulator@3 { + compatible = "broadcom,bcm2835-power-dev", + "broadcom,bcm2708-power-dev"; + reg = <3>; + + vin-supply = <&power>; + regulator-name = "USB HCD"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + }; + + aliases { + uart0 = &uart0; + }; + + chosen { + bootargs = ""; /* Set by VideoCore */ + stdin = "uart0"; + stdout = "uart0"; + }; + +}; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:01:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 68445F6B; Mon, 1 Jul 2013 05:01:28 +0000 (UTC) (envelope-from rpaulo@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 5B7861D7A; Mon, 1 Jul 2013 05:01:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6151SXp072936; Mon, 1 Jul 2013 05:01:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6151SVK072935; Mon, 1 Jul 2013 05:01:28 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307010501.r6151SVK072935@svn.freebsd.org> From: Rui Paulo Date: Mon, 1 Jul 2013 05:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252440 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:01:28 -0000 Author: rpaulo Date: Mon Jul 1 05:01:27 2013 New Revision: 252440 URL: http://svnweb.freebsd.org/changeset/base/252440 Log: Use the new FDT_FILE rpi.dts. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Mon Jul 1 05:01:01 2013 (r252439) +++ head/sys/arm/conf/RPI-B Mon Jul 1 05:01:27 2013 (r252440) @@ -118,4 +118,4 @@ options FDT # Note: DTB is normally loaded and modified by RPi boot loader, then # handed to kernel via U-Boot and ubldr. #options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts +makeoptions FDT_DTS_FILE=rpi.dts From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:02:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DD05178; Mon, 1 Jul 2013 05:02:38 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2C1711D82; Mon, 1 Jul 2013 05:02:38 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:59aa:f7dd:2eeb:e336] (unknown [IPv6:2601:9:4d00:119:59aa:f7dd:2eeb:e336]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 5753D3982B; Sun, 30 Jun 2013 22:02:37 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252439 - head/sys/boot/fdt/dts From: Rui Paulo In-Reply-To: <201307010501.r61511Lg072828@svn.freebsd.org> Date: Sun, 30 Jun 2013 22:02:36 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201307010501.r61511Lg072828@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1508) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:02:38 -0000 On 30 Jun 2013, at 22:01, Rui Paulo wrote: > Author: rpaulo > Date: Mon Jul 1 05:01:01 2013 > New Revision: 252439 > URL: http://svnweb.freebsd.org/changeset/base/252439 >=20 > Log: > Split bcm2835-rpi-b.dts into bcm2835.dtsi and rpi.dts. This DTS = actually works > on all R-Pi models because VideoCore binary patches it during boot. >=20 > Reviewed by: gonzo Also reviewed by ray@ (earlier version). -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:24:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F201551; Mon, 1 Jul 2013 05:24:59 +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 610B51E21; Mon, 1 Jul 2013 05:24:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615OxXK079442; Mon, 1 Jul 2013 05:24:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Ox0C079441; Mon, 1 Jul 2013 05:24:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010524.r615Ox0C079441@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252442 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:24:59 -0000 Author: yongari Date: Mon Jul 1 05:24:58 2013 New Revision: 252442 URL: http://svnweb.freebsd.org/changeset/base/252442 Log: MFC r252143: When RX checksum offloading is active, AX88772B will prepend a checksum header. The header contains a received frame length but the defined length for AX88772B is different with other ASIX controllers. When the RX checksum is off, AX88772B controller does not prepend a checksum header so driver has to use normal header length mask. This change should fix RX errors when RX checksum offloading is off. Modified: stable/9/sys/dev/usb/net/if_axe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:17:55 2013 (r252441) +++ stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:24:58 2013 (r252442) @@ -1354,15 +1354,14 @@ axe_init(struct usb_ether *ue) if (AXE_IS_178_FAMILY(sc)) { sc->sc_flags &= ~(AXE_FLAG_STD_FRAME | AXE_FLAG_CSUM_FRAME); - if ((sc->sc_flags & AXE_FLAG_772B) != 0) - sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; - else - sc->sc_lenmask = AXE_HDR_LEN_MASK; if ((sc->sc_flags & AXE_FLAG_772B) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) + (ifp->if_capenable & IFCAP_RXCSUM) != 0) { + sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_CSUM_FRAME; - else + } else { + sc->sc_lenmask = AXE_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_STD_FRAME; + } } /* Configure TX/RX checksum offloading. */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:26:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B653827; Mon, 1 Jul 2013 05:26:30 +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 F22851E47; Mon, 1 Jul 2013 05:26:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615QT9l079730; Mon, 1 Jul 2013 05:26:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615QTdw079729; Mon, 1 Jul 2013 05:26:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010526.r615QTdw079729@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252443 - stable/8/sys/dev/usb/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:26:30 -0000 Author: yongari Date: Mon Jul 1 05:26:29 2013 New Revision: 252443 URL: http://svnweb.freebsd.org/changeset/base/252443 Log: MFC r252143: When RX checksum offloading is active, AX88772B will prepend a checksum header. The header contains a received frame length but the defined length for AX88772B is different with other ASIX controllers. When the RX checksum is off, AX88772B controller does not prepend a checksum header so driver has to use normal header length mask. This change should fix RX errors when RX checksum offloading is off. Modified: stable/8/sys/dev/usb/net/if_axe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:24:58 2013 (r252442) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:26:29 2013 (r252443) @@ -1355,15 +1355,14 @@ axe_init(struct usb_ether *ue) if (AXE_IS_178_FAMILY(sc)) { sc->sc_flags &= ~(AXE_FLAG_STD_FRAME | AXE_FLAG_CSUM_FRAME); - if ((sc->sc_flags & AXE_FLAG_772B) != 0) - sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; - else - sc->sc_lenmask = AXE_HDR_LEN_MASK; if ((sc->sc_flags & AXE_FLAG_772B) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) + (ifp->if_capenable & IFCAP_RXCSUM) != 0) { + sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_CSUM_FRAME; - else + } else { + sc->sc_lenmask = AXE_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_STD_FRAME; + } } /* Configure TX/RX checksum offloading. */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:29:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCBB89A6; Mon, 1 Jul 2013 05:29: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 AE8811E5E; Mon, 1 Jul 2013 05:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615TgZj080139; Mon, 1 Jul 2013 05:29:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Tgd6080137; Mon, 1 Jul 2013 05:29:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010529.r615Tgd6080137@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:29:42 +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: r252444 - in stable/9/sys/dev/usb: . net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:29:42 -0000 Author: yongari Date: Mon Jul 1 05:29:42 2013 New Revision: 252444 URL: http://svnweb.freebsd.org/changeset/base/252444 Log: MFC r252185: Add Lenovo USB 2.0 Ethernet adapter. PR: usb/179920 Modified: stable/9/sys/dev/usb/net/if_axe.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/net/if_axe.c ============================================================================== --- stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:26:29 2013 (r252443) +++ stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:29:42 2013 (r252444) @@ -162,6 +162,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), + AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B), AXE_DEV(LINKSYS2, USB200M, 0), AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178), AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Jul 1 05:26:29 2013 (r252443) +++ stable/9/sys/dev/usb/usbdevs Mon Jul 1 05:29:42 2013 (r252444) @@ -678,6 +678,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -2420,6 +2421,9 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 /* Leadtek products */ product LEADTEK 9531 0x2101 9531 GPS +/* Lenovo products */ +product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet + /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:30:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C853BBCD; Mon, 1 Jul 2013 05:30:38 +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 B9FFB1F15; Mon, 1 Jul 2013 05:30:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615UcUY082045; Mon, 1 Jul 2013 05:30:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615UcgK082043; Mon, 1 Jul 2013 05:30:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010530.r615UcgK082043@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252445 - in stable/8/sys/dev/usb: . net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:30:38 -0000 Author: yongari Date: Mon Jul 1 05:30:38 2013 New Revision: 252445 URL: http://svnweb.freebsd.org/changeset/base/252445 Log: MFC r252185: Add Lenovo USB 2.0 Ethernet adapter. PR: usb/179920 Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:29:42 2013 (r252444) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:30:38 2013 (r252445) @@ -163,6 +163,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), + AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B), AXE_DEV(LINKSYS2, USB200M, 0), AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178), AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jul 1 05:29:42 2013 (r252444) +++ stable/8/sys/dev/usb/usbdevs Mon Jul 1 05:30:38 2013 (r252445) @@ -677,6 +677,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -2421,6 +2422,9 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 /* Leadtek products */ product LEADTEK 9531 0x2101 9531 GPS +/* Lenovo products */ +product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet + /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:33:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4CD22D57; Mon, 1 Jul 2013 05:33:02 +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 3EDA21F2D; Mon, 1 Jul 2013 05:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615X2v3082439; Mon, 1 Jul 2013 05:33:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615X2Vg082438; Mon, 1 Jul 2013 05:33:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010533.r615X2Vg082438@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:33:02 +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: r252446 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:33:02 -0000 Author: yongari Date: Mon Jul 1 05:33:01 2013 New Revision: 252446 URL: http://svnweb.freebsd.org/changeset/base/252446 Log: MFC r252186: Add Lenovo USB 2.0 Ethernet adapter to the list of supported devices. Modified: stable/9/share/man/man4/axe.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/axe.4 ============================================================================== --- stable/9/share/man/man4/axe.4 Mon Jul 1 05:30:38 2013 (r252445) +++ stable/9/share/man/man4/axe.4 Mon Jul 1 05:33:01 2013 (r252446) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 25, 2013 .Dt AXE 4 .Os .Sh NAME @@ -215,6 +215,8 @@ AX88772B: .Bl -bullet -compact .It ASIX AX88772B +.It +Lenovo USB 2.0 Ethernet .El .Pp AX88760: From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 05:33:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1517ED4; Mon, 1 Jul 2013 05:33:55 +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 B39131F37; Mon, 1 Jul 2013 05:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615XtSv082597; Mon, 1 Jul 2013 05:33:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Xtxn082596; Mon, 1 Jul 2013 05:33:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010533.r615Xtxn082596@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252448 - stable/8/share/man/man4 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 05:33:55 -0000 Author: yongari Date: Mon Jul 1 05:33:55 2013 New Revision: 252448 URL: http://svnweb.freebsd.org/changeset/base/252448 Log: MFC r252186: Add Lenovo USB 2.0 Ethernet adapter to the list of supported devices. Modified: stable/8/share/man/man4/axe.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Mon Jul 1 05:33:53 2013 (r252447) +++ stable/8/share/man/man4/axe.4 Mon Jul 1 05:33:55 2013 (r252448) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 25, 2013 .Dt AXE 4 .Os .Sh NAME @@ -215,6 +215,8 @@ AX88772B: .Bl -bullet -compact .It ASIX AX88772B +.It +Lenovo USB 2.0 Ethernet .El .Pp AX88760: From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 06:32:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A24A98A; Mon, 1 Jul 2013 06:32:57 +0000 (UTC) (envelope-from rpaulo@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 5CAA710D6; Mon, 1 Jul 2013 06:32:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616WvkN000454; Mon, 1 Jul 2013 06:32:57 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616Wv07000453; Mon, 1 Jul 2013 06:32:57 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307010632.r616Wv07000453@svn.freebsd.org> From: Rui Paulo Date: Mon, 1 Jul 2013 06:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252449 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 06:32:57 -0000 Author: rpaulo Date: Mon Jul 1 06:32:56 2013 New Revision: 252449 URL: http://svnweb.freebsd.org/changeset/base/252449 Log: Disable debugging. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Jul 1 05:33:55 2013 (r252448) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Jul 1 06:32:56 2013 (r252449) @@ -74,8 +74,6 @@ __FBSDID("$FreeBSD$"); #define BCM_SDHCI_BUFFER_SIZE 512 -#define DEBUG - #ifdef DEBUG #define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 06:33:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 38463B18; Mon, 1 Jul 2013 06:33:36 +0000 (UTC) (envelope-from rpaulo@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 2B82110E5; Mon, 1 Jul 2013 06:33:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616XaM2000630; Mon, 1 Jul 2013 06:33:36 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616Xa1h000629; Mon, 1 Jul 2013 06:33:36 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307010633.r616Xa1h000629@svn.freebsd.org> From: Rui Paulo Date: Mon, 1 Jul 2013 06:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252450 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 06:33:36 -0000 Author: rpaulo Date: Mon Jul 1 06:33:35 2013 New Revision: 252450 URL: http://svnweb.freebsd.org/changeset/base/252450 Log: The mbox driver is actually MP safe, so set the right flag in bus_setup_intr(). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Jul 1 06:32:56 2013 (r252449) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Jul 1 06:33:35 2013 (r252450) @@ -163,11 +163,9 @@ bcm_mbox_attach(device_t dev) } /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, - NULL, bcm_mbox_intr, sc, - &sc->intr_hl) != 0) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->irq_res); + if (bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE | INTR_TYPE_MISC, + NULL, bcm_mbox_intr, sc, &sc->intr_hl) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq_res); device_printf(dev, "Unable to setup the clock irq handler.\n"); return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 06:58:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15693B6; Mon, 1 Jul 2013 06:58: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 0779A119B; Mon, 1 Jul 2013 06:58:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616w5Fc006726; Mon, 1 Jul 2013 06:58:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616w5PA006725; Mon, 1 Jul 2013 06:58:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010658.r616w5PA006725@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 06:58: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: r252452 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 06:58:06 -0000 Author: yongari Date: Mon Jul 1 06:58:05 2013 New Revision: 252452 URL: http://svnweb.freebsd.org/changeset/base/252452 Log: MFC r251481: Do not report current link status if driver is not running. Reporting link status in driver has a side-effect that makes mii(4) check current link status. mii(4) will call link status change callback when it sees link state change. Normally this wouldn't have problems. However, ASF/IPMI firmware can actively access PHY regardless of driver's running state such that reporting link status for not-running interface can generate meaningless link UP/DOWN messages. This change also makes dhclient think driver got a valid link regardless of link establishment so it will bypass dhclient's initial link status check. I think that wouldn't be issue though. 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 Jul 1 06:44:27 2013 (r252451) +++ stable/9/sys/dev/bge/if_bge.c Mon Jul 1 06:58:05 2013 (r252452) @@ -5608,6 +5608,10 @@ bge_ifmedia_sts(struct ifnet *ifp, struc BGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BGE_UNLOCK(sc); + return; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 06:58:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1BE97236; Mon, 1 Jul 2013 06:58:36 +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 0E12511A3; Mon, 1 Jul 2013 06:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616wZvG006824; Mon, 1 Jul 2013 06:58:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616wZr8006823; Mon, 1 Jul 2013 06:58:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010658.r616wZr8006823@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 06:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252453 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 06:58:36 -0000 Author: yongari Date: Mon Jul 1 06:58:35 2013 New Revision: 252453 URL: http://svnweb.freebsd.org/changeset/base/252453 Log: MFC r251481: Do not report current link status if driver is not running. Reporting link status in driver has a side-effect that makes mii(4) check current link status. mii(4) will call link status change callback when it sees link state change. Normally this wouldn't have problems. However, ASF/IPMI firmware can actively access PHY regardless of driver's running state such that reporting link status for not-running interface can generate meaningless link UP/DOWN messages. This change also makes dhclient think driver got a valid link regardless of link establishment so it will bypass dhclient's initial link status check. I think that wouldn't be issue though. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 1 06:58:05 2013 (r252452) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 1 06:58:35 2013 (r252453) @@ -5621,6 +5621,10 @@ bge_ifmedia_sts(struct ifnet *ifp, struc BGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BGE_UNLOCK(sc); + return; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:00:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A68241D; Mon, 1 Jul 2013 07:00:13 +0000 (UTC) (envelope-from peter@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 1CE3911BF; Mon, 1 Jul 2013 07:00:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6170CqO007423; Mon, 1 Jul 2013 07:00:12 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6170C0Q007420; Mon, 1 Jul 2013 07:00:12 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307010700.r6170C0Q007420@svn.freebsd.org> From: Peter Wemm Date: Mon, 1 Jul 2013 07:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252454 - head/usr.bin/svn/lib/libapr_util X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:00:13 -0000 Author: peter Date: Mon Jul 1 07:00:12 2013 New Revision: 252454 URL: http://svnweb.freebsd.org/changeset/base/252454 Log: Update to current configuration. Modified: head/usr.bin/svn/lib/libapr_util/apr_ldap.h head/usr.bin/svn/lib/libapr_util/apu.h head/usr.bin/svn/lib/libapr_util/apu_config.h Modified: head/usr.bin/svn/lib/libapr_util/apr_ldap.h ============================================================================== --- head/usr.bin/svn/lib/libapr_util/apr_ldap.h Mon Jul 1 06:58:35 2013 (r252453) +++ head/usr.bin/svn/lib/libapr_util/apr_ldap.h Mon Jul 1 07:00:12 2013 (r252454) @@ -41,6 +41,7 @@ #define APR_HAS_MOZILLA_LDAPSDK 0 #define APR_HAS_OPENLDAP_LDAPSDK 0 #define APR_HAS_MICROSOFT_LDAPSDK 0 +#define APR_HAS_TIVOLI_LDAPSDK 0 #define APR_HAS_ZOS_LDAPSDK 0 #define APR_HAS_OTHER_LDAPSDK 0 @@ -58,7 +59,11 @@ * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ +#if APR_HAS_TIVOLI_LDAPSDK +#define APR_HAS_LDAP_SSL 0 +#else #define APR_HAS_LDAP_SSL 1 +#endif #define APR_HAS_LDAP_URL_PARSE 0 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) @@ -98,15 +103,19 @@ /* * For ldap function calls that input a size limit on the number of returned elements * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) + * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK + * or process is configured for. */ -#if APR_HAS_ZOS_LDAPSDK -#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT -#else #ifdef LDAP_DEFAULT_LIMIT #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT #else -#define APR_LDAP_SIZELIMIT -1 /* equivalent to LDAP_DEFAULT_LIMIT */ +#ifdef LDAP_NO_LIMIT +#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT +#endif #endif + +#ifndef APR_LDAP_SIZELIMIT +#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ #endif /* @@ -147,10 +156,43 @@ typedef struct apr_ldap_err_t { } #endif +/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection + * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone + * manually chooses another SDK on Windows + */ +#if APR_HAS_MICROSOFT_LDAPSDK +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ + || (s) == LDAP_UNAVAILABLE) +#else +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) +#endif + +/* These symbols are not actually exported in a DSO build, but mapped into + * a private exported function array for apr_ldap_stub to bind dynamically. + * Rename them appropriately to protect the global namespace. + */ +#ifdef APU_DSO_LDAP_BUILD + +#define apr_ldap_info apr__ldap_info +#define apr_ldap_init apr__ldap_init +#define apr_ldap_ssl_init apr__ldap_ssl_init +#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit +#define apr_ldap_get_option apr__ldap_get_option +#define apr_ldap_set_option apr__ldap_set_option +#define apr_ldap_rebind_init apr__ldap_rebind_init +#define apr_ldap_rebind_add apr__ldap_rebind_add +#define apr_ldap_rebind_remove apr__ldap_rebind_remove + +#define APU_DECLARE_LDAP(type) type +#else +#define APU_DECLARE_LDAP(type) APU_DECLARE(type) +#endif + #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" +#include "apr_ldap_rebind.h" -/** @} */ #endif /* APR_HAS_LDAP */ +/** @} */ #endif /* APU_LDAP_H */ Modified: head/usr.bin/svn/lib/libapr_util/apu.h ============================================================================== --- head/usr.bin/svn/lib/libapr_util/apu.h Mon Jul 1 06:58:35 2013 (r252453) +++ head/usr.bin/svn/lib/libapr_util/apu.h Mon Jul 1 07:00:12 2013 (r252454) @@ -48,25 +48,41 @@ * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * - * @deffunc APU_DECLARE(rettype) apr_func(args); + * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * - * @deffunc APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @deffunc APU_DECLARE_DATA type apr_variable; - * @tip APU_DECLARE_DATA extern type apr_variable; syntax is required for + * @fn APU_DECLARE_DATA type apr_variable; + * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA + +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. + * + * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APU_MODULE_DECLARE_DATA are always exported. + * @code + * module APU_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APU_MODULE_DECLARE_DATA +#else +#define APU_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + /* * we always have SDBM (it's in our codebase) */ @@ -77,12 +93,19 @@ #if APU_HAVE_DB #define APU_HAVE_DB_VERSION 0 -#endif /* APU_HAVE_DB */ +#endif #define APU_HAVE_PGSQL 0 #define APU_HAVE_MYSQL 0 #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_FREETDS 0 +#define APU_HAVE_ODBC 0 + +#define APU_HAVE_CRYPTO 0 +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 #define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 0 Modified: head/usr.bin/svn/lib/libapr_util/apu_config.h ============================================================================== --- head/usr.bin/svn/lib/libapr_util/apu_config.h Mon Jul 1 06:58:35 2013 (r252453) +++ head/usr.bin/svn/lib/libapr_util/apu_config.h Mon Jul 1 07:00:12 2013 (r252454) @@ -6,9 +6,18 @@ /* Define if the system crypt() function is threadsafe */ /* #undef APU_CRYPT_THREADSAFE */ +/* Define to 1 if modular components are built as DSOs */ +/* #undef APU_DSO_BUILD */ + +/* Define to be absolute path to DSO directory */ +/* #undef APU_DSO_LIBDIR */ + /* Define if the inbuf parm to iconv() is const char ** */ /* #undef APU_ICONV_INBUF_CONST */ +/* Define that OpenSSL uses const buffers */ +#define CRYPTO_OPENSSL_CONST_BUFFERS 1 + /* Define if crypt_r has uses CRYPTD */ /* #undef CRYPT_R_CRYPTD */ @@ -21,9 +30,16 @@ /* Define to 1 if you have the `crypt_r' function. */ /* #undef HAVE_CRYPT_R */ +/* Define to 1 if you have the declaration of `EVP_PKEY_CTX_new', and to 0 if + you don't. */ +#define HAVE_DECL_EVP_PKEY_CTX_NEW 1 + /* Define if expat.h is available */ #define HAVE_EXPAT_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FREETDS_SYBDB_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_ICONV_H */ @@ -42,9 +58,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LDAP_SSL_H */ -/* Define to 1 if you have the `lber' library (-llber). */ -/* #undef HAVE_LIBLBER */ - /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBPQ_FE_H */ @@ -57,18 +70,57 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_MYSQL_MYSQL_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MYSQL_MY_GLOBAL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MYSQL_MY_SYS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MY_GLOBAL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MY_SYS_H */ + /* Define to 1 if you have the `nl_langinfo' function. */ #define HAVE_NL_LANGINFO 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_NSS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NSS_PK11PUB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OCI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ODBC_SQL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_X509_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PK11PUB_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_POSTGRESQL_LIBPQ_FE_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PRERROR_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_SQLITE3_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SQLITE_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SQL_H */ + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -81,6 +133,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYBDB_H */ + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -99,6 +154,9 @@ /* Define if xml/xmlparse.h is available */ /* #undef HAVE_XML_XMLPARSE_H */ +/* Define if ldap_set_rebind_proc takes three arguments */ +/* #undef LDAP_SET_REBIND_PROC_THREE */ + /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" @@ -111,6 +169,9 @@ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "" From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:02:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 85EEA5BB; Mon, 1 Jul 2013 07:02:45 +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 5E4BB11DA; Mon, 1 Jul 2013 07:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6172jJN009317; Mon, 1 Jul 2013 07:02:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6172jFu009315; Mon, 1 Jul 2013 07:02:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010702.r6172jFu009315@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 07:02: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: r252455 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:02:45 -0000 Author: yongari Date: Mon Jul 1 07:02:44 2013 New Revision: 252455 URL: http://svnweb.freebsd.org/changeset/base/252455 Log: MFC r251482,251733: r251482: Correct setting TX random backoff register. This register is implemented as a 10 bits linear feedback shift register so only lower 10 bits are valid. Because this register is used to initialize random backoff interval register only when resolved duplex is half-duplex, it wouldn't have caused issues in these days. r251733: Fix a typo introduced in r213280. IFM_OPTIONS macro should see current media word. 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 Jul 1 07:00:12 2013 (r252454) +++ stable/9/sys/dev/bge/if_bge.c Mon Jul 1 07:02:44 2013 (r252455) @@ -1284,7 +1284,7 @@ bge_miibus_statchg(device_t dev) /* 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) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { 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) @@ -2280,9 +2280,9 @@ bge_blockinit(struct bge_softc *sc) /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, - IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + + (IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] + - IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5] + + IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5]) & BGE_TX_BACKOFF_SEED_MASK); /* Set inter-packet gap */ Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Jul 1 07:00:12 2013 (r252454) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Jul 1 07:02:44 2013 (r252455) @@ -797,7 +797,7 @@ #define BGE_LEDCTL_BLINKPERIOD_OVERRIDE 0x80000000 /* TX backoff seed register */ -#define BGE_TX_BACKOFF_SEED_MASK 0x3F +#define BGE_TX_BACKOFF_SEED_MASK 0x3FF /* Autopoll status register */ #define BGE_AUTOPOLLSTS_ERROR 0x00000001 From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:03:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6777974B; Mon, 1 Jul 2013 07:03:39 +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 41B4F11E2; Mon, 1 Jul 2013 07:03:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6173dCS009495; Mon, 1 Jul 2013 07:03:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6173cSK009493; Mon, 1 Jul 2013 07:03:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010703.r6173cSK009493@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 07:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252456 - stable/8/sys/dev/bge X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:03:39 -0000 Author: yongari Date: Mon Jul 1 07:03:38 2013 New Revision: 252456 URL: http://svnweb.freebsd.org/changeset/base/252456 Log: MFC r251482,251733: r251482: Correct setting TX random backoff register. This register is implemented as a 10 bits linear feedback shift register so only lower 10 bits are valid. Because this register is used to initialize random backoff interval register only when resolved duplex is half-duplex, it wouldn't have caused issues in these days. r251733: Fix a typo introduced in r213280. IFM_OPTIONS macro should see current media word. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 1 07:02:44 2013 (r252455) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 1 07:03:38 2013 (r252456) @@ -1283,7 +1283,7 @@ bge_miibus_statchg(device_t dev) /* 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) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { 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) @@ -2279,9 +2279,9 @@ bge_blockinit(struct bge_softc *sc) /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, - IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + + (IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] + - IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5] + + IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5]) & BGE_TX_BACKOFF_SEED_MASK); /* Set inter-packet gap */ Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Jul 1 07:02:44 2013 (r252455) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Jul 1 07:03:38 2013 (r252456) @@ -797,7 +797,7 @@ #define BGE_LEDCTL_BLINKPERIOD_OVERRIDE 0x80000000 /* TX backoff seed register */ -#define BGE_TX_BACKOFF_SEED_MASK 0x3F +#define BGE_TX_BACKOFF_SEED_MASK 0x3FF /* Autopoll status register */ #define BGE_AUTOPOLLSTS_ERROR 0x00000001 From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:07:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65D0C8F8; Mon, 1 Jul 2013 07:07:36 +0000 (UTC) (envelope-from peter@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 58CD91208; Mon, 1 Jul 2013 07:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6177auI010181; Mon, 1 Jul 2013 07:07:36 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6177aZv010179; Mon, 1 Jul 2013 07:07:36 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307010707.r6177aZv010179@svn.freebsd.org> From: Peter Wemm Date: Mon, 1 Jul 2013 07:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252457 - head/usr.bin/svn/lib/libapr_util X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:07:36 -0000 Author: peter Date: Mon Jul 1 07:07:35 2013 New Revision: 252457 URL: http://svnweb.freebsd.org/changeset/base/252457 Log: If you've compiled your base system with WITH_ICONV, then use it for svn alongside the other consumers (bsdtar, csh etc). The svnlite build gets upset when it hits non-ascii characters in inconvenient places. Modified: head/usr.bin/svn/lib/libapr_util/Makefile head/usr.bin/svn/lib/libapr_util/apu.h Modified: head/usr.bin/svn/lib/libapr_util/Makefile ============================================================================== --- head/usr.bin/svn/lib/libapr_util/Makefile Mon Jul 1 07:03:38 2013 (r252456) +++ head/usr.bin/svn/lib/libapr_util/Makefile Mon Jul 1 07:07:35 2013 (r252457) @@ -28,5 +28,11 @@ CFLAGS+= -DHAVE_CONFIG_H \ -I${APR}/include/arch/unix \ -I${APR}/include +.include + +.if ${MK_ICONV} == "yes" +CFLAGS+= -DHAVE_ICONV_H=1 -DAPU_HAVE_ICONV=1 +.endif + .include Modified: head/usr.bin/svn/lib/libapr_util/apu.h ============================================================================== --- head/usr.bin/svn/lib/libapr_util/apu.h Mon Jul 1 07:03:38 2013 (r252456) +++ head/usr.bin/svn/lib/libapr_util/apu.h Mon Jul 1 07:07:35 2013 (r252457) @@ -107,8 +107,12 @@ #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 +#ifndef APU_HAVE_APR_ICONV #define APU_HAVE_APR_ICONV 0 +#endif +#ifndef APU_HAVE_ICONV #define APU_HAVE_ICONV 0 +#endif #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:25:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD7A9C98; Mon, 1 Jul 2013 07:25:42 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id C185F128B; Mon, 1 Jul 2013 07:25:42 +0000 (UTC) Received: from delphij-macbook.local (c-67-188-85-47.hsd1.ca.comcast.net [67.188.85.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id EE90D1E119; Mon, 1 Jul 2013 00:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1372663542; bh=INtdzwANJyLXvVB+y1MO6EvTI7vBp4XiuFUZwds4Pxg=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=lPcmMnehjnFpcv+86JcNvjqTM5Vq9KPK8vdyiUgRb4Uv5Euy0Qc5b9YjpLDt72TG3 5zWF0NNLvZustzwZjqtMrCIdXjBwZZfWSFNFUqe1PL28x8vVdCnH0UqbK5o8Yu76To tXnGubzsBKDicst46cHOK1TYLhVGghYFDSTyshvc= Message-ID: <51D12EF8.5000108@delphij.net> Date: Mon, 01 Jul 2013 00:25:44 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: "Pedro F. Giffuni" Subject: Re: svn commit: r252435 - in head/sys/ufs: ffs ufs References: <201307010300.r6130GWT035496@svn.freebsd.org> In-Reply-To: <201307010300.r6130GWT035496@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:25:42 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 6/30/13 8:00 PM, Pedro F. Giffuni wrote: > Author: pfg Date: Mon Jul 1 03:00:15 2013 New Revision: 252435 > URL: http://svnweb.freebsd.org/changeset/base/252435 > > Log: Change i_gen in UFS to an unsigned type. > [...] > Modified: head/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > > - --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 02:48:27 2013 (r252434) > +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 03:00:15 2013 > (r252435) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, > ffs_flags * already have one. This should only happen on old > filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random() / > 2 + 1; + ip->i_gen = arc4random() + 1; if ((vp->v_mount->mnt_flag > & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, > ip->i_gen); > Why ip->i_gen must be non-zero here? (I think it does not. Note that arc4random() can return UINT32_MAX so the new code does not guarantee this anyway, while old code does). If my understanding of the code is right, I think it doesn't really hurt to have 0 in ip->i_gen in the places where arc4random() is used (next time it would be regenerated), so probably we can just use ip->i_gen = arc4random()? However, if I was wrong, you probably want some construction like this: %%% for (;;) { %%% ip->i_gen = arc4random(); %%% if (ip->i_gen != UINT32_MAX) %%% break; %%% } %%% ip->i_gen++; Or we probably need to import a variant of arc4random_uniform into kernel? Cheers, -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJR0S74AAoJEG80Jeu8UPuzoRgIAJ5xyeUkJf6KGVdz3KkhuJ+m YJ6MjNZDo8xEcbZcuuH4PzzFyZZrO7puL0wMjlEN8fJIWkf/mXLpN+pAdVgU6h8Y A3plrlznEZH/s/G+FdZnHC1aIrizk/F2pm+/ev+e4kUX0covbreiK3gOAEsmi4Ik sfcsh+JCFrbbICQbN09EtUdfgmFdIPT+uni95gYdZ9K5poOeJ5NgsN9aDv2V0qJR pyLmWE26cj+SgfJhCahmoHXjVSgywG4O4XnAqxTUMbVRsV7ELYwJjugCKib1UFPl axwFc3Oh8KlFlczAgkWbSlf8ea5Jql1o6PXYQvuGHBUQdY5gQLXAAJMdc4iFIrY= =3RzL -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 07:37:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EE5C7F7A; Mon, 1 Jul 2013 07:37:31 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id 4645112E6; Mon, 1 Jul 2013 07:37:30 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApUGALov0VFR8aFy/2dsb2JhbABagwkygwlHvBB+F3SCIwEBBSMzIgEQCxgJFgsCAgkDAgECASceBg0BBQIBAYgPCKpJkFmNDYJRB4JRgRYDkAiBLZdYgxM6 Received: from 114.161-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.161.114]) by relay.skynet.be with ESMTP; 01 Jul 2013 09:37:23 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r617bM0C001210; Mon, 1 Jul 2013 09:37:22 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51D131AC.9010502@coosemans.org> Date: Mon, 01 Jul 2013 09:37:16 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r252411 - head/sys/sys References: <201306300854.r5U8sfYS018720@svn.freebsd.org> <51D07C10.2000509@coosemans.org> <51D09019.50101@coosemans.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2OKCUNNVRTRXTPCRTNFRV" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 07:37:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OKCUNNVRTRXTPCRTNFRV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-06-30 22:29, Ed Schouten wrote: > 2013/6/30 Tijl Coosemans : >> The N1570 draft of C11 7.1.2 point 6 says: >> Any declaration of a library function shall have external linkage. >=20 > Then I think we are in serious troubles. For example, > atomic_fetch_add() is described as a "generic function". Is a "generic > function" a "library function"? If so, my guess is that it is > impossible to derive a standards-compliant implementation of this > header. The standard doesn't define what a generic function is. There is a defect report about that: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_419.htm ------enig2OKCUNNVRTRXTPCRTNFRV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHRMbEACgkQfoCS2CCgtiv82AD/SeSbD60vO5Ufv06Yxp/ka9J7 xxBP/WyZDH726gYm7xMA/REP7KFVADmCNkbtWFar4TWa9A0SDKfwMqosTpa3cm2l =8dRC -----END PGP SIGNATURE----- ------enig2OKCUNNVRTRXTPCRTNFRV-- From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:06:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1418459; Mon, 1 Jul 2013 08:06:27 +0000 (UTC) (envelope-from peter@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 7C1C81454; Mon, 1 Jul 2013 08:06:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6186QKC027322; Mon, 1 Jul 2013 08:06:26 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6186QmN027318; Mon, 1 Jul 2013 08:06:26 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307010806.r6186QmN027318@svn.freebsd.org> From: Peter Wemm Date: Mon, 1 Jul 2013 08:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252458 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:06:27 -0000 Author: peter Date: Mon Jul 1 08:06:26 2013 New Revision: 252458 URL: http://svnweb.freebsd.org/changeset/base/252458 Log: __weak_alias() doesn't exist on FreeBSD. Use __weak_reference(); Expose iconv functions as weak symbols as well as their internal remapped #define names. This is necessary for autoconf compatability - on Linux it appears that #include isn't a link time prerequisite for their version that's built into glibc. Initialize the pthread rwlock. Note that upstream has three separate locks. The file-local static lock appears intentional. I'm using this as a ports-compatible compile-time substitute for converters/libiconv on one of my personal machines. Modified: head/lib/libc/iconv/Symbol.map head/lib/libc/iconv/citrus_lock.h head/lib/libc/iconv/iconv.c Modified: head/lib/libc/iconv/Symbol.map ============================================================================== --- head/lib/libc/iconv/Symbol.map Mon Jul 1 07:07:35 2013 (r252457) +++ head/lib/libc/iconv/Symbol.map Mon Jul 1 08:06:26 2013 (r252458) @@ -17,6 +17,16 @@ FBSD_1.2 { libiconvlist; }; +FBSD_1.3 { + iconv; + iconv_open; + iconv_close; + iconv_open_into; + iconv_set_relocation_prefix; + iconvctl; + iconvlist; +}; + FBSDprivate_1.0 { _citrus_bcs_convert_to_lower; _citrus_bcs_convert_to_upper; Modified: head/lib/libc/iconv/citrus_lock.h ============================================================================== --- head/lib/libc/iconv/citrus_lock.h Mon Jul 1 07:07:35 2013 (r252457) +++ head/lib/libc/iconv/citrus_lock.h Mon Jul 1 08:06:26 2013 (r252458) @@ -27,7 +27,8 @@ #include -static pthread_rwlock_t lock; +/* XXX Yes, the original code has three separate file-local lock instances */ +static pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER; #define WLOCK if (__isthreaded) \ pthread_rwlock_wrlock(&lock); Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Mon Jul 1 07:07:35 2013 (r252457) +++ head/lib/libc/iconv/iconv.c Mon Jul 1 08:06:26 2013 (r252458) @@ -47,16 +47,13 @@ #include "citrus_hash.h" #include "citrus_iconv.h" -#ifdef __weak_alias -__weak_alias(libiconv, _iconv) -__weak_alias(libiconv_open, _iconv_open) -__weak_alias(libiconv_open_into, _iconv_open_into) -__weak_alias(libiconv_close, _iconv_close) -__weak_alias(libiconvlist, _iconvlist) -__weak_alias(libiconvctl, _iconvctl) -__weak_alias(libiconv_set_relocation_prefix, _iconv_set_relocation_prefix) -__weak_alias(iconv_canonicalize, _iconv_canonicalize) -#endif +__weak_reference(libiconv, iconv); +__weak_reference(libiconv_open, iconv_open); +__weak_reference(libiconv_open_into, iconv_open_into); +__weak_reference(libiconv_close, iconv_close); +__weak_reference(libiconvlist, iconvlist); +__weak_reference(libiconvctl, iconvctl); +__weak_reference(libiconv_set_relocation_prefix, iconv_set_relocation_prefix); #define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:14:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 946846F8 for ; Mon, 1 Jul 2013 08:14:44 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com [IPv6:2607:f8b0:400c:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 56CAC15D9 for ; Mon, 1 Jul 2013 08:14:44 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id hz11so1784959vcb.10 for ; Mon, 01 Jul 2013 01:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ISW99VcO8E/anLbB4h1z69G2LuFJyn3jel3M5AzRZDI=; b=DaUD9CelFNcVe/U9jv0LnqgOncRY2kd6/luk8xAiZY5804noSKd2pnTyN3LsPtJjlD dTohAaVyshk31jko8Qxsb1om27mY4efpPFavKNriAHbo/BWxBAEk4J94waf9PVUZVGi9 phSSbLF6cIFJFnNpLJGgsZ8qOKTcvhAwd7LEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=ISW99VcO8E/anLbB4h1z69G2LuFJyn3jel3M5AzRZDI=; b=Lv+ZWSXmmOVytxMdhYMGTErxBzpalrjbWjM3b/LpOHknK9Bc958ngOEhMkdNrBqbY9 S9iowasv1bYfaUKwWCJKzaoThm8/lKkx6/1v2b+XFDtM9ZSF0/1mza3gaWYQFSgGTPQ3 /Tt6GuTK8QbjAeaV5z0bw+6bHRK1qYnaQwcDSukMn9aTro+kBesccamcsAZ+shynswev uRVpo43yZ547BfQAk9MfXWNsvgf+nTiXgxx3RN6D0Lt6H5put11MlgxRqzy9DNeS4CL1 ex1o3YoWF1Knp+VX/e1YNWAddN7c/Sv60dSfhJ9O2R6CUWWOWVF/vT+pMvkW5gmxue3k LKwQ== MIME-Version: 1.0 X-Received: by 10.52.65.111 with SMTP id w15mr7418182vds.73.1372666483884; Mon, 01 Jul 2013 01:14:43 -0700 (PDT) Received: by 10.221.37.198 with HTTP; Mon, 1 Jul 2013 01:14:43 -0700 (PDT) In-Reply-To: <201307010806.r6186QmN027318@svn.freebsd.org> References: <201307010806.r6186QmN027318@svn.freebsd.org> Date: Mon, 1 Jul 2013 01:14:43 -0700 Message-ID: Subject: Re: svn commit: r252458 - head/lib/libc/iconv From: Peter Wemm To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlSXx+zFWYI67xOUvdEzsbcKSDwV9OgiOu8XElx5bvu5ezGvumtilG667LIBidzubs48z6v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:14:44 -0000 On Mon, Jul 1, 2013 at 1:06 AM, Peter Wemm wrote: > Author: peter > Date: Mon Jul 1 08:06:26 2013 > New Revision: 252458 > URL: http://svnweb.freebsd.org/changeset/base/252458 > > Log: [..] > I'm using this as a ports-compatible compile-time substitute for > converters/libiconv on one of my personal machines. > In case anyone else is crazy enough, this is what I'm doing. 1) make.conf: WITH_ICONV=yes 2) patch ports Mk to disable "USES=iconv" Index: Mk/Uses/iconv.mk =================================================================== --- Mk/Uses/iconv.mk (revision 322113) +++ Mk/Uses/iconv.mk (working copy) @@ -16,6 +16,6 @@ IGNORE= USES=iconv does not require args .endif -LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv +#LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv .endif So far, I don't seem to be being punished for trying this. But I was able to remove converters/libiconv from all its downstream consumers before installing the local one. Having said that, it's all bound to catch fire now..... I have suspect that autoconf will make a smooth transition as difficult as possible by "autodetecting" libiconv if it was present. One way might be to move libiconv.so.3 to a lib compat directory and make sure there are no libiconv.so or libiconv.a files around. That **might** be enough to allow old binaries to run while you force rebuild. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:21:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2F10D1B; Mon, 1 Jul 2013 08:21:06 +0000 (UTC) (envelope-from smh@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 A54A71670; Mon, 1 Jul 2013 08:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618L66N032584; Mon, 1 Jul 2013 08:21:06 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618L6lL032583; Mon, 1 Jul 2013 08:21:06 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010821.r618L6lL032583@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:21:06 +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: r252459 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:21:06 -0000 Author: smh Date: Mon Jul 1 08:21:06 2013 New Revision: 252459 URL: http://svnweb.freebsd.org/changeset/base/252459 Log: MFC r252390: Remove invalid ASSERT Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_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/dsl_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:06:26 2013 (r252458) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:21:06 2013 (r252459) @@ -1258,8 +1258,6 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t int error; objset_t *mos = dp->dp_meta_objset; - ASSERT(dmu_buf_refcount(dd->dd_dbuf) <= 2); - VERIFY0(dsl_dir_hold(dp, ddra->ddra_oldname, FTAG, &dd, NULL)); VERIFY0(dsl_dir_hold(dp, ddra->ddra_newname, FTAG, &newparent, &mynewname)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:24:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1AD6AEDB; Mon, 1 Jul 2013 08:24:15 +0000 (UTC) (envelope-from smh@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 0CBC9169D; Mon, 1 Jul 2013 08:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618OEda033030; Mon, 1 Jul 2013 08:24:14 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618OEru033029; Mon, 1 Jul 2013 08:24:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010824.r618OEru033029@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:24:14 +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: r252460 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:24:15 -0000 Author: smh Date: Mon Jul 1 08:24:14 2013 New Revision: 252460 URL: http://svnweb.freebsd.org/changeset/base/252460 Log: MFC r252392: style(9) fixes 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 Mon Jul 1 08:21:06 2013 (r252459) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:24:14 2013 (r252460) @@ -75,7 +75,8 @@ cmn_err(int type, const char *fmt, ...) } int -assfail(const char *a, const char *f, int l) { +assfail(const char *a, const char *f, int l) +{ panic("solaris assert: %s, file: %s, line: %d", a, f, l); @@ -84,7 +85,8 @@ assfail(const char *a, const char *f, in void assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, - const char *f, int l) { + const char *f, int l) +{ panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", a, lv, op, rv, f, l); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:25:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 237D42D3; Mon, 1 Jul 2013 08:25:51 +0000 (UTC) (envelope-from smh@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 147E916C3; Mon, 1 Jul 2013 08:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618PoFT033280; Mon, 1 Jul 2013 08:25:50 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618Pos5033279; Mon, 1 Jul 2013 08:25:50 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010825.r618Pos5033279@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252461 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:25:51 -0000 Author: smh Date: Mon Jul 1 08:25:50 2013 New Revision: 252461 URL: http://svnweb.freebsd.org/changeset/base/252461 Log: MFC r252390: Remove invalid ASSERT Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:24:14 2013 (r252460) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:25:50 2013 (r252461) @@ -1258,8 +1258,6 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t int error; objset_t *mos = dp->dp_meta_objset; - ASSERT(dmu_buf_refcount(dd->dd_dbuf) <= 2); - VERIFY0(dsl_dir_hold(dp, ddra->ddra_oldname, FTAG, &dd, NULL)); VERIFY0(dsl_dir_hold(dp, ddra->ddra_newname, FTAG, &newparent, &mynewname)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:27:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E59D649D; Mon, 1 Jul 2013 08:27:15 +0000 (UTC) (envelope-from smh@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 D7E9716F1; Mon, 1 Jul 2013 08:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618RFfK033489; Mon, 1 Jul 2013 08:27:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618RFMj033488; Mon, 1 Jul 2013 08:27:15 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010827.r618RFMj033488@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252462 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:27:16 -0000 Author: smh Date: Mon Jul 1 08:27:15 2013 New Revision: 252462 URL: http://svnweb.freebsd.org/changeset/base/252462 Log: MFC r252392: style(9) fixes Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:25:50 2013 (r252461) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:27:15 2013 (r252462) @@ -75,7 +75,8 @@ cmn_err(int type, const char *fmt, ...) } int -assfail(const char *a, const char *f, int l) { +assfail(const char *a, const char *f, int l) +{ panic("solaris assert: %s, file: %s, line: %d", a, f, l); @@ -84,7 +85,8 @@ assfail(const char *a, const char *f, in void assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, - const char *f, int l) { + const char *f, int l) +{ panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", a, lv, op, rv, f, l); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:37:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21281D6D; Mon, 1 Jul 2013 08:37:43 +0000 (UTC) (envelope-from gavin@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 05B4E1889; Mon, 1 Jul 2013 08:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618bgl0036448; Mon, 1 Jul 2013 08:37:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618bgrI036446; Mon, 1 Jul 2013 08:37:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307010837.r618bgrI036446@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 1 Jul 2013 08:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252463 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:37:43 -0000 Author: gavin Date: Mon Jul 1 08:37:42 2013 New Revision: 252463 URL: http://svnweb.freebsd.org/changeset/base/252463 Log: Take into safekeeping the following bits: art, bgray, brucec, bruno, cokane, davidc, dg, dwhite, gordon, guido, jkoshy, jon, kato, matteo, mdodd, mohans, mtm, olli, phantom, sephe, sos, wsalamon, zml All have been idle for some time. Most have been contacted and have indicated that they are unlikely to have time to work on FreeBSD again any time soon. Mail to cokane, mohans and phantom bounces. Remove entries from conf/mentors where necessary. Thank you all for all your work in the past, and feel free to request your commit bit back should you find yourself able to contribute again in the future. Approved by: core, individual committers Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Jul 1 08:27:15 2013 (r252462) +++ svnadmin/conf/access Mon Jul 1 08:37:42 2013 (r252463) @@ -31,7 +31,6 @@ andreast andrew antoine ariff -art asomers attilio avatar @@ -40,13 +39,10 @@ bapt bde benl benno -bgray bms brian freebsd-committers@Awfulhak.org brooks -brucec brueffer -bruno bryanv bschmidt bz @@ -54,7 +50,6 @@ carl charnier cherry cognet -cokane cperciva cracauer csjp @@ -62,7 +57,6 @@ cy daichi darrenr das -davidc davidch davidcs davide @@ -73,12 +67,10 @@ deischen delphij des dfr -dg dim dmarion dteske dumbbell -dwhite dwmalone dwmalone=freebsd-committers@maths.tcd.ie eadler ed @@ -104,12 +96,10 @@ gleb glebius gnn gonzo -gordon green grehan grog gshapiro freebsd-cvs-committers@g.gshapiro.net -guido harti hiren hmp @@ -134,13 +124,11 @@ jilles jimharris jinmei jkim -jkoshy jlh jls jmallett jmg joerg freebsd-devel@uriah.heep.sax.de -jon jonathan jpaetzel julian @@ -148,7 +136,6 @@ jwd kaiw kan kargl -kato ken kensmith kevlo @@ -166,27 +153,23 @@ marius markj markm markus -matteo mav maxim mbr mckay mckusick mdf -mdodd melifaro miwi mjacob mjg mlaier mm -mohans monthadar motoyuki mp mpp mr -mtm n_hibma devnull neel netchild @@ -196,13 +179,11 @@ nwhitehorn nyan obrien oleg -olli pb peadar peter peter@wemm.org peterj pfg -phantom philip phk pho @@ -233,7 +214,6 @@ scf schweikh scottl se -sephe sepotvin silby simokawa @@ -241,7 +221,6 @@ simon sjg smh sobomax -sos commit@deepcore.dk sson ssouhlal stas @@ -272,8 +251,6 @@ will wkoszek wollman wpaul -wsalamon yongari zec -zml zont Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Jul 1 08:27:15 2013 (r252462) +++ svnadmin/conf/mentors Mon Jul 1 08:37:42 2013 (r252463) @@ -12,10 +12,8 @@ # Mentee Mentor Optional comment achim scottl Co-mentor: emaste anchie bz -art avg Co-mentor: marcel asomers ken Co-mentor: gibbs, will benl philip Co-mentor: simon -bgray cognet carl jimharris cy andre Co-mentor: glebius eri mlaier Co-mentor: thompsa From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 08:38:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0552CF92; Mon, 1 Jul 2013 08:38:32 +0000 (UTC) (envelope-from peter@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 E181918A8; Mon, 1 Jul 2013 08:38:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618cVdn036578; Mon, 1 Jul 2013 08:38:31 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618cVk6036577; Mon, 1 Jul 2013 08:38:31 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307010838.r618cVk6036577@svn.freebsd.org> From: Peter Wemm Date: Mon, 1 Jul 2013 08:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252464 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 08:38:32 -0000 Author: peter Date: Mon Jul 1 08:38:31 2013 New Revision: 252464 URL: http://svnweb.freebsd.org/changeset/base/252464 Log: If strdup failed, don't try and free the wrong thing. Modified: head/lib/libc/iconv/citrus_mapper.c Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Mon Jul 1 08:37:42 2013 (r252463) +++ head/lib/libc/iconv/citrus_mapper.c Mon Jul 1 08:38:31 2013 (r252464) @@ -96,7 +96,7 @@ _citrus_mapper_create_area( ma->ma_dir = strdup(area); if (ma->ma_dir == NULL) { ret = errno; - free(ma->ma_dir); + free(ma); goto quit; } _CITRUS_HASH_INIT(&ma->ma_cache, CM_HASH_SIZE); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 12:22:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D060399B; Mon, 1 Jul 2013 12:22:44 +0000 (UTC) (envelope-from gavin@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 C1CE118B9; Mon, 1 Jul 2013 12:22:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61CMiDx002652; Mon, 1 Jul 2013 12:22:44 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61CMiBk002651; Mon, 1 Jul 2013 12:22:44 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307011222.r61CMiBk002651@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 1 Jul 2013 12:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252465 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 12:22:44 -0000 Author: gavin Date: Mon Jul 1 12:22:44 2013 New Revision: 252465 URL: http://svnweb.freebsd.org/changeset/base/252465 Log: Take JINMEI Tatuya's commit bit into safekeeping, per his email to core. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Jul 1 08:38:31 2013 (r252464) +++ svnadmin/conf/access Mon Jul 1 12:22:44 2013 (r252465) @@ -122,7 +122,6 @@ jhb jhibbits jilles jimharris -jinmei jkim jlh jls @@ -236,8 +235,8 @@ thompsa ticso tijl trasz -trociny trhodes +trociny truckman tuexen ume From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 13:53:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 51039C16 for ; Mon, 1 Jul 2013 13:53:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm41-vm8.bullet.mail.gq1.yahoo.com (nm41-vm8.bullet.mail.gq1.yahoo.com [67.195.87.95]) by mx1.freebsd.org (Postfix) with ESMTP id D9DE31CE8 for ; Mon, 1 Jul 2013 13:53:50 +0000 (UTC) Received: from [216.39.60.180] by nm41.bullet.mail.gq1.yahoo.com with NNFMP; 01 Jul 2013 13:53:49 -0000 Received: from [208.71.42.200] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 01 Jul 2013 13:53:49 -0000 Received: from [127.0.0.1] by smtp211.mail.gq1.yahoo.com with NNFMP; 01 Jul 2013 13:53:49 -0000 X-Yahoo-Newman-Id: 841028.71113.bm@smtp211.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8Ftprq8VM1nXeBZDiJxOvdUGSnVF1La.pubs0bs4G1M7Zmv cOQ4j0CimTUXaQOwHmpCqDtSLVvQYvhcV6dazp0u4.Hq7nh3EglRt.LuEk_e f_4XqFX8JT6bAw8t8mDmtOFJBH56TWp5apvMifm8UPWizsuEIpbizjsJkX.v 6JxrEom6lJ4EQP8AA5eXD4tqfXhJ3SZQETbbTr5X.F.2xRb711oNWsaXteK0 gP6pRfESOGyqATbw6hV3WqDfKoN25KmMnUTXkYPj.xzl0gzIvqRmtl6FSRvv 3.TACTLckAeDBGKyJlnYDJkD4NP9XimQwnLmTosyuuAVG8pEknH_KxHW4Es9 uY_Z5D97fkv56CxsYJ0GLpDhNPYfvr5NBbuy88EBTYQRZRsjwd9rRy9p1Iq_ tm2wC3oaN2NWVhoY6gzaziTsxxHOMTLrM33VxxlOFy0mbUo3.sVAjrXCHoQw QCzGwI41CmlT2HN7t7IzTVmOI78F4sPzRQEIvmvUnmQt7kxqNNWSeHbIvQAQ 109iqW2fUfcqJoks0Ec9A5Jt2FJZQA6aLIB5hkhS6xtTyRqaDWNMURfUOqK8 kgNU8h65iZMmD5oXHeZ_oVZi.vMcIJgdfP1XF_3I1xGtyPDxRYumUS25zH88 NMCKtS52fLFj0Xo7LquLt83SW9Myx4UTY X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp211.mail.gq1.yahoo.com with SMTP; 01 Jul 2013 06:53:49 -0700 PDT Message-ID: <51D189EB.1000208@FreeBSD.org> Date: Mon, 01 Jul 2013 08:53:47 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: d@delphij.net Subject: Re: svn commit: r252435 - in head/sys/ufs: ffs ufs References: <201307010300.r6130GWT035496@svn.freebsd.org> <51D12EF8.5000108@delphij.net> In-Reply-To: <51D12EF8.5000108@delphij.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin Li X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 13:53:51 -0000 Hello; Thanks for reviewing ... El 01/07/2013 2:25 a. m., Xin Li escribió: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 6/30/13 8:00 PM, Pedro F. Giffuni wrote: >> Author: pfg Date: Mon Jul 1 03:00:15 2013 New Revision: 252435 >> URL: http://svnweb.freebsd.org/changeset/base/252435 >> >> Log: Change i_gen in UFS to an unsigned type. >> > [...] >> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> ============================================================================== >> >> > - --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 02:48:27 2013 (r252434) >> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 03:00:15 2013 >> (r252435) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, >> ffs_flags * already have one. This should only happen on old >> filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random() / >> 2 + 1; + ip->i_gen = arc4random() + 1; if ((vp->v_mount->mnt_flag >> & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, >> ip->i_gen); >> > > Why ip->i_gen must be non-zero here? (I think it does not. Note that > arc4random() can return UINT32_MAX so the new code does not guarantee > this anyway, while old code does). > Zero is the expected value when the disk is very old and has no i_gen. In reality this is likely to be dead code, the real set up of i_gen is done in newfs and newfs_random() already produces and unsigned int. > If my understanding of the code is right, I think it doesn't really > hurt to have 0 in ip->i_gen in the places where arc4random() is used > (next time it would be regenerated), so probably we can just use > ip->i_gen = arc4random()? > That is pretty much what newfs_random() does. > However, if I was wrong, you probably want some construction like this: > > %%% for (;;) { > %%% ip->i_gen = arc4random(); > %%% if (ip->i_gen != UINT32_MAX) > %%% break; > %%% } > %%% ip->i_gen++; > Theorically having an open loop in a filesystem is a bad programming practice. I think I prefer the simple arc4random but still having a potential overflow here is not a problem. > Or we probably need to import a variant of arc4random_uniform into kernel? > What we have is sufficient and perhaps somewhat overdesigned, i_gen doesn't have to be too random at all. Cheers, Pedro. From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 14:49:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 377019D7; Mon, 1 Jul 2013 14:49:24 +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 24C3F1F1F; Mon, 1 Jul 2013 14:49:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61EnOFW043955; Mon, 1 Jul 2013 14:49:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61EnOjP043954; Mon, 1 Jul 2013 14:49:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307011449.r61EnOjP043954@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 1 Jul 2013 14:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252467 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 14:49:24 -0000 Author: pfg Date: Mon Jul 1 14:49:23 2013 New Revision: 252467 URL: http://svnweb.freebsd.org/changeset/base/252467 Log: Change i_gen in UFS to an unsigned type. Further simplify the i_gen calculation for older disks. Having a zero here is not really a problem and this is more similar to what is done in newfs_random(). Reported by: Xin Li MFC after: 4 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:45:03 2013 (r252466) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:49:23 2013 (r252467) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random() + 1; + ip->i_gen = arc4random(); if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 17:06:12 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC4005DC; Mon, 1 Jul 2013 17:06:12 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 98078168D; Mon, 1 Jul 2013 17:06:12 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r61H65Yc041597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Jul 2013 10:06:06 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r61H65wI041596; Mon, 1 Jul 2013 10:06:05 -0700 (PDT) (envelope-from jmg) Date: Mon, 1 Jul 2013 10:06:05 -0700 From: John-Mark Gurney To: Peter Wemm Subject: Re: svn commit: r252458 - head/lib/libc/iconv Message-ID: <20130701170605.GM26412@funkthat.com> References: <201307010806.r6186QmN027318@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307010806.r6186QmN027318@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 01 Jul 2013 10:06:06 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 17:06:12 -0000 Peter Wemm wrote this message on Mon, Jul 01, 2013 at 08:06 +0000: > Initialize the pthread rwlock. Note that upstream has three > separate locks. The file-local static lock appears intentional. I believe that when I was tracing the lock issues, that there were some deadlocks that can occur even w/ separate locks. I did post a patch that made the lock a single lock and avoided the issues w/ the lock, but as I didn't have time to test it, never committed it. This definitely needs some real software engineering applied to it, either put this declaration in the respective files (so that if someone uses this is a new file, they won't get burned) and comments around the macros that it isn't a global lock. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 17:23:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F2D68B9; Mon, 1 Jul 2013 17:23:14 +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 51F7C172D; Mon, 1 Jul 2013 17:23:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61HNEFo089778; Mon, 1 Jul 2013 17:23:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61HNEdQ089777; Mon, 1 Jul 2013 17:23:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307011723.r61HNEdQ089777@svn.freebsd.org> From: Alexander Motin Date: Mon, 1 Jul 2013 17:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252468 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 17:23:14 -0000 Author: mav Date: Mon Jul 1 17:23:13 2013 New Revision: 252468 URL: http://svnweb.freebsd.org/changeset/base/252468 Log: Move pos++ out of the complicated equation, introduced at r240780. There is an oppinion that result of that equation is compiler-specific. Submitted by: dt71@gmx.com, kientzle Reviewed by: rmacklem MFC after: 3 days Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Mon Jul 1 14:49:23 2013 (r252467) +++ head/lib/libstand/nfs.c Mon Jul 1 17:23:13 2013 (r252468) @@ -1465,8 +1465,9 @@ nfs_readdir(struct open_file *f, struct d->d_name[d->d_namlen] = '\0'; pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t); - fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos++]) << 32) | - ntohl(rent->nameplus[pos++]); + fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos]) << 32) | + ntohl(rent->nameplus[pos + 1]); + pos += 2; buf = (u_char *)&rent->nameplus[pos]; return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 17:31:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2031EDFA; Mon, 1 Jul 2013 17:31:05 +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 132881797; Mon, 1 Jul 2013 17:31:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61HV4Ls092479; Mon, 1 Jul 2013 17:31:04 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61HV4OY092478; Mon, 1 Jul 2013 17:31:04 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307011731.r61HV4OY092478@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 1 Jul 2013 17:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252469 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 17:31:05 -0000 Author: np Date: Mon Jul 1 17:31:04 2013 New Revision: 252469 URL: http://svnweb.freebsd.org/changeset/base/252469 Log: Add a sysctl to get the number of filters available. sysctl dev.t4nex..nfilters sysctl dev.t5nex..nfilters MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jul 1 17:23:13 2013 (r252468) +++ head/sys/dev/cxgbe/t4_main.c Mon Jul 1 17:31:04 2013 (r252469) @@ -4189,6 +4189,9 @@ t4_sysctls(struct adapter *sc) sizeof(sc->sge.counter_val), sysctl_int_array, "A", "interrupt holdoff packet counter values"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD, + NULL, sc->tids.nftids, "number of filters"); + #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 17:32:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67DB4F60; Mon, 1 Jul 2013 17:32:08 +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 5AAEE17A3; Mon, 1 Jul 2013 17:32:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61HW83N092638; Mon, 1 Jul 2013 17:32:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61HW8bQ092637; Mon, 1 Jul 2013 17:32:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307011732.r61HW8bQ092637@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 1 Jul 2013 17:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252470 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 17:32:08 -0000 Author: np Date: Mon Jul 1 17:32:07 2013 New Revision: 252470 URL: http://svnweb.freebsd.org/changeset/base/252470 Log: Count the number of hits for a filter by default. MFC after: 3 days Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Mon Jul 1 17:31:04 2013 (r252469) +++ head/tools/tools/cxgbetool/cxgbetool.c Mon Jul 1 17:32:07 2013 (r252470) @@ -965,6 +965,7 @@ set_filter(uint32_t idx, int argc, const }; bzero(&t, sizeof (t)); t.idx = idx; + t.fs.hitcnts = 1; for (start_arg = 0; start_arg + 2 <= argc; start_arg += 2) { const char **args = &argv[start_arg]; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 17:57:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E2C89462; Mon, 1 Jul 2013 17:57:22 +0000 (UTC) (envelope-from smh@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 D58B518C5; Mon, 1 Jul 2013 17:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61HvMxX098849; Mon, 1 Jul 2013 17:57:22 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61HvM22098848; Mon, 1 Jul 2013 17:57:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307011757.r61HvM22098848@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 17:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252471 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 17:57:23 -0000 Author: smh Date: Mon Jul 1 17:57:22 2013 New Revision: 252471 URL: http://svnweb.freebsd.org/changeset/base/252471 Log: Remove forced timeout of in-flight commands from mfi_timeout. While this prevents commands getting stuck forever there is no way to guarantee that data from the command hasn't been committed to the device. In addition older mfi firmware has a bug that would cause the controller to frequently stall IO for over our timeout value, which when combined with a forced timeout often resulted in panics in UFS; which would otherwise be avoided when the command eventually completed if left alone. For reference this timeout issue is resolved in Dell FW package 21.2.1-0000. Fixed FW package version for none Dell controller will likely vary. MFC after: 2 days Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Mon Jul 1 17:32:07 2013 (r252470) +++ head/sys/dev/mfi/mfi.c Mon Jul 1 17:57:22 2013 (r252471) @@ -3773,12 +3773,15 @@ mfi_timeout(void *data) MFI_PRINT_CMD(cm); MFI_VALIDATE_CMD(sc, cm); /* - * Fail the command instead of leaving it on - * the queue where it could remain stuck forever + * While commands can get stuck forever we do + * not fail them as there is no way to tell if + * the controller has actually processed them + * or not. + * + * In addition its very likely that force + * failing a command here would cause a panic + * e.g. in UFS. */ - mfi_remove_busy(cm); - cm->cm_error = ETIMEDOUT; - mfi_complete(sc, cm); timedout++; } } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 18:41:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9970A303; Mon, 1 Jul 2013 18:41:08 +0000 (UTC) (envelope-from trociny@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 8C9D21AFC; Mon, 1 Jul 2013 18:41:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61If8l3013289; Mon, 1 Jul 2013 18:41:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61If8Vh013286; Mon, 1 Jul 2013 18:41:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307011841.r61If8Vh013286@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 1 Jul 2013 18:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252472 - in head/sbin: hastctl hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 18:41:08 -0000 Author: trociny Date: Mon Jul 1 18:41:07 2013 New Revision: 252472 URL: http://svnweb.freebsd.org/changeset/base/252472 Log: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd MFC after: 3 days Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/control.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Mon Jul 1 17:57:22 2013 (r252471) +++ head/sbin/hastctl/hastctl.c Mon Jul 1 18:41:07 2013 (r252472) @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch static int control_list(struct nv *nv) { + pid_t pid; unsigned int ii; const char *str; int error, ret; @@ -331,6 +332,9 @@ control_list(struct nv *nv) str = nv_get_string(nv, "status%u", ii); if (str != NULL) printf(" status: %s\n", str); + pid = nv_get_int32(nv, "workerpid%u", ii); + if (pid != 0) + printf(" workerpid: %d\n", pid); printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Mon Jul 1 17:57:22 2013 (r252471) +++ head/sbin/hastd/control.c Mon Jul 1 18:41:07 2013 (r252472) @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, compression_name(res->hr_compression), "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); + nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no); switch (res->hr_role) { case HAST_ROLE_PRIMARY: From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 18:45:27 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A386454D; Mon, 1 Jul 2013 18:45:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 37E401B2E; Mon, 1 Jul 2013 18:45:27 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 7725F1252D2; Tue, 2 Jul 2013 04:27:27 +1000 (EST) Date: Tue, 2 Jul 2013 04:27:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r252467 - head/sys/ufs/ffs In-Reply-To: <201307011449.r61EnOjP043954@svn.freebsd.org> Message-ID: <20130702031244.Q19968@besplex.bde.org> References: <201307011449.r61EnOjP043954@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=pHRvX3JBB04A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Nw6HGA-A-RMA:10 a=deVyh3sjnY2ZYR7BRNkA:9 a=CjuIK1q_8ugA:10 a=h29Nqe6eIYPUJYRs:21 a=vF3kbaQWrGgMy4Ok:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 18:45:27 -0000 On Mon, 1 Jul 2013, Pedro F. Giffuni wrote: > Log: > Change i_gen in UFS to an unsigned type. > > Further simplify the i_gen calculation for older disks. > Having a zero here is not really a problem and this is more > similar to what is done in newfs_random(). This seems to be a minor problem. > Modified: head/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:45:03 2013 (r252466) > +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:49:23 2013 (r252467) > @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > * already have one. This should only happen on old filesystems. > */ The comment is wronger than before. This should (really shouldn't, but does) happen happens on new file systems under the following conditions: - if newfs initialized i_gen (other than by bzeroing it) and arc4random() returned 0 in newfs. We used to fix up this case. In the previous version, we failed to fix up this case when arc4random() returns UINT32_MAX. Now we fail to fix it up when arc4random() returns 0. The combined chance of failure is 1 in 2**64. - if newfs didn't initialize i_gen. We used to fix up this case. Now we fail to fix it up, similarly to the above, except the chance of failure when newfs didn't do the initialization is 1 in 2**32. > if (ip->i_gen == 0) { > - ip->i_gen = arc4random() + 1; > + ip->i_gen = arc4random(); > if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { > ip->i_flag |= IN_MODIFIED; > DIP_SET(ip, i_gen, ip->i_gen); When we fail to fix up i_gen, we keep using i_gen = 0 until the vnode is recycled. When the vnode is reused again after recycling it, we execute the above code again. Normally it doesn't fail again. So the inode gets a new generation number even though the inode wasn't reallocated. The MNT_RDONLY case gives a similar bug (when ip->i_gen needs fixing). Now i_gen is normally "fixed" to nonzero, but only for the in-core inode since the disk inode is read-only. After recycling, the inode again usually gets a new inode number although it wasn't reallocated. ffs_valloc() is more careful to never allocate i_gen = 0 (unless it was changed recently), but is/was still buggy. The old version was: % if (ip->i_gen == 0 || ++ip->i_gen == 0) % ip->i_gen = arc4random() / 2 + 1; It prefers to just add 1, without ever producing 0. When it wraps around to 0, it could advance to 1, but it uses arc4random(), apparently just to share code with the initially-zero case. It was careful to actually change i_gen in the wrapping case. Then i_gen is initially 0xFFFFFFFF; arc4random() might give that value again, so the value returned by arc4random() was divided by 2 to make it quite different (at most 0x7FFFFFFF); then 1 was added to keep it away from 0 (this also depends on dividing by 2). This had nothing to do with the type being signed -- arc4random() / 2 + 1 can still overflow the signed type with a probability of 1 in 2**31, and incrementing i_gen overflows with a probability of up to 1/2. I think ffs_valloc() still has the (i_gen == 0 || ++i_gen == 0) logic, but it doesn't work without the division and addition. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 18:59:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 261FFB73; Mon, 1 Jul 2013 18:59:00 +0000 (UTC) (envelope-from tuexen@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 191B11C0F; Mon, 1 Jul 2013 18:59:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61Iwx1Z016966; Mon, 1 Jul 2013 18:58:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61Iwx7r016965; Mon, 1 Jul 2013 18:58:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307011858.r61Iwx7r016965@svn.freebsd.org> From: Michael Tuexen Date: Mon, 1 Jul 2013 18:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252473 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 18:59:00 -0000 Author: tuexen Date: Mon Jul 1 18:58:59 2013 New Revision: 252473 URL: http://svnweb.freebsd.org/changeset/base/252473 Log: Enable SCTP, since it is also enabled on GENERIC and it works fine on the Raspberry Pi. Discussed with: rpaulo Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Mon Jul 1 18:41:07 2013 (r252472) +++ head/sys/arm/conf/RPI-B Mon Jul 1 18:58:59 2013 (r252473) @@ -39,6 +39,7 @@ options HZ=100 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options SCTP #Stream Control Transmission Protocol options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 19:17:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3168F190 for ; Mon, 1 Jul 2013 19:17:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm7.bullet.mail.bf1.yahoo.com (nm7.bullet.mail.bf1.yahoo.com [98.139.212.166]) by mx1.freebsd.org (Postfix) with ESMTP id 4FDC41CDB for ; Mon, 1 Jul 2013 19:17:04 +0000 (UTC) Received: from [66.196.81.170] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jul 2013 19:17:02 -0000 Received: from [98.139.211.202] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jul 2013 19:17:02 -0000 Received: from [127.0.0.1] by smtp211.mail.bf1.yahoo.com with NNFMP; 01 Jul 2013 19:17:02 -0000 X-Yahoo-Newman-Id: 347875.32894.bm@smtp211.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Sm2P37cVM1mbEaks4DIiew2.vw2Y9ogmVj2t_Mcnlil5Y6F A7gk6mwFssDNOYGw7rzyroaOxFycuv7FClBVXH1eKzmUEB7HYdHb17euKm6j KALxa.zBxq5nXmrQhLKSGw0UZCXV5FN7yBc5fV7CUmodgx981gUR5b5wi.xb usOdOmg_LZTeEwAKFprKuLvUME5Ezhfc7hpnqfLwMhQA4HecTNVuGKrk.RMU kQA7dqVEk4j.PiZ1UE8nI13sM.8wN4wjsh6plVW197aY45FTpj9x6T730U6q IoiqYeW_Vzjt9aXSYfCv6BdHhXvuSGaec0RhwKzEK91Iq9Vgn3vD7NmiVFfv QVwtscDpp3_UsbxzwVtT8rqhtF3RE0FfK0okvjS9TU_9SeqJektTDleavomL OcpefgIpYiQpKc1NYY9PE8Zm2dPnBY0.xlCbKF6RFMYQHcuajplsH6a0PnRm GI5sP2KRHgvtxaLxlxwADQicwB3PX_hItPXzLWawhhY8571i7JL1kH7YZqPg fPQ1csrh_6Rqpi8gIBXSMFHUDtsDK2Yt5XFqNdBfodT3AXg8ykVvg8A-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp211.mail.bf1.yahoo.com with SMTP; 01 Jul 2013 12:17:02 -0700 PDT Message-ID: <51D1D5AC.3000805@FreeBSD.org> Date: Mon, 01 Jul 2013 14:17:00 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r252467 - head/sys/ufs/ffs References: <201307011449.r61EnOjP043954@svn.freebsd.org> <20130702031244.Q19968@besplex.bde.org> In-Reply-To: <20130702031244.Q19968@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 19:17:05 -0000 Hi Bruce; El 01/07/2013 1:27 p. m., Bruce Evans escribió: > On Mon, 1 Jul 2013, Pedro F. Giffuni wrote: > >> Log: >> Change i_gen in UFS to an unsigned type. >> >> Further simplify the i_gen calculation for older disks. >> Having a zero here is not really a problem and this is more >> similar to what is done in newfs_random(). > > This seems to be a minor problem. > >> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> ============================================================================== >> >> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:45:03 2013 >> (r252466) >> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:49:23 2013 >> (r252467) >> @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >> * already have one. This should only happen on old filesystems. >> */ > > The comment is wronger than before. This should (really shouldn't, but > does) happen happens on new file systems under the following conditions: > - if newfs initialized i_gen (other than by bzeroing it) and arc4random() > returned 0 in newfs. We used to fix up this case. In the previous > version, we failed to fix up this case when arc4random() returns > UINT32_MAX. Now we fail to fix it up when arc4random() returns 0. > The combined chance of failure is 1 in 2**64. > - if newfs didn't initialize i_gen. We used to fix up this case. Now > we fail to fix it up, similarly to the above, except the chance of > failure when newfs didn't do the initialization is 1 in 2**32. > >> if (ip->i_gen == 0) { >> - ip->i_gen = arc4random() + 1; >> + ip->i_gen = arc4random(); >> if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { >> ip->i_flag |= IN_MODIFIED; >> DIP_SET(ip, i_gen, ip->i_gen); > > When we fail to fix up i_gen, we keep using i_gen = 0 until the vnode is > recycled. When the vnode is reused again after recycling it, we execute > the above code again. Normally it doesn't fail again. So the inode gets > a new generation number even though the inode wasn't reallocated. > This can happen but the effect is, I think, negligible. > The MNT_RDONLY case gives a similar bug (when ip->i_gen needs fixing). > Now i_gen is normally "fixed" to nonzero, but only for the in-core inode > since the disk inode is read-only. After recycling, the inode again > usually gets a new inode number although it wasn't reallocated. > > ffs_valloc() is more careful to never allocate i_gen = 0 (unless it was > changed recently), but is/was still buggy. The old version was: > > % if (ip->i_gen == 0 || ++ip->i_gen == 0) > % ip->i_gen = arc4random() / 2 + 1; > > It prefers to just add 1, without ever producing 0. When it wraps > around to 0, it could advance to 1, but it uses arc4random(), apparently > just to share code with the initially-zero case. It was careful to > actually change i_gen in the wrapping case. Then i_gen is initially > 0xFFFFFFFF; arc4random() might give that value again, so the value > returned by arc4random() was divided by 2 to make it quite different > (at most 0x7FFFFFFF); then 1 was added to keep it away from 0 (this > also depends on dividing by 2). This had nothing to do with the type > being signed -- arc4random() / 2 + 1 can still overflow the signed > type with a probability of 1 in 2**31, and incrementing i_gen overflows > with a probability of up to 1/2. > This is similar to the code that I changed originally. What I will do is revert that line to it's original state: on older disks it is unlikely that we will need the extra bit the original change is attempting to rescue. > I think ffs_valloc() still has the (i_gen == 0 || ++i_gen == 0) logic, > but it doesn't work without the division and addition. > I hadnt notice the use in ffs_valloc(). Lucky for me ;). Pedro. From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 20:05:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 075C6DFD; Mon, 1 Jul 2013 20:05:44 +0000 (UTC) (envelope-from grehan@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 ED7A31ED2; Mon, 1 Jul 2013 20:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61K5h9E037809; Mon, 1 Jul 2013 20:05:43 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61K5hAs037808; Mon, 1 Jul 2013 20:05:43 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201307012005.r61K5hAs037808@svn.freebsd.org> From: Peter Grehan Date: Mon, 1 Jul 2013 20:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252475 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 20:05:44 -0000 Author: grehan Date: Mon Jul 1 20:05:43 2013 New Revision: 252475 URL: http://svnweb.freebsd.org/changeset/base/252475 Log: Ignore guest PAT settings by default in EPT mappings. From experimentation, other hypervisors also do this. Diagnosed by: tycho nightingale at pluribusnetworks com Reviewed by: neel Modified: head/sys/amd64/vmm/intel/ept.c Modified: head/sys/amd64/vmm/intel/ept.c ============================================================================== --- head/sys/amd64/vmm/intel/ept.c Mon Jul 1 19:58:13 2013 (r252474) +++ head/sys/amd64/vmm/intel/ept.c Mon Jul 1 20:05:43 2013 (r252475) @@ -77,6 +77,11 @@ MALLOC_DECLARE(M_VMX); static uint64_t page_sizes_mask; +/* + * Set this to 1 to have the EPT tables respect the guest PAT settings + */ +static int ept_pat_passthru; + int ept_init(void) { @@ -226,10 +231,13 @@ ept_create_mapping(uint64_t *ptp, vm_pad ptp[ptpindex] |= EPT_PG_EX; /* - * XXX should we enforce this memory type by setting the - * ignore PAT bit to 1. + * By default the PAT type is ignored - this appears to + * be how other hypervisors handle EPT. Allow this to be + * overridden. */ ptp[ptpindex] |= EPT_PG_MEMORY_TYPE(attr); + if (!ept_pat_passthru) + ptp[ptpindex] |= EPT_PG_IGNORE_PAT; if (nlevels > 0) ptp[ptpindex] |= EPT_PG_SUPERPAGE; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 20:45:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A1DDAF5; Mon, 1 Jul 2013 20:45:56 +0000 (UTC) (envelope-from delphij@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 4B7C410ED; Mon, 1 Jul 2013 20:45:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61KjuRS049572; Mon, 1 Jul 2013 20:45:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61KjuSl049571; Mon, 1 Jul 2013 20:45:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012045.r61KjuSl049571@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 20:45:56 +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: r252477 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 20:45:56 -0000 Author: delphij Date: Mon Jul 1 20:45:55 2013 New Revision: 252477 URL: http://svnweb.freebsd.org/changeset/base/252477 Log: MFC r252062: Call sshd_precmd instead of sshd_configtest when the operator requests reload or restart, which, in addition of testing the configuration, will also generate host keys when they are not present (previous behavior). Obtained from: FreeNAS Ok'ed by: bdrewery, des Modified: stable/9/etc/rc.d/sshd Directory Properties: stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/rc.d/sshd ============================================================================== --- stable/9/etc/rc.d/sshd Mon Jul 1 20:30:48 2013 (r252476) +++ stable/9/etc/rc.d/sshd Mon Jul 1 20:45:55 2013 (r252477) @@ -14,8 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" -reload_precmd="sshd_configtest" -restart_precmd="sshd_configtest" +reload_precmd="sshd_precmd" +restart_precmd="sshd_precmd" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 20:46:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DF3E3C53; Mon, 1 Jul 2013 20:46:35 +0000 (UTC) (envelope-from delphij@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 D13E510F9; Mon, 1 Jul 2013 20:46:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61KkZZn049737; Mon, 1 Jul 2013 20:46:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61KkZ5n049736; Mon, 1 Jul 2013 20:46:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012046.r61KkZ5n049736@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 20:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252478 - stable/8/etc/rc.d X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 20:46:36 -0000 Author: delphij Date: Mon Jul 1 20:46:35 2013 New Revision: 252478 URL: http://svnweb.freebsd.org/changeset/base/252478 Log: MFC r252062: Call sshd_precmd instead of sshd_configtest when the operator requests reload or restart, which, in addition of testing the configuration, will also generate host keys when they are not present (previous behavior). Obtained from: FreeNAS Ok'ed by: bdrewery, des Modified: stable/8/etc/rc.d/sshd Directory Properties: stable/8/etc/rc.d/ (props changed) Modified: stable/8/etc/rc.d/sshd ============================================================================== --- stable/8/etc/rc.d/sshd Mon Jul 1 20:45:55 2013 (r252477) +++ stable/8/etc/rc.d/sshd Mon Jul 1 20:46:35 2013 (r252478) @@ -14,8 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" -reload_precmd="sshd_configtest" -restart_precmd="sshd_configtest" +reload_precmd="sshd_precmd" +restart_precmd="sshd_precmd" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:16:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 53DB64FA; Mon, 1 Jul 2013 21:16:20 +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 45F101278; Mon, 1 Jul 2013 21:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LGJwZ058741; Mon, 1 Jul 2013 21:16:19 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LGJjN058740; Mon, 1 Jul 2013 21:16:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307012116.r61LGJjN058740@svn.freebsd.org> From: Rick Macklem Date: Mon, 1 Jul 2013 21:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252479 - head/sys/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:16:20 -0000 Author: rmacklem Date: Mon Jul 1 21:16:19 2013 New Revision: 252479 URL: http://svnweb.freebsd.org/changeset/base/252479 Log: A recent version of the oldnfs NFS client in head/current will crash when doing a large write, since m_get2() would return NULL. This patch fixes the problem, since nfsm_uiotombuf() will allocate additional mbufs, as required. Reported by: sbruno Tested by: sbruno Discussed with: glebius Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Jul 1 20:46:35 2013 (r252478) +++ head/sys/nfsclient/nfs_vnops.c Mon Jul 1 21:16:19 2013 (r252479) @@ -1379,8 +1379,8 @@ nfs_writerpc(struct vnode *vp, struct ui while (tsiz > 0) { nfsstats.rpccnt[NFSPROC_WRITE]++; len = (tsiz > wsize) ? wsize : tsiz; - mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len), - M_WAITOK, MT_DATA, 0); + mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED, M_WAITOK, + MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:18:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 937FA67A; Mon, 1 Jul 2013 21:18:39 +0000 (UTC) (envelope-from delphij@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 86126128E; Mon, 1 Jul 2013 21:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LIdh0059038; Mon, 1 Jul 2013 21:18:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LIdSX059037; Mon, 1 Jul 2013 21:18:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012118.r61LIdSX059037@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 21:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252480 - head/sbin/swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:18:39 -0000 Author: delphij Date: Mon Jul 1 21:18:39 2013 New Revision: 252480 URL: http://svnweb.freebsd.org/changeset/base/252480 Log: Correct a typo in comment. Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Mon Jul 1 21:16:19 2013 (r252479) +++ head/sbin/swapon/swapon.c Mon Jul 1 21:18:39 2013 (r252480) @@ -310,7 +310,7 @@ swap_on_off_gbde(const char *name, int d return (ret); } -/* Build geli(8) arguments from mntopts */ +/* Build geli(8) arguments from mntops */ static char * swap_on_geli_args(const char *mntops) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:20:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 137A78A8; Mon, 1 Jul 2013 21:20:19 +0000 (UTC) (envelope-from asomers@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 0521212A3; Mon, 1 Jul 2013 21:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LKIZK059336; Mon, 1 Jul 2013 21:20:18 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LKIxI059332; Mon, 1 Jul 2013 21:20:18 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201307012120.r61LKIxI059332@svn.freebsd.org> From: Alan Somers Date: Mon, 1 Jul 2013 21:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252481 - in head: etc sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:20:19 -0000 Author: asomers Date: Mon Jul 1 21:20:17 2013 New Revision: 252481 URL: http://svnweb.freebsd.org/changeset/base/252481 Log: Add syslog(3) support to devd(8). sbin/devd/devd.cc All output will now go to syslog(3) if devd is daemonized, or stderr if it's running in the foreground. sbin/devd/devd.8 Remove the "-D" flag. Filtering messages by priority now happens in the usual syslog way. For performance reasons, a few extra-verbose debugging statements are now conditional on the "-d" (do not daemonize) flag. etc/syslog.conf etc/newsyslog.conf Direct messages from devd(8) to /var/log/devd.log, but leave it disabled by default Reviewed by: eadler Approved by: gibbs (co-mentor) MFC after: never (removed a command-line option from devd) Modified: head/etc/newsyslog.conf head/etc/syslog.conf head/sbin/devd/devd.8 head/sbin/devd/devd.cc Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Mon Jul 1 21:18:39 2013 (r252480) +++ head/etc/newsyslog.conf Mon Jul 1 21:20:17 2013 (r252481) @@ -32,6 +32,7 @@ /var/log/monthly.log 640 12 * $M1D0 JN /var/log/pflog 600 3 100 * JB /var/run/pflogd.pid /var/log/ppp.log root:network 640 3 100 * JC +/var/log/devd.log 644 3 100 * JC /var/log/security 600 10 100 * JC /var/log/sendmail.st 640 10 * 168 BN /var/log/utx.log 644 3 * @01T05 B Modified: head/etc/syslog.conf ============================================================================== --- head/etc/syslog.conf Mon Jul 1 21:18:39 2013 (r252480) +++ head/etc/syslog.conf Mon Jul 1 21:20:17 2013 (r252481) @@ -13,6 +13,7 @@ mail.info /var/log/maillog lpr.info /var/log/lpd-errs ftp.info /var/log/xferlog cron.* /var/log/cron +!-devd *.=debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log @@ -27,6 +28,9 @@ cron.* /var/log/cron # news.crit /var/log/news/news.crit # news.err /var/log/news/news.err # news.notice /var/log/news/news.notice +# Uncomment this if you wish to see messages produced by devd +# !devd +# *.>=info /var/log/devd.log !ppp *.* /var/log/ppp.log !* Modified: head/sbin/devd/devd.8 ============================================================================== --- head/sbin/devd/devd.8 Mon Jul 1 21:18:39 2013 (r252480) +++ head/sbin/devd/devd.8 Mon Jul 1 21:20:17 2013 (r252481) @@ -33,7 +33,7 @@ .Nd "device state change daemon" .Sh SYNOPSIS .Nm -.Op Fl Ddn +.Op Fl dn .Op Fl f Ar file .Op Fl l Ar num .Sh DESCRIPTION @@ -44,10 +44,8 @@ kernel events happen. .Pp The following options are accepted. .Bl -tag -width ".Fl f Ar file" -.It Fl D -Enable debugging messages. .It Fl d -Run in the foreground instead of becoming a daemon. +Run in the foreground instead of becoming a daemon and log additional information for debugging. .It Fl f Ar file Use configuration file .Ar file Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Jul 1 21:18:39 2013 (r252480) +++ head/sbin/devd/devd.cc Mon Jul 1 21:20:17 2013 (r252481) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -114,13 +115,13 @@ static const char detach = '-'; static struct pidfh *pfh; -int Dflag; int dflag; int nflag; static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; +static void devdlog(int priority, const char* message, ...); static void event_loop(void); static void usage(void); @@ -243,8 +244,7 @@ bool action::do_action(config &c) { string s = c.expand_string(_cmd.c_str()); - if (Dflag) - fprintf(stderr, "Executing '%s'\n", s.c_str()); + devdlog(LOG_NOTICE, "Executing '%s'\n", s.c_str()); my_system(s.c_str()); return (true); } @@ -268,9 +268,16 @@ match::do_match(config &c) const string &value = c.get_variable(_var); bool retval; - if (Dflag) - fprintf(stderr, "Testing %s=%s against %s, invert=%d\n", + /* + * This function gets called WAY too often to justify calling syslog() + * each time, even at LOG_DEBUG. Because if syslogd isn't running, it + * can consume excessive amounts of systime inside of connect(). Only + * log when we're in -d mode. + */ + if (dflag) { + devdlog(LOG_DEBUG, "Testing %s=%s against %s, invert=%d\n", _var.c_str(), value.c_str(), _re.c_str(), _inv); + } retval = (regexec(&_regex, value.c_str(), 0, NULL, 0) == 0); if (_inv == 1) @@ -322,8 +329,7 @@ media::do_match(config &c) value = c.get_variable("device-name"); if (value.empty()) value = c.get_variable("subsystem"); - if (Dflag) - fprintf(stderr, "Testing media type of %s against 0x%x\n", + devdlog(LOG_DEBUG, "Testing media type of %s against 0x%x\n", value.c_str(), _type); retval = false; @@ -335,13 +341,11 @@ media::do_match(config &c) if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { - if (Dflag) - fprintf(stderr, "%s has media type 0x%x\n", + devdlog(LOG_DEBUG, "%s has media type 0x%x\n", value.c_str(), IFM_TYPE(ifmr.ifm_active)); retval = (IFM_TYPE(ifmr.ifm_active) == _type); } else if (_type == -1) { - if (Dflag) - fprintf(stderr, "%s has unknown media type\n", + devdlog(LOG_DEBUG, "%s has unknown media type\n", value.c_str()); retval = true; } @@ -374,8 +378,14 @@ var_list::is_set(const string &var) cons void var_list::set_variable(const string &var, const string &val) { - if (Dflag) - fprintf(stderr, "setting %s=%s\n", var.c_str(), val.c_str()); + /* + * This function gets called WAY too often to justify calling syslog() + * each time, even at LOG_DEBUG. Because if syslogd isn't running, it + * can consume excessive amounts of systime inside of connect(). Only + * log when we're in -d mode. + */ + if (dflag) + devdlog(LOG_DEBUG, "setting %s=%s\n", var.c_str(), val.c_str()); _vars[var] = val; } @@ -393,8 +403,7 @@ config::reset(void) void config::parse_one_file(const char *fn) { - if (Dflag) - fprintf(stderr, "Parsing %s\n", fn); + devdlog(LOG_DEBUG, "Parsing %s\n", fn); yyin = fopen(fn, "r"); if (yyin == NULL) err(1, "Cannot open config file %s", fn); @@ -411,8 +420,7 @@ config::parse_files_in_dir(const char *d struct dirent *dp; char path[PATH_MAX]; - if (Dflag) - fprintf(stderr, "Parsing files in %s\n", dirname); + devdlog(LOG_DEBUG, "Parsing files in %s\n", dirname); dirp = opendir(dirname); if (dirp == NULL) return; @@ -539,8 +547,7 @@ config::push_var_table() vl = new var_list(); _var_list_table.push_back(vl); - if (Dflag) - fprintf(stderr, "Pushing table\n"); + devdlog(LOG_DEBUG, "Pushing table\n"); } void @@ -548,8 +555,7 @@ config::pop_var_table() { delete _var_list_table.back(); _var_list_table.pop_back(); - if (Dflag) - fprintf(stderr, "Popping table\n"); + devdlog(LOG_DEBUG, "Popping table\n"); } void @@ -731,8 +737,7 @@ config::find_and_execute(char type) s = "detach"; break; } - if (Dflag) - fprintf(stderr, "Processing %s event\n", s); + devdlog(LOG_DEBUG, "Processing %s event\n", s); for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); @@ -750,8 +755,7 @@ process_event(char *buffer) char *sp; sp = buffer + 1; - if (Dflag) - fprintf(stderr, "Processing event '%s'\n", buffer); + devdlog(LOG_DEBUG, "Processing event '%s'\n", buffer); type = *buffer++; cfg.push_var_table(); // No match doesn't have a device, and the format is a little @@ -843,6 +847,8 @@ notify_clients(const char *data, int len --num_clients; close(*i); i = clients.erase(i); + devdlog(LOG_WARNING, "notify_clients: write() failed; " + "dropping unresponsive client\n"); } else ++i; } @@ -871,6 +877,8 @@ check_clients(void) --num_clients; close(*i); i = clients.erase(i); + devdlog(LOG_NOTICE, "check_clients: " + "dropping disconnected client\n"); } else ++i; } @@ -923,8 +931,7 @@ event_loop(void) rv = select(fd + 1, &fds, &fds, &fds, &tv); // No events -> we've processed all pending events if (rv == 0) { - if (Dflag) - fprintf(stderr, "Calling daemon\n"); + devdlog(LOG_DEBUG, "Calling daemon\n"); cfg.remove_pidfile(); cfg.open_pidfile(); daemon(0, 0); @@ -967,6 +974,11 @@ event_loop(void) if (FD_ISSET(fd, &fds)) { rv = read(fd, buffer, sizeof(buffer) - 1); if (rv > 0) { + if (rv == sizeof(buffer) - 1) { + devdlog(LOG_WARNING, "Warning: " + "available event data exceeded " + "buffer space\n"); + } notify_clients(buffer, rv); buffer[rv] = '\0'; while (buffer[--rv] == '\n') @@ -1078,10 +1090,27 @@ gensighand(int) romeo_must_die = 1; } +/* + * Local logging function. Prints to syslog if we're daemonized; syslog + * otherwise. + */ +static void +devdlog(int priority, const char* fmt, ...) +{ + va_list argp; + + va_start(argp, fmt); + if (dflag) + vfprintf(stderr, fmt, argp); + else + vsyslog(priority, fmt, argp); + va_end(argp); +} + static void usage() { - fprintf(stderr, "usage: %s [-Ddn] [-l connlimit] [-f file]\n", + fprintf(stderr, "usage: %s [-dn] [-l connlimit] [-f file]\n", getprogname()); exit(1); } @@ -1111,11 +1140,8 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "Ddf:l:n")) != -1) { + while ((ch = getopt(argc, argv, "df:l:n")) != -1) { switch (ch) { - case 'D': - Dflag++; - break; case 'd': dflag++; break; From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:33:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B04B1CBF; Mon, 1 Jul 2013 21:33:05 +0000 (UTC) (envelope-from asomers@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 A2FF21333; Mon, 1 Jul 2013 21:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LX5RW064309; Mon, 1 Jul 2013 21:33:05 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LX5Lo064308; Mon, 1 Jul 2013 21:33:05 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201307012133.r61LX5Lo064308@svn.freebsd.org> From: Alan Somers Date: Mon, 1 Jul 2013 21:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252482 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:33:05 -0000 Author: asomers Date: Mon Jul 1 21:33:05 2013 New Revision: 252482 URL: http://svnweb.freebsd.org/changeset/base/252482 Log: Add a SIGINFO handler to devd. It will send useful statistics to syslog or stderr as appropriate. Currently, the only statistic printed is the number of events received. Reviewed by: eadler Approved by: gibbs (co-mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Jul 1 21:20:17 2013 (r252481) +++ head/sbin/devd/devd.cc Mon Jul 1 21:33:05 2013 (r252482) @@ -117,6 +117,8 @@ static struct pidfh *pfh; int dflag; int nflag; +static unsigned total_events = 0; +static volatile sig_atomic_t got_siginfo = 0; static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -965,6 +967,11 @@ event_loop(void) tv.tv_usec = 0; } rv = select(max_fd, &fds, NULL, NULL, &tv); + if (got_siginfo) { + devdlog(LOG_INFO, "Events received so far=%ld\n", + total_events); + got_siginfo = 0; + } if (rv == -1) { if (errno == EINTR) continue; @@ -974,6 +981,7 @@ event_loop(void) if (FD_ISSET(fd, &fds)) { rv = read(fd, buffer, sizeof(buffer) - 1); if (rv > 0) { + total_events++; if (rv == sizeof(buffer) - 1) { devdlog(LOG_WARNING, "Warning: " "available event data exceeded " @@ -1091,6 +1099,16 @@ gensighand(int) } /* + * SIGINFO handler. Will print useful statistics to the syslog or stderr + * as appropriate + */ +static void +siginfohand(int) +{ + got_siginfo = 1; +} + +/* * Local logging function. Prints to syslog if we're daemonized; syslog * otherwise. */ @@ -1169,6 +1187,7 @@ main(int argc, char **argv) signal(SIGHUP, gensighand); signal(SIGINT, gensighand); signal(SIGTERM, gensighand); + signal(SIGINFO, siginfohand); event_loop(); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:41:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B255EEB; Mon, 1 Jul 2013 21:41:13 +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 4DD1E1392; Mon, 1 Jul 2013 21:41:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LfDD6066883; Mon, 1 Jul 2013 21:41:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LfDR8066882; Mon, 1 Jul 2013 21:41:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307012141.r61LfDR8066882@svn.freebsd.org> From: Rick Macklem Date: Mon, 1 Jul 2013 21:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252483 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:41:13 -0000 Author: rmacklem Date: Mon Jul 1 21:41:12 2013 New Revision: 252483 URL: http://svnweb.freebsd.org/changeset/base/252483 Log: Document the fact that an NFSv4 mount uses the host uuid to uniquely identify the client to the server. As such, NFSv4 mounts will break if host_enable="NO" is specified. This is a content change. Suggested by: lars@netapp.com MFC after: 3 days Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Mon Jul 1 21:33:05 2013 (r252482) +++ head/usr.sbin/nfsd/nfsv4.4 Mon Jul 1 21:41:12 2013 (r252483) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd July 1, 2013 .Dt NFSV4 4 .Os .Sh NAME @@ -233,6 +233,20 @@ plus set ``tcp'' and The .Xr nfsuserd 8 must be running, as above. +Also, since an +.Nm +mount uses the host uuid to identify the client uniquely to the server, +you cannot safely do an +.Nm +mount when +.sp +.Bd -literal -offset indent -compact +hostid_enable="NO" +.Ed +.sp +is set in +.Xr rc.conf 5 . +.sp If the .Nm server that is being mounted on supports delegations, you can start the From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:43:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9833CF8; Mon, 1 Jul 2013 21:43:40 +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 8B4C413A9; Mon, 1 Jul 2013 21:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LheAp067177; Mon, 1 Jul 2013 21:43:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61Lhemi067176; Mon, 1 Jul 2013 21:43:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307012143.r61Lhemi067176@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 1 Jul 2013 21:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252484 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:43:40 -0000 Author: pfg Date: Mon Jul 1 21:43:40 2013 New Revision: 252484 URL: http://svnweb.freebsd.org/changeset/base/252484 Log: Change i_gen in UFS to an unsigned type. Revert the simplification of the i_gen calculation. It is still a good idea to avoid zero values and for the case of old filesystems there is probably no advantage in using the complete 32 bits anyways. Discussed with: bde MFC after: 4 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 21:41:12 2013 (r252483) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 21:43:40 2013 (r252484) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random(); + ip->i_gen = arc4random()/2 + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:49:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87CFA39F; Mon, 1 Jul 2013 21:49:17 +0000 (UTC) (envelope-from asomers@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 785E31482; Mon, 1 Jul 2013 21:49:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LnHOW067922; Mon, 1 Jul 2013 21:49:17 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LnHMQ067921; Mon, 1 Jul 2013 21:49:17 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201307012149.r61LnHMQ067921@svn.freebsd.org> From: Alan Somers Date: Mon, 1 Jul 2013 21:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252485 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:49:17 -0000 Author: asomers Date: Mon Jul 1 21:49:17 2013 New Revision: 252485 URL: http://svnweb.freebsd.org/changeset/base/252485 Log: style(9) fixes, including the removal of page break characters. No functional changes. Approved by: gibbs (co-mentor) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Jul 1 21:43:40 2013 (r252484) +++ head/sbin/devd/devd.cc Mon Jul 1 21:49:17 2013 (r252485) @@ -170,7 +170,7 @@ bool event_proc::run(config &c) const { vector::const_iterator i; - + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); @@ -178,7 +178,7 @@ event_proc::run(config &c) const } action::action(const char *cmd) - : _cmd(cmd) + : _cmd(cmd) { // nothing } @@ -197,7 +197,7 @@ my_system(const char *command) sigset_t newsigblock, oldsigblock; if (!command) /* just checking... */ - return(1); + return (1); /* * Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save @@ -270,7 +270,7 @@ match::do_match(config &c) const string &value = c.get_variable(_var); bool retval; - /* + /* * This function gets called WAY too often to justify calling syslog() * each time, even at LOG_DEBUG. Because if syslogd isn't running, it * can consume excessive amounts of systime inside of connect(). Only @@ -285,7 +285,7 @@ match::do_match(config &c) if (_inv == 1) retval = (retval == 0) ? 1 : 0; - return retval; + return (retval); } #include @@ -354,7 +354,7 @@ media::do_match(config &c) close(s); } - return retval; + return (retval); } const string var_list::bogus = "_$_$_$_$_B_O_G_U_S_$_$_$_$_"; @@ -470,7 +470,7 @@ void config::open_pidfile() { pid_t otherpid; - + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); @@ -484,21 +484,21 @@ config::open_pidfile() void config::write_pidfile() { - + pidfile_write(pfh); } void config::close_pidfile() { - + pidfile_close(pfh); } void config::remove_pidfile() { - + pidfile_remove(pfh); } @@ -546,7 +546,7 @@ void config::push_var_table() { var_list *vl; - + vl = new var_list(); _var_list_table.push_back(vl); devdlog(LOG_DEBUG, "Pushing table\n"); @@ -581,7 +581,7 @@ config::get_variable(const string &var) bool config::is_id_char(char ch) const { - return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || + return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); } @@ -597,7 +597,7 @@ config::expand_one(const char *&src, str dst += *src++; return; } - + // $(foo) -> $(foo) // Not sure if I want to support this or not, so for now we just pass // it through. @@ -614,7 +614,7 @@ config::expand_one(const char *&src, str } return; } - + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { dst += '$'; @@ -665,7 +665,7 @@ bool config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; - + if (*buffer == '\0') return (false); walker = lhs = buffer; @@ -749,7 +749,7 @@ config::find_and_execute(char type) } - + static void process_event(char *buffer) { @@ -800,7 +800,7 @@ process_event(char *buffer) cfg.set_variable("bus", sp + 3); break; } - + cfg.find_and_execute(type); cfg.pop_var_table(); } @@ -1005,7 +1005,7 @@ event_loop(void) } close(fd); } - + /* * functions that the parser uses. */ @@ -1090,7 +1090,7 @@ set_variable(const char *var, const char free(const_cast(val)); } - + static void gensighand(int) From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:58:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2E0AB57C; Mon, 1 Jul 2013 21:58:09 +0000 (UTC) (envelope-from delphij@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 20EF515F4; Mon, 1 Jul 2013 21:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61Lw9X3070585; Mon, 1 Jul 2013 21:58:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61Lw8JB070584; Mon, 1 Jul 2013 21:58:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012158.r61Lw8JB070584@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 21:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252486 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:58:09 -0000 Author: delphij Date: Mon Jul 1 21:58:08 2013 New Revision: 252486 URL: http://svnweb.freebsd.org/changeset/base/252486 Log: Fix typo in vfs_mount(9) item. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Jul 1 21:49:17 2013 (r252485) +++ head/ObsoleteFiles.inc Mon Jul 1 21:58:08 2013 (r252486) @@ -41,7 +41,7 @@ # 20130623: dialog update from 1.1 to 1.2 OLD_LIBS+=usr/lib/libdialog.so.7 OLD_LIBS+=usr/lib32/libdialog.so.7 -# 20130616: vfs_mounted.9 removed +# 20130616: vfs_mount.9 removed OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20130614: remove CVS from base OLD_FILES+=usr/bin/cvs From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 21:59:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEB0C6D7; Mon, 1 Jul 2013 21:59:18 +0000 (UTC) (envelope-from delphij@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 B6AB415FC; Mon, 1 Jul 2013 21:59:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LxIIb070762; Mon, 1 Jul 2013 21:59:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LxHej070754; Mon, 1 Jul 2013 21:59:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012159.r61LxHej070754@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 21:59:17 +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: r252487 - in stable/9: . share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:59:19 -0000 Author: delphij Date: Mon Jul 1 21:59:17 2013 New Revision: 252487 URL: http://svnweb.freebsd.org/changeset/base/252487 Log: MFC r251825,252486: Remove vfs_mount(9), it have been died since 2004. Deleted: stable/9/share/man/man9/vfs_mount.9 Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/kernel_mount.9 stable/9/share/man/man9/vfsconf.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/ObsoleteFiles.inc Mon Jul 1 21:59:17 2013 (r252487) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20130701: vfs_mount.9 removed +OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20130624: vinum.4 removed OLD_FILES+=usr/share/man/man4/vinum.4.gz # 20130415: Ports are no more available via cvsup Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/Makefile Mon Jul 1 21:59:17 2013 (r252487) @@ -280,7 +280,6 @@ MAN= accept_filter.9 \ vfs_getvfs.9 \ VFS_LOCK_GIANT.9 \ VFS_MOUNT.9 \ - vfs_mount.9 \ vfs_mountedfrom.9 \ VFS_QUOTACTL.9 \ VFS_ROOT.9 \ Modified: stable/9/share/man/man9/kernel_mount.9 ============================================================================== --- stable/9/share/man/man9/kernel_mount.9 Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/kernel_mount.9 Mon Jul 1 21:59:17 2013 (r252487) @@ -195,7 +195,6 @@ must come in pairs, e.g., .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_MOUNT 9 , -.Xr vfs_mount 9 .Sh HISTORY The .Fn kernel_mount Modified: stable/9/share/man/man9/vfsconf.9 ============================================================================== --- stable/9/share/man/man9/vfsconf.9 Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/vfsconf.9 Mon Jul 1 21:59:17 2013 (r252487) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd June 16, 2013 .Dt VFSCONF 9 .Os .Sh NAME @@ -58,7 +58,7 @@ struct vfsconf { .Ed .Pp When a new file system is mounted, -.Xr vfs_mount 9 +.Xr mount 2 does a lookup of the .Vt vfsconf structure by its name, and if it is not already registered, @@ -143,7 +143,7 @@ or .Fn vfs_unregister , whatever the case. .Sh SEE ALSO -.Xr vfs_mount 9 , +.Xr mount 2 , .Xr vfs_rootmountalloc 9 , .Xr VFS_SET 9 .Sh AUTHORS From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 22:02:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2916C90E; Mon, 1 Jul 2013 22:02:41 +0000 (UTC) (envelope-from delphij@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 01B201624; Mon, 1 Jul 2013 22:02:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M2eDl073102; Mon, 1 Jul 2013 22:02:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M2eux073098; Mon, 1 Jul 2013 22:02:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012202.r61M2eux073098@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252488 - in stable/8: . share/man/man9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 22:02:41 -0000 Author: delphij Date: Mon Jul 1 22:02:39 2013 New Revision: 252488 URL: http://svnweb.freebsd.org/changeset/base/252488 Log: MFC r251825,252486: Remove vfs_mount(9), it have been died since 2004. Deleted: stable/8/share/man/man9/vfs_mount.9 Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/kernel_mount.9 stable/8/share/man/man9/vfsconf.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/ObsoleteFiles.inc Mon Jul 1 22:02:39 2013 (r252488) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20130701: vfs_mount.9 removed +OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20110915: rename congestion control manpages OLD_FILES+=usr/share/man/man4/cc.4.gz OLD_FILES+=usr/share/man/man9/cc.9.gz Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/Makefile Mon Jul 1 22:02:39 2013 (r252488) @@ -277,7 +277,6 @@ MAN= accept_filter.9 \ vfs_getvfs.9 \ VFS_LOCK_GIANT.9 \ VFS_MOUNT.9 \ - vfs_mount.9 \ vfs_mountedfrom.9 \ VFS_QUOTACTL.9 \ VFS_ROOT.9 \ Modified: stable/8/share/man/man9/kernel_mount.9 ============================================================================== --- stable/8/share/man/man9/kernel_mount.9 Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/kernel_mount.9 Mon Jul 1 22:02:39 2013 (r252488) @@ -195,7 +195,6 @@ must come in pairs, e.g., .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_MOUNT 9 , -.Xr vfs_mount 9 .Sh HISTORY The .Fn kernel_mount Modified: stable/8/share/man/man9/vfsconf.9 ============================================================================== --- stable/8/share/man/man9/vfsconf.9 Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/vfsconf.9 Mon Jul 1 22:02:39 2013 (r252488) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd June 16, 2013 .Dt VFSCONF 9 .Os .Sh NAME @@ -58,7 +58,7 @@ struct vfsconf { .Ed .Pp When a new file system is mounted, -.Xr vfs_mount 9 +.Xr mount 2 does a lookup of the .Vt vfsconf structure by its name, and if it is not already registered, @@ -143,7 +143,7 @@ or .Fn vfs_unregister , whatever the case. .Sh SEE ALSO -.Xr vfs_mount 9 , +.Xr mount 2 , .Xr vfs_rootmountalloc 9 , .Xr VFS_SET 9 .Sh AUTHORS From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 22:05:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90A2DA7E; Mon, 1 Jul 2013 22:05:43 +0000 (UTC) (envelope-from delphij@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 8339F163B; Mon, 1 Jul 2013 22:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M5hIS073602; Mon, 1 Jul 2013 22:05:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M5hKU073601; Mon, 1 Jul 2013 22:05:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012205.r61M5hKU073601@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:05:43 +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: r252489 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 22:05:43 -0000 Author: delphij Date: Mon Jul 1 22:05:43 2013 New Revision: 252489 URL: http://svnweb.freebsd.org/changeset/base/252489 Log: MFC r251859: Return ENETDOWN instead of ENOENT when all lagg(4) links are inactive when upper layer tries to transmit packet. This gives better feedback and meaningful errors for applications. Reviewed by: thompsa Modified: stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Mon Jul 1 22:02:39 2013 (r252488) +++ stable/9/sys/net/if_lagg.c Mon Jul 1 22:05:43 2013 (r252489) @@ -1597,7 +1597,7 @@ lagg_rr_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1645,7 +1645,7 @@ lagg_fail_start(struct lagg_softc *sc, s /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1774,7 +1774,7 @@ lagg_lb_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 22:07:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 93332BED; Mon, 1 Jul 2013 22:07:01 +0000 (UTC) (envelope-from delphij@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 862E2164E; Mon, 1 Jul 2013 22:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M71fq073844; Mon, 1 Jul 2013 22:07:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M71om073843; Mon, 1 Jul 2013 22:07:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012207.r61M71om073843@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252490 - stable/8/sys/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 22:07:01 -0000 Author: delphij Date: Mon Jul 1 22:07:01 2013 New Revision: 252490 URL: http://svnweb.freebsd.org/changeset/base/252490 Log: MFC r251859: Return ENETDOWN instead of ENOENT when all lagg(4) links are inactive when upper layer tries to transmit packet. This gives better feedback and meaningful errors for applications. Reviewed by: thompsa Modified: stable/8/sys/net/if_lagg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Mon Jul 1 22:05:43 2013 (r252489) +++ stable/8/sys/net/if_lagg.c Mon Jul 1 22:07:01 2013 (r252490) @@ -1572,7 +1572,7 @@ lagg_rr_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1620,7 +1620,7 @@ lagg_fail_start(struct lagg_softc *sc, s /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1749,7 +1749,7 @@ lagg_lb_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 22:21:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39163ED8; Mon, 1 Jul 2013 22:21:43 +0000 (UTC) (envelope-from rmh@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 2C1D4169F; Mon, 1 Jul 2013 22:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61MLhHk079237; Mon, 1 Jul 2013 22:21:43 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61MLhaM079236; Mon, 1 Jul 2013 22:21:43 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201307012221.r61MLhaM079236@svn.freebsd.org> From: Robert Millan Date: Mon, 1 Jul 2013 22:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252491 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 22:21:43 -0000 Author: rmh Date: Mon Jul 1 22:21:42 2013 New Revision: 252491 URL: http://svnweb.freebsd.org/changeset/base/252491 Log: Wrap cxgbe declaration around MK_SOURCELESS_UCODE check Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jul 1 22:07:01 2013 (r252490) +++ head/sys/modules/Makefile Mon Jul 1 22:21:42 2013 (r252491) @@ -81,7 +81,7 @@ SUBDIR= \ ${_ctau} \ ctl \ ${_cxgb} \ - cxgbe \ + ${_cxgbe} \ ${_cyclic} \ dc \ dcons \ @@ -386,6 +386,10 @@ _cxgb= cxgb .endif .endif +.if ${MK_SOURCELESS_UCODE} != "no" +_cxgbe= cxgbe +.endif + .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) _crypto= crypto From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 22:38:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E51D8366; Mon, 1 Jul 2013 22:38:37 +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 D45FE1732; Mon, 1 Jul 2013 22:38:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61Mcbee082955; Mon, 1 Jul 2013 22:38:37 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61McbFM082949; Mon, 1 Jul 2013 22:38:37 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307012238.r61McbFM082949@svn.freebsd.org> From: Warren Block Date: Mon, 1 Jul 2013 22:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252492 - in head: sbin/geom/class/part sbin/reboot sys/boot/i386/gptboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 22:38:38 -0000 Author: wblock (doc committer) Date: Mon Jul 1 22:38:36 2013 New Revision: 252492 URL: http://svnweb.freebsd.org/changeset/base/252492 Log: Add a new gptboot(8) man page. Factor out the redundant information in gpart(8) and boot(8), adding references to gptboot(8) in both. Reviewed by: jhb, ae, pjd, Paul Schenkeveld , david_a_bright@dell.com (portions), gjb MFC after: 1 week Added: head/sys/boot/i386/gptboot/gptboot.8 (contents, props changed) Modified: head/sbin/geom/class/part/gpart.8 head/sbin/reboot/boot_i386.8 head/sys/boot/i386/gptboot/Makefile Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Jul 1 22:21:42 2013 (r252491) +++ head/sbin/geom/class/part/gpart.8 Mon Jul 1 22:38:36 2013 (r252492) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2013 +.Dd July 1, 2013 .Dt GPART 8 .Os .Sh NAME @@ -645,14 +645,12 @@ The scheme-specific attributes for GPT: When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition. -Multiple partitions might be marked with the +Multiple partitions can be marked with the .Cm bootme attribute. -In such scenario the -.Nm gptboot -will try all -.Cm bootme -partitions one by one, until the next boot stage is successfully entered. +See +.Xr gptboot 8 +for more details. .It Cm bootonce Setting this attribute automatically sets the .Cm bootme @@ -660,49 +658,14 @@ attribute. When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition only once. -Partitions with both -.Cm bootonce -and -.Cm bootme -attributes are tried before partitions with only the -.Cm bootme -attribute. -Before -.Cm bootonce -partition is tried, the -.Nm gptboot -removes the -.Cm bootme -attribute and tries to execute the next boot stage. -If it fails, the -.Cm bootonce -attribute that is now alone is replaced with the -.Cm bootfailed -attribute. -If the execution of the next boot stage succeeds, but the system is not fully -booted, the -.Nm gptboot -will look for -.Cm bootonce -attributes alone (without the -.Cm bootme -attribute) on the next system boot and will replace those with the -.Cm bootfailed -attribute. -If the system is fully booted, the -.Pa /etc/rc.d/gptboot -start-up script will look for partition with the -.Cm bootonce -attribute alone, will remove the attribute and log that the system was -successfully booted from this partition. -There should be at most one -.Cm bootonce -partition when system is successfully booted. -Multiple partitions might be marked with the +Multiple partitions can be marked with the .Cm bootonce and .Cm bootme attribute pairs. +See +.Xr gptboot 8 +for more details. .It Cm bootfailed This attribute should not be manually managed. It is managed by the @@ -710,14 +673,9 @@ It is managed by the stage 1 boot loader and the .Pa /etc/rc.d/gptboot start-up script. -This attribute is used to mark partitions that had the -.Cm bootonce -attribute set, but we failed to boot from them. -Once we successfully boot, the -.Pa /etc/rc.d/gptboot -script will log all the partitions we failed to boot from and will remove the -.Cm bootfailed -attributes. +See +.Xr gptboot 8 +for more details. .El .Pp The scheme-specific attributes for MBR: @@ -795,20 +753,17 @@ There are two variants of bootstrap code .Pa /boot/gptboot and .Pa /boot/gptzfsboot . +.Pp .Pa /boot/gptboot -is used to boot from UFS. -It searches through +is used to boot from UFS partitions. +.Cm gptboot +searches through .Cm freebsd-ufs -partitions in the GPT and boots from the first one with the +partitions in the GPT and selects one to boot based on the .Cm bootonce -attribute set. -If that attribute is not found, -.Pa /boot/gptboot -boots from the first -.Cm freebsd-ufs -partition with the +and .Cm bootme -attribute set. +attributes. If neither attribute is found, .Pa /boot/gptboot boots from the first @@ -817,6 +772,10 @@ partition. .Pa /boot/loader .Pq the third bootstrap stage is loaded from the first partition that matches these conditions. +See +.Xr gptboot 8 +for more information. +.Pp .Pa /boot/gptzfsboot is used to boot from ZFS. It searches through the GPT for @@ -1105,7 +1064,8 @@ and .Xr dd 1 , .Xr geom 4 , .Xr boot0cfg 8 , -.Xr geom 8 +.Xr geom 8 , +.Xr gptboot 8 .Sh HISTORY The .Nm Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Mon Jul 1 22:21:42 2013 (r252491) +++ head/sbin/reboot/boot_i386.8 Mon Jul 1 22:38:36 2013 (r252492) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2010 +.Dd July 1, 2013 .Dt BOOT 8 i386 .Os .Sh NAME @@ -351,6 +351,7 @@ requirement has not been adhered to. .Xr bsdlabel 8 , .Xr btxld 8 , .Xr config 8 , +.Xr gptboot 8 , .Xr halt 8 , .Xr loader 8 , .Xr nextboot 8 , Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Jul 1 22:21:42 2013 (r252491) +++ head/sys/boot/i386/gptboot/Makefile Mon Jul 1 22:38:36 2013 (r252492) @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common FILES= gptboot +MAN= gptboot.8 NM?= nm Added: head/sys/boot/i386/gptboot/gptboot.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/gptboot/gptboot.8 Mon Jul 1 22:38:36 2013 (r252492) @@ -0,0 +1,236 @@ +.\" Copyright (c) 2013 Warren Block +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 1, 2013 +.Dt GPTBOOT 8 +.Os +.Sh NAME +.Nm gptboot +.Nd GPT bootcode for UFS on BIOS-based computers +.Sh DESCRIPTION +.Nm +is used on BIOS-based computers to boot from a UFS partition on a +GPT-partitioned disk. +.Nm +is installed in a +.Cm freebsd-boot +partition with +.Xr gpart 8 . +.Sh IMPLEMENTATION NOTES +The GPT standard allows a variable number of partitions, but +.Nm +only boots from tables with 128 partitions or less. +.Sh PARTITION ATTRIBUTES +.Nm +checks and manages several attributes of GPT UFS partitions. +.Bl -tag -width ".Cm bootfailed" +.It Cm bootme +Attempt to boot from this partition. +If more than one partition has the +.Cm bootme +attribute set, +.Nm +will attempt to boot each one until successful. +.It Cm bootonce +Attempt to boot from this partition only one time. +Setting this attribute with +.Xr gpart 8 +automatically also sets the +.Cm bootme +attribute. +Multiple partitions may have the +.Cm bootonce +and +.Cm bootme +attributes set. +.It Cm bootfailed +The +.Cm bootfailed +attribute marks partitions that had the +.Cm bootonce +attribute set, but failed to boot. +This attribute is managed by the system. +See +.Sx "BOOTING" +and +.Sx "POST-BOOT ACTIONS" +below for details. +.El +.Sh USAGE +For normal usage, the user does not have to set or manage any of the +partition attributes. +.Nm +will boot from the first UFS partition found. +.Pp +The +.Cm bootonce +attribute can be used for testing an upgraded operating system on +an already-working computer. +The existing system partition is left untouched, and the new version +of the operating system to be tested is installed on another partition. +The +.Cm bootonce +attribute is set on that new test partition. +The next boot is attempted from the test partition. +Success or failure will be shown in the system log files. +After a successful boot of the test partition, a user script can check +the logs and change the +.Cm bootme +attributes so the test partition becomes the new system partition. +Because the +.Cm bootonce +attribute is cleared after an attempted boot, a failed boot will not +leave the system attempting to boot from a partition that will never +succeed. +Instead, the system will boot from the older, known-working operating +system that has not been modified. +If the +.Cm bootme +attribute is set on any partitions, booting will be attempted from them +first. +If no partitions with +.Cm bootme +attributes are found, booting will be attempted from the first UFS +partition found. +.Sh BOOTING +.Nm +first reads the partition table. +All +.Cm freebsd-ufs +partitions with only the +.Cm bootonce +attribute set, indicating a failed boot, are set to +.Cm bootfailed . +.Nm +then scans through all of the +.Cm freebsd-ufs +partitions. +Boot behavior depends on the combination of +.Cm bootme +and +.Cm bootonce +attributes set on those partitions. +.Bl -tag -width ".Cm bootonce + .Cm bootme" +.It Cm bootonce + Cm bootme +Highest priority: booting is attempted from each of the +.Cm freebsd-ufs +partitions with both of these attributes. +On each partition, the +.Cm bootme +attribute is removed and the boot attempted. +.It Cm bootme +Middle priority: booting is attempted from each of the +.Cm freebsd-ufs +partitions with the +.Cm bootme +attribute. +.It neither +If neither +.Cm bootonce +nor +.Cm bootme +attributes are found on any partitions, booting is attempted from the +first +.Cm freebsd-ufs +partition on the disk. +.El +.Sh POST-BOOT ACTIONS +The startup script +.Pa /etc/rc.d/gptboot +checks the attributes of +.Cm freebsd-ufs +partitions on all GPT disks. +Partitions with the +.Cm bootfailed +attribute generate a +.Dq boot from X failed +system log message. +Partitions with only the +.Cm bootonce +attribute, indicating a partition that successfully booted, generate a +.Dq boot from X succeeded +system log message. +The +.Cm bootfailed +attributes are cleared from all the partitions. +The +.Cm bootonce +attribute is cleared from the partition that successfully booted. +There is normally only one of these. +.Sh FILES +.Bl -tag -width /boot/loader -compact +.It Pa /boot/gptboot +.It Pa /boot.config +.El +.Sh EXAMPLES +.Nm +is typically installed in combination with a +.Dq protective MBR +.Po +see +.Xr gpart 8 +.Pc . +Install +.Nm +on the +.Pa ada0 +drive: +.Bd -literal -offset indent +gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 +.Ed +.Pp +.Nm +can also be installed without the PMBR: +.Bd -literal -offset indent +gpart bootcode -p /boot/gptboot -i 1 ada0 +.Ed +.Pp +Set the +.Cm bootme +attribute for partition 2: +.Bd -literal -offset indent +gpart set -a bootme -i 2 ada0 +.Ed +.Pp +Set the +.Cm bootonce +attribute for partition 2, automatically also setting the +.Cm bootme +attribute: +.Bd -literal -offset indent +gpart set -a bootonce -i 2 ada0 +.Ed +.Pp +.Sh SEE ALSO +.Xr boot.config 5 , +.Xr rc.conf 5 , +.Xr boot 8 , +.Xr gpart 8 +.Sh HISTORY +.Nm +appeared in FreeBSD 7.1. +.Sh AUTHORS +Warren Block From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 23:13:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 143CC9E2; Mon, 1 Jul 2013 23:13:00 +0000 (UTC) (envelope-from markj@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 063FD18AD; Mon, 1 Jul 2013 23:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61NCx4o094039; Mon, 1 Jul 2013 23:12:59 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61NCxk9094038; Mon, 1 Jul 2013 23:12:59 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307012312.r61NCxk9094038@svn.freebsd.org> From: Mark Johnston Date: Mon, 1 Jul 2013 23:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252493 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 23:13:00 -0000 Author: markj Date: Mon Jul 1 23:12:59 2013 New Revision: 252493 URL: http://svnweb.freebsd.org/changeset/base/252493 Log: Be sure to destory the fasttrap cleanup mutex when unloading the fasttrap module. This should be MFCed with r250953. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Jul 1 22:38:36 2013 (r252492) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Jul 1 23:12:59 2013 (r252493) @@ -2435,6 +2435,7 @@ fasttrap_unload(void) mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", 0); fasttrap_cleanup_proc = NULL; + mtx_destroy(&fasttrap_cleanup_mtx); #ifdef DEBUG mutex_enter(&fasttrap_count_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Jul 1 23:53:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 900431F5; Mon, 1 Jul 2013 23:53:23 +0000 (UTC) (envelope-from grehan@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 8157219F5; Mon, 1 Jul 2013 23:53:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61NrNdY005347; Mon, 1 Jul 2013 23:53:23 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61NrMb1005346; Mon, 1 Jul 2013 23:53:22 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201307012353.r61NrMb1005346@svn.freebsd.org> From: Peter Grehan Date: Mon, 1 Jul 2013 23:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252494 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 23:53:23 -0000 Author: grehan Date: Mon Jul 1 23:53:22 2013 New Revision: 252494 URL: http://svnweb.freebsd.org/changeset/base/252494 Log: Fix up option parsing to allow a colon in the config section. Clean up some other unnecessary code. Submitted by: Dinakar Medavaram dinnu sun at gmail Reviewed by: neel Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Jul 1 23:12:59 2013 (r252493) +++ head/usr.sbin/bhyve/pci_emul.c Mon Jul 1 23:53:22 2013 (r252494) @@ -140,20 +140,15 @@ pci_parse_slot(char *opt, int legacy) error = -1; str = cpy = strdup(opt); - config = NULL; - - if (strchr(str, ':') != NULL) { - slot = strsep(&str, ":"); - func = strsep(&str, ","); - } else { - slot = strsep(&str, ","); - func = NULL; - } - + slot = strsep(&str, ","); + func = NULL; + if (strchr(slot, ':') != NULL) { + func = cpy; + (void) strsep(&func, ":"); + } + emul = strsep(&str, ","); - if (str != NULL) { - config = strsep(&str, ","); - } + config = str; if (emul == NULL) { pci_parse_slot_usage(opt); From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 04:27:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E130745F; Tue, 2 Jul 2013 04:27:17 +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 D052A135C; Tue, 2 Jul 2013 04:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624RHs0086507; Tue, 2 Jul 2013 04:27:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624RGHP086501; Tue, 2 Jul 2013 04:27:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307020427.r624RGHP086501@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 2 Jul 2013 04:27:16 +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: r252495 - in stable/9: share/man/man4 sys/dev/cxgb sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/dev/cxgbe/tom sys/modules/cxgbe sys/modules/cxgbe/firmware sys/modules/c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 04:27:18 -0000 Author: np Date: Tue Jul 2 04:27:16 2013 New Revision: 252495 URL: http://svnweb.freebsd.org/changeset/base/252495 Log: MFC all cxgbe(4) changes missing from stable/9: r248925, r249368, r249370, r249376, r249382, r249383, r249385, r249391, r249392, r249393, r249627, r249629, r250090, r250092, r250093, r250117, r250218, r250221, r250614, r251213, r251317, r251358, r251434, r251518, r251638, r252312, r252469, r252470, r250697(kib). r248925: Support for Chelsio's 40G Terminator 5 (aka T5) ASIC. ... r249368: Set and display the IP fragment bit correctly when dealing with the filter mode. r249370: cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or t5nex attach to their devices. r249376: - Explain clearly why a different firmware is being installed (if/when it is being installed). Improve other error messages while here. - Select special FPGA specific configuration profile when appropriate. r249382: There is no need for elaborate queries and error checking when trying to set FW4MSG_ENCAP. r249383: Get rid of a couple of stray \n's. r249385: cxgbe/tom: Slight simplification of code that calculates options2. r249391: Auto-reduce the holdoff timers that are greater than the maximum value allowed by the hardware. r249392: Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/). r249393: Add pciids of the T5 based cards. The ones that I haven't tested with cxgbe(4) are disabled for now. This will change. r249627: cxgbe/tom: Update the CLIP table on the chip when there are changes to the list of IPv6 addresses on the system. The table is used for TOE+IPv6 only. r249629: cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa). r250090: cxgbe(4): Some updates to shared code. r250092: - Provide accurate ifmedia information so that 40G ports/transceivers are displayed properly in ifconfig, etc. - Use the same number of tx and rx queues for a 40G port as for a 10G port. r250093: Attach to the T580 (2 x 40G) card. r250117: Fix DDP breakage introduced in r248925. Bitwise OR has higher precedence than ternary conditional. r250218: cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special. All the M_PROTOn flags are clobbered when an mbuf is appended to the socket buffer. r250221: cxgbe: Switch to a better way to install firmware. r250614: Deal correctly with 40G ports that don't have any transceiver plugged in. Do not claim that they have unknown tranceivers. r251213: cxgbe(4): Some more debug sysctls. These work on both T4 and T5 based cards. r251317: cxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being loaded via loader.conf. r251358: cxgbe(4): Provide accurate hit count for filters on T5 cards. The location within the TCB and the size have both changed. r251434: cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0. r251518: cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator. This fixes a panic when allocating a mixture of IPv6 and IPv4 stids. r251638: cxgbe/tom: Allow caller to select the queue (control or data) used to send the CPL_SET_TCB_FIELD request in t4_set_tcb_field(). r252312: Update T5 register ranges. This is so that regdump skips over registers with read side-effects. r252469: Add a sysctl to get the number of filters available. sysctl dev.t4nex..nfilters sysctl dev.t5nex..nfilters r252470: Count the number of hits for a filter by default. r250697: Add dependencies on the firmware, which allows the loading of the cxgb and cxgbe modules. Added: stable/9/sys/modules/cxgbe/t4_firmware/ - copied from r248925, head/sys/modules/cxgbe/t4_firmware/ stable/9/tools/tools/cxgbetool/reg_defs_t5.c - copied unchanged from r248925, head/tools/tools/cxgbetool/reg_defs_t5.c Deleted: stable/9/sys/modules/cxgbe/firmware/ Modified: stable/9/share/man/man4/cxgbe.4 stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/common/t4_msg.h stable/9/sys/dev/cxgbe/common/t4_regs.h stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/osdep.h stable/9/sys/dev/cxgbe/t4_ioctl.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/dev/cxgbe/tom/t4_connect.c stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_ddp.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/cxgbe/tom/t4_tom.c stable/9/sys/dev/cxgbe/tom/t4_tom.h stable/9/sys/modules/cxgbe/Makefile stable/9/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/tools/tools/cxgbetool/ (props changed) Modified: stable/9/share/man/man4/cxgbe.4 ============================================================================== --- stable/9/share/man/man4/cxgbe.4 Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/share/man/man4/cxgbe.4 Tue Jul 2 04:27:16 2013 (r252495) @@ -46,9 +46,10 @@ kernel configuration file: .Ed .Pp To load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent +t4fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgb/cxgb_main.c Tue Jul 2 04:27:16 2013 (r252495) @@ -149,6 +149,7 @@ static devclass_t cxgb_controller_devcla DRIVER_MODULE(cxgbc, pci, cxgb_controller_driver, cxgb_controller_devclass, cxgbc_mod_event, 0); MODULE_VERSION(cxgbc, 1); +MODULE_DEPEND(cxgbc, firmware, 1, 1, 1); /* * Attachment glue for the ports. Attachment is done directly to the Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/adapter.h Tue Jul 2 04:27:16 2013 (r252495) @@ -50,9 +50,6 @@ #include "offload.h" #include "firmware/t4fw_interface.h" -#define T4_CFGNAME "t4fw_cfg" -#define T4_FWNAME "t4fw" - MALLOC_DECLARE(M_CXGBE); #define CXGBE_UNIMPLEMENTED(s) \ panic("%s (%s, line %d) not implemented yet.", s, __FILE__, __LINE__) @@ -144,12 +141,6 @@ enum { TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; -#ifdef T4_PKT_TIMESTAMP -#define RX_COPY_THRESHOLD (MINCLSIZE - 8) -#else -#define RX_COPY_THRESHOLD MINCLSIZE -#endif - enum { /* adapter intr_type */ INTR_INTX = (1 << 0), @@ -327,6 +318,9 @@ enum { EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps */ }; +/* Listed in order of preference. Update t4_sysctls too if you change these */ +enum {DOORBELL_UDB, DOORBELL_WCWR, DOORBELL_UDBWC, DOORBELL_KDB}; + /* * Egress Queue: driver is producer, T4 is consumer. * @@ -344,6 +338,9 @@ struct sge_eq { struct tx_desc *desc; /* KVA of descriptor ring */ bus_addr_t ba; /* bus address of descriptor ring */ struct sge_qstat *spg; /* status page, for convenience */ + int doorbells; + volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ + u_int udb_qid; /* relative qid within the doorbell page */ uint16_t cap; /* max # of desc, for convenience */ uint16_t avail; /* available descriptors, for convenience */ uint16_t qsize; /* size (# of entries) of the queue */ @@ -496,6 +493,7 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; + int s_qpp; int nrxq; /* total # of Ethernet rx queues */ int ntxq; /* total # of Ethernet tx tx queues */ @@ -541,6 +539,9 @@ struct adapter { bus_space_handle_t bh; bus_space_tag_t bt; bus_size_t mmio_len; + int udbs_rid; + struct resource *udbs_res; + volatile uint8_t *udbs_base; unsigned int pf; unsigned int mbox; @@ -570,6 +571,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct tid_info tids; + int doorbells; int open_device_map; #ifdef TCP_OFFLOAD int offload_map; @@ -748,13 +750,22 @@ t4_os_set_hw_addr(struct adapter *sc, in bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN); } -static inline bool is_10G_port(const struct port_info *pi) +static inline bool +is_10G_port(const struct port_info *pi) { return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } -static inline int tx_resume_threshold(struct sge_eq *eq) +static inline bool +is_40G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); +} + +static inline int +tx_resume_threshold(struct sge_eq *eq) { return (eq->qsize / 4); @@ -778,7 +789,9 @@ void end_synchronized_op(struct adapter /* t4_sge.c */ void t4_sge_modload(void); -int t4_sge_init(struct adapter *); +void t4_init_sge_cpl_handlers(struct adapter *); +void t4_tweak_chip_settings(struct adapter *); +int t4_read_chip_settings(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/common/common.h Tue Jul 2 04:27:16 2013 (r252495) @@ -42,15 +42,19 @@ enum { MACADDR_LEN = 12, /* MAC Address length */ }; -enum { MEM_EDC0, MEM_EDC1, MEM_MC }; +enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1 }; enum { MEMWIN0_APERTURE = 2048, MEMWIN0_BASE = 0x1b800, MEMWIN1_APERTURE = 32768, MEMWIN1_BASE = 0x28000, - MEMWIN2_APERTURE = 65536, - MEMWIN2_BASE = 0x30000, + + MEMWIN2_APERTURE_T4 = 65536, + MEMWIN2_BASE_T4 = 0x30000, + + MEMWIN2_APERTURE_T5 = 128 * 1024, + MEMWIN2_BASE_T5 = 0x60000, }; enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; @@ -63,15 +67,20 @@ enum { PAUSE_AUTONEG = 1 << 2 }; -#define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 8 -#define FW_VERSION_MICRO 4 -#define FW_VERSION_BUILD 0 - -#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \ - V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \ - V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \ - V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD)) +#define FW_VERSION_MAJOR_T4 1 +#define FW_VERSION_MINOR_T4 8 +#define FW_VERSION_MICRO_T4 4 +#define FW_VERSION_BUILD_T4 0 + +#define FW_VERSION_MAJOR_T5 0 +#define FW_VERSION_MINOR_T5 5 +#define FW_VERSION_MICRO_T5 18 +#define FW_VERSION_BUILD_T5 0 + +struct memwin { + uint32_t base; + uint32_t aperture; +}; struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -267,18 +276,20 @@ struct adapter_params { unsigned int cim_la_size; - /* Used as int in sysctls, do not reduce size */ - unsigned int nports; /* # of ethernet ports */ - unsigned int portvec; - unsigned int rev; /* chip revision */ - unsigned int offload; + uint8_t nports; /* # of ethernet ports */ + uint8_t portvec; + unsigned int chipid:4; /* chip ID. T4 = 4, T5 = 5, ... */ + unsigned int rev:4; /* chip revision */ + unsigned int fpga:1; /* this is an FPGA */ + unsigned int offload:1; /* hw is TOE capable, fw has divvied up card + resources for TOE operation. */ + unsigned int bypass:1; /* this is a bypass card */ unsigned int ofldq_wr_cred; }; -enum { /* chip revisions */ - T4_REV_A = 0, -}; +#define CHELSIO_T4 0x4 +#define CHELSIO_T5 0x5 struct trace_params { u32 data[TRACE_LEN / 4]; @@ -316,6 +327,31 @@ static inline int is_offload(const struc return adap->params.offload; } +static inline int chip_id(struct adapter *adap) +{ + return adap->params.chipid; +} + +static inline int chip_rev(struct adapter *adap) +{ + return adap->params.rev; +} + +static inline int is_t4(struct adapter *adap) +{ + return adap->params.chipid == CHELSIO_T4; +} + +static inline int is_t5(struct adapter *adap) +{ + return adap->params.chipid == CHELSIO_T5; +} + +static inline int is_fpga(struct adapter *adap) +{ + return adap->params.fpga; +} + static inline unsigned int core_ticks_per_usec(const struct adapter *adap) { return adap->params.vpd.cclk / 1000; @@ -388,7 +424,7 @@ int t4_read_flash(struct adapter *adapte int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); int t4_load_boot(struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size); -unsigned int t4_flash_cfg_addr(struct adapter *adapter); +int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); @@ -437,7 +473,8 @@ int t4_cim_read_la(struct adapter *adap, void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp, unsigned int *pif_req_wrptr, unsigned int *pif_rsp_wrptr); void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp); -int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *parity); +int t4_mc_read(struct adapter *adap, int idx, u32 addr, + __be32 *data, u64 *parity); int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *parity); int t4_mem_read(struct adapter *adap, int mtype, u32 addr, u32 size, __be32 *data); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Tue Jul 2 04:27:16 2013 (r252495) @@ -176,9 +176,7 @@ static void t4_report_fw_error(struct ad u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (!(pcie_fw & F_PCIE_FW_ERR)) - CH_ERR(adap, "Firmware error report called with no error\n"); - else + if (pcie_fw & F_PCIE_FW_ERR) CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); } @@ -312,6 +310,7 @@ int t4_wr_mbox_meat(struct adapter *adap /** * t4_mc_read - read from MC through backdoor accesses * @adap: the adapter + * @idx: which MC to access * @addr: address of first byte requested * @data: 64 bytes of data containing the requested address * @ecc: where to store the corresponding 64-bit ECC word @@ -320,22 +319,40 @@ int t4_wr_mbox_meat(struct adapter *adap * that covers the requested address @addr. If @parity is not %NULL it * is assigned the 64-bit ECC word for the read data. */ -int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *ecc) +int t4_mc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) { int i; + u32 mc_bist_cmd_reg, mc_bist_cmd_addr_reg, mc_bist_cmd_len_reg; + u32 mc_bist_status_rdata_reg, mc_bist_data_pattern_reg; + + if (is_t4(adap)) { + mc_bist_cmd_reg = A_MC_BIST_CMD; + mc_bist_cmd_addr_reg = A_MC_BIST_CMD_ADDR; + mc_bist_cmd_len_reg = A_MC_BIST_CMD_LEN; + mc_bist_status_rdata_reg = A_MC_BIST_STATUS_RDATA; + mc_bist_data_pattern_reg = A_MC_BIST_DATA_PATTERN; + } else { + mc_bist_cmd_reg = MC_REG(A_MC_P_BIST_CMD, idx); + mc_bist_cmd_addr_reg = MC_REG(A_MC_P_BIST_CMD_ADDR, idx); + mc_bist_cmd_len_reg = MC_REG(A_MC_P_BIST_CMD_LEN, idx); + mc_bist_status_rdata_reg = MC_REG(A_MC_P_BIST_STATUS_RDATA, + idx); + mc_bist_data_pattern_reg = MC_REG(A_MC_P_BIST_DATA_PATTERN, + idx); + } - if (t4_read_reg(adap, A_MC_BIST_CMD) & F_START_BIST) + if (t4_read_reg(adap, mc_bist_cmd_reg) & F_START_BIST) return -EBUSY; - t4_write_reg(adap, A_MC_BIST_CMD_ADDR, addr & ~0x3fU); - t4_write_reg(adap, A_MC_BIST_CMD_LEN, 64); - t4_write_reg(adap, A_MC_BIST_DATA_PATTERN, 0xc); - t4_write_reg(adap, A_MC_BIST_CMD, V_BIST_OPCODE(1) | F_START_BIST | - V_BIST_CMD_GAP(1)); - i = t4_wait_op_done(adap, A_MC_BIST_CMD, F_START_BIST, 0, 10, 1); + t4_write_reg(adap, mc_bist_cmd_addr_reg, addr & ~0x3fU); + t4_write_reg(adap, mc_bist_cmd_len_reg, 64); + t4_write_reg(adap, mc_bist_data_pattern_reg, 0xc); + t4_write_reg(adap, mc_bist_cmd_reg, V_BIST_OPCODE(1) | + F_START_BIST | V_BIST_CMD_GAP(1)); + i = t4_wait_op_done(adap, mc_bist_cmd_reg, F_START_BIST, 0, 10, 1); if (i) return i; -#define MC_DATA(i) MC_BIST_STATUS_REG(A_MC_BIST_STATUS_RDATA, i) +#define MC_DATA(i) MC_BIST_STATUS_REG(mc_bist_status_rdata_reg, i) for (i = 15; i >= 0; i--) *data++ = ntohl(t4_read_reg(adap, MC_DATA(i))); @@ -360,20 +377,47 @@ int t4_mc_read(struct adapter *adap, u32 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) { int i; + u32 edc_bist_cmd_reg, edc_bist_cmd_addr_reg, edc_bist_cmd_len_reg; + u32 edc_bist_cmd_data_pattern, edc_bist_status_rdata_reg; - idx *= EDC_STRIDE; - if (t4_read_reg(adap, A_EDC_BIST_CMD + idx) & F_START_BIST) + if (is_t4(adap)) { + edc_bist_cmd_reg = EDC_REG(A_EDC_BIST_CMD, idx); + edc_bist_cmd_addr_reg = EDC_REG(A_EDC_BIST_CMD_ADDR, idx); + edc_bist_cmd_len_reg = EDC_REG(A_EDC_BIST_CMD_LEN, idx); + edc_bist_cmd_data_pattern = EDC_REG(A_EDC_BIST_DATA_PATTERN, + idx); + edc_bist_status_rdata_reg = EDC_REG(A_EDC_BIST_STATUS_RDATA, + idx); + } else { +/* + * These macro are missing in t4_regs.h file. + * Added temporarily for testing. + */ +#define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) +#define EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx) + edc_bist_cmd_reg = EDC_REG_T5(A_EDC_H_BIST_CMD, idx); + edc_bist_cmd_addr_reg = EDC_REG_T5(A_EDC_H_BIST_CMD_ADDR, idx); + edc_bist_cmd_len_reg = EDC_REG_T5(A_EDC_H_BIST_CMD_LEN, idx); + edc_bist_cmd_data_pattern = EDC_REG_T5(A_EDC_H_BIST_DATA_PATTERN, + idx); + edc_bist_status_rdata_reg = EDC_REG_T5(A_EDC_H_BIST_STATUS_RDATA, + idx); +#undef EDC_REG_T5 +#undef EDC_STRIDE_T5 + } + + if (t4_read_reg(adap, edc_bist_cmd_reg) & F_START_BIST) return -EBUSY; - t4_write_reg(adap, A_EDC_BIST_CMD_ADDR + idx, addr & ~0x3fU); - t4_write_reg(adap, A_EDC_BIST_CMD_LEN + idx, 64); - t4_write_reg(adap, A_EDC_BIST_DATA_PATTERN + idx, 0xc); - t4_write_reg(adap, A_EDC_BIST_CMD + idx, + t4_write_reg(adap, edc_bist_cmd_addr_reg, addr & ~0x3fU); + t4_write_reg(adap, edc_bist_cmd_len_reg, 64); + t4_write_reg(adap, edc_bist_cmd_data_pattern, 0xc); + t4_write_reg(adap, edc_bist_cmd_reg, V_BIST_OPCODE(1) | V_BIST_CMD_GAP(1) | F_START_BIST); - i = t4_wait_op_done(adap, A_EDC_BIST_CMD + idx, F_START_BIST, 0, 10, 1); + i = t4_wait_op_done(adap, edc_bist_cmd_reg, F_START_BIST, 0, 10, 1); if (i) return i; -#define EDC_DATA(i) (EDC_BIST_STATUS_REG(A_EDC_BIST_STATUS_RDATA, i) + idx) +#define EDC_DATA(i) EDC_BIST_STATUS_REG(edc_bist_status_rdata_reg, i) for (i = 15; i >= 0; i--) *data++ = ntohl(t4_read_reg(adap, EDC_DATA(i))); @@ -425,8 +469,8 @@ int t4_mem_read(struct adapter *adap, in /* * Read the chip's memory block and bail if there's an error. */ - if (mtype == MEM_MC) - ret = t4_mc_read(adap, pos, data, NULL); + if ((mtype == MEM_MC) || (mtype == MEM_MC1)) + ret = t4_mc_read(adap, mtype - MEM_MC, pos, data, NULL); else ret = t4_edc_read(adap, mtype, pos, data, NULL); if (ret) @@ -464,8 +508,9 @@ struct t4_vpd_hdr { #define EEPROM_STAT_ADDR 0x7bfc #define VPD_BASE 0x400 #define VPD_BASE_OLD 0 -#define VPD_LEN 512 +#define VPD_LEN 1024 #define VPD_INFO_FLD_HDR_SIZE 3 +#define CHELSIO_VPD_UNIQUE_ID 0x82 /** * t4_seeprom_read - read a serial EEPROM location @@ -630,7 +675,7 @@ static int get_vpd_params(struct adapter * it at 0. */ ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); - addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD; + addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < sizeof(vpd); i += 4) { ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); @@ -668,8 +713,10 @@ static int get_vpd_params(struct adapter i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN)); strstrip(p->sn); + i = vpd[pn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->pn, vpd + pn, min(i, PN_LEN)); strstrip((char *)p->pn); + i = vpd[na - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); @@ -914,6 +961,7 @@ int t4_get_tp_version(struct adapter *ad int t4_check_fw_version(struct adapter *adapter) { int ret, major, minor, micro; + int exp_major, exp_minor, exp_micro; ret = t4_get_fw_version(adapter, &adapter->params.fw_vers); if (!ret) @@ -925,13 +973,30 @@ int t4_check_fw_version(struct adapter * minor = G_FW_HDR_FW_VER_MINOR(adapter->params.fw_vers); micro = G_FW_HDR_FW_VER_MICRO(adapter->params.fw_vers); - if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */ + switch (chip_id(adapter)) { + case CHELSIO_T4: + exp_major = FW_VERSION_MAJOR_T4; + exp_minor = FW_VERSION_MINOR_T4; + exp_micro = FW_VERSION_MICRO_T4; + break; + case CHELSIO_T5: + exp_major = FW_VERSION_MAJOR_T5; + exp_minor = FW_VERSION_MINOR_T5; + exp_micro = FW_VERSION_MICRO_T5; + break; + default: + CH_ERR(adapter, "Unsupported chip type, %x\n", + chip_id(adapter)); + return -EINVAL; + } + + if (major != exp_major) { /* major mismatch - fail */ CH_ERR(adapter, "card FW has major version %u, driver wants " - "%u\n", major, FW_VERSION_MAJOR); + "%u\n", major, exp_major); return -EINVAL; } - if (minor == FW_VERSION_MINOR && micro == FW_VERSION_MICRO) + if (minor == exp_minor && micro == exp_micro) return 0; /* perfect match */ /* Minor/micro version mismatch. Report it but often it's OK. */ @@ -970,14 +1035,19 @@ static int t4_flash_erase_sectors(struct * @adapter: the adapter * * Return the address within the flash where the Firmware Configuration - * File is stored. + * File is stored, or an error if the device FLASH is too small to contain + * a Firmware Configuration File. */ -unsigned int t4_flash_cfg_addr(struct adapter *adapter) +int t4_flash_cfg_addr(struct adapter *adapter) { - if (adapter->params.sf_size == 0x100000) - return FLASH_FPGA_CFG_START; - else - return FLASH_CFG_START; + /* + * If the device FLASH isn't large enough to hold a Firmware + * Configuration File, return an error. + */ + if (adapter->params.sf_size < FLASH_CFG_START + FLASH_CFG_MAX_SIZE) + return -ENOSPC; + + return FLASH_CFG_START; } /** @@ -990,12 +1060,16 @@ unsigned int t4_flash_cfg_addr(struct ad */ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) { - int ret, i, n; + int ret, i, n, cfg_addr; unsigned int addr; unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - addr = t4_flash_cfg_addr(adap); + cfg_addr = t4_flash_cfg_addr(adap); + if (cfg_addr < 0) + return cfg_addr; + + addr = cfg_addr; flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { @@ -1072,6 +1146,13 @@ int t4_load_fw(struct adapter *adap, con FLASH_FW_MAX_SIZE); return -EFBIG; } + if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || + (is_t5(adap) && hdr->chip != FW_HDR_CHIP_T5)) { + CH_ERR(adap, + "FW image (%d) is not suitable for this adapter (%d)\n", + hdr->chip, chip_id(adap)); + return -EINVAL; + } for (csum = 0, i = 0; i < size / sizeof(csum); i++) csum += ntohl(p[i]); @@ -1407,6 +1488,7 @@ out: void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres) { unsigned int i, v; + int cim_num_obq = is_t4(adap) ? CIM_NUM_OBQ : CIM_NUM_OBQ_T5; for (i = 0; i < CIM_NUM_IBQ; i++) { t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_IBQSELECT | @@ -1416,7 +1498,7 @@ void t4_read_cimq_cfg(struct adapter *ad *size++ = G_CIMQSIZE(v) * 256; /* value is in 256-byte units */ *thres++ = G_QUEFULLTHRSH(v) * 8; /* 8-byte unit */ } - for (i = 0; i < CIM_NUM_OBQ; i++) { + for (i = 0; i < cim_num_obq; i++) { t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_OBQSELECT | V_QUENUMSELECT(i)); v = t4_read_reg(adap, A_CIM_QUEUE_CONFIG_CTRL); @@ -1452,8 +1534,12 @@ int t4_read_cim_ibq(struct adapter *adap for (i = 0; i < n; i++, addr++) { t4_write_reg(adap, A_CIM_IBQ_DBG_CFG, V_IBQDBGADDR(addr) | F_IBQDBGEN); + /* + * It might take 3-10ms before the IBQ debug read access is + * allowed. Wait for 1 Sec with a delay of 1 usec. + */ err = t4_wait_op_done(adap, A_CIM_IBQ_DBG_CFG, F_IBQDBGBUSY, 0, - 2, 1); + 1000000, 1); if (err) return err; *data++ = t4_read_reg(adap, A_CIM_IBQ_DBG_DATA); @@ -1477,8 +1563,9 @@ int t4_read_cim_obq(struct adapter *adap { int i, err; unsigned int addr, v, nwords; + int cim_num_obq = is_t4(adap) ? CIM_NUM_OBQ : CIM_NUM_OBQ_T5; - if (qid > 5 || (n & 3)) + if (qid >= cim_num_obq || (n & 3)) return -EINVAL; t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_OBQSELECT | @@ -1762,7 +1849,8 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ + FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) /** * t4_link_start - apply link configuration to MAC/PHY @@ -1933,6 +2021,47 @@ static void pcie_intr_handler(struct ada { 0 } }; + static struct intr_info t5_pcie_intr_info[] = { + { F_MSTGRPPERR, "Master Response Read Queue parity error", + -1, 1 }, + { F_MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 }, + { F_MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 }, + { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, + { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, + { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, + { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, + { F_PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error", + -1, 1 }, + { F_PIOREQGRPPERR, "PCI PIO request Group FIFO parity error", + -1, 1 }, + { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, + { F_MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 }, + { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, + { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, + { F_DREQWRPERR, "PCI DMA channel write request parity error", + -1, 1 }, + { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, + { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, + { F_HREQWRPERR, "PCI HMA channel count parity error", -1, 1 }, + { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, + { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, + { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, + { F_FIDPERR, "PCI FID parity error", -1, 1 }, + { F_VFIDPERR, "PCI INTx clear parity error", -1, 1 }, + { F_MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 }, + { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, + { F_IPRXHDRGRPPERR, "PCI IP Rx header group parity error", + -1, 1 }, + { F_IPRXDATAGRPPERR, "PCI IP Rx data group parity error", + -1, 1 }, + { F_RPLPERR, "PCI IP replay buffer parity error", -1, 1 }, + { F_IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 }, + { F_TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 }, + { F_READRSPERR, "Outbound read error", -1, + 0 }, + { 0 } + }; + int fat; fat = t4_handle_intr_status(adapter, @@ -1941,7 +2070,9 @@ static void pcie_intr_handler(struct ada t4_handle_intr_status(adapter, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, pcie_port_intr_info) + - t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, pcie_intr_info); + t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, + is_t4(adapter) ? + pcie_intr_info : t5_pcie_intr_info); if (fat) t4_fatal_err(adapter); } @@ -2286,8 +2417,13 @@ static void mem_intr_handler(struct adap addr = EDC_REG(A_EDC_INT_CAUSE, idx); cnt_addr = EDC_REG(A_EDC_ECC_STATUS, idx); } else { - addr = A_MC_INT_CAUSE; - cnt_addr = A_MC_ECC_STATUS; + if (is_t4(adapter)) { + addr = A_MC_INT_CAUSE; + cnt_addr = A_MC_ECC_STATUS; + } else { + addr = A_MC_P_INT_CAUSE; + cnt_addr = A_MC_P_ECC_STATUS; + } } v = t4_read_reg(adapter, addr) & MEM_INT_MASK; @@ -2368,9 +2504,15 @@ static void ncsi_intr_handler(struct ada */ static void xgmac_intr_handler(struct adapter *adap, int port) { - u32 v = t4_read_reg(adap, PORT_REG(port, A_XGMAC_PORT_INT_CAUSE)); + u32 v, int_cause_reg; + + if (is_t4(adap)) + int_cause_reg = PORT_REG(port, A_XGMAC_PORT_INT_CAUSE); + else + int_cause_reg = T5_PORT_REG(port, A_MAC_PORT_INT_CAUSE); - v &= F_TXFIFO_PRTY_ERR | F_RXFIFO_PRTY_ERR; + v = t4_read_reg(adap, int_cause_reg); + v &= (F_TXFIFO_PRTY_ERR | F_RXFIFO_PRTY_ERR); if (!v) return; @@ -2378,7 +2520,7 @@ static void xgmac_intr_handler(struct ad CH_ALERT(adap, "XGMAC %d Tx FIFO parity error\n", port); if (v & F_RXFIFO_PRTY_ERR) CH_ALERT(adap, "XGMAC %d Rx FIFO parity error\n", port); - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_INT_CAUSE), v); + t4_write_reg(adap, int_cause_reg, v); t4_fatal_err(adap); } @@ -2388,12 +2530,19 @@ static void xgmac_intr_handler(struct ad static void pl_intr_handler(struct adapter *adap) { static struct intr_info pl_intr_info[] = { - { F_FATALPERR, "T4 fatal parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, { F_PERRVFID, "PL VFID_MAP parity error", -1, 1 }, { 0 } }; - if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, pl_intr_info)) + static struct intr_info t5_pl_intr_info[] = { + { F_PL_BUSPERR, "PL bus parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, + { 0 } + }; + + if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, + is_t4(adap) ? pl_intr_info : t5_pl_intr_info)) t4_fatal_err(adap); } @@ -2526,7 +2675,6 @@ void t4_intr_clear(struct adapter *adapt A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_NONFAT_ERR, A_PCIE_INT_CAUSE, - A_MC_INT_CAUSE, A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS, A_MA_INT_CAUSE, A_EDC_INT_CAUSE, EDC_REG(A_EDC_INT_CAUSE, 1), A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, @@ -2546,6 +2694,9 @@ void t4_intr_clear(struct adapter *adapt for (i = 0; i < ARRAY_SIZE(cause_reg); ++i) t4_write_reg(adapter, cause_reg[i], 0xffffffff); + t4_write_reg(adapter, is_t4(adapter) ? A_MC_INT_CAUSE : + A_MC_P_INT_CAUSE, 0xffffffff); + t4_write_reg(adapter, A_PL_INT_CAUSE, GLBL_INTR_MASK); (void) t4_read_reg(adapter, A_PL_INT_CAUSE); /* flush */ } @@ -3531,7 +3682,10 @@ int t4_set_trace_filter(struct adapter * V_TFMINPKTSIZE(tp->min_len)); t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | - V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert)); + is_t4(adap) ? + V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert) : + V_T5_TFPORT(tp->port) | F_T5_TFEN | + V_T5_TFINVERTMATCH(tp->invert)); return 0; } @@ -3555,13 +3709,18 @@ void t4_get_trace_filter(struct adapter ctla = t4_read_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst); ctlb = t4_read_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_B + ofst); - *enabled = !!(ctla & F_TFEN); + if (is_t4(adap)) { + *enabled = !!(ctla & F_TFEN); + tp->port = G_TFPORT(ctla); + } else { + *enabled = !!(ctla & F_T5_TFEN); + tp->port = G_T5_TFPORT(ctla); + } tp->snap_len = G_TFCAPTUREMAX(ctlb); tp->min_len = G_TFMINPKTSIZE(ctlb); tp->skip_ofst = G_TFOFFSET(ctla); tp->skip_len = G_TFLENGTH(ctla); tp->invert = !!(ctla & F_TFINVERTMATCH); - tp->port = G_TFPORT(ctla); ofst = (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH) * idx; data_reg = A_MPS_TRC_FILTER0_MATCH + ofst; @@ -3584,11 +3743,19 @@ void t4_get_trace_filter(struct adapter void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) { int i; + u32 data[2]; for (i = 0; i < PM_NSTATS; i++) { t4_write_reg(adap, A_PM_TX_STAT_CONFIG, i + 1); cnt[i] = t4_read_reg(adap, A_PM_TX_STAT_COUNT); - cycles[i] = t4_read_reg64(adap, A_PM_TX_STAT_LSB); + if (is_t4(adap)) + cycles[i] = t4_read_reg64(adap, A_PM_TX_STAT_LSB); + else { + t4_read_indirect(adap, A_PM_TX_DBG_CTRL, + A_PM_TX_DBG_DATA, data, 2, + A_PM_TX_DBG_STAT_MSB); + cycles[i] = (((u64)data[0] << 32) | data[1]); + } } } @@ -3603,11 +3770,19 @@ void t4_pmtx_get_stats(struct adapter *a void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) { int i; + u32 data[2]; for (i = 0; i < PM_NSTATS; i++) { t4_write_reg(adap, A_PM_RX_STAT_CONFIG, i + 1); cnt[i] = t4_read_reg(adap, A_PM_RX_STAT_COUNT); - cycles[i] = t4_read_reg64(adap, A_PM_RX_STAT_LSB); + if (is_t4(adap)) + cycles[i] = t4_read_reg64(adap, A_PM_RX_STAT_LSB); + else { + t4_read_indirect(adap, A_PM_RX_DBG_CTRL, + A_PM_RX_DBG_DATA, data, 2, + A_PM_RX_DBG_STAT_MSB); + cycles[i] = (((u64)data[0] << 32) | data[1]); + } } } @@ -3666,7 +3841,9 @@ void t4_get_port_stats(struct adapter *a u32 bgmap = get_mps_bg_map(adap, idx); #define GET_STAT(name) \ - t4_read_reg64(adap, PORT_REG(idx, A_MPS_PORT_STAT_##name##_L)) + t4_read_reg64(adap, \ + (is_t4(adap) ? PORT_REG(idx, A_MPS_PORT_STAT_##name##_L) : \ + T5_PORT_REG(idx, A_MPS_PORT_STAT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->tx_pause = GET_STAT(TX_PORT_PAUSE); @@ -3745,13 +3922,19 @@ void t4_clr_port_stats(struct adapter *a { unsigned int i; u32 bgmap = get_mps_bg_map(adap, idx); + u32 port_base_addr; + + if (is_t4(adap)) + port_base_addr = PORT_BASE(idx); + else + port_base_addr = T5_PORT_BASE(idx); for (i = A_MPS_PORT_STAT_TX_PORT_BYTES_L; - i <= A_MPS_PORT_STAT_TX_PORT_PPP7_H; i += 8) - t4_write_reg(adap, PORT_REG(idx, i), 0); + i <= A_MPS_PORT_STAT_TX_PORT_PPP7_H; i += 8) + t4_write_reg(adap, port_base_addr + i, 0); for (i = A_MPS_PORT_STAT_RX_PORT_BYTES_L; - i <= A_MPS_PORT_STAT_RX_PORT_LESS_64B_H; i += 8) - t4_write_reg(adap, PORT_REG(idx, i), 0); + i <= A_MPS_PORT_STAT_RX_PORT_LESS_64B_H; i += 8) + t4_write_reg(adap, port_base_addr + i, 0); for (i = 0; i < 4; i++) if (bgmap & (1 << i)) { t4_write_reg(adap, @@ -3774,7 +3957,10 @@ void t4_get_lb_stats(struct adapter *ada u32 bgmap = get_mps_bg_map(adap, idx); #define GET_STAT(name) \ - t4_read_reg64(adap, PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L)) + t4_read_reg64(adap, \ + (is_t4(adap) ? \ + PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L) : \ + T5_PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->octets = GET_STAT(BYTES); @@ -3791,8 +3977,7 @@ void t4_get_lb_stats(struct adapter *ada p->frames_512_1023 = GET_STAT(512B_1023B); p->frames_1024_1518 = GET_STAT(1024B_1518B); p->frames_1519_max = GET_STAT(1519B_MAX); - p->drop = t4_read_reg(adap, PORT_REG(idx, - A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES)); + p->drop = GET_STAT(DROP_FRAMES); p->ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; p->ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; @@ -3818,14 +4003,26 @@ void t4_get_lb_stats(struct adapter *ada void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr) { + u32 mag_id_reg_l, mag_id_reg_h, port_cfg_reg; + + if (is_t4(adap)) { + mag_id_reg_l = PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_LO); + mag_id_reg_h = PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_HI); + port_cfg_reg = PORT_REG(port, A_XGMAC_PORT_CFG2); + } else { + mag_id_reg_l = T5_PORT_REG(port, A_MAC_PORT_MAGIC_MACID_LO); + mag_id_reg_h = T5_PORT_REG(port, A_MAC_PORT_MAGIC_MACID_HI); + port_cfg_reg = T5_PORT_REG(port, A_MAC_PORT_CFG2); + } + if (addr) { - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_LO), + t4_write_reg(adap, mag_id_reg_l, (addr[2] << 24) | (addr[3] << 16) | (addr[4] << 8) | addr[5]); - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_HI), + t4_write_reg(adap, mag_id_reg_h, (addr[0] << 8) | addr[1]); } - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), F_MAGICEN, + t4_set_reg_field(adap, port_cfg_reg, F_MAGICEN, V_MAGICEN(addr != NULL)); } @@ -3848,16 +4045,23 @@ int t4_wol_pat_enable(struct adapter *ad u64 mask0, u64 mask1, unsigned int crc, bool enable) { int i; + u32 port_cfg_reg; + + if (is_t4(adap)) + port_cfg_reg = PORT_REG(port, A_XGMAC_PORT_CFG2); + else + port_cfg_reg = T5_PORT_REG(port, A_MAC_PORT_CFG2); if (!enable) { - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), - F_PATEN, 0); + t4_set_reg_field(adap, port_cfg_reg, F_PATEN, 0); return 0; } if (map > 0xff) return -EINVAL; -#define EPIO_REG(name) PORT_REG(port, A_XGMAC_PORT_EPIO_##name) +#define EPIO_REG(name) \ + (is_t4(adap) ? PORT_REG(port, A_XGMAC_PORT_EPIO_##name) : \ + T5_PORT_REG(port, A_MAC_PORT_EPIO_##name)) t4_write_reg(adap, EPIO_REG(DATA1), mask0 >> 32); t4_write_reg(adap, EPIO_REG(DATA2), mask1); @@ -3883,7 +4087,7 @@ int t4_wol_pat_enable(struct adapter *ad } #undef EPIO_REG - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), 0, F_PATEN); + t4_set_reg_field(adap, port_cfg_reg, 0, F_PATEN); return 0; } @@ -4487,8 +4691,8 @@ int t4_query_params(struct adapter *adap V_FW_PARAMS_CMD_VFN(vf)); c.retval_len16 = htonl(FW_LEN16(c)); - for (i = 0; i < nparams; i++, p += 2) - *p = htonl(*params++); + for (i = 0; i < nparams; i++, p += 2, params++) + *p = htonl(*params); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) @@ -4527,8 +4731,10 @@ int t4_set_params(struct adapter *adap, c.retval_len16 = htonl(FW_LEN16(c)); while (nparams--) { - *p++ = htonl(*params++); - *p++ = htonl(*val++); + *p++ = htonl(*params); + params++; + *p++ = htonl(*val); + val++; } return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); @@ -4763,9 +4969,12 @@ int t4_alloc_mac_filt(struct adapter *ad int offset, ret = 0; struct fw_vi_mac_cmd c; unsigned int nfilters = 0; + unsigned int max_naddr = is_t4(adap) ? + NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; unsigned int rem = naddr; - if (naddr > NUM_MPS_CLS_SRAM_L_INSTANCES) + if (naddr > max_naddr) return -EINVAL; for (offset = 0; offset < naddr ; /**/) { @@ -4806,10 +5015,10 @@ int t4_alloc_mac_filt(struct adapter *ad u16 index = G_FW_VI_MAC_CMD_IDX(ntohs(p->valid_to_idx)); if (idx) - idx[offset+i] = (index >= NUM_MPS_CLS_SRAM_L_INSTANCES + idx[offset+i] = (index >= max_naddr ? 0xffff : index); - if (index < NUM_MPS_CLS_SRAM_L_INSTANCES) + if (index < max_naddr) nfilters++; else if (hash) *hash |= (1ULL << hash_mac_addr(addr[offset+i])); @@ -4853,6 +5062,9 @@ int t4_change_mac(struct adapter *adap, int ret, mode; struct fw_vi_mac_cmd c; struct fw_vi_mac_exact *p = c.u.exact; + unsigned int max_mac_addr = is_t4(adap) ? + NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; if (idx < 0) /* new allocation */ idx = persist ? FW_VI_MAC_ADD_PERSIST_MAC : FW_VI_MAC_ADD_MAC; @@ -4867,10 +5079,10 @@ int t4_change_mac(struct adapter *adap, V_FW_VI_MAC_CMD_IDX(idx)); memcpy(p->macaddr, addr, sizeof(p->macaddr)); - ret = t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), &c); + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) { ret = G_FW_VI_MAC_CMD_IDX(ntohs(p->valid_to_idx)); - if (ret >= NUM_MPS_CLS_SRAM_L_INSTANCES) + if (ret >= max_mac_addr) ret = -ENOMEM; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 04:42:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 058D36D2; Tue, 2 Jul 2013 04:42:33 +0000 (UTC) (envelope-from kib@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 ECBD31453; Tue, 2 Jul 2013 04:42:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624gWRq091556; Tue, 2 Jul 2013 04:42:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624gWL9091555; Tue, 2 Jul 2013 04:42:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307020442.r624gWL9091555@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 2 Jul 2013 04:42: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: r252496 - stable/9/sys/dev/drm2/i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 04:42:33 -0000 Author: kib Date: Tue Jul 2 04:42:32 2013 New Revision: 252496 URL: http://svnweb.freebsd.org/changeset/base/252496 Log: MFC r251960: Since the gem pagefault handler relocks the vm object lock, other thread might fault on the same GTT offset meantime and instantiate the mapping. Recheck that the mgt device object still does not have a page at the current offset after relocking, and return a possibly installed page. Modified: stable/9/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_gem.c Tue Jul 2 04:27:16 2013 (r252495) +++ stable/9/sys/dev/drm2/i915/i915_gem.c Tue Jul 2 04:42:32 2013 (r252496) @@ -1371,6 +1371,23 @@ unlocked_vmobj: } else DRM_LOCK(dev); + /* + * Since the object lock was dropped, other thread might have + * faulted on the same GTT address and instantiated the + * mapping for the page. Recheck. + */ + VM_OBJECT_LOCK(vm_obj); + m = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + if (m != NULL) { + if ((m->flags & VPO_BUSY) != 0) { + DRM_UNLOCK(dev); + vm_page_sleep(m, "915pee"); + goto retry; + } + goto have_page; + } else + VM_OBJECT_UNLOCK(vm_obj); + /* Now bind it into the GTT if needed */ if (!obj->map_and_fenceable) { ret = i915_gem_object_unbind(obj); @@ -1424,8 +1441,9 @@ unlocked_vmobj: goto retry; } m->valid = VM_PAGE_BITS_ALL; - *mres = m; vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); +have_page: + *mres = m; vm_page_busy(m); CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 04:45:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47D538E1; Tue, 2 Jul 2013 04:45:52 +0000 (UTC) (envelope-from kib@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 380F9147E; Tue, 2 Jul 2013 04:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624jqcl092045; Tue, 2 Jul 2013 04:45:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624jpjG092043; Tue, 2 Jul 2013 04:45:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307020445.r624jpjG092043@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 2 Jul 2013 04:45: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: r252497 - in stable/9/sys/dev: drm2/i915 syscons X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 04:45:52 -0000 Author: kib Date: Tue Jul 2 04:45:51 2013 New Revision: 252497 URL: http://svnweb.freebsd.org/changeset/base/252497 Log: MFC r251961: Disable wait for the retrace if KMS is activated. Modified: stable/9/sys/dev/drm2/i915/intel_fb.c stable/9/sys/dev/syscons/scvgarndr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_fb.c Tue Jul 2 04:42:32 2013 (r252496) +++ stable/9/sys/dev/drm2/i915/intel_fb.c Tue Jul 2 04:45:51 2013 (r252497) @@ -207,6 +207,8 @@ static void intel_fbdev_destroy(struct d } } +extern int sc_txtmouse_no_retrace_wait; + int intel_fbdev_init(struct drm_device *dev) { struct intel_fbdev *ifbdev; @@ -229,6 +231,7 @@ int intel_fbdev_init(struct drm_device * drm_fb_helper_single_add_all_connectors(&ifbdev->helper); drm_fb_helper_initial_config(&ifbdev->helper, 32); + sc_txtmouse_no_retrace_wait = 1; return 0; } Modified: stable/9/sys/dev/syscons/scvgarndr.c ============================================================================== --- stable/9/sys/dev/syscons/scvgarndr.c Tue Jul 2 04:42:32 2013 (r252496) +++ stable/9/sys/dev/syscons/scvgarndr.c Tue Jul 2 04:45:51 2013 (r252497) @@ -395,6 +395,8 @@ vga_txtblink(scr_stat *scp, int at, int { } +int sc_txtmouse_no_retrace_wait; + #ifndef SC_NO_CUTPASTE static void @@ -445,7 +447,9 @@ draw_txtmouse(scr_stat *scp, int x, int #if 1 /* wait for vertical retrace to avoid jitter on some videocards */ crtc_addr = scp->sc->adp->va_crtc_addr; - while (!(inb(crtc_addr + 6) & 0x08)) /* idle */ ; + while (!sc_txtmouse_no_retrace_wait && + !(inb(crtc_addr + 6) & 0x08)) + /* idle */ ; #endif c = scp->sc->mouse_char; vidd_load_font(scp->sc->adp, 0, 32, 8, font_buf, c, 4); From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 05:08:29 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 503FDCE3; Tue, 2 Jul 2013 05:08:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id F21F41654; Tue, 2 Jul 2013 05:08:28 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id DF5553C0EAB; Tue, 2 Jul 2013 14:41:57 +1000 (EST) Date: Tue, 2 Jul 2013 14:41:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r252484 - head/sys/ufs/ffs In-Reply-To: <201307012143.r61Lhemi067176@svn.freebsd.org> Message-ID: <20130702130818.V865@besplex.bde.org> References: <201307012143.r61Lhemi067176@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=K9A2evXCcLcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Nw6HGA-A-RMA:10 a=j_m6SzapsullctZUoX8A:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 05:08:29 -0000 On Mon, 1 Jul 2013, Pedro F. Giffuni wrote: > Log: > Change i_gen in UFS to an unsigned type. > > Revert the simplification of the i_gen calculation. > It is still a good idea to avoid zero values and for the case > of old filesystems there is probably no advantage in using > the complete 32 bits anyways. Er, this doesn't revert it. > Modified: head/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 21:41:12 2013 (r252483) > +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 21:43:40 2013 (r252484) > @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > * already have one. This should only happen on old filesystems. > */ > if (ip->i_gen == 0) { > - ip->i_gen = arc4random(); > + ip->i_gen = arc4random()/2 + 1; Missing spaces around binary operator. The old version was formatted normally. > if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { > ip->i_flag |= IN_MODIFIED; > DIP_SET(ip, i_gen, ip->i_gen); Also, IIRC ext2fs still hasn't caught up with the change from random() to arc4random() in 2003. random() / 2 + 1 doesn't work as intended on 64-bit arches, since random() returns u_long, so when u_long is 64 bits, dividing it by 2 leaves 63 bits, which is too many for i_gen. Also, random(9) is internally broken on 64-bit arches. It shouldn't exist. It is not random() at all, but just rand() with the clamp to RAND_MAX removed. Its linear congruential generator is suboptimal for 64 bits, and other parts of its algorithm are just broken for 64 bits. It uses longs internally to try to fake unsigned 31 bits, but the faking is broken in different ways depending on the size of long. It is documented to return a 31-bit value, but on 32-bit arches it seems to be possible for it to return 0xfffffffff, and on 64-bit arches it does return full 64-bit values. random(9) was cloned from rand(3). The userland versions have been edited a bit, but still have most of the bugs: random(3) uses an internal copy of rand(3) named good_rand() for seeding. If USE_WEAK_SEEDING is defined, this uses a weaker linear congruential generator (LCG). This uses int32_t instead of long internally, and doesn't attempt to reduce the value to 31 bits. Otherwise, the same LCG as random(9) is used, with the same buggy code except for changing the longs to 32-bits. Using int32_t gives the same overflow bugs on all (supported) arches, and avoids returning invalid values half the time on 64-bit arches. There are 2 callers of good_rand(), and only 1 of them discards bits above the 31st. srand() also supports USE_WEAK_SEEDING. It uses u_long internally, so it is actually correct. The internal value has the number of bits in a u_long and is generated without overflow and without any bias in the reduction to 31 bits. Then returning this value as an int in by taking the value modulo ((u_long)RAND_MAX + 1) gives a correct reduction to 31 bits when RAND_MAX is 0x7fffffff (or 15 bits if RAND_MAX is 0x7fff, etc.). srand() in the !USE_WEAK_SEEDING case still uses the same buggy code as random(9), with type long, so the internal values overflow and the inernal reduction to 31 bits is buggy, with the bugs depending on the size of long and other things. But it is mostly saved by taking the value modulo ((u_long)RAND_MAX + 1). This reduces to a valid value and leaves only minor biases from the buggy earlier reduction. random(6) used to have bugs related to the buggy internal reduction, and the biases from these were noticed. It uses floating point, so the reduction was easier, but it was still done wrong, by dividing by LONG_MAX instead of RANDOM_MAX_PLUS1. Using LONG_MAX is like using 0x7fffffff in random(9), but obviously buggier since the range for both is documented to be [0,0x7fffffff]. Hard-coding 0x7fffffff in random(6) would have been equally buggy. I think 0x80000000 is correct in both, but in random(9) this assumes too much about type sizes and layouts. The correct method in integer code is to take an unsigned modulus with divisor 0x80000000. Let the compiler optimize this to masking with 0x7fffffff. This depends on the maximum value plus 1 being representable in an unsigned type. For rand(), this occurs because rand() returns int, and for random(3), this occurs because random(3) returns long. Another bug in random(9) is that it returns u_long, so its API is different from random(3), but since it is documented to return only 31 bits, it is not really different except in the buggy cases where it returns 32-64 bits. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 05:47:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0BF13517; Tue, 2 Jul 2013 05:47:44 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id CBC251765; Tue, 2 Jul 2013 05:47:43 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r625lgs5064602; Mon, 1 Jul 2013 22:47:42 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r625lgTf064601; Mon, 1 Jul 2013 22:47:42 -0700 (PDT) (envelope-from sgk) Date: Mon, 1 Jul 2013 22:47:42 -0700 From: Steve Kargl To: Jim Harris Subject: Re: svn commit: r252277 - head/sbin/nvmecontrol Message-ID: <20130702054742.GA64572@troutmask.apl.washington.edu> References: <201306262353.r5QNrs6N012404@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306262353.r5QNrs6N012404@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 05:47:44 -0000 On Wed, Jun 26, 2013 at 11:53:54PM +0000, Jim Harris wrote: > Author: jimharris > Date: Wed Jun 26 23:53:54 2013 > New Revision: 252277 > URL: http://svnweb.freebsd.org/changeset/base/252277 > ===> sbin/nvmecontrol (all) cc -O2 -pipe -march=core2 -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/sbin/nvmecontrol/firmware.c cc1: warnings being treated as errors /usr/src/sbin/nvmecontrol/firmware.c: In function 'read_image_file': /usr/src/sbin/nvmecontrol/firmware.c:86: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'off_t' /usr/src/sbin/nvmecontrol/firmware.c:99: warning: format '%zd' expects type 'signed size_t', but argument 5 has type 'off_t' *** Error code 1 Stop. make: stopped in /usr/src/sbin/nvmecontrol *** Error code 1 Stop. make: stopped in /usr/src/sbin *** Error code 1 Stop. make: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src *** Error code 1 From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 05:53:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6DE789B; Tue, 2 Jul 2013 05:53:41 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5211792; Tue, 2 Jul 2013 05:53:40 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id r625rY8Z022428; Tue, 2 Jul 2013 07:53:34 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id r625rYKp017918; Tue, 2 Jul 2013 07:53:34 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.7/8.14.7) id r625rYXC006155; Date: Tue, 2 Jul 2013 07:53:33 +0200 From: Andre Albsmeier To: "Kenneth D. Merry" Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130702055333.GA2729@bali> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306252143.r5PLhoM0064338@svn.freebsd.org> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "svn-src-stable-9@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 05:53:41 -0000 On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > Author: ken > Date: Tue Jun 25 21:43:49 2013 > New Revision: 252214 > URL: http://svnweb.freebsd.org/changeset/base/252214 Hi Ken, > Log: > MFC: 249658, 249701 > > Update chio(1) and ch(4) to support reporting element designators. > > This allows mapping a tape drive in a changer (as reported by > 'chio status') to a sa(4) driver instance by comparing the > serial numbers. > > The designators can be ASCII (which is printed out directly), binary > (which is printed in hex format) or UTF-8, which is printed in either > native UTF-8 format if the terminal can support it, or in %XX notation > for non-ASCII characters. Thanks to Hiroki Sato for the > explanation and example UTF-8 printing code. > > chio.h: Modify the changer_element_status structure to add new > fields and definitions from the SMC3r16 spec. > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > define a new CHIOGSTATUS ioctl. > > Clean up some tab/space issues. > > chio.c: For the 'status' subcommand, print the designator field > if it is supplied by a device. > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > ELEMENT STATUS command structure. > > Add a read_element_status_device_id structure > for the data fields in the new standard. Add new > unions, dt_or_obsolete and voltage_devid, to hold > and address data from either SCSI-2 or newer devices. > > scsi_ch.c: Implement support for fetching device IDs with READ > ELEMENT STATUS data. > > Add new arguments to scsi_read_element_status() to > allow the user to request the DVCID and CURDATA bits. This broke "chio status" when talking to my QUALSTAR TLS-8211 library: Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error scsi_cmd->flags (Byte 6) must be zero for this library so I had to use this workaround to make it work again until a better solution is available: --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 @@ -1245,8 +1245,8 @@ /* tag_action */ MSG_SIMPLE_Q_TAG, /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet], - /* dvcid */ 1, - /* curdata */ 1, + /* dvcid */ 0, + /* curdata */ 0, /* count */ 1, /* data_ptr */ data, /* dxfer_len */ 1024, @@ -1284,8 +1284,8 @@ /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet] + cesr->cesr_element_base, - /* dvcid */ 1, - /* curdata */ 1, + /* dvcid */ 0, + /* curdata */ 0, /* count */ cesr->cesr_element_count, /* data_ptr */ data, /* dxfer_len */ size, -Andre From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 06:49:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3898C5BE; Tue, 2 Jul 2013 06:49:06 +0000 (UTC) (envelope-from rpaulo@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 2A7AC19AA; Tue, 2 Jul 2013 06:49:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r626n6p1027313; Tue, 2 Jul 2013 06:49:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r626n6eV027312; Tue, 2 Jul 2013 06:49:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307020649.r626n6eV027312@svn.freebsd.org> From: Rui Paulo Date: Tue, 2 Jul 2013 06:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252498 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 06:49:06 -0000 Author: rpaulo Date: Tue Jul 2 06:49:05 2013 New Revision: 252498 URL: http://svnweb.freebsd.org/changeset/base/252498 Log: Add RealTek 8192SU product IDs. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jul 2 04:45:51 2013 (r252497) +++ head/sys/dev/usb/usbdevs Tue Jul 2 06:49:05 2013 (r252498) @@ -849,6 +849,7 @@ product ACCTON RT3070_2 0xa702 RT3070 product ACCTON RT2870_1 0xb522 RT2870 product ACCTON RT3070_3 0xc522 RT3070 product ACCTON RT3070_5 0xd522 RT3070 +product ACCTON RTL8192SU 0xc512 RTL8192SU product ACCTON ZD1211B 0xe501 ZD1211B /* Aceeca products */ @@ -1134,7 +1135,9 @@ product ASUS RT2870_4 0x1760 RT2870 product ASUS RT2870_5 0x1761 RT2870 product ASUS USBN13 0x1784 USB-N13 product ASUS RT3070_1 0x1790 RT3070 +product ASUS USBN10 0x1786 USB-N10 product ASUS RTL8192CU 0x17ab RTL8192CU +product ASUS RTL8192SU 0x1791 RTL8192SU product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA product ASUS GMSC 0x422f ASUS Generic Mass Storage @@ -1185,7 +1188,11 @@ product AZUREWAVE RT3070_3 0x3305 RT3070 product AZUREWAVE RTL8188CU 0x3357 RTL8188CU product AZUREWAVE RTL8188CE_1 0x3358 RTL8188CE product AZUREWAVE RTL8188CE_2 0x3359 RTL8188CE - +product AZUREWAVE RTL8192SU_1 0x3306 RTL8192SU +product AZUREWAVE RTL8192SU_2 0x3309 RTL8192SU +product AZUREWAVE RTL8192SU_3 0x3310 RTL8192SU +product AZUREWAVE RTL8192SU_4 0x3311 RTL8192SU +product AZUREWAVE RTL8192SU_5 0x3325 RTL8192SU /* Baltech products */ product BALTECH CARDREADER 0x9999 Card reader @@ -1242,6 +1249,9 @@ product BELKIN F5D7050E 0x705e F5D7050E product BELKIN RT2870_1 0x8053 RT2870 product BELKIN RT2870_2 0x805c RT2870 product BELKIN F5D8053V3 0x815c F5D8053 v3 +product BELKIN RTL8192SU_1 0x815f RTL8192SU +product BELKIN RTL8192SU_2 0x845a RTL8192SU +product BELKIN RTL8192SU_3 0x945a RTL8192SU product BELKIN F5D8055 0x825a F5D8055 product BELKIN F5D8055V2 0x825b F5D8055 v2 product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter @@ -1368,6 +1378,9 @@ product CONCEPTRONIC AR5523_1 0x7801 AR5 product CONCEPTRONIC AR5523_1_NF 0x7802 AR5523 (no firmware) product CONCEPTRONIC AR5523_2 0x7811 AR5523 product CONCEPTRONIC AR5523_2_NF 0x7812 AR5523 (no firmware) +product CONCEPTRONIC2 RTL8192SU_1 0x3300 RTL8192SU +product CONCEPTRONIC2 RTL8192SU_2 0x3301 RTL8192SU +product CONCEPTRONIC2 RTL8192SU_3 0x3302 RTL8192SU product CONCEPTRONIC2 C54RU 0x3c02 C54RU WLAN product CONCEPTRONIC2 C54RU2 0x3c22 C54RU product CONCEPTRONIC2 RT3070_1 0x3c08 RT3070 @@ -1404,6 +1417,7 @@ product COREGA RT2870_2 0x003c RT2870 product COREGA RT2870_3 0x003f RT2870 product COREGA RT3070 0x0041 RT3070 product COREGA CGWLUSB300GNM 0x0042 CG-WLUSB300GNM +product COREGA RTL8192SU 0x0047 RTL8192SU product COREGA RTL8192CU 0x0056 RTL8192CU product COREGA WLUSB_11_STICK 0x7613 WLAN USB Stick 11 @@ -1546,6 +1560,9 @@ product DLINK RTL8192CU_1 0x3307 RTL8192 product DLINK RTL8192CU_2 0x3309 RTL8192CU product DLINK RTL8192CU_3 0x330a RTL8192CU product DLINK DWA131B 0x330d DWA-131 rev B +product DLINK2 RTL8192SU_1 0x3300 RTL8192SU +product DLINK2 RTL8192SU_2 0x3302 RTL8192SU +product DLINK2 DWA131A1 0x3303 DWA-131 A1 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 @@ -1582,6 +1599,9 @@ product DYNASTREAM ANTDEVBOARD2 0x1006 A /* Edimax products */ product EDIMAX EW7318USG 0x7318 USB Wireless dongle +product EDIMAX RTL8192SU_1 0x7611 RTL8192SU +product EDIMAX RTL8192SU_2 0x7612 RTL8192SU +product EDIMAX RTL8192SU_3 0x7622 RTL8192SU product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 @@ -2075,6 +2095,8 @@ product GUILLEMOT HWGUSB254 0xe000 HWGUS product GUILLEMOT HWGUSB254LB 0xe010 HWGUSB2-54-LB product GUILLEMOT HWGUSB254V2AP 0xe020 HWGUSB2-54V2-AP product GUILLEMOT HWNU300 0xe030 HWNU-300 +product GUILLEMOT HWNUM300 0xe031 HWNUm-300 +product GUILLEMOT HWGUN54 0xe032 HWGUn-54 product GUILLEMOT HWNUP150 0xe033 HWNUP-150 /* Hagiwara products */ @@ -2101,6 +2123,8 @@ product HAWKING HWUN2 0x0009 HWUN2 product HAWKING RT3070 0x000b RT3070 product HAWKING RTL8192CU 0x0019 RTL8192CU product HAWKING UF100 0x400c 10/100 USB Ethernet +product HAWKING RTL8192SU_1 0x0015 RTL8192SU +product HAWKING RTL8192SU_2 0x0016 RTL8192SU /* HID Global GmbH products */ product HIDGLOBAL CM2020 0x0596 Omnikey Cardman 2020 @@ -3338,6 +3362,7 @@ product PLANEX2 GWUSVALUEEZ 0xed17 GW-US product PLANEX3 GWUS54GZ 0xab10 GW-US54GZ product PLANEX3 GU1000T 0xab11 GU-1000T product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini +product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U @@ -3555,6 +3580,10 @@ product REALTEK USB20CRW 0x0158 USB20CRW product REALTEK RTL8188CTV 0x018a RTL8188CTV product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8188CE_0 0x8170 RTL8188CE +product REALTEK RTL8171 0x8171 RTL8171 +product REALTEK RTL8172 0x8172 RTL8172 +product REALTEK RTL8173 0x8173 RTL8173 +product REALTEK RTL8174 0x8174 RTL8174 product REALTEK RTL8188CE_1 0x817e RTL8188CE product REALTEK RTL8188CU_0 0x8176 RTL8188CU product REALTEK RTL8188CU_1 0x817a RTL8188CU @@ -3569,7 +3598,10 @@ product REALTEK RTL8191CU 0x8177 RTL8191 product REALTEK RTL8192CU 0x8178 RTL8192CU product REALTEK RTL8192CE 0x817c RTL8192CE product REALTEK RTL8188RU_1 0x817d RTL8188RU +product REALTEK RTL8712 0x8712 RTL8712 +product REALTEK RTL8713 0x8712 RTL8713 product REALTEK RTL8188RU_2 0x317f RTL8188RU +product REALTEK RTL8192SU 0xc512 RTL8192SU /* RedOctane products */ product REDOCTANE DUMMY 0x0000 Dummy product @@ -3720,6 +3752,8 @@ product SENAO RT3072_2 0x9707 RT3072 product SENAO RT3072_3 0x9708 RT3072 product SENAO RT3072_4 0x9709 RT3072 product SENAO RT3072_5 0x9801 RT3072 +product SENAO RTL8192SU_1 0x9603 RTL8192SU +product SENAO RTL8192SU_2 0x9605 RTL8192SU /* ShanTou products */ product SHANTOU ST268 0x0268 ST268 @@ -3940,9 +3974,11 @@ product SITECOMEU WL608 0x003f WL-608 product SITECOMEU RT3071 0x0040 RT3071 product SITECOMEU RT3072_1 0x0041 RT3072 product SITECOMEU RT3072_2 0x0042 RT3072 +product SITECOMEU WL353 0x0045 WL-353 product SITECOMEU RT3072_3 0x0047 RT3072 product SITECOMEU RT3072_4 0x0048 RT3072 product SITECOMEU RT3072_5 0x004a RT3072 +product SITECOMEU WL349V1 0x004b WL-349 v1 product SITECOMEU RT3072_6 0x004d RT3072 product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU product SITECOMEU RTL8188CU_2 0x005c RTL8188CU @@ -4110,6 +4146,7 @@ product SURECOM RT2573 0x31f3 RT2573 /* Sweex products */ product SWEEX ZD1211 0x1809 ZD1211 product SWEEX2 LW153 0x0153 LW153 +product SWEEX2 LW154 0x0154 LW154 product SWEEX2 LW303 0x0302 LW303 product SWEEX2 LW313 0x0313 LW313 From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 06:59:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06B647D8; Tue, 2 Jul 2013 06:59:38 +0000 (UTC) (envelope-from rpaulo@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 D508B19E4; Tue, 2 Jul 2013 06:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r626xb7L030162; Tue, 2 Jul 2013 06:59:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r626xbxA030161; Tue, 2 Jul 2013 06:59:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307020659.r626xbxA030161@svn.freebsd.org> From: Rui Paulo Date: Tue, 2 Jul 2013 06:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252499 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 06:59:38 -0000 Author: rpaulo Date: Tue Jul 2 06:59:37 2013 New Revision: 252499 URL: http://svnweb.freebsd.org/changeset/base/252499 Log: Add register definitions for the Wii IPC system. Modified: head/sys/powerpc/wii/wii_ipcreg.h Modified: head/sys/powerpc/wii/wii_ipcreg.h ============================================================================== --- head/sys/powerpc/wii/wii_ipcreg.h Tue Jul 2 06:49:05 2013 (r252498) +++ head/sys/powerpc/wii/wii_ipcreg.h Tue Jul 2 06:59:37 2013 (r252499) @@ -34,4 +34,69 @@ #define WIIIPC_IOH_ADDR 0x133e0000 #define WIIIPC_IOH_LEN 0xc20000 +#define WIIIPC_TXBUF 0x00 +#define WIIIPC_CSR 0x04 +#define WIIIPC_CSR_TXSTART 0x01 +#define WIIIPC_CSR_TBEI 0x02 +#define WIIIPC_CSR_RBFI 0x04 +#define WIIIPC_CSR_RXREADY 0x08 +#define WIIIPC_CSR_RBFIMASK 0x10 +#define WIIIPC_CSR_TBEIMASK 0x20 +#define WIIIPC_RXBUF 0x08 +#define WIIIPC_ISR 0x30 +#define WIIIPC_ISR_MAGIC 0x40000000 + +enum wiiipc_cmd { + WIIIPC_CMD_OPEN = 1, + WIIIPC_CMD_CLOSE = 2, + WIIIPC_CMD_READ = 3, + WIIIPC_CMD_WRITE = 4, + WIIIPC_CMD_SEEK = 5, + WIIIPC_CMD_IOCTL = 6, + WIIIPC_CMD_IOCTLV = 7, + WIIIPC_CMD_ASYNCRESP = 8 +}; + +struct wiiipc_ipc_msg { + uint32_t ipc_cmd; + int32_t ipc_result; + int32_t ipc_fd; /* WIIIPC_CMD_ASYNCRESP - the original cmd */ + union { + struct { + intptr_t pathname; + uint32_t mode; + } _ipc_open; + struct { + intptr_t data; + uint32_t len; + } _ipc_read, _ipc_write; + struct { + int32_t offset; + int32_t whence; + } _ipc_seek; + struct { + uint32_t request; + intptr_t ibuf; + uint32_t ilen; + intptr_t obuf; + uint32_t olen; + } _ipc_ioctl; + struct { + uint32_t request; + uint32_t argin; + uint32_t argout; + intptr_t iovec; + } _ipc_ioctlv; + uint32_t _ipc_argv[5]; + } args; +} __attribute__((packed)); + +CTASSERT(sizeof(struct wiiipc_ipc_msg) == 32); + +#define ipc_open args._ipc_open +#define ipc_read args._ipc_read +#define ipc_write args._ipc_write +#define ipc_ioctl args._ipc_ioctl +#define ipc_ioctlv args._ipc_ioctlv + #endif /* _POWERPC_WII_WII_IPCREG_H */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 07:17:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 407B1B2E; Tue, 2 Jul 2013 07:17:57 +0000 (UTC) (envelope-from rpaulo@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 338511A77; Tue, 2 Jul 2013 07:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r627Hvo0036277; Tue, 2 Jul 2013 07:17:57 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r627HvF3036276; Tue, 2 Jul 2013 07:17:57 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307020717.r627HvF3036276@svn.freebsd.org> From: Rui Paulo Date: Tue, 2 Jul 2013 07:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252500 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 07:17:57 -0000 Author: rpaulo Date: Tue Jul 2 07:17:56 2013 New Revision: 252500 URL: http://svnweb.freebsd.org/changeset/base/252500 Log: Fix indentation. Submitted by: jmallet Modified: head/sys/powerpc/wii/wii_ipcreg.h Modified: head/sys/powerpc/wii/wii_ipcreg.h ============================================================================== --- head/sys/powerpc/wii/wii_ipcreg.h Tue Jul 2 06:59:37 2013 (r252499) +++ head/sys/powerpc/wii/wii_ipcreg.h Tue Jul 2 07:17:56 2013 (r252500) @@ -93,10 +93,10 @@ struct wiiipc_ipc_msg { CTASSERT(sizeof(struct wiiipc_ipc_msg) == 32); -#define ipc_open args._ipc_open +#define ipc_open args._ipc_open #define ipc_read args._ipc_read #define ipc_write args._ipc_write -#define ipc_ioctl args._ipc_ioctl -#define ipc_ioctlv args._ipc_ioctlv +#define ipc_ioctl args._ipc_ioctl +#define ipc_ioctlv args._ipc_ioctlv #endif /* _POWERPC_WII_WII_IPCREG_H */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 07:35:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FBFDD99; Tue, 2 Jul 2013 07:35:58 +0000 (UTC) (envelope-from hrs@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 1229E1AFE; Tue, 2 Jul 2013 07:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r627ZvIC041667; Tue, 2 Jul 2013 07:35:57 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r627Zvh6041665; Tue, 2 Jul 2013 07:35:57 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307020735.r627Zvh6041665@svn.freebsd.org> From: Hiroki Sato Date: Tue, 2 Jul 2013 07:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252501 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 07:35:58 -0000 Author: hrs Date: Tue Jul 2 07:35:57 2013 New Revision: 252501 URL: http://svnweb.freebsd.org/changeset/base/252501 Log: Add Planex MZK-UE150N. Submitted by: Yusuke Tanaka MFC after: 3 days Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Jul 2 07:17:56 2013 (r252500) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Jul 2 07:35:57 2013 (r252501) @@ -94,6 +94,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), + USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* Quirks for printer devices */ USB_QUIRK(HP, 895C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), USB_QUIRK(HP, 880C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jul 2 07:17:56 2013 (r252500) +++ head/sys/dev/usb/usbdevs Tue Jul 2 07:35:57 2013 (r252501) @@ -3351,6 +3351,7 @@ product PLANEX2 RTL8192CU 0xab2b RTL8192 product PLANEX2 GWUS54HP 0xab01 GW-US54HP product PLANEX2 GWUS300MINIS 0xab24 GW-US300MiniS product PLANEX2 RT3070 0xab25 RT3070 +product PLANEX2 MZKUE150N 0xab2f MZK-UE150N product PLANEX2 GWUS54MINI2 0xab50 GW-US54Mini2 product PLANEX2 GWUS54SG 0xc002 GW-US54SG product PLANEX2 GWUS54GZL 0xc007 GW-US54GZL From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 07:36:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F9F0ECF; Tue, 2 Jul 2013 07:36:05 +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 03BC91AFF; Tue, 2 Jul 2013 07:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r627a4jZ041733; Tue, 2 Jul 2013 07:36:04 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r627a4x6041732; Tue, 2 Jul 2013 07:36:04 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307020736.r627a4x6041732@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 2 Jul 2013 07:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252502 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 07:36:05 -0000 Author: mjg Date: Tue Jul 2 07:36:04 2013 New Revision: 252502 URL: http://svnweb.freebsd.org/changeset/base/252502 Log: Fix receiving fd over unix socket broken in r247740. If n fds were passed, it would receive the first one n times. Reported by: Shawn Webb , koobs, gleb Tested by: koobs, gleb Reviewed by: pjd Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Jul 2 07:35:57 2013 (r252501) +++ head/sys/kern/uipc_usrreq.c Tue Jul 2 07:36:04 2013 (r252502) @@ -1764,8 +1764,8 @@ unp_externalize(struct mbuf *control, st } for (i = 0; i < newfds; i++, fdp++) { fde = &fdesc->fd_ofiles[*fdp]; - fde->fde_file = fdep[0]->fde_file; - filecaps_move(&fdep[0]->fde_caps, + fde->fde_file = fdep[i]->fde_file; + filecaps_move(&fdep[i]->fde_caps, &fde->fde_caps); if ((flags & MSG_CMSG_CLOEXEC) != 0) fde->fde_flags |= UF_EXCLOSE; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 07:59:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C85B15D2; Tue, 2 Jul 2013 07:59:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5A91C08; Tue, 2 Jul 2013 07:59:35 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1B59A42256C; Tue, 2 Jul 2013 17:39:53 +1000 (EST) Date: Tue, 2 Jul 2013 17:39:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: RAND_MAX broken (was: Re: svn commit: r252484 - head/sys/ufs/ffs) In-Reply-To: <20130702130818.V865@besplex.bde.org> Message-ID: <20130702165642.X1571@besplex.bde.org> References: <201307012143.r61Lhemi067176@svn.freebsd.org> <20130702130818.V865@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=q8y3vL6zz0wA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=69vcZ3OAW6IA:10 a=y0Gr8lqk-sMI6N-6crQA:9 a=CjuIK1q_8ugA:10 a=DC9f5aCraMhFT89y:21 a=2b5V4k5jrWGD9E0b:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Pedro F. Giffuni" , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 07:59:36 -0000 On Tue, 2 Jul 2013, Bruce Evans wrote: > ... > Also, random(9) is internally broken on 64-bit arches. It shouldn't > exist. It is not random() at all, but just rand() with the clamp to > RAND_MAX removed. Its linear congruential generator is suboptimal > for 64 bits, and other parts of its algorithm are just broken for > 64 bits. It uses longs internally to try to fake unsigned 31 bits, > but the faking is broken in different ways depending on the size of > long. It is documented to return a 31-bit value, but on 32-bit > arches it seems to be possible for it to return 0xfffffffff, and on > 64-bit arches it does return full 64-bit values. > > random(9) was cloned from rand(3). The userland versions have been > edited a bit, but still have most of the bugs: > > random(3) uses an internal copy of rand(3) named good_rand() for > seeding. If USE_WEAK_SEEDING is defined, this uses a weaker linear > congruential generator (LCG). This uses int32_t instead of long > internally, and doesn't attempt to reduce the value to 31 bits. > Otherwise, the same LCG as random(9) is used, with the same buggy code > except for changing the longs to 32-bits. Using int32_t gives the > same overflow bugs on all (supported) arches, and avoids returning > invalid values half the time on 64-bit arches. There are 2 callers > of good_rand(), and only 1 of them discards bits above the 31st. > > srand() also supports USE_WEAK_SEEDING. It uses u_long internally, > so it is actually correct. The internal value has the number of > bits in a u_long and is generated without overflow and without any > bias in the reduction to 31 bits. Then returning this value as > an int in by taking the value modulo ((u_long)RAND_MAX + 1) gives > a correct reduction to 31 bits when RAND_MAX is 0x7fffffff (or > 15 bits if RAND_MAX is 0x7fff, etc.). > > srand() in the !USE_WEAK_SEEDING case still uses the same buggy code > as random(9), with type long, so the internal values overflow and the > inernal reduction to 31 bits is buggy, with the bugs depending on the > size of long and other things. But it is mostly saved by taking the > value modulo ((u_long)RAND_MAX + 1). This reduces to a valid value > and leaves only minor biases from the buggy earlier reduction. > > random(6) used to have bugs related to the buggy internal reduction, > and the biases from these were noticed. It uses floating point, so > the reduction was easier, but it was still done wrong, by dividing > by LONG_MAX instead of RANDOM_MAX_PLUS1. Using LONG_MAX is like using > 0x7fffffff in random(9), but obviously buggier since the range for > both is documented to be [0,0x7fffffff]. Hard-coding 0x7fffffff in > random(6) would have been equally buggy. I think 0x80000000 is correct > in both, but in random(9) this assumes too much about type sizes and > layouts. The correct method in integer code is to take an unsigned > modulus with divisor 0x80000000. Let the compiler optimize this to > masking with 0x7fffffff. This depends on the maximum value plus 1 > being representable in an unsigned type. For rand(), this occurs > because rand() returns int, and for random(3), this occurs because > random(3) returns long. > > Another bug in random(9) is that it returns u_long, so its API is > different from random(3), but since it is documented to return only > 31 bits, it is not really different except in the buggy cases where > it returns 32-64 bits. The bugs are a little different than I said above. There is no overflow problem and no problem with invalid values being produces, since the algorithm from ACM is careful to do everything with 32 bit signed integers without causing overflow. The algorithm just doesn't produce values mod 2**32 as expected by all the functions. It does what it claims to do -- it produces values mod (2**32 - 1). The largest bug is that RAND_MAX is off by 1. It is specified as the largest value returned by rand(), but in FreeBSD rand() never returns it unless USE_WEAK_SEEDING is confgured. The values should be unifornly distributed on average beteen 0 and RAND_MAX,but that is impossible if RADND_MAX is never returned. From libc/stdlib/srand.c: % static int % do_rand(unsigned long *ctx) % { % #ifdef USE_WEAK_SEEDING % /* % * Historic implementation compatibility. % * The random sequences do not vary much with the seed, % * even with overflowing. % */ % return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); RAND_MAX is correct for this algorithm. Except it is off by about a factor of 65536 instead of just by +1. This is the LCG documented as an example in C standards. It is only suitable for use with 16-bit ints and/or with RAND_MAX = 32767 and that is how it is used in the example. With FreeBSD's RAND_MAX = 0x7fffffff, RAND_MAX is correct but the implementation is of low quality. % #else /* !USE_WEAK_SEEDING */ % /* % * Compute x = (7^5 * x) mod (2^31 - 1) Note that (2**31 - 1) is not 2**31. % * without overflowing 31 bits: % * (2^31 - 1) = 127773 * (7^5) + 2836 % * From "Random number generators: good ones are hard to find", % * Park and Miller, Communications of the ACM, vol. 31, no. 10, % * October 1988, p. 1195. % */ % long hi, lo, x; % % /* Can't be initialized with 0, so use another value. */ % if (*ctx == 0) % *ctx = 123459876; % hi = *ctx / 127773; % lo = *ctx % 127773; % x = 16807 * lo - 2836 * hi; This splits up the multiplication so that it cannot overflow. But the subtraction may give negative value. % if (x < 0) % x += 0x7fffffff; This does the mod by (2**31 - 1). The range of values before and after the mod operation are not clear to me. If the comment is correct, then the algorithm must have arranged that the value is never 2's complement INT32_MIN or INT32_MAX before the mod operation, else the final value would be out of bounds. % return ((*ctx = x) % ((u_long)RAND_MAX + 1)); If the ACM part of the algorithm is correct, then this part is nonsense (has no effect), since the mod has already been taken using the correct modulus, and the correct modulus is smaller than the 1 used here. If the ACM part of the algorithm is incorrect, then this part prevents returning the invalid value -1, but the values are very unlikely to be correctly distributed. With 64-bit longs, the multiplication can be written more simply and run more efficiently as a 64-bit one, but it isn't clear that translation to match the comment: % * Compute x = (7^5 * x) mod (2^31 - 1) x = ((int64_t)16807 * x) % 0x7fffffff; gives the same result. This expression would also be much slower if the mod operation cannot be reduced by the compiler, so perhaps you should write this expression as: int64_t y = (int64_t)16807 * x; int32_t z = y; /* but do this more carefully */ if (y < 0) y += 0x7fffffff; /* (mod 2**31 - 1), as before */ % #endif /* !USE_WEAK_SEEDING */ random(9) and good_rand() don't have the bogus mod by (RAND_MAX + 1). They don't really document their maximum value, and it might not matter that they never return 0x7fffffff. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 08:04:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62C94833; Tue, 2 Jul 2013 08:04:42 +0000 (UTC) (envelope-from andrew@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 5598A1C40; Tue, 2 Jul 2013 08:04:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6284fMg050407; Tue, 2 Jul 2013 08:04:41 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6284fft050406; Tue, 2 Jul 2013 08:04:41 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307020804.r6284fft050406@svn.freebsd.org> From: Andrew Turner Date: Tue, 2 Jul 2013 08:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252503 - head/contrib/llvm/lib/Target/ARM X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 08:04:42 -0000 Author: andrew Date: Tue Jul 2 08:04:41 2013 New Revision: 252503 URL: http://svnweb.freebsd.org/changeset/base/252503 Log: Work around an ARM EABI issue where clang would sometimes incorrectly align the stack in a leaf function that uses TLS. The issue is, when using TLS, the function is no longer a leaf as it calls __aeabi_read_tp. With statically linked programs this is not an issue as it doesn't make use of the stack, however with dynamically linked applications we enter rtld which does use the stack and makes assumptions about it's alignment. This is only a temporary fix until a better patch can be made and submitted upstream. Modified: head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h Modified: head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h Tue Jul 2 07:36:04 2013 (r252502) +++ head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h Tue Jul 2 08:04:41 2013 (r252503) @@ -27,7 +27,7 @@ protected: public: explicit ARMFrameLowering(const ARMSubtarget &sti) - : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 4), + : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 8), STI(sti) { } From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 08:44:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B1CB9FCA; Tue, 2 Jul 2013 08:44:57 +0000 (UTC) (envelope-from lstewart@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 A29231D96; Tue, 2 Jul 2013 08:44:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r628ivoQ062743; Tue, 2 Jul 2013 08:44:57 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r628iuBT062735; Tue, 2 Jul 2013 08:44:56 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307020844.r628iuBT062735@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 2 Jul 2013 08:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252504 - in head: share/man/man4 sys/modules/cc sys/modules/cc/cc_cdg sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 08:44:57 -0000 Author: lstewart Date: Tue Jul 2 08:44:56 2013 New Revision: 252504 URL: http://svnweb.freebsd.org/changeset/base/252504 Log: Import an implementation of the CAIA Delay-Gradient (CDG) congestion control algorithm, which is based on the 2011 v0.1 patch release and described in the paper "Revisiting TCP Congestion Control using Delay Gradients" by David Hayes and Grenville Armitage. It is implemented as a kernel module compatible with the modular congestion control framework. CDG is a hybrid congestion control algorithm which reacts to both packet loss and inferred queuing delay. It attempts to operate as a delay-based algorithm where possible, but utilises heuristics to detect loss-based TCP cross traffic and will compete effectively as required. CDG is therefore incrementally deployable and suitable for use on shared networks. In collaboration with: David Hayes and Grenville Armitage MFC after: 4 days Sponsored by: Cisco University Research Program and FreeBSD Foundation Added: head/share/man/man4/cc_cdg.4 (contents, props changed) head/sys/modules/cc/cc_cdg/ head/sys/modules/cc/cc_cdg/Makefile (contents, props changed) head/sys/netinet/cc/cc_cdg.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/modules/cc/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jul 2 08:04:41 2013 (r252503) +++ head/share/man/man4/Makefile Tue Jul 2 08:44:56 2013 (r252504) @@ -81,6 +81,7 @@ MAN= aac.4 \ cardbus.4 \ carp.4 \ cas.4 \ + cc_cdg.4 \ cc_chd.4 \ cc_cubic.4 \ cc_hd.4 \ Added: head/share/man/man4/cc_cdg.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cc_cdg.4 Tue Jul 2 08:44:56 2013 (r252504) @@ -0,0 +1,155 @@ +.\" +.\" Copyright (c) 2013 Swinburne University of Technology, Melbourne, Australia +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 2, 2013 +.Dt CC_CDG 4 +.Os +.Sh NAME +.Nm cc_cdg +.Nd CDG Congestion Control Algorithm +.Sh DESCRIPTION +CAIA-Delay Gradient (CDG) is a hybrid congestion control algorithm which reacts +to both packet loss and inferred queuing delay. +It attempts to operate as a delay-based algorithm where possible, but utilises +heuristics to detect loss-based TCP cross traffic and will compete effectively +as required. +CDG is therefore incrementally deployable and suitable for use on shared +networks. +.Pp +During delay-based operation, CDG uses a delay-gradient based probabilistic +backoff mechanism, and will also try to infer non congestion related +packet losses and avoid backing off when they occur. +During loss-based operation, CDG essentially reverts to +.Xr cc_newreno 4 Ns - Ns like +behaviour. +.Pp +CDG switches to loss-based operation when it detects that a configurable number +of consecutive delay-based backoffs have had no measurable effect. +It periodically attempts to return to delay-based operation, but will keep +switching back to loss-based operation as required. +.Sh MIB Variables +The algorithm exposes the following variables in the +.Va net.inet.tcp.cc.cdg +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va exp_backoff_scale" +.It Va version +Current algorithm/implementation version number. +.It Va beta_delay +Delay-based window decrease factor as a percentage (on delay-based backoff, w = +w * beta_delay / 100). +Default is 70. +.It Va beta_loss +Loss-based window decrease factor as a percentage (on loss-based backoff, w = +w * beta_loss / 100). +Default is 50. +.It Va exp_backoff_scale +Scaling parameter for the probabilistic exponential backoff. +Default is 2. +.It Va smoothing_factor +Number of samples used for moving average smoothing (0 means no smoothing). +Default is 8. +.It Va loss_compete_consec_cong +Number of consecutive delay-gradient based congestion episodes which will +trigger loss-based CC compatibility. +Default is 5. +.It Va loss_compete_hold_backoff +Number of consecutive delay-gradient based congestion episodes to hold the +window backoff for loss-based CC compatibility. +Default is 5. +.It Va alpha_inc +If non-zero, this enables an experimental mode where CDG's window increase +factor (alpha) is increased by 1 MSS every +.Va alpha_inc +RTTs during congestion avoidance mode. +(Setting +.Va alpha_inc +to 1 results in the most aggressive growth of the window increase factor over +time. +Use higher +.Va alpha_inc +values for slower growth.) +Default is 0. +.El +.Sh SEE ALSO +.Xr cc_chd 4 , +.Xr cc_cubic 4 , +.Xr cc_hd 4 , +.Xr cc_htcp 4 , +.Xr cc_newreno 4 , +.Xr cc_vegas 4 , +.Xr h_ertt 4 , +.Xr mod_cc 4 , +.Xr tcp 4 , +.Xr khelp 9 , +.Xr mod_cc 9 +.Rs +.%A "D. A. Hayes" +.%A "G. Armitage" +.%T "Revisiting TCP Congestion Control using Delay Gradients" +.%J "Networking 2011 Proceedings, Part II" +.%D "May 2011" +.%P "328-341" +.Re +.Rs +.%A "N. Khademi" +.%A "G. Armitage" +.%T "Minimising RTT across homogeneous 802.11 WLANs with CAIA Delay-Gradient TCP (v0.1)" +.%R "CAIA Technical Report 121113A" +.%D "November 2012" +.%U "http://caia.swin.edu.au/reports/121113A/CAIA-TR-121113A.pdf" +.Re +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and The Cisco University Research Program Fund, a +corporate advised fund of Silicon Valley Community Foundation. +.Sh HISTORY +The +.Nm +congestion control module first appeared in +.Fx 9.2 . +.Pp +The module was first released in 2011 by David Hayes whilst working on the +NewTCP research project at Swinburne University of Technology's Centre for +Advanced Internet Architectures, Melbourne, Australia. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +congestion control module was written by +.An David Hayes Aq david.hayes@ieee.org . +This manual page was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org +and +.An Grenville Armitage Aq garmitage@swin.edu.au . +.Sh BUGS +The underlying algorithm and parameter values are still a work in progress and +may not be optimal for some network scenarios. Modified: head/sys/modules/cc/Makefile ============================================================================== --- head/sys/modules/cc/Makefile Tue Jul 2 08:04:41 2013 (r252503) +++ head/sys/modules/cc/Makefile Tue Jul 2 08:44:56 2013 (r252504) @@ -1,6 +1,7 @@ # $FreeBSD$ -SUBDIR= cc_chd \ +SUBDIR= cc_cdg \ + cc_chd \ cc_cubic \ cc_hd \ cc_htcp \ Added: head/sys/modules/cc/cc_cdg/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cc/cc_cdg/Makefile Tue Jul 2 08:44:56 2013 (r252504) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../../netinet/cc +KMOD= cc_cdg +SRCS= cc_cdg.c + +.include Added: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_cdg.c Tue Jul 2 08:44:56 2013 (r252504) @@ -0,0 +1,695 @@ +/*- + * Copyright (c) 2009-2013 + * Swinburne University of Technology, Melbourne, Australia + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University of Technology, by David Hayes, made + * possible in part by a gift from The Cisco University Research Program Fund, + * a corporate advised fund of Silicon Valley Community Foundation. Development + * and testing were further assisted by a grant from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * CAIA Delay-Gradient (CDG) congestion control algorithm + * + * An implemention of the delay-gradient congestion control algorithm proposed + * in the following paper: + * + * D. A. Hayes and G. Armitage, "Revisiting TCP Congestion Control using Delay + * Gradients", in IFIP Networking, Valencia, Spain, 9-13 May 2011. + * + * Developed as part of the NewTCP research project at Swinburne University of + * Technology's Centre for Advanced Internet Architectures, Melbourne, + * Australia. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#define CDG_VERSION "0.1" + +#define CAST_PTR_INT(X) (*((int*)(X))) + +#ifndef VIMAGE +#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ + sysctl_handle_int(oidp, arg1, arg2, req) +#endif + +/* Private delay-gradient induced congestion control signal. */ +#define CC_CDG_DELAY 0x01000000 + +/* NewReno window deflation factor on loss (as a percentage). */ +#define RENO_BETA 50 + +/* Queue states. */ +#define CDG_Q_EMPTY 1 +#define CDG_Q_RISING 2 +#define CDG_Q_FALLING 3 +#define CDG_Q_FULL 4 +#define CDG_Q_UNKNOWN 9999 + +/* Number of bit shifts used in probexp lookup table. */ +#define EXP_PREC 15 + +/* Largest gradient represented in probexp lookup table. */ +#define MAXGRAD 5 + +/* + * Delay Precision Enhance - number of bit shifts used for qtrend related + * integer arithmetic precision. + */ +#define D_P_E 7 + +struct qdiff_sample { + long qdiff; + STAILQ_ENTRY(qdiff_sample) qdiff_lnk; +}; + +struct cdg { + long max_qtrend; + long min_qtrend; + STAILQ_HEAD(minrtts_head, qdiff_sample) qdiffmin_q; + STAILQ_HEAD(maxrtts_head, qdiff_sample) qdiffmax_q; + long window_incr; + /* rttcount for window increase when in congestion avoidance */ + long rtt_count; + /* maximum measured rtt within an rtt period */ + int maxrtt_in_rtt; + /* maximum measured rtt within prev rtt period */ + int maxrtt_in_prevrtt; + /* minimum measured rtt within an rtt period */ + int minrtt_in_rtt; + /* minimum measured rtt within prev rtt period */ + int minrtt_in_prevrtt; + /* consecutive congestion episode counter */ + uint32_t consec_cong_cnt; + /* when tracking a new reno type loss window */ + uint32_t shadow_w; + /* maximum number of samples in the moving average queue */ + int sample_q_size; + /* number of samples in the moving average queue */ + int num_samples; + /* estimate of the queue state of the path */ + int queue_state; +}; + +/* + * Lookup table for: + * (1 - exp(-x)) << EXP_PREC, where x = [0,MAXGRAD] in 2^-7 increments + * + * Note: probexp[0] is set to 10 (not 0) as a safety for very low increase + * gradients. + */ +static const int probexp[641] = { + 10,255,508,759,1008,1255,1501,1744,1985,2225,2463,2698,2932,3165,3395,3624, + 3850,4075,4299,4520,4740,4958,5175,5389,5602,5814,6024,6232,6438,6643,6846, + 7048,7248,7447,7644,7839,8033,8226,8417,8606,8794,8981,9166,9350,9532,9713, + 9892,10070,10247,10422,10596,10769,10940,11110,11278,11445,11611,11776,11939, + 12101,12262,12422,12580,12737,12893,13048,13201,13354,13505,13655,13803,13951, + 14097,14243,14387,14530,14672,14813,14952,15091,15229,15365,15500,15635,15768, + 15900,16032,16162,16291,16419,16547,16673,16798,16922,17046,17168,17289,17410, + 17529,17648,17766,17882,17998,18113,18227,18340,18453,18564,18675,18784,18893, + 19001,19108,19215,19320,19425,19529,19632,19734,19835,19936,20036,20135,20233, + 20331,20427,20523,20619,20713,20807,20900,20993,21084,21175,21265,21355,21444, + 21532,21619,21706,21792,21878,21962,22046,22130,22213,22295,22376,22457,22537, + 22617,22696,22774,22852,22929,23006,23082,23157,23232,23306,23380,23453,23525, + 23597,23669,23739,23810,23879,23949,24017,24085,24153,24220,24286,24352,24418, + 24483,24547,24611,24675,24738,24800,24862,24924,24985,25045,25106,25165,25224, + 25283,25341,25399,25456,25513,25570,25626,25681,25737,25791,25846,25899,25953, + 26006,26059,26111,26163,26214,26265,26316,26366,26416,26465,26514,26563,26611, + 26659,26707,26754,26801,26847,26893,26939,26984,27029,27074,27118,27162,27206, + 27249,27292,27335,27377,27419,27460,27502,27543,27583,27624,27664,27703,27743, + 27782,27821,27859,27897,27935,27973,28010,28047,28084,28121,28157,28193,28228, + 28263,28299,28333,28368,28402,28436,28470,28503,28536,28569,28602,28634,28667, + 28699,28730,28762,28793,28824,28854,28885,28915,28945,28975,29004,29034,29063, + 29092,29120,29149,29177,29205,29232,29260,29287,29314,29341,29368,29394,29421, + 29447,29472,29498,29524,29549,29574,29599,29623,29648,29672,29696,29720,29744, + 29767,29791,29814,29837,29860,29882,29905,29927,29949,29971,29993,30014,30036, + 30057,30078,30099,30120,30141,30161,30181,30201,30221,30241,30261,30280,30300, + 30319,30338,30357,30376,30394,30413,30431,30449,30467,30485,30503,30521,30538, + 30555,30573,30590,30607,30624,30640,30657,30673,30690,30706,30722,30738,30753, + 30769,30785,30800,30815,30831,30846,30861,30876,30890,30905,30919,30934,30948, + 30962,30976,30990,31004,31018,31031,31045,31058,31072,31085,31098,31111,31124, + 31137,31149,31162,31174,31187,31199,31211,31223,31235,31247,31259,31271,31283, + 31294,31306,31317,31328,31339,31351,31362,31373,31383,31394,31405,31416,31426, + 31436,31447,31457,31467,31477,31487,31497,31507,31517,31527,31537,31546,31556, + 31565,31574,31584,31593,31602,31611,31620,31629,31638,31647,31655,31664,31673, + 31681,31690,31698,31706,31715,31723,31731,31739,31747,31755,31763,31771,31778, + 31786,31794,31801,31809,31816,31824,31831,31838,31846,31853,31860,31867,31874, + 31881,31888,31895,31902,31908,31915,31922,31928,31935,31941,31948,31954,31960, + 31967,31973,31979,31985,31991,31997,32003,32009,32015,32021,32027,32033,32038, + 32044,32050,32055,32061,32066,32072,32077,32083,32088,32093,32098,32104,32109, + 32114,32119,32124,32129,32134,32139,32144,32149,32154,32158,32163,32168,32173, + 32177,32182,32186,32191,32195,32200,32204,32209,32213,32217,32222,32226,32230, + 32234,32238,32242,32247,32251,32255,32259,32263,32267,32270,32274,32278,32282, + 32286,32290,32293,32297,32301,32304,32308,32311,32315,32318,32322,32325,32329, + 32332,32336,32339,32342,32346,32349,32352,32356,32359,32362,32365,32368,32371, + 32374,32377,32381,32384,32387,32389,32392,32395,32398,32401,32404,32407,32410, + 32412,32415,32418,32421,32423,32426,32429,32431,32434,32437,32439,32442,32444, + 32447,32449,32452,32454,32457,32459,32461,32464,32466,32469,32471,32473,32476, + 32478,32480,32482,32485,32487,32489,32491,32493,32495,32497,32500,32502,32504, + 32506,32508,32510,32512,32514,32516,32518,32520,32522,32524,32526,32527,32529, + 32531,32533,32535,32537,32538,32540,32542,32544,32545,32547}; + +static uma_zone_t qdiffsample_zone; + +static MALLOC_DEFINE(M_CDG, "cdg data", + "Per connection data required for the CDG congestion control algorithm"); + +static int ertt_id; + +static VNET_DEFINE(uint32_t, cdg_alpha_inc); +static VNET_DEFINE(uint32_t, cdg_beta_delay); +static VNET_DEFINE(uint32_t, cdg_beta_loss); +static VNET_DEFINE(uint32_t, cdg_smoothing_factor); +static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale); +static VNET_DEFINE(uint32_t, cdg_consec_cong); +static VNET_DEFINE(uint32_t, cdg_hold_backoff); +#define V_cdg_alpha_inc VNET(cdg_alpha_inc) +#define V_cdg_beta_delay VNET(cdg_beta_delay) +#define V_cdg_beta_loss VNET(cdg_beta_loss) +#define V_cdg_smoothing_factor VNET(cdg_smoothing_factor) +#define V_cdg_exp_backoff_scale VNET(cdg_exp_backoff_scale) +#define V_cdg_consec_cong VNET(cdg_consec_cong) +#define V_cdg_hold_backoff VNET(cdg_hold_backoff) + +/* Function prototypes. */ +static int cdg_mod_init(void); +static void cdg_conn_init(struct cc_var *ccv); +static int cdg_cb_init(struct cc_var *ccv); +static void cdg_cb_destroy(struct cc_var *ccv); +static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void cdg_ack_received(struct cc_var *ccv, uint16_t ack_type); + +struct cc_algo cdg_cc_algo = { + .name = "cdg", + .mod_init = cdg_mod_init, + .ack_received = cdg_ack_received, + .cb_destroy = cdg_cb_destroy, + .cb_init = cdg_cb_init, + .conn_init = cdg_conn_init, + .cong_signal = cdg_cong_signal +}; + +/* Vnet created and being initialised. */ +static void +cdg_init_vnet(const void *unused __unused) +{ + + V_cdg_alpha_inc = 0; + V_cdg_beta_delay = 70; + V_cdg_beta_loss = 50; + V_cdg_smoothing_factor = 8; + V_cdg_exp_backoff_scale = 3; + V_cdg_consec_cong = 5; + V_cdg_hold_backoff = 5; +} + +static int +cdg_mod_init(void) +{ + VNET_ITERATOR_DECL(v); + + ertt_id = khelp_get_id("ertt"); + if (ertt_id <= 0) + return (EINVAL); + + qdiffsample_zone = uma_zcreate("cdg_qdiffsample", + sizeof(struct qdiff_sample), NULL, NULL, NULL, NULL, 0, 0); + + VNET_LIST_RLOCK(); + VNET_FOREACH(v) { + CURVNET_SET(v); + cdg_init_vnet(NULL); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + cdg_cc_algo.post_recovery = newreno_cc_algo.post_recovery; + cdg_cc_algo.after_idle = newreno_cc_algo.after_idle; + + return (0); +} + +static int +cdg_cb_init(struct cc_var *ccv) +{ + struct cdg *cdg_data; + + cdg_data = malloc(sizeof(struct cdg), M_CDG, M_NOWAIT); + if (cdg_data == NULL) + return (ENOMEM); + + cdg_data->shadow_w = 0; + cdg_data->max_qtrend = 0; + cdg_data->min_qtrend = 0; + cdg_data->queue_state = CDG_Q_UNKNOWN; + cdg_data->maxrtt_in_rtt = 0; + cdg_data->maxrtt_in_prevrtt = 0; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->minrtt_in_prevrtt = 0; + cdg_data->window_incr = 0; + cdg_data->rtt_count = 0; + cdg_data->consec_cong_cnt = 0; + cdg_data->sample_q_size = V_cdg_smoothing_factor; + cdg_data->num_samples = 0; + STAILQ_INIT(&cdg_data->qdiffmin_q); + STAILQ_INIT(&cdg_data->qdiffmax_q); + + ccv->cc_data = cdg_data; + + return (0); +} + +static void +cdg_conn_init(struct cc_var *ccv) +{ + struct cdg *cdg_data = ccv->cc_data; + + /* + * Initialise the shadow_cwnd in case we are competing with loss based + * flows from the start + */ + cdg_data->shadow_w = CCV(ccv, snd_cwnd); +} + +static void +cdg_cb_destroy(struct cc_var *ccv) +{ + struct cdg *cdg_data; + struct qdiff_sample *qds, *qds_n; + + cdg_data = ccv->cc_data; + + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + free(ccv->cc_data, M_CDG); +} + +static int +cdg_beta_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && + (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static int +cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static inline unsigned long +cdg_window_decrease(struct cc_var *ccv, unsigned long owin, unsigned int beta) +{ + + return ((ulmin(CCV(ccv, snd_wnd), owin) * beta) / 100); +} + +/* + * Window increase function + * This window increase function is independent of the initial window size + * to ensure small window flows are not discriminated against (i.e. fairness). + * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for + * the next alpha_inc rtts, etc. + */ +static void +cdg_window_increase(struct cc_var *ccv, int new_measurement) +{ + struct cdg *cdg_data; + int incr, s_w_incr; + + cdg_data = ccv->cc_data; + incr = s_w_incr = 0; + + if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) { + /* Slow start. */ + incr = CCV(ccv, t_maxseg); + s_w_incr = incr; + cdg_data->window_incr = cdg_data->rtt_count = 0; + } else { + /* Congestion avoidance. */ + if (new_measurement) { + s_w_incr = CCV(ccv, t_maxseg); + if (V_cdg_alpha_inc == 0) { + incr = CCV(ccv, t_maxseg); + } else { + if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { + cdg_data->window_incr++; + cdg_data->rtt_count = 0; + } + incr = CCV(ccv, t_maxseg) * + cdg_data->window_incr; + } + } + } + + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + + CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); +} + +static void +cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) +{ + struct cdg *cdg_data = ccv->cc_data; + + switch(signal_type) { + case CC_CDG_DELAY: + CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, + CCV(ccv, snd_cwnd), V_cdg_beta_delay); + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + cdg_data->window_incr = cdg_data->rtt_count = 0; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + break; + case CC_NDUPACK: + /* + * If already responding to congestion OR we have guessed no + * queue in the path is full. + */ + if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || + cdg_data->queue_state < CDG_Q_FULL) { + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + } else { + /* + * Loss is likely to be congestion related. We have + * inferred a queue full state, so have shadow window + * react to loss as NewReno would. + */ + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = cdg_window_decrease(ccv, + cdg_data->shadow_w, RENO_BETA); + + CCV(ccv, snd_ssthresh) = ulmax(cdg_data->shadow_w, + cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), + V_cdg_beta_loss)); + + cdg_data->window_incr = cdg_data->rtt_count = 0; + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + break; + default: + newreno_cc_algo.cong_signal(ccv, signal_type); + break; + } +} + +/* + * Using a negative exponential probabilistic backoff so that sources with + * varying RTTs which share the same link will, on average, have the same + * probability of backoff over time. + * + * Prob_backoff = 1 - exp(-qtrend / V_cdg_exp_backoff_scale), where + * V_cdg_exp_backoff_scale is the average qtrend for the exponential backoff. + */ +static inline int +prob_backoff(long qtrend) +{ + int backoff, idx, p; + + backoff = (qtrend > ((MAXGRAD * V_cdg_exp_backoff_scale) << D_P_E)); + + if (!backoff) { + if (V_cdg_exp_backoff_scale > 1) + idx = (qtrend + V_cdg_exp_backoff_scale / 2) / + V_cdg_exp_backoff_scale; + else + idx = qtrend; + + /* Backoff probability proportional to rate of queue growth. */ + p = (INT_MAX / (1 << EXP_PREC)) * probexp[idx]; + backoff = (random() < p); + } + + return (backoff); +} + +static inline void +calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) +{ + struct qdiff_sample *qds; + + ++cdg_data->num_samples; + if (cdg_data->num_samples > cdg_data->sample_q_size) { + /* Minimum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + cdg_data->min_qtrend = cdg_data->min_qtrend + + (qdiff_min - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmin_q, qdiff_lnk); + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, qdiff_lnk); + + /* Maximum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + cdg_data->max_qtrend = cdg_data->max_qtrend + + (qdiff_max - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmax_q, qdiff_lnk); + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, qdiff_lnk); + --cdg_data->num_samples; + } else { + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds != NULL) { + cdg_data->min_qtrend = cdg_data->min_qtrend + + qdiff_min / cdg_data->sample_q_size; + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, + qdiff_lnk); + } + + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds) { + cdg_data->max_qtrend = cdg_data->max_qtrend + + qdiff_max / cdg_data->sample_q_size; + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, + qdiff_lnk); + } + } +} + +static void +cdg_ack_received(struct cc_var *ccv, uint16_t ack_type) +{ + struct cdg *cdg_data; + struct ertt *e_t; + long qdiff_max, qdiff_min; + int congestion, new_measurement, slowstart; + + cdg_data = ccv->cc_data; + e_t = (struct ertt *)khelp_get_osd(CCV(ccv, osd), ertt_id); + new_measurement = e_t->flags & ERTT_NEW_MEASUREMENT; + congestion = 0; + cdg_data->maxrtt_in_rtt = imax(e_t->rtt, cdg_data->maxrtt_in_rtt); + cdg_data->minrtt_in_rtt = imin(e_t->rtt, cdg_data->minrtt_in_rtt); + + if (new_measurement) { + slowstart = (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)); + /* + * Update smoothed gradient measurements. Since we are only + * using one measurement per RTT, use max or min rtt_in_rtt. + * This is also less noisy than a sample RTT measurement. Max + * RTT measurements can have trouble due to OS issues. + */ + if (cdg_data->maxrtt_in_prevrtt) { + qdiff_max = ((long)(cdg_data->maxrtt_in_rtt - + cdg_data->maxrtt_in_prevrtt) << D_P_E ); + qdiff_min = ((long)(cdg_data->minrtt_in_rtt - + cdg_data->minrtt_in_prevrtt) << D_P_E ); + + calc_moving_average(cdg_data, qdiff_max, qdiff_min); + + /* Probabilistic backoff with respect to gradient. */ + if (slowstart && qdiff_min > 0) + congestion = prob_backoff(qdiff_min); + else if (cdg_data->min_qtrend > 0) + congestion = prob_backoff(cdg_data->min_qtrend); + else if (slowstart && qdiff_max > 0) + congestion = prob_backoff(qdiff_max); + else if (cdg_data->max_qtrend > 0) + congestion = prob_backoff(cdg_data->max_qtrend); + + /* Update estimate of queue state. */ + if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend <= 0) { + cdg_data->queue_state = CDG_Q_FULL; + } else if (cdg_data->min_qtrend >= 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_EMPTY; + cdg_data->shadow_w = 0; + } else if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend > 0) { + cdg_data->queue_state = CDG_Q_RISING; + } else if (cdg_data->min_qtrend < 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_FALLING; + } + + if (cdg_data->min_qtrend < 0 || + cdg_data->max_qtrend < 0) + cdg_data->consec_cong_cnt = 0; + } + + cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; + cdg_data->maxrtt_in_rtt = 0; + e_t->flags &= ~ERTT_NEW_MEASUREMENT; + } + + if (congestion) { + cdg_data->consec_cong_cnt++; + if (!IN_RECOVERY(CCV(ccv, t_flags))) { + if (cdg_data->consec_cong_cnt <= V_cdg_consec_cong) + cdg_cong_signal(ccv, CC_CDG_DELAY); + else + /* + * We have been backing off but the queue is not + * falling. Assume we are competing with + * loss-based flows and don't back off for the + * next V_cdg_hold_backoff RTT periods. + */ + if (cdg_data->consec_cong_cnt >= + V_cdg_consec_cong + V_cdg_hold_backoff) + cdg_data->consec_cong_cnt = 0; + + /* Won't see effect until 2nd RTT. */ + cdg_data->maxrtt_in_prevrtt = 0; + /* + * Resync shadow window in case we are competing with a + * loss based flow + */ + cdg_data->shadow_w = ulmax(CCV(ccv, snd_cwnd), + cdg_data->shadow_w); + } + } else if (ack_type == CC_ACK) + cdg_window_increase(ccv, new_measurement); +} + +/* When a vnet is created and being initialised, init the per-stack CDG vars. */ +VNET_SYSINIT(cdg_init_vnet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, + cdg_init_vnet, NULL); + +SYSCTL_DECL(_net_inet_tcp_cc_cdg); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW, NULL, + "CAIA delay-gradient congestion control related settings"); + +SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_AUTO, version, + CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, + "Current algorithm/implementation version number"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, + "Increment the window increase factor alpha by 1 MSS segment every " + "alpha_inc RTTs during congestion avoidance mode."); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, + &cdg_beta_handler, "IU", + "Delay-based window decrease factor as a percentage " + "(on delay-based backoff, w = w * beta_delay / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, + &cdg_beta_handler, "IU", + "Loss-based window decrease factor as a percentage " + "(on loss-based backoff, w = w * beta_loss / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, + &cdg_exp_backoff_scale_handler, "IU", + "Scaling parameter for the probabilistic exponential backoff"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, + "Number of samples used for moving average smoothing (0 = no smoothing)"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, + "Number of consecutive delay-gradient based congestion episodes which will " + "trigger loss based CC compatibility"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, + "Number of consecutive delay-gradient based congestion episodes to hold " + "the window backoff for loss based CC compatibility"); + +DECLARE_CC_MODULE(cdg, &cdg_cc_algo); + +MODULE_DEPEND(cdg, ertt, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 10:36:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D6984CC; Tue, 2 Jul 2013 10:36:58 +0000 (UTC) (envelope-from gjb@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 0FD361336; Tue, 2 Jul 2013 10:36:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62Aavnx095104; Tue, 2 Jul 2013 10:36:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62AavQg095103; Tue, 2 Jul 2013 10:36:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307021036.r62AavQg095103@svn.freebsd.org> From: Glen Barber Date: Tue, 2 Jul 2013 10:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252505 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 10:36:58 -0000 Author: gjb Date: Tue Jul 2 10:36:57 2013 New Revision: 252505 URL: http://svnweb.freebsd.org/changeset/base/252505 Log: - Update newvers.sh to include svn revision in uname(1) if the system has svnliteversion. - If svnliteversion is not found, look for svnversion in /usr/bin and /usr/local/bin, since svnlite can be installed as svn if WITH_SVN is set.[1] - Remove /bin from binary search paths.[1] Discussed with: kib [1] MFC after: 3 days Approved by: kib (mentor) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Jul 2 08:44:56 2013 (r252504) +++ head/sys/conf/newvers.sh Tue Jul 2 10:36:57 2013 (r252505) @@ -88,16 +88,26 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') -for dir in /bin /usr/bin /usr/local/bin; do +if [ -x /usr/bin/svnliteversion ] ; then + svnversion=/usr/bin/svnliteversion +fi + +for dir in /usr/bin /usr/local/bin; do + if [ ! -z "${svnversion}" ] ; then + break + fi if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then svnversion=${dir}/svnversion + break fi +done +for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then p4_cmd=${dir}/p4 fi done if [ -d "${SYSDIR}/../.git" ] ; then - for dir in /bin /usr/bin /usr/local/bin; do + for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/git" ] ; then git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" break From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 13:24:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64728C95; Tue, 2 Jul 2013 13:24:38 +0000 (UTC) (envelope-from bms@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 563261D5D; Tue, 2 Jul 2013 13:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62DOcib045328; Tue, 2 Jul 2013 13:24:38 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62DObMJ045325; Tue, 2 Jul 2013 13:24:37 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201307021324.r62DObMJ045325@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 2 Jul 2013 13:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252506 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 13:24:38 -0000 Author: bms Date: Tue Jul 2 13:24:37 2013 New Revision: 252506 URL: http://svnweb.freebsd.org/changeset/base/252506 Log: When acquiring a lease, record the value of the BOOTP siaddr field contained in the DHCP offer, and write it out to the lease file as an unquoted value of the "next-server" keyword. The value is ignored when the lease is read back by dhclient, however other applications are free to parse it. The intent behind this change is to allow easier interoperability with automated installation systems e.g. Cobbler, Foreman, Razor; FreeBSD installation kernels can automatically probe the network to discover deployment servers. There are no plans to MFC this change unless a backport is specifically requested. The syntax of the "next-server " lease keyword is intended to be identical to that used by the ISC DHCPD server in its configuration files. The required defines are already present in dhclient but were unused before this change. (Note: This is NOT the same as Option 66, tftp-server-name). It has been exercised in a university protocol testbed environment, with Cobbler and an mfsBSD image containing pc-sysinstall (driven by Cobbler Cheetah templates). The SYSLINUX memdisk driver is used to boot mfsBSD. Currently this approach requires that a dedicated system profile has been created for the node where FreeBSD is to be deployed. If this is not present, the pc-sysinstall wrapper will be unable to obtain a node configuration. There is code in progress to allow mfsBSD images to obtain the required hints from the memdisk environment by parsing the MBFT ACPI chunk. This is non-standard as it is not linked into the platform's ACPI RSDT. Reviewed by: des Modified: head/sbin/dhclient/clparse.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/clparse.c ============================================================================== --- head/sbin/dhclient/clparse.c Tue Jul 2 10:36:57 2013 (r252505) +++ head/sbin/dhclient/clparse.c Tue Jul 2 13:24:37 2013 (r252506) @@ -642,6 +642,10 @@ parse_client_lease_declaration(FILE *cfi case FILENAME: lease->filename = parse_string(cfile); return; + case NEXT_SERVER: + if (!parse_ip_addr(cfile, &lease->nextserver)) + return; + break; case SERVER_NAME: lease->server_name = parse_string(cfile); return; Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Tue Jul 2 10:36:57 2013 (r252505) +++ head/sbin/dhclient/dhclient.c Tue Jul 2 13:24:37 2013 (r252506) @@ -1063,6 +1063,9 @@ packet_to_lease(struct packet *packet) lease->address.len = sizeof(packet->raw->yiaddr); memcpy(lease->address.iabuf, &packet->raw->yiaddr, lease->address.len); + lease->nextserver.len = sizeof(packet->raw->siaddr); + memcpy(lease->nextserver.iabuf, &packet->raw->siaddr, lease->nextserver.len); + /* If the server name was filled out, copy it. Do not attempt to validate the server name as a host name. RFC 2131 merely states that sname is NUL-terminated (which do @@ -1874,6 +1877,11 @@ write_client_lease(struct interface_info fprintf(leaseFile, " bootp;\n"); fprintf(leaseFile, " interface \"%s\";\n", ip->name); fprintf(leaseFile, " fixed-address %s;\n", piaddr(lease->address)); + if (lease->nextserver.len == sizeof(inaddr_any) && + 0 != memcmp(lease->nextserver.iabuf, &inaddr_any, + sizeof(inaddr_any))) + fprintf(leaseFile, " next-server %s;\n", + piaddr(lease->nextserver)); if (lease->filename) fprintf(leaseFile, " filename \"%s\";\n", lease->filename); if (lease->server_name) Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Tue Jul 2 10:36:57 2013 (r252505) +++ head/sbin/dhclient/dhcpd.h Tue Jul 2 13:24:37 2013 (r252506) @@ -121,6 +121,7 @@ struct client_lease { struct client_lease *next; time_t expiry, renewal, rebind; struct iaddr address; + struct iaddr nextserver; char *server_name; char *filename; struct string_list *medium; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 14:48:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A957B697; Tue, 2 Jul 2013 14:48:39 +0000 (UTC) (envelope-from asomers@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 9BAAD118D; Tue, 2 Jul 2013 14:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62EmdYX069683; Tue, 2 Jul 2013 14:48:39 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Emd0n069682; Tue, 2 Jul 2013 14:48:39 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201307021448.r62Emd0n069682@svn.freebsd.org> From: Alan Somers Date: Tue, 2 Jul 2013 14:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252508 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 14:48:39 -0000 Author: asomers Date: Tue Jul 2 14:48:39 2013 New Revision: 252508 URL: http://svnweb.freebsd.org/changeset/base/252508 Log: Explicitly include to fix compilation with libc++. It is implicitly included by libstdc++. Reported By: Oliver Hartmann Approved by: gibbs (co-mentor, implicit) Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Tue Jul 2 13:48:16 2013 (r252507) +++ head/sbin/devd/devd.cc Tue Jul 2 14:48:39 2013 (r252508) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 15:45:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 656FF81C for ; Tue, 2 Jul 2013 15:45:26 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by mx1.freebsd.org (Postfix) with ESMTP id E10FB1674 for ; Tue, 2 Jul 2013 15:45:25 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id dy20so5634912lab.23 for ; Tue, 02 Jul 2013 08:45:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=Uikhacxpo9Ka9PlcOKzkYDEQgVyjxc8UGxY6QY5mFRk=; b=kzIF75eZWm1oLenIKJ733wbb6u+juvYHYlrh60z98qmqmf2UJNdmwxjd9llujsn4vL H/He/epgYtN8ZTK+bLhpiCDEU2PKK0Nm9JJ31UP9IWgXhImDXA1/B3CzLpgQjdO1Be6G 9C5UNalhIWWAc1Nhr2lMaIPqyLVarofdp1LJ3wbArNXJzpqK6VkdD7cW+6fT2IE5Nzz/ AuGt0q/MRNzRFJXyMsWNUQ2pAZKGbxHofOA6tBWsEO/auZw/nLdyJT7jeOR1tBUTMKrZ 54XUp38w38U1C0QVu1Q8/HXH1cl1kvJHYKacEHkVLw7Md6tPUN5ZdEphZOQlW3I8iYxS Wzaw== X-Received: by 10.152.2.168 with SMTP id 8mr14566165lav.69.1372779918558; Tue, 02 Jul 2013 08:45:18 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id m1sm9291403lag.3.2013.07.02.08.45.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 08:45:18 -0700 (PDT) Message-ID: <51D2F571.8050108@freebsd.org> Date: Tue, 02 Jul 2013 19:44:49 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: RAND_MAX broken References: <201307012143.r61Lhemi067176@svn.freebsd.org> <20130702130818.V865@besplex.bde.org> <20130702165642.X1571@besplex.bde.org> In-Reply-To: <20130702165642.X1571@besplex.bde.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnyBN3JwNcTtLbkSPBP7QTBbXarRTbVZuKlkX9LhtJeep2vAeaX51CffH6z3q0wQ8yYGeZd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Pedro F. Giffuni" , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 15:45:26 -0000 On 02.07.2013 11:39, Bruce Evans wrote: > The bugs are a little different than I said above. There is no overflow > problem and no problem with invalid values being produces, since the > algorithm from ACM is careful to do everything with 32 bit signed > integers without causing overflow. The algorithm just doesn't produce > values mod 2**32 as expected by all the functions. It does what it > claims to do -- it produces values mod (2**32 - 1). The largest bug > is that RAND_MAX is off by 1. It is specified as the largest value > returned by rand(), but in FreeBSD rand() never returns it unless > USE_WEAK_SEEDING is confgured. The values should be unifornly > distributed on average beteen 0 and RAND_MAX,but that is impossible > if RADND_MAX is never returned. From libc/stdlib/srand.c: Don't ever consider USE_WEAK_SEEDING defined - result is distributet _very_ poorly and the code should be removed long time ago. BTW, I don't understand well fixes you suggest. Is it to define RAND_MAX as 0x7ffffffe ? -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 16:00:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79A64E99; Tue, 2 Jul 2013 16:00:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 575311744; Tue, 2 Jul 2013 16:00:26 +0000 (UTC) Received: from [192.168.1.75] (75-48-77-17.lightspeed.cncrca.sbcglobal.net [75.48.77.17]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 529C4B915; Tue, 2 Jul 2013 12:00:20 -0400 (EDT) Message-ID: <51D2F915.2070303@FreeBSD.org> Date: Tue, 02 Jul 2013 09:00:21 -0700 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Julian Elischer Subject: Re: svn commit: r252346 - head/share/man/man9 References: <201306281633.r5SGXjFU017827@svn.freebsd.org> <51CEDE2B.60204@freebsd.org> <51CEE326.2010903@freebsd.org> In-Reply-To: <51CEE326.2010903@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 02 Jul 2013 12:00:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 16:00:26 -0000 On 6/29/13 6:37 AM, Julian Elischer wrote: > On 6/29/13 9:16 PM, Julian Elischer wrote: >> thanks! >> >> >>> -If the owner is not currently actually running then the spin step is >>> skipped. >>> +then a thread attempting to acquire the mutex will spin rather than >>> yielding >>> +the processor. > Am I wrong in thinking that it will only spin for a short while, > eventually yielding? > > The original text said this but the new text implies it will spin forever. It does not use a spin timeout. I considered adding a separate note to define adaptive spinning generically as it is used by multiple lock types (mutexes, rwlocks, and sx locks). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 16:33:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02E5D832; Tue, 2 Jul 2013 16:33:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id BDA2E18A6; Tue, 2 Jul 2013 16:33:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D026710425B7; Wed, 3 Jul 2013 02:33:30 +1000 (EST) Date: Wed, 3 Jul 2013 02:33:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: RAND_MAX broken In-Reply-To: <51D2F571.8050108@freebsd.org> Message-ID: <20130703020550.E8632@besplex.bde.org> References: <201307012143.r61Lhemi067176@svn.freebsd.org> <20130702130818.V865@besplex.bde.org> <20130702165642.X1571@besplex.bde.org> <51D2F571.8050108@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=lqUz0ovpAEAA:10 a=Aq5J0u6kN07AkTABL6YA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 16:33:38 -0000 On Tue, 2 Jul 2013, Andrey Chernov wrote: > On 02.07.2013 11:39, Bruce Evans wrote: >> The bugs are a little different than I said above. There is no overflow >> problem and no problem with invalid values being produces, since the >> algorithm from ACM is careful to do everything with 32 bit signed >> integers without causing overflow. The algorithm just doesn't produce >> values mod 2**32 as expected by all the functions. It does what it >> claims to do -- it produces values mod (2**32 - 1). The largest bug >> is that RAND_MAX is off by 1. It is specified as the largest value >> returned by rand(), but in FreeBSD rand() never returns it unless >> USE_WEAK_SEEDING is confgured. The values should be unifornly >> distributed on average beteen 0 and RAND_MAX,but that is impossible >> if RADND_MAX is never returned. From libc/stdlib/srand.c: > > Don't ever consider USE_WEAK_SEEDING defined - result is distributet > _very_ poorly and the code should be removed long time ago. > > BTW, I don't understand well fixes you suggest. Is it to define RAND_MAX > as 0x7ffffffe ? That would would be more correct. It might have compatibility problems. I checked the values returned by rand(). The ACM part works as intended, so it never returns RAND_MAX. It also never returns 0. So the distribution of values in the documented range [0, RAND_MAX] is very non-uniform. It is uniform in [1, RAND_MAX - 1]. To use this algorithm for rand(), 1 should have been subtracted, giving a range of [0, 0x7ffffffe]. In mathematical terms, the algorithm uses the (multiplicative) group of units in the field Z/(0x7fffffff.Z), but for rand() we want the values to be in the the additive group Z/(0x7ffffffe.Z). Subtracting 1 doesn't preserve the group operation but gives the right set of values. 0x7ffffffff is used because it is prime. 0x800000001, 0xffffffff and 0x100000001 are not prime, so the algorithm can't easily be modified to give the range [0, 0x7fffffff] or a 32-bit range. The most interesting prime near 2**31 or 2*32 is 2**32 - 5. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 16:39:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F0BDADF; Tue, 2 Jul 2013 16:39:13 +0000 (UTC) (envelope-from hrs@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 3CE3618EF; Tue, 2 Jul 2013 16:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62GdD8n002599; Tue, 2 Jul 2013 16:39:13 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62GdDoG002598; Tue, 2 Jul 2013 16:39:13 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307021639.r62GdDoG002598@svn.freebsd.org> From: Hiroki Sato Date: Tue, 2 Jul 2013 16:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252510 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 16:39:13 -0000 Author: hrs Date: Tue Jul 2 16:39:12 2013 New Revision: 252510 URL: http://svnweb.freebsd.org/changeset/base/252510 Log: Fix a panic when leaving MC group in a kernel with VIMAGE enabled. in_leavegroup() is called from an asynchronous task, and igmp_change_state() requires that curvnet is set by the caller. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Jul 2 14:54:18 2013 (r252509) +++ head/sys/netinet/in_mcast.c Tue Jul 2 16:39:12 2013 (r252510) @@ -1236,7 +1236,9 @@ in_leavegroup_locked(struct in_multi *in KASSERT(error == 0, ("%s: failed to merge inm state", __func__)); CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); + CURVNET_SET(inm->inm_ifp->if_vnet); error = igmp_change_state(inm); + CURVNET_RESTORE(); if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 16:49:35 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8295E04; Tue, 2 Jul 2013 16:49:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 368AB1978; Tue, 2 Jul 2013 16:49:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA24641; Tue, 02 Jul 2013 19:49:32 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uu3lj-00057V-W8; Tue, 02 Jul 2013 19:49:32 +0300 Message-ID: <51D30463.50608@FreeBSD.org> Date: Tue, 02 Jul 2013 19:48:35 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Konstantin Belousov Subject: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> In-Reply-To: <201306031736.r53Hain5093431@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 16:49:35 -0000 on 03/06/2013 20:36 Konstantin Belousov said the following: > Author: kib > Date: Mon Jun 3 17:36:43 2013 > New Revision: 251322 > URL: http://svnweb.freebsd.org/changeset/base/251322 > > Log: > Be more generous when donating the current thread time to the owner of > the vnode lock while iterating over the free vnode list. Instead of > yielding, pause for 1 tick. The change is reported to help in some > virtualized environments. Kostik, I've just run into a problem where word "generous" does not seem to be applicable at all unless I am mistaken about how the code works. There is a thread in vdropl() call that has a vnode interlock and want to take vnode_free_list_mtx. Then there is a thread that keeps cycling on the locked interlock while holding vnode_free_list_mtx: #0 cpustop_handler () at /usr/src/sys/amd64/amd64/mp_machdep.c:1391 #1 0xffffffff80cc8e1d in ipi_nmi_handler () at /usr/src/sys/amd64/amd64/mp_machdep.c:1373 #2 0xffffffff80cd6269 in trap (frame=0xffffff80002baf30) at /usr/src/sys/amd64/amd64/trap.c:211 #3 0xffffffff80cbf86f in nmi_calltrap () at /usr/src/sys/amd64/amd64/exception.S:501 #4 0xffffffff80924f22 in _mtx_trylock (m=0xfffffe00236f4c98, opts=0, file=, line=0) at atomic.h:160 #5 0xffffffff809d3e5a in mnt_vnode_next_active (mvp=0xffffff86c95e4958, mp=0xfffffe00118039a8) at /usr/src/sys/kern/vfs_subr.c:4813 #6 0xffffffff809daa86 in vfs_msync (mp=0xfffffe00118039a8, flags=2) at /usr/src/sys/kern/vfs_subr.c:3542 #7 0xffffffff809e06ef in sys_sync (td=, uap=) at /usr/src/sys/kern/vfs_syscalls.c:149 #8 0xffffffff80cd515a in amd64_syscall (td=0xfffffe019d966490, traced=0) at subr_syscall.c:135 #9 0xffffffff80cbf717 in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:387 Now the curious part: (kgdb) p td->td_swvoltick $4 = 0 (kgdb) p td->td_ru.ru_nvcsw $7 = 0 ticks happen to be in negative territory: (kgdb) p ticks $2 = -1946084020 Give this definition: int should_yield(void) { return (ticks - curthread->td_swvoltick >= hogticks); } We see that should_yield() is going to return false until ticks roll over to become positive again. And obviously with the thread spinning on VI_TRYLOCK() it's not going to get its td_swvoltick updated. I am not sure if the originally reported problem was also caused by should_yield() or if it was something else. But in either case I think that we should fix should_yield. Perhaps (ticks - curthread->td_swvoltick) should be cast to unsigned before comparison? > Submitted by: Roger Pau Monn? > Discussed with: jilles > Tested by: pho > MFC after: 2 weeks > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Mon Jun 3 17:36:26 2013 (r251321) > +++ head/sys/kern/vfs_subr.c Mon Jun 3 17:36:43 2013 (r251322) > @@ -4693,7 +4693,7 @@ restart: > if (mp_ncpus == 1 || should_yield()) { > TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); > mtx_unlock(&vnode_free_list_mtx); > - kern_yield(PRI_USER); > + pause("vnacti", 1); > mtx_lock(&vnode_free_list_mtx); > goto restart; > } > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 16:58:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 816C7463; Tue, 2 Jul 2013 16:58:17 +0000 (UTC) (envelope-from hrs@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 737AA1A01; Tue, 2 Jul 2013 16:58:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62GwHph008347; Tue, 2 Jul 2013 16:58:17 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62GwGJI008338; Tue, 2 Jul 2013 16:58:16 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307021658.r62GwGJI008338@svn.freebsd.org> From: Hiroki Sato Date: Tue, 2 Jul 2013 16:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252511 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 16:58:17 -0000 Author: hrs Date: Tue Jul 2 16:58:15 2013 New Revision: 252511 URL: http://svnweb.freebsd.org/changeset/base/252511 Log: - Allow ND6_IFF_AUTO_LINKLOCAL for IFT_BRIDGE. An interface with IFT_BRIDGE is initialized with !ND6_IFF_AUTO_LINKLOCAL && !ND6_IFF_ACCEPT_RTADV regardless of net.inet6.ip6.accept_rtadv and net.inet6.ip6.auto_linklocal. To configure an autoconfigured link-local address (RFC 4862), the following rc.conf(5) configuration can be used: ifconfig_bridge0_ipv6="inet6 auto_linklocal" - if_bridge(4) now removes IPv6 addresses on a member interface to be added when the parent interface or one of the existing member interfaces has an IPv6 address. if_bridge(4) merges each link-local scope zone which the member interfaces form respectively, so it causes address scope violation. Removal of the IPv6 addresses prevents it. - if_lagg(4) now removes IPv6 addresses on a member interfaces unconditionally. - Set reasonable flags to non-IPv6-capable interfaces. [*] Submitted by: rpaulo [*] MFC after: 1 week Modified: head/sys/net/if_bridge.c head/sys/net/if_lagg.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/net/if_bridge.c Tue Jul 2 16:58:15 2013 (r252511) @@ -118,6 +118,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #if defined(INET) || defined(INET6) #include @@ -1041,14 +1042,6 @@ bridge_ioctl_add(struct bridge_softc *sc if (ifs->if_bridge != NULL) return (EBUSY); - bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO); - if (bif == NULL) - return (ENOMEM); - - bif->bif_ifp = ifs; - bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER; - bif->bif_savedcaps = ifs->if_capenable; - switch (ifs->if_type) { case IFT_ETHER: case IFT_L2VLAN: @@ -1056,20 +1049,94 @@ bridge_ioctl_add(struct bridge_softc *sc /* permitted interface types */ break; default: - error = EINVAL; - goto out; + return (EINVAL); } +#ifdef INET6 + /* + * Two valid inet6 addresses with link-local scope must not be + * on the parent interface and the member interfaces at the + * same time. This restriction is needed to prevent violation + * of link-local scope zone. Attempts to add a member + * interface which has inet6 addresses when the parent has + * inet6 triggers removal of all inet6 addresses on the member + * interface. + */ + + /* Check if the parent interface has a link-local scope addr. */ + if (in6ifa_llaonifp(sc->sc_ifp) != NULL) { + /* + * If any, remove all inet6 addresses from the member + * interfaces. + */ + BRIDGE_XLOCK(sc); + LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { + if (in6ifa_llaonifp(bif->bif_ifp)) { + BRIDGE_UNLOCK(sc); + in6_ifdetach(bif->bif_ifp); + BRIDGE_LOCK(sc); + if_printf(sc->sc_ifp, + "IPv6 addresses on %s have been removed " + "before adding it as a member to prevent " + "IPv6 address scope violation.\n", + bif->bif_ifp->if_xname); + } + } + BRIDGE_XDROP(sc); + if (in6ifa_llaonifp(ifs)) { + BRIDGE_UNLOCK(sc); + in6_ifdetach(ifs); + BRIDGE_LOCK(sc); + if_printf(sc->sc_ifp, + "IPv6 addresses on %s have been removed " + "before adding it as a member to prevent " + "IPv6 address scope violation.\n", + ifs->if_xname); + } + } else { + struct in6_ifaddr *ia6_m, *ia6_s; + /* + * If not, check whether one of the existing member + * interfaces have inet6 address. If any, remove + * inet6 addresses on the interface to be added. + */ + BRIDGE_XLOCK(sc); + LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { + ia6_m = in6ifa_llaonifp(bif->bif_ifp); + if (ia6_m != NULL) + break; + } + BRIDGE_XDROP(sc); + ia6_s = in6ifa_llaonifp(ifs); + + if (ia6_m != NULL && ia6_s != NULL) { + BRIDGE_UNLOCK(sc); + in6_ifdetach(ifs); + BRIDGE_LOCK(sc); + if_printf(sc->sc_ifp, "IPv6 addresses on %s have " + "been removed before adding it as a member " + "to prevent IPv6 address scope violation.\n", + ifs->if_xname); + } + } +#endif /* Allow the first Ethernet member to define the MTU */ if (LIST_EMPTY(&sc->sc_iflist)) sc->sc_ifp->if_mtu = ifs->if_mtu; else if (sc->sc_ifp->if_mtu != ifs->if_mtu) { if_printf(sc->sc_ifp, "invalid MTU: %lu(%s) != %lu\n", ifs->if_mtu, ifs->if_xname, sc->sc_ifp->if_mtu); - error = EINVAL; - goto out; + return (EINVAL); } + bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO); + if (bif == NULL) + return (ENOMEM); + + bif->bif_ifp = ifs; + bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER; + bif->bif_savedcaps = ifs->if_capenable; + /* * Assign the interface's MAC address to the bridge if it's the first * member and the MAC address of the bridge has not been changed from @@ -1104,12 +1171,10 @@ bridge_ioctl_add(struct bridge_softc *sc BRIDGE_LOCK(sc); break; } - if (error) - bridge_delete_member(sc, bif, 0); -out: + if (error) { - if (bif != NULL) - free(bif, M_DEVBUF); + bridge_delete_member(sc, bif, 0); + free(bif, M_DEVBUF); } return (error); } @@ -3408,7 +3473,7 @@ bridge_fragment(struct ifnet *ifp, struc continue; } bcopy(eh, mtod(m0, caddr_t), ETHER_HDR_LEN); - } else + } else m_freem(m); } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/net/if_lagg.c Tue Jul 2 16:58:15 2013 (r252511) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include +#include +#include #endif #include @@ -543,6 +545,34 @@ lagg_port_create(struct lagg_softc *sc, if (ifp->if_type != IFT_ETHER) return (EPROTONOSUPPORT); +#ifdef INET6 + /* + * The member interface should not have inet6 address because + * two interfaces with a valid link-local scope zone must not be + * merged in any form. This restriction is needed to + * prevent violation of link-local scope zone. Attempts to + * add a member interface which has inet6 addresses triggers + * removal of all inet6 addresses on the member interface. + */ + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (in6ifa_llaonifp(lp->lp_ifp)) { + in6_ifdetach(lp->lp_ifp); + if_printf(sc->sc_ifp, + "IPv6 addresses on %s have been removed " + "before adding it as a member to prevent " + "IPv6 address scope violation.\n", + lp->lp_ifp->if_xname); + } + } + if (in6ifa_llaonifp(ifp)) { + in6_ifdetach(ifp); + if_printf(sc->sc_ifp, + "IPv6 addresses on %s have been removed " + "before adding it as a member to prevent " + "IPv6 address scope violation.\n", + ifp->if_xname); + } +#endif /* Allow the first Ethernet member to define the MTU */ if (SLIST_EMPTY(&sc->sc_ports)) sc->sc_ifp->if_mtu = ifp->if_mtu; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/netinet6/in6.c Tue Jul 2 16:58:15 2013 (r252511) @@ -1987,6 +1987,32 @@ in6ifa_ifpwithaddr(struct ifnet *ifp, st } /* + * Find a link-local scoped address on ifp and return it if any. + */ +struct in6_ifaddr * +in6ifa_llaonifp(struct ifnet *ifp) +{ + struct sockaddr_in6 *sin6; + struct ifaddr *ifa; + + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) + return (NULL); + if_addr_rlock(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) + break; + } + if_addr_runlock(ifp); + + return ((struct in6_ifaddr *)ifa); +} + +/* * Convert IP6 address to printable (loggable) representation. Caller * has to make sure that ip6buf is at least INET6_ADDRSTRLEN long. */ Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/netinet6/in6_ifattach.c Tue Jul 2 16:58:15 2013 (r252511) @@ -266,6 +266,7 @@ found: /* get EUI64 */ switch (ifp->if_type) { + case IFT_BRIDGE: case IFT_ETHER: case IFT_L2VLAN: case IFT_FDDI: @@ -727,6 +728,8 @@ in6_ifattach(struct ifnet *ifp, struct i switch (ifp->if_type) { case IFT_PFLOG: case IFT_PFSYNC: + ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; + ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED; return; } @@ -734,7 +737,6 @@ in6_ifattach(struct ifnet *ifp, struct i * quirks based on interface type */ switch (ifp->if_type) { -#ifdef IFT_STF case IFT_STF: /* * 6to4 interface is a very special kind of beast. @@ -742,8 +744,8 @@ in6_ifattach(struct ifnet *ifp, struct i * linklocals for 6to4 interface, but there's no use and * it is rather harmful to have one. */ - goto statinit; -#endif + ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; + break; default: break; } @@ -777,8 +779,7 @@ in6_ifattach(struct ifnet *ifp, struct i /* * assign a link-local address, if there's none. */ - if (ifp->if_type != IFT_BRIDGE && - !(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { int error; @@ -795,10 +796,6 @@ in6_ifattach(struct ifnet *ifp, struct i ifa_free(&ia->ia_ifa); } -#ifdef IFT_STF /* XXX */ -statinit: -#endif - /* update dynamically. */ if (V_in6_maxmtu < ifp->if_mtu) V_in6_maxmtu = ifp->if_mtu; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/netinet6/in6_var.h Tue Jul 2 16:58:15 2013 (r252511) @@ -800,6 +800,7 @@ void in6_setmaxmtu(void); int in6_if2idlen(struct ifnet *); struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int); struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *); +struct in6_ifaddr *in6ifa_llaonifp(struct ifnet *); char *ip6_sprintf(char *, const struct in6_addr *); int in6_addr2zoneid(struct ifnet *, struct in6_addr *, u_int32_t *); int in6_matchlen(struct in6_addr *, struct in6_addr *); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Jul 2 16:39:12 2013 (r252510) +++ head/sys/netinet6/nd6.c Tue Jul 2 16:58:15 2013 (r252511) @@ -176,13 +176,25 @@ nd6_ifattach(struct ifnet *ifp) nd->flags = ND6_IFF_PERFORMNUD; - /* A loopback interface always has ND6_IFF_AUTO_LINKLOCAL. */ - if (V_ip6_auto_linklocal || (ifp->if_flags & IFF_LOOPBACK)) + /* A loopback interface always has ND6_IFF_AUTO_LINKLOCAL. + * XXXHRS: Clear ND6_IFF_AUTO_LINKLOCAL on an IFT_BRIDGE interface by + * default regardless of the V_ip6_auto_linklocal configuration to + * give a reasonable default behavior. + */ + if ((V_ip6_auto_linklocal && ifp->if_type != IFT_BRIDGE) || + (ifp->if_flags & IFF_LOOPBACK)) nd->flags |= ND6_IFF_AUTO_LINKLOCAL; - - /* A loopback interface does not need to accept RTADV. */ - if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK)) - nd->flags |= ND6_IFF_ACCEPT_RTADV; + /* + * A loopback interface does not need to accept RTADV. + * XXXHRS: Clear ND6_IFF_ACCEPT_RTADV on an IFT_BRIDGE interface by + * default regardless of the V_ip6_accept_rtadv configuration to + * prevent the interface from accepting RA messages arrived + * on one of the member interfaces with ND6_IFF_ACCEPT_RTADV. + */ + if (V_ip6_accept_rtadv && + !(ifp->if_flags & IFF_LOOPBACK) && + (ifp->if_type != IFT_BRIDGE)) + nd->flags |= ND6_IFF_ACCEPT_RTADV; if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK)) nd->flags |= ND6_IFF_NO_RADR; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:09:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19FBFAA5; Tue, 2 Jul 2013 17:09:58 +0000 (UTC) (envelope-from obrien@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 0AE711ABC; Tue, 2 Jul 2013 17:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62H9vcA012082; Tue, 2 Jul 2013 17:09:57 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62H9vIT012081; Tue, 2 Jul 2013 17:09:57 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307021709.r62H9vIT012081@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 2 Jul 2013 17:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252512 - head/gnu/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:09:58 -0000 Author: obrien Date: Tue Jul 2 17:09:57 2013 New Revision: 252512 URL: http://svnweb.freebsd.org/changeset/base/252512 Log: Make it so that 'patch < FUBAR' and 'patch -i FUBAR' operate the same. The former makes a copy of stdin, but was not accurately putting the content of stdin into a temp file. This lead to the undercounting the number of lines in hunks containing NUL characters when reading from stdin. Thus resulting in "unexpected end of file in patch" errors. Modified: head/gnu/usr.bin/patch/pch.c Modified: head/gnu/usr.bin/patch/pch.c ============================================================================== --- head/gnu/usr.bin/patch/pch.c Tue Jul 2 16:58:15 2013 (r252511) +++ head/gnu/usr.bin/patch/pch.c Tue Jul 2 17:09:57 2013 (r252512) @@ -83,12 +83,17 @@ re_patch(void) void open_patch_file(char *filename) { + int nr, nw; + if (filename == Nullch || !*filename || strEQ(filename, "-")) { pfp = fopen(TMPPATNAME, "w"); if (pfp == Nullfp) pfatal2("can't create %s", TMPPATNAME); - while (fgets(buf, buf_size, stdin) != Nullch) - fputs(buf, pfp); + while ((nr = fread(buf, 1, buf_size, stdin)) > 0) { + nw = fwrite(buf, 1, nr, pfp); + if (nr != nw) + pfatal2("write error to %s", TMPPATNAME); + } Fclose(pfp); filename = TMPPATNAME; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:12:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C1C9CBF; Tue, 2 Jul 2013 17:12:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) by mx1.freebsd.org (Postfix) with ESMTP id 794FD1AF0; Tue, 2 Jul 2013 17:12:56 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id y10so4769209wgg.4 for ; Tue, 02 Jul 2013 10:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4JsQlM5PuByaoem78H4/JBtXL4Uukf9yIZ96peTO8dE=; b=a9DwAKchOz02L9IZyqWW3gtC7Dz3Dei4QPQluSUZ4RCG6obFUuHV2wrkdgJFZkfICv N9Rx0exVTaD3xsAVr+Cf3ezuvvdH4wZea3B8dpgDKwhC9y9XV8qEUJQTmZ4RAzOJSBE3 8oyGJaW9mzsIMBQ2rRgKrnrqQ2vqrNTgxjGVxzgBISZNl8cO2RL7r3LtGsQgprRhnlkz 753ja+BaeILnSTQChHGTOhYyFNM61K308HGdDSYM/xlwIt2KIBAUlqzhl21975J5LU4w PUH7w8SiO7mNYvl+2I/1esUKh6GsTzrl9R9f4rxWUaAEtuZ8vdT3ygVD8AoVSmSSNKtF sohQ== MIME-Version: 1.0 X-Received: by 10.180.211.202 with SMTP id ne10mr16096840wic.39.1372785175593; Tue, 02 Jul 2013 10:12:55 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.194.93.232 with HTTP; Tue, 2 Jul 2013 10:12:55 -0700 (PDT) In-Reply-To: <51D30463.50608@FreeBSD.org> References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> Date: Tue, 2 Jul 2013 19:12:55 +0200 X-Google-Sender-Auth: DlNzQ-9KEjPauUf5M5IgTdeTN9A Message-ID: Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:12:57 -0000 On Tue, Jul 2, 2013 at 6:48 PM, Andriy Gapon wrote: > on 03/06/2013 20:36 Konstantin Belousov said the following: >> Author: kib >> Date: Mon Jun 3 17:36:43 2013 >> New Revision: 251322 >> URL: http://svnweb.freebsd.org/changeset/base/251322 >> >> Log: >> Be more generous when donating the current thread time to the owner of >> the vnode lock while iterating over the free vnode list. Instead of >> yielding, pause for 1 tick. The change is reported to help in some >> virtualized environments. > > Kostik, > > I've just run into a problem where word "generous" does not seem to be > applicable at all unless I am mistaken about how the code works. While "ticks" is signed it is used as an unsigned int. td_swvolticks is always derived by ticks, which again will always be used as an unisgned and then the subtractions among the 2 will be consistent. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:17:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E709D15B; Tue, 2 Jul 2013 17:17:42 +0000 (UTC) (envelope-from obrien@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 D97E71B4A; Tue, 2 Jul 2013 17:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62HHgZ1015025; Tue, 2 Jul 2013 17:17:42 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62HHg9f015024; Tue, 2 Jul 2013 17:17:42 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307021717.r62HHg9f015024@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 2 Jul 2013 17:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252513 - head/gnu/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:17:43 -0000 Author: obrien Date: Tue Jul 2 17:17:42 2013 New Revision: 252513 URL: http://svnweb.freebsd.org/changeset/base/252513 Log: Properly handle input lines containing NUL characters such that pgets() accurately fills the read buffer. Callers of pgets() still mis-process the buffer contents if the read line contains NUL characters, but this at least makes pgets() accurate. Modified: head/gnu/usr.bin/patch/pch.c Modified: head/gnu/usr.bin/patch/pch.c ============================================================================== --- head/gnu/usr.bin/patch/pch.c Tue Jul 2 17:09:57 2013 (r252512) +++ head/gnu/usr.bin/patch/pch.c Tue Jul 2 17:17:42 2013 (r252513) @@ -1181,7 +1181,7 @@ pgets(bool do_indent) indent++; } } - Strncpy(buf, line, len - skipped); + memcpy(buf, line, len - skipped); buf[len - skipped] = '\0'; } return len; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:25:56 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 34E173F6; Tue, 2 Jul 2013 17:25:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D72891BD1; Tue, 2 Jul 2013 17:25:54 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA25251; Tue, 02 Jul 2013 20:25:52 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uu4Ku-0005As-Fc; Tue, 02 Jul 2013 20:25:52 +0300 Message-ID: <51D30CE8.7030803@FreeBSD.org> Date: Tue, 02 Jul 2013 20:24:56 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:25:56 -0000 on 02/07/2013 20:12 Attilio Rao said the following: > While "ticks" is signed it is used as an unsigned int. > td_swvolticks is always derived by ticks, which again will always be > used as an unisgned and then the subtractions among the 2 will be > consistent. So returning to my example where ticks == -1946084020 and td_swvoltick == 0 and (ticks - td->td_swvoltick) == -1946084020. Is this consistent in your opinion? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:34:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C8138AB; Tue, 2 Jul 2013 17:34:35 +0000 (UTC) (envelope-from delphij@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 296F81C4C; Tue, 2 Jul 2013 17:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62HYZwJ020448; Tue, 2 Jul 2013 17:34:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62HYZ0V020447; Tue, 2 Jul 2013 17:34:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307021734.r62HYZ0V020447@svn.freebsd.org> From: Xin LI Date: Tue, 2 Jul 2013 17:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252514 - head/sbin/swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:34:35 -0000 Author: delphij Date: Tue Jul 2 17:34:34 2013 New Revision: 252514 URL: http://svnweb.freebsd.org/changeset/base/252514 Log: Plug a memory leak. Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Tue Jul 2 17:17:42 2013 (r252513) +++ head/sbin/swapon/swapon.c Tue Jul 2 17:34:34 2013 (r252514) @@ -491,6 +491,7 @@ swap_on_off_md(const char *name, char *m if (!qflag) warnx("%s: Device already in use", vnodefile); + free(vnodefile); return (NULL); } error = run_cmd(&fd, "%s -a -t vnode -n -f %s", @@ -498,6 +499,7 @@ swap_on_off_md(const char *name, char *m if (error) { warnx("mdconfig (attach) error: file=%s", vnodefile); + free(vnodefile); return (NULL); } sfd = fdopen(fd, "r"); @@ -537,6 +539,7 @@ swap_on_off_md(const char *name, char *m if (!qflag) warnx("md%d on %s: Device already " "in use", mdunit, vnodefile); + free(vnodefile); return (NULL); } error = run_cmd(NULL, "%s -a -t vnode -u %d -f %s", @@ -544,6 +547,7 @@ swap_on_off_md(const char *name, char *m if (error) { warnx("mdconfig (attach) error: " "md%d on file=%s", mdunit, vnodefile); + free(vnodefile); return (NULL); } } @@ -557,6 +561,7 @@ swap_on_off_md(const char *name, char *m if (!qflag) warnx("md on %s: Device not found", vnodefile); + free(vnodefile); return (NULL); } sfd = fdopen(fd, "r"); @@ -599,6 +604,7 @@ swap_on_off_md(const char *name, char *m if (!qflag) warnx("md%d on %s: Device not found", mdunit, vnodefile); + free(vnodefile); return (NULL); } } @@ -622,6 +628,7 @@ err: fclose(sfd); if (fd != -1) close(fd); + free(vnodefile); return (ret); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:52:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42624E2A; Tue, 2 Jul 2013 17:52:28 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) by mx1.freebsd.org (Postfix) with ESMTP id 5A02E1D0B; Tue, 2 Jul 2013 17:52:27 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id n11so5112211wgh.9 for ; Tue, 02 Jul 2013 10:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=SCdWLb/wG0q8QdtHQr6S0k8HQnao7BPxxuqJC4ED4G8=; b=Y9snN61gJle6lVAvK7NsN2a8UDygqX80d286zEc2RHDlRNMXJ1iM4iaolQBpDmoIek EGQGHq4sJMcq97FrrQg61En52tjQNo+Mgs6ymLKIW4nUea/UTzAQn0da9s8aNir3uEK+ Imp2HRC7aHix+qcBgSRA5AwwWkwuM+7OX51kgB8cuwgDsOZ6S8dlbK2+sLI7eweY33Qp SYAlsS8UFbtVmumv6LdwO765OVw/UYbWF9XHju0nq5AE/ttD0wpq9BJCfeqNPN+cy3Zi oxjctUpTPmfyHmTNzL0rRMkM4myzP7SxVRrgYrlN/aE8MT1h0pRmE6LWzPdpeXNGsay8 TbBw== MIME-Version: 1.0 X-Received: by 10.194.122.71 with SMTP id lq7mr23955090wjb.77.1372787546278; Tue, 02 Jul 2013 10:52:26 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.194.93.232 with HTTP; Tue, 2 Jul 2013 10:52:26 -0700 (PDT) In-Reply-To: <51D30CE8.7030803@FreeBSD.org> References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D30CE8.7030803@FreeBSD.org> Date: Tue, 2 Jul 2013 19:52:26 +0200 X-Google-Sender-Auth: HWommTtTBzKQCUv7Q8BoB0MUuqY Message-ID: Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:52:28 -0000 On Tue, Jul 2, 2013 at 7:24 PM, Andriy Gapon wrote: > on 02/07/2013 20:12 Attilio Rao said the following: >> While "ticks" is signed it is used as an unsigned int. >> td_swvolticks is always derived by ticks, which again will always be >> used as an unisgned and then the subtractions among the 2 will be >> consistent. > > So returning to my example where ticks == -1946084020 and td_swvoltick == 0 and > (ticks - td->td_swvoltick) == -1946084020. Is this consistent in your opinion? I was just pointing out that the real bug is not in the subtraction itself but on the hogticks comparison. This is because hogticks is not an absolute measurement but it represents really a ticks difference. In my opinion we should define hogticks as an unsigned int and add a small comment saying that it is a differential. This will fix the issue. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 17:59:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 161E7163; Tue, 2 Jul 2013 17:59:44 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3DB1D47; Tue, 2 Jul 2013 17:59:43 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id k14so3873609qcv.20 for ; Tue, 02 Jul 2013 10:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ot8eoHa7Okd5NVdSvynTd3++9Nr9m+LysBuFyv8y5E8=; b=fABWGI1SRs8Io+mDsPqlz13U3HT8kOK15urId0R6O6vrxMA2lvA36p1pWA1wHzckgC d2l290AUw1oA8pKoZzEI/vOYwRrzp9UYCNvjIDxwZcaLTBq8UgZk4O1/0NpypuQHqc3T JaMe6+SYKqLJgwquiEI09V5SLzzI3XY/sCyltz9Ezc8oqlBKFsWdZRV9jMWA1VIUsupP ir2Elk7T/4K4teCWZtK8XyEV9TuqlGxvvO2Wk7bHXvG3ipdYCrJRWI6NdRDk73XqB1lk IW/zcZXmFZul5nC3xZwGND/en4CB9MQ+kbuyf61rUP81D3hPjk9n9BEFNe/7tYvHc/tN zyCw== MIME-Version: 1.0 X-Received: by 10.49.105.97 with SMTP id gl1mr39996822qeb.76.1372787983166; Tue, 02 Jul 2013 10:59:43 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.224.209.6 with HTTP; Tue, 2 Jul 2013 10:59:43 -0700 (PDT) In-Reply-To: <51D30463.50608@FreeBSD.org> References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> Date: Tue, 2 Jul 2013 13:59:43 -0400 X-Google-Sender-Auth: Aw-grtIPFEotE5D8fjMQYlIJVHE Message-ID: Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] From: Ed Maste To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 17:59:44 -0000 On 2 July 2013 12:48, Andriy Gapon wrote: > I am not sure if the originally reported problem was also caused by > should_yield() or if it was something else. But in either case I think that we > should fix should_yield. Perhaps (ticks - curthread->td_swvoltick) should be > cast to unsigned before comparison? What about just initializing td_swvoltick to ticks at td creation? From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 18:09:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 866D03D5; Tue, 2 Jul 2013 18:09:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4CF1D9F; Tue, 2 Jul 2013 18:09:34 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA25959; Tue, 02 Jul 2013 21:09:33 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uu51A-0005Ek-Uf; Tue, 02 Jul 2013 21:09:32 +0300 Message-ID: <51D31724.6090807@FreeBSD.org> Date: Tue, 02 Jul 2013 21:08:36 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D30CE8.7030803@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:09:36 -0000 on 02/07/2013 20:52 Attilio Rao said the following: > I was just pointing out that the real bug is not in the subtraction > itself but on the hogticks comparison. > This is because hogticks is not an absolute measurement but it > represents really a ticks difference. > In my opinion we should define hogticks as an unsigned int and add a > small comment saying that it is a differential. > This will fix the issue. I think that my original suggestion is equivalently well if not more obvious. This is a common knowledge: http://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution distance = (signed)( i1 - i2 ) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 18:12:13 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E8345ED; Tue, 2 Jul 2013 18:12:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 12DAE1DD0; Tue, 2 Jul 2013 18:12:11 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA25999; Tue, 02 Jul 2013 21:12:04 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uu53b-0005FB-Sb; Tue, 02 Jul 2013 21:12:03 +0300 Message-ID: <51D317BC.9020204@FreeBSD.org> Date: Tue, 02 Jul 2013 21:11:08 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ed Maste Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:12:13 -0000 on 02/07/2013 20:59 Ed Maste said the following: > On 2 July 2013 12:48, Andriy Gapon wrote: >> I am not sure if the originally reported problem was also caused by >> should_yield() or if it was something else. But in either case I think that we >> should fix should_yield. Perhaps (ticks - curthread->td_swvoltick) should be >> cast to unsigned before comparison? > > What about just initializing td_swvoltick to ticks at td creation? I like this idea. Still I think that distance between two wrapping numbers should be calculated properly even if that mostly would not matter in practice. distance = (signed)( i1 - i2 ) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 18:45:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7343C5D; Tue, 2 Jul 2013 18:45:38 +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 C9B371F22; Tue, 2 Jul 2013 18:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62Ijcao041063; Tue, 2 Jul 2013 18:45:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Ijc4S041062; Tue, 2 Jul 2013 18:45:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307021845.r62Ijc4S041062@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 2 Jul 2013 18:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252515 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:45:38 -0000 Author: pfg Date: Tue Jul 2 18:45:37 2013 New Revision: 252515 URL: http://svnweb.freebsd.org/changeset/base/252515 Log: Style fix: spaces. Cleanup the incomplete revert. Reported by: bde MFC after: 4 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Jul 2 17:34:34 2013 (r252514) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Jul 2 18:45:37 2013 (r252515) @@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags * already have one. This should only happen on old filesystems. */ if (ip->i_gen == 0) { - ip->i_gen = arc4random()/2 + 1; + ip->i_gen = arc4random() / 2 + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen); From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 18:54:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53FB9EA0; Tue, 2 Jul 2013 18:54:40 +0000 (UTC) (envelope-from trociny@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 44F951F70; Tue, 2 Jul 2013 18:54:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62IsepN043714; Tue, 2 Jul 2013 18:54:40 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Isd20043711; Tue, 2 Jul 2013 18:54:39 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021854.r62Isd20043711@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 18:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252516 - head/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:54:40 -0000 Author: trociny Date: Tue Jul 2 18:54:39 2013 New Revision: 252516 URL: http://svnweb.freebsd.org/changeset/base/252516 Log: Add a mib for worker process ID. MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Tue Jul 2 18:45:37 2013 (r252515) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Tue Jul 2 18:54:39 2013 (r252516) @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY REVISION "201304130000Z" DESCRIPTION "Initial revision." + REVISION "201307010000Z" + DESCRIPTION + "Added hastResourceWorkerPid." ::= { begemot 220 } begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } @@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE { hastResourceReadErrors Counter64, hastResourceWriteErrors Counter64, hastResourceDeleteErrors Counter64, - hastResourceFlushErrors Counter64 + hastResourceFlushErrors Counter64, + hastResourceWorkerPid INTEGER } hastResourceIndex OBJECT-TYPE @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE "Count of resource local flush operations that failed." ::= { hastResourceEntry 21 } +hastResourceWorkerPid OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "Worker process ID." + ::= { hastResourceEntry 22 } + END Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Tue Jul 2 18:45:37 2013 (r252515) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Tue Jul 2 18:54:39 2013 (r252516) @@ -78,6 +78,7 @@ struct hast_snmp_resource { uint64_t write_errors; uint64_t delete_errors; uint64_t flush_errors; + pid_t workerpid; }; static TAILQ_HEAD(, hast_snmp_resource) resources = @@ -343,6 +344,7 @@ update_resources(void) nv_get_uint64(nvout, "stat_delete_error%u", i); res->flush_errors = nv_get_uint64(nvout, "stat_flush_error%u", i); + res->workerpid = nv_get_int32(nvout, "workerpid%u", i); TAILQ_INSERT_TAIL(&resources, res, link); } nv_free(nvout); @@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context case LEAF_hastResourceFlushErrors: value->v.counter64 = res->flush_errors; break; + case LEAF_hastResourceWorkerPid: + value->v.integer = res->workerpid; + break; default: ret = SNMP_ERR_RES_UNAVAIL; break; Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Tue Jul 2 18:45:37 2013 (r252515) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Tue Jul 2 18:54:39 2013 (r252516) @@ -59,6 +59,7 @@ (19 hastResourceWriteErrors COUNTER64 GET) (20 hastResourceDeleteErrors COUNTER64 GET) (21 hastResourceFlushErrors COUNTER64 GET) + (22 hastResourceWorkerPid INTEGER GET) ) ) ) From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:27:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8543F876; Tue, 2 Jul 2013 19:27:08 +0000 (UTC) (envelope-from trociny@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 5CBBE10A8; Tue, 2 Jul 2013 19:27:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JR8PX057163; Tue, 2 Jul 2013 19:27:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JR8Na057161; Tue, 2 Jul 2013 19:27:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021927.r62JR8Na057161@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:27:08 +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: r252517 - stable/9/sbin/hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:27:08 -0000 Author: trociny Date: Tue Jul 2 19:27:07 2013 New Revision: 252517 URL: http://svnweb.freebsd.org/changeset/base/252517 Log: MFC r248294, r248296: r248294 (pjd): Delete requests can be larger than MAXPHYS. r248296 (pjd): Minor corrections. Modified: stable/9/sbin/hastd/hastd.8 stable/9/sbin/hastd/secondary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/hastd.8 ============================================================================== --- stable/9/sbin/hastd/hastd.8 Tue Jul 2 18:54:39 2013 (r252516) +++ stable/9/sbin/hastd/hastd.8 Tue Jul 2 19:27:07 2013 (r252517) @@ -51,7 +51,7 @@ Only one machine (cluster node) can acti This machine is called primary. The .Nm -daemon operates on block level, which makes it transparent for file +daemon operates on block level, which makes it transparent to file systems and applications. .Pp There is one main @@ -68,7 +68,7 @@ The exact format is: hastd: () .Ed .Pp -When (and only when) +If (and only if) .Nm operates in primary role for the given resource, corresponding .Pa /dev/hast/ @@ -77,8 +77,8 @@ File systems and applications can use th requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and synchronously replicated -to the remote (secondary) node if it is available. +is send to local component and replicated to the remote (secondary) node if it +is available. Read operations .Dv ( BIO_READ ) are handled locally unless I/O error occurs or local version of the data Modified: stable/9/sbin/hastd/secondary.c ============================================================================== --- stable/9/sbin/hastd/secondary.c Tue Jul 2 18:54:39 2013 (r252516) +++ stable/9/sbin/hastd/secondary.c Tue Jul 2 19:27:07 2013 (r252517) @@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, str hio->hio_error = EINVAL; goto end; } - if (hio->hio_length > MAXPHYS) { + if (hio->hio_cmd != HIO_DELETE && hio->hio_length > MAXPHYS) { pjdlog_error("Data length is too large (%ju > %ju).", (uintmax_t)hio->hio_length, (uintmax_t)MAXPHYS); hio->hio_error = EINVAL; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:28:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4AA4F9D8 for ; Tue, 2 Jul 2013 19:28:10 +0000 (UTC) (envelope-from florent@peterschmitt.fr) Received: from peterschmitt.fr (peterschmitt.fr [5.135.177.31]) by mx1.freebsd.org (Postfix) with ESMTP id 166E810B5 for ; Tue, 2 Jul 2013 19:28:09 +0000 (UTC) Received: from localhost.localdomain (4ab54-4-88-163-248-31.fbx.proxad.net [88.163.248.31]) by peterschmitt.fr (Postfix) with ESMTPSA id 6C1CA667A for ; Tue, 2 Jul 2013 21:28:04 +0200 (CEST) Message-ID: <51D329BB.7010000@peterschmitt.fr> Date: Tue, 02 Jul 2013 21:27:55 +0200 From: Florent Peterschmitt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r252514 - head/sbin/swapon References: <201307021734.r62HYZ0V020447@svn.freebsd.org> In-Reply-To: <201307021734.r62HYZ0V020447@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2BUHAFIJVVTGUGVTAARLJ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:28:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BUHAFIJVVTGUGVTAARLJ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Le 02/07/2013 19:34, Xin LI a =E9crit : > Author: delphij > Date: Tue Jul 2 17:34:34 2013 > New Revision: 252514 > URL: http://svnweb.freebsd.org/changeset/base/252514 >=20 > Log: > Plug a memory leak. >=20 > Modified: > head/sbin/swapon/swapon.c >=20 > Modified: head/sbin/swapon/swapon.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/swapon/swapon.c Tue Jul 2 17:17:42 2013 (r252513) > +++ head/sbin/swapon/swapon.c Tue Jul 2 17:34:34 2013 (r252514) Hi, Wouldn't be simpler to do a "goto" somewhere in the code to do the free() and return(NULL) instead of copying those instructions at each cas= e ? It's just a question. --=20 Florent Peterschmitt | Please: florent@peterschmitt.fr | * Avoid HTML/RTF in E-mail. +33 (0)6 64 33 97 92 | * Send PDF for documents. http://florent.peterschmitt.fr | Thank you :) ------enig2BUHAFIJVVTGUGVTAARLJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJR0ym/AAoJEMtO2Sol0IIm7kcH/3qkD2CqZC8jW/a5iLgnGHm7 JjgwmzxYbo4LHVRQBziAV7JuRdijzuUyxSdi1eXUGOT/0MbU5IjVbp2NTFXWGx7t LZD8m2MaxCAFvPKtEgNPi8CfPCZAi9p9nSZamsHrlIY6GBV4bdPdUbw9CxeCxHqT sjR6Ijq3Y9W+ZVC1oubMi1/aPpKMK0z8htZ8YdquUMO8y4js4DfNhWhACu4N6pwT xLyQQPdIZ8jiUbcmGnG+Bh587p2EFpylcyyF6XL4q7i2Mzhzo3hTz8YKmDEL+8+j 6vaphckkOuPvN386DEHteOJNkfdyPQDAVGXwYkf80mw9X+Ik8i4rTAzPqQQjhsQ= =fceF -----END PGP SIGNATURE----- ------enig2BUHAFIJVVTGUGVTAARLJ-- From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:28:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C1089DB; Tue, 2 Jul 2013 19:28:17 +0000 (UTC) (envelope-from trociny@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 7429710B7; Tue, 2 Jul 2013 19:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JSHxb057365; Tue, 2 Jul 2013 19:28:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JSHti057363; Tue, 2 Jul 2013 19:28:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021928.r62JSHti057363@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252518 - stable/8/sbin/hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:28:17 -0000 Author: trociny Date: Tue Jul 2 19:28:16 2013 New Revision: 252518 URL: http://svnweb.freebsd.org/changeset/base/252518 Log: MFC r248294, r248296: r248294 (pjd): Delete requests can be larger than MAXPHYS. r248296 (pjd): Minor corrections. Modified: stable/8/sbin/hastd/hastd.8 stable/8/sbin/hastd/secondary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.8 ============================================================================== --- stable/8/sbin/hastd/hastd.8 Tue Jul 2 19:27:07 2013 (r252517) +++ stable/8/sbin/hastd/hastd.8 Tue Jul 2 19:28:16 2013 (r252518) @@ -51,7 +51,7 @@ Only one machine (cluster node) can acti This machine is called primary. The .Nm -daemon operates on block level, which makes it transparent for file +daemon operates on block level, which makes it transparent to file systems and applications. .Pp There is one main @@ -68,7 +68,7 @@ The exact format is: hastd: () .Ed .Pp -When (and only when) +If (and only if) .Nm operates in primary role for the given resource, corresponding .Pa /dev/hast/ @@ -77,8 +77,8 @@ File systems and applications can use th requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and synchronously replicated -to the remote (secondary) node if it is available. +is send to local component and replicated to the remote (secondary) node if it +is available. Read operations .Dv ( BIO_READ ) are handled locally unless I/O error occurs or local version of the data Modified: stable/8/sbin/hastd/secondary.c ============================================================================== --- stable/8/sbin/hastd/secondary.c Tue Jul 2 19:27:07 2013 (r252517) +++ stable/8/sbin/hastd/secondary.c Tue Jul 2 19:28:16 2013 (r252518) @@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, str hio->hio_error = EINVAL; goto end; } - if (hio->hio_length > MAXPHYS) { + if (hio->hio_cmd != HIO_DELETE && hio->hio_length > MAXPHYS) { pjdlog_error("Data length is too large (%ju > %ju).", (uintmax_t)hio->hio_length, (uintmax_t)MAXPHYS); hio->hio_error = EINVAL; From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:29:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7798B7B; Tue, 2 Jul 2013 19:29:00 +0000 (UTC) (envelope-from trociny@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 95E7110C0; Tue, 2 Jul 2013 19:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JT0Kj057473; Tue, 2 Jul 2013 19:29:00 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JT0Rl057472; Tue, 2 Jul 2013 19:29:00 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021929.r62JT0Rl057472@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:29: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: r252519 - stable/9/sbin/hastctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:29:00 -0000 Author: trociny Date: Tue Jul 2 19:29:00 2013 New Revision: 252519 URL: http://svnweb.freebsd.org/changeset/base/252519 Log: MFC r248286 (pjd): Removed redundant includes. Modified: stable/9/sbin/hastctl/hastctl.c Directory Properties: stable/9/sbin/hastctl/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Tue Jul 2 19:28:16 2013 (r252518) +++ stable/9/sbin/hastctl/hastctl.c Tue Jul 2 19:29:00 2013 (r252519) @@ -31,21 +31,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:29:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31444CE5; Tue, 2 Jul 2013 19:29:46 +0000 (UTC) (envelope-from trociny@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 2378910CE; Tue, 2 Jul 2013 19:29:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JTkox057604; Tue, 2 Jul 2013 19:29:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JTkvR057603; Tue, 2 Jul 2013 19:29:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021929.r62JTkvR057603@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252520 - stable/8/sbin/hastctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:29:46 -0000 Author: trociny Date: Tue Jul 2 19:29:45 2013 New Revision: 252520 URL: http://svnweb.freebsd.org/changeset/base/252520 Log: MFC r248286 (pjd): Removed redundant includes. Modified: stable/8/sbin/hastctl/hastctl.c Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Tue Jul 2 19:29:00 2013 (r252519) +++ stable/8/sbin/hastctl/hastctl.c Tue Jul 2 19:29:45 2013 (r252520) @@ -31,21 +31,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:33:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1127CEFC; Tue, 2 Jul 2013 19:33:20 +0000 (UTC) (envelope-from gavin@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 038C710FD; Tue, 2 Jul 2013 19:33:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JXJIR059763; Tue, 2 Jul 2013 19:33:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JXJfI059760; Tue, 2 Jul 2013 19:33:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307021933.r62JXJfI059760@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 2 Jul 2013 19:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252521 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:33:20 -0000 Author: gavin Date: Tue Jul 2 19:33:19 2013 New Revision: 252521 URL: http://svnweb.freebsd.org/changeset/base/252521 Log: Take into safekeeping the following bits: anchie, ariff, daichi, darrenr, dd, eivind, flz, green, hmp, iedowse, jls, kmacy, kris, le, luoqi, markus, mbr, mlaier, motoyuki, mpp, mr, nork, pb, peadar, rik, rodrigc, rse, sam, sepotvin, simokawa, sson, ssouhlal, suz, syrinx, tanimura, ticso, weongyo, wes, wpaul. All have been idle in the src tree for some time, and have not responded to emails asking whether they are likely to become active again and so wish to retain their commit bit. Remove them, and entries from conf/mentors where necessary. Thank you all for all your work in the past, and feel free to request your commit bit back should you find yourself able to contribute again in the future. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Jul 2 19:29:45 2013 (r252520) +++ svnadmin/conf/access Tue Jul 2 19:33:19 2013 (r252521) @@ -25,12 +25,10 @@ akiyama alc alfred ambrisko -anchie andre andreast andrew antoine -ariff asomers attilio avatar @@ -54,15 +52,12 @@ cperciva cracauer csjp cy -daichi -darrenr das davidch davidcs davide davidxu dchagin -dd deischen delphij des @@ -75,7 +70,6 @@ dwmalone dwmalone=freebsd-committers@mat eadler ed edwin -eivind emaste emax eri @@ -83,7 +77,6 @@ erwin fabient fanf fjoe -flz gabor gad gallatin @@ -96,17 +89,14 @@ gleb glebius gnn gonzo -green grehan grog gshapiro freebsd-cvs-committers@g.gshapiro.net harti hiren -hmp hrs hselasky ian -iedowse imp ivoras iwasaki @@ -124,7 +114,6 @@ jilles jimharris jkim jlh -jls jmallett jmg joerg freebsd-devel@uriah.heep.sax.de @@ -140,21 +129,15 @@ kensmith kevlo kib kientzle -kmacy -kris kuriyama -le lstewart luigi -luoqi marcel marius markj markm -markus mav maxim -mbr mckay mckusick mdf @@ -162,24 +145,17 @@ melifaro miwi mjacob mjg -mlaier mm monthadar -motoyuki mp -mpp -mr n_hibma devnull neel netchild -nork np nwhitehorn nyan obrien oleg -pb -peadar peter peter@wemm.org peterj pfg @@ -194,45 +170,33 @@ raj ray rdivacky remko -rik rmacklem rmh rnoland roberto -rodrigc rpaulo rrs -rse rstone ru rwatson bb+lists.freebsd.cvs-committers@cyrus.watson.org -sam sanpei sbruno scf schweikh scottl se -sepotvin silby -simokawa simon sjg smh sobomax -sson -ssouhlal stas stefanf -suz -syrinx syuu takawata -tanimura theraven thomas thompsa -ticso tijl trasz trhodes @@ -244,12 +208,9 @@ ups ups_old@stups.com uqs vanhu versus -weongyo -wes will wkoszek wollman -wpaul yongari zec zont Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jul 2 19:29:45 2013 (r252520) +++ svnadmin/conf/mentors Tue Jul 2 19:33:19 2013 (r252521) @@ -11,7 +11,6 @@ # Mentee Mentor Optional comment achim scottl Co-mentor: emaste -anchie bz asomers ken Co-mentor: gibbs, will benl philip Co-mentor: simon carl jimharris @@ -26,7 +25,6 @@ jonathan rwatson jwd rmacklem miwi rwatson monthadar adrian -nork imp peterj jhb Co-mentor: grog snb dwmalone versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:35:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 70672297; Tue, 2 Jul 2013 19:35:05 +0000 (UTC) (envelope-from andrew@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 624C71118; Tue, 2 Jul 2013 19:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JZ5Qh060092; Tue, 2 Jul 2013 19:35:05 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JZ5qS060091; Tue, 2 Jul 2013 19:35:05 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307021935.r62JZ5qS060091@svn.freebsd.org> From: Andrew Turner Date: Tue, 2 Jul 2013 19:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252522 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:35:05 -0000 Author: andrew Date: Tue Jul 2 19:35:04 2013 New Revision: 252522 URL: http://svnweb.freebsd.org/changeset/base/252522 Log: Enable VFP on Raspberry Pi. This has worked as of r251712. Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Jul 2 19:33:19 2013 (r252521) +++ head/sys/arm/conf/RPI-B Tue Jul 2 19:35:04 2013 (r252522) @@ -120,3 +120,6 @@ options FDT # handed to kernel via U-Boot and ubldr. #options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rpi.dts + +device vfp # vfp/neon +options ARM_VFP_SUPPORT # vfp/neon From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:42:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 551136A8; Tue, 2 Jul 2013 19:42:48 +0000 (UTC) (envelope-from delphij@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 47FF0119C; Tue, 2 Jul 2013 19:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JgmKU062797; Tue, 2 Jul 2013 19:42:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Jgmqj062796; Tue, 2 Jul 2013 19:42:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307021942.r62Jgmqj062796@svn.freebsd.org> From: Xin LI Date: Tue, 2 Jul 2013 19:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252523 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:42:48 -0000 Author: delphij Date: Tue Jul 2 19:42:47 2013 New Revision: 252523 URL: http://svnweb.freebsd.org/changeset/base/252523 Log: When listing with -f, skip all memory disks that are not vnode-backed. Noticed by: kevlo MFC after: 3 days Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Tue Jul 2 19:35:04 2013 (r252522) +++ head/sbin/mdconfig/mdconfig.c Tue Jul 2 19:42:47 2013 (r252523) @@ -450,7 +450,8 @@ md_list(const char *units, int opt, cons continue; else ffound = 1; - } + } else if (fflag != NULL) + continue; if (nflag && strncmp(pp->lg_name, MD_NAME, 2) == 0) printf("%s", pp->lg_name + 2); else From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:44:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FC3C90C; Tue, 2 Jul 2013 19:44:03 +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 1199C11B0; Tue, 2 Jul 2013 19:44:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62Ji2J0063025; Tue, 2 Jul 2013 19:44:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Ji2d3063024; Tue, 2 Jul 2013 19:44:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307021944.r62Ji2d3063024@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Jul 2013 19:44:02 +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: r252524 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:44:03 -0000 Author: mm Date: Tue Jul 2 19:44:02 2013 New Revision: 252524 URL: http://svnweb.freebsd.org/changeset/base/252524 Log: MFC r252380: Unbreak "zfs jail" and "zfs unjail" (broken in stable/9 since r249643) I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's with the new zfs_ioctl_register_legacy() function. These operations do not modify pools or datasets so there is no need to log them to pool history. Reported by: Alexander Leidinger on current@ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:42:47 2013 (r252523) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:44:02 2013 (r252524) @@ -5575,6 +5575,13 @@ zfs_ioctl_init(void) zfs_ioctl_register_dataset_nolog(ZFS_IOC_TMP_SNAPSHOT, zfs_ioc_tmp_snapshot, zfs_secpolicy_tmp_snapshot, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); + +#ifdef __FreeBSD__ + zfs_ioctl_register_dataset_nolog(ZFS_IOC_JAIL, zfs_ioc_jail, + zfs_secpolicy_config, POOL_CHECK_NONE); + zfs_ioctl_register_dataset_nolog(ZFS_IOC_UNJAIL, zfs_ioc_unjail, + zfs_secpolicy_config, POOL_CHECK_NONE); +#endif } int From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 19:45:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A552A5E; Tue, 2 Jul 2013 19:45:15 +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 1C8BD11C8; Tue, 2 Jul 2013 19:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JjEYj063262; Tue, 2 Jul 2013 19:45:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JjEMd063261; Tue, 2 Jul 2013 19:45:14 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307021945.r62JjEMd063261@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Jul 2013 19:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252525 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 19:45:15 -0000 Author: mm Date: Tue Jul 2 19:45:14 2013 New Revision: 252525 URL: http://svnweb.freebsd.org/changeset/base/252525 Log: MFC r252380: Unbreak "zfs jail" and "zfs unjail" (broken in stable/8 since r251757) I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's with the new zfs_ioctl_register_legacy() function. These operations do not modify pools or datasets so there is no need to log them to pool history. Reported by: Alexander Leidinger on current@ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:44:02 2013 (r252524) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:45:14 2013 (r252525) @@ -5575,6 +5575,13 @@ zfs_ioctl_init(void) zfs_ioctl_register_dataset_nolog(ZFS_IOC_TMP_SNAPSHOT, zfs_ioc_tmp_snapshot, zfs_secpolicy_tmp_snapshot, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); + +#ifdef __FreeBSD__ + zfs_ioctl_register_dataset_nolog(ZFS_IOC_JAIL, zfs_ioc_jail, + zfs_secpolicy_config, POOL_CHECK_NONE); + zfs_ioctl_register_dataset_nolog(ZFS_IOC_UNJAIL, zfs_ioc_unjail, + zfs_secpolicy_config, POOL_CHECK_NONE); +#endif } int From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 20:17:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F760456 for ; Tue, 2 Jul 2013 20:17:53 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx1.freebsd.org (Postfix) with ESMTP id 04A751321 for ; Tue, 2 Jul 2013 20:17:52 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fs12so6056903lab.12 for ; Tue, 02 Jul 2013 13:17:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type:x-gm-message-state; bh=F9Zxb2Zj0WO4Fd6B2ViF2FCgIPhfZYeJIxJAXPcdU7g=; b=g3iFbfmqPAsd2BDtbKRS6wMvkgXf8t7abM9u/qHdGa9wqVk3kqDdLRY0L9mJaYaMmn MSoJmNDYgCGNuWBWHeLN/cpx1TzfsJ9TyjUwaegrK0pAN6gt+h5UpdzvU3UOLzoncCpN e+KRvEpyW3h+dkD3/Ncd9VTn5DkixTtctXXf//zCQITe+FTcVuaqCougo9B3Cb+BTuqk 1rc69ADcR7S1mKd4AcIUANW8aNpY5UJW9l02CHSrYacgeZkprTUledkjXghsRWX9d4AO bIO80AS1l0ZNbRx8Va6t5zIakvOga9UoyTrCrT/GXnYw50HAXrwPep6kajQEm4tu+5jD msoA== X-Received: by 10.112.159.169 with SMTP id xd9mr14648379lbb.43.1372796271201; Tue, 02 Jul 2013 13:17:51 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id p10sm9645739lap.8.2013.07.02.13.17.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 13:17:50 -0700 (PDT) Message-ID: <51D33552.1030208@freebsd.org> Date: Wed, 03 Jul 2013 00:17:22 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: RAND_MAX broken References: <201307012143.r61Lhemi067176@svn.freebsd.org> <20130702130818.V865@besplex.bde.org> <20130702165642.X1571@besplex.bde.org> <51D2F571.8050108@freebsd.org> <20130703020550.E8632@besplex.bde.org> In-Reply-To: <20130703020550.E8632@besplex.bde.org> OpenPGP: id=964474DD Content-Type: multipart/mixed; boundary="------------010001020809020802050200" X-Gm-Message-State: ALoCoQmleE6X3f2Zn6qy4DkqjqAdS1d+szZ7Jw0DzX/aBrKPWJlCkK0nfrnssr0Bs40ATrJKVp/z Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 20:17:53 -0000 This is a multi-part message in MIME format. --------------010001020809020802050200 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 02.07.2013 20:33, Bruce Evans wrote: > I checked the values returned by rand(). The ACM part works as > intended, so it never returns RAND_MAX. It also never returns 0. So > the distribution of values in the documented range [0, RAND_MAX] is > very non-uniform. It is uniform in [1, RAND_MAX - 1]. To use this > algorithm for rand(), 1 should have been subtracted, giving a range > of [0, 0x7ffffffe]. Do you mean [0, 0x7ffffffd] (assuming 1 subtracted)? See attached patch. I don't see compatibility problems at least from POSIX specs point of view - they don't say something specific about RAND_MAX. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N --------------010001020809020802050200 Content-Type: text/plain; charset=windows-1251; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" --- stdlib.h.bak 2013-07-03 00:08:25.000000000 +0400 +++ stdlib.h 2013-07-03 00:10:17.000000000 +0400 @@ -69,7 +69,7 @@ #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -#define RAND_MAX 0x7fffffff +#define RAND_MAX 0x7ffffffd __BEGIN_DECLS #ifdef _XLOCALE_H_ --- rand.c.bak 2013-07-03 00:08:00.000000000 +0400 +++ rand.c 2013-07-03 00:11:33.000000000 +0400 @@ -75,7 +75,8 @@ x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - return ((*ctx = x) % ((u_long)RAND_MAX + 1)); + *ctx = x; + return (x - 1); #endif /* !USE_WEAK_SEEDING */ } --------------010001020809020802050200-- From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 20:25:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BB480832; Tue, 2 Jul 2013 20:25: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 ADA8D137D; Tue, 2 Jul 2013 20:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62KPwDL075831; Tue, 2 Jul 2013 20:25:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62KPwY0075830; Tue, 2 Jul 2013 20:25:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201307022025.r62KPwY0075830@svn.freebsd.org> From: Eitan Adler Date: Tue, 2 Jul 2013 20:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252526 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 20:25:58 -0000 Author: eadler Date: Tue Jul 2 20:25:58 2013 New Revision: 252526 URL: http://svnweb.freebsd.org/changeset/base/252526 Log: Remove extranious '.' Submitted by: swildner@DragonflyBSD.org Modified: head/share/man/man4/oce.4 Modified: head/share/man/man4/oce.4 ============================================================================== --- head/share/man/man4/oce.4 Tue Jul 2 19:45:14 2013 (r252525) +++ head/share/man/man4/oce.4 Tue Jul 2 20:25:58 2013 (r252526) @@ -91,7 +91,7 @@ Firmware can be updated by following the .It Copy the below code to a Makefile: .Bd -literal -offset indent -\&.KMOD=elxflash +KMOD=elxflash FIRMWS=imagename.ufi:elxflash \&.include .Ed From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 21:07:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59BB3418; Tue, 2 Jul 2013 21:07:09 +0000 (UTC) (envelope-from mckusick@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 321FF170D; Tue, 2 Jul 2013 21:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62L79HZ087840; Tue, 2 Jul 2013 21:07:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62L786A087838; Tue, 2 Jul 2013 21:07:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201307022107.r62L786A087838@svn.freebsd.org> From: Kirk McKusick Date: Tue, 2 Jul 2013 21:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252527 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 21:07:09 -0000 Author: mckusick Date: Tue Jul 2 21:07:08 2013 New Revision: 252527 URL: http://svnweb.freebsd.org/changeset/base/252527 Log: Make better use of metadata area by avoiding using it for data blocks that no should no longer immediately follow their indirect blocks. MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Jul 2 20:25:58 2013 (r252526) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Jul 2 21:07:08 2013 (r252527) @@ -1710,7 +1710,7 @@ ffs_alloccgblk(ip, bp, bpref, size) cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); if (bpref == 0) { - bpref = cgp->cg_rotor; + bpref = cgbase(fs, cgp->cg_cgx) + cgp->cg_rotor + fs->fs_frag; } else if ((cgbpref = dtog(fs, bpref)) != cgp->cg_cgx) { /* map bpref to correct zone in this cg */ if (bpref < cgdata(fs, cgbpref)) Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Jul 2 20:25:58 2013 (r252526) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Jul 2 21:07:08 2013 (r252527) @@ -299,6 +299,10 @@ retry: continue; } UFS_LOCK(ump); + /* + * If parent indirect has just been allocated, try to cluster + * immediately following it. + */ if (pref == 0) pref = ffs_blkpref_ufs1(ip, lbn, i - num - 1, (ufs1_daddr_t *)0); @@ -368,7 +372,14 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - if (pref == 0) + /* + * If allocating metadata at the front of the cylinder + * group and parent indirect block has just been allocated, + * then cluster next to it if it is the first indirect in + * the file. Otherwise it has been allocated in the metadata + * area, so we want to find our own place out in the data area. + */ + if (pref == 0 || (lbn > NDADDR && fs->fs_metaspace != 0)) pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, @@ -850,6 +861,10 @@ retry: continue; } UFS_LOCK(ump); + /* + * If parent indirect has just been allocated, try to cluster + * immediately following it. + */ if (pref == 0) pref = ffs_blkpref_ufs2(ip, lbn, i - num - 1, (ufs2_daddr_t *)0); @@ -920,7 +935,14 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - if (pref == 0) + /* + * If allocating metadata at the front of the cylinder + * group and parent indirect block has just been allocated, + * then cluster next to it if it is the first indirect in + * the file. Otherwise it has been allocated in the metadata + * area, so we want to find our own place out in the data area. + */ + if (pref == 0 || (lbn > NDADDR && fs->fs_metaspace != 0)) pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 21:41:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 33A4B9C2; Tue, 2 Jul 2013 21:41:08 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id ED4521847; Tue, 2 Jul 2013 21:41:07 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id DBE701203E3; Tue, 2 Jul 2013 23:40:50 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id C2E4628493; Tue, 2 Jul 2013 23:40:50 +0200 (CEST) Date: Tue, 2 Jul 2013 23:40:50 +0200 From: Jilles Tjoelker To: Mikolaj Golub Subject: Re: svn commit: r252516 - head/usr.sbin/bsnmpd/modules/snmp_hast Message-ID: <20130702214050.GA73342@stack.nl> References: <201307021854.r62Isd20043711@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307021854.r62Isd20043711@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 21:41:08 -0000 On Tue, Jul 02, 2013 at 06:54:39PM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Tue Jul 2 18:54:39 2013 > New Revision: 252516 > URL: http://svnweb.freebsd.org/changeset/base/252516 > Log: > Add a mib for worker process ID. > MFC after: 3 days > Modified: > head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt > head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c > head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def > > Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt > ============================================================================== > --- head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Tue Jul 2 18:45:37 2013 (r252515) > +++ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Tue Jul 2 18:54:39 2013 (r252516) > @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY > [snip] > @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE > "Count of resource local flush operations that failed." > ::= { hastResourceEntry 21 } > > +hastResourceWorkerPid OBJECT-TYPE > + SYNTAX INTEGER > + MAX-ACCESS read-write I think MAX-ACCESS should be read-only here. The process ID is assigned when the worker process is created and it makes no sense for a network management system to change it. > + STATUS current > + DESCRIPTION > + "Worker process ID." > + ::= { hastResourceEntry 22 } > + > END -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 00:19:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C16A18E2; Wed, 3 Jul 2013 00:19:03 +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 99DC71D72; Wed, 3 Jul 2013 00:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r630J3GD043929; Wed, 3 Jul 2013 00:19:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r630J38H043928; Wed, 3 Jul 2013 00:19:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307030019.r630J38H043928@svn.freebsd.org> From: Rick Macklem Date: Wed, 3 Jul 2013 00:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252528 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 00:19:03 -0000 Author: rmacklem Date: Wed Jul 3 00:19:03 2013 New Revision: 252528 URL: http://svnweb.freebsd.org/changeset/base/252528 Log: A problem with the old NFS client where large writes to large files would sometimes result in a corrupted file was reported via email. This problem appears to have been caused by r251719 (reverting r251719 fixed the problem). Although I have not been able to reproduce this problem, I suspect it is caused by another thread increasing np->n_size after the mtx_unlock(&np->n_mtx) but before the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes updates to np->n_size, doing the vnode_pager_setsize() with the mutex locked appears to avoid the problem. Unfortunately, vnode_pager_setsize() where the new size is smaller, cannot be called with a mutex held. This patch returns the semantics to be close to pre-r251719 (actually pre-r248567, r248581, r248567 for the new client) such that the call to vnode_pager_setsize() is only delayed until after the mutex is unlocked when np->n_size is shrinking. Since the file is growing when being written, I believe this will fix the corruption. A better solution might be to replace the mutex with a sleep lock, but that is a non-trivial conversion, so this fix is hoped to be sufficient in the meantime. Reported by: David G. Lawrence (dg@dglawrence.com) Tested by: David G. Lawrence (to be done soon) Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue Jul 2 21:07:08 2013 (r252527) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Jul 3 00:19:03 2013 (r252528) @@ -433,6 +433,7 @@ nfscl_loadattrcache(struct vnode **vpp, vap->va_size = np->n_size; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + vnode_pager_setsize(vp, np->n_size); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -444,12 +445,22 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } + vnode_pager_setsize(vp, np->n_size); + } else if (vap->va_size < np->n_size) { + /* + * When shrinking the size, the call to + * vnode_pager_setsize() cannot be done + * with the mutex held, so delay it until + * after the mtx_unlock call. + */ + nsize = np->n_size = vap->va_size; + np->n_flag |= NSIZECHANGED; + setnsize = 1; } else { np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; + vnode_pager_setsize(vp, np->n_size); } - setnsize = 1; - nsize = vap->va_size; } else { np->n_size = vap->va_size; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 02:24:24 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D17CE6A; Wed, 3 Jul 2013 02:24:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 60D0815DC; Wed, 3 Jul 2013 02:24:23 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 54E4B782128; Wed, 3 Jul 2013 12:24:16 +1000 (EST) Date: Wed, 3 Jul 2013 12:24:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kirk McKusick Subject: Re: svn commit: r252527 - head/sys/ufs/ffs In-Reply-To: <201307022107.r62L786A087838@svn.freebsd.org> Message-ID: <20130703113444.S1064@besplex.bde.org> References: <201307022107.r62L786A087838@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=h_N1z8Yi7zIA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Nw6HGA-A-RMA:10 a=80BaD0dnlkPG_ILAy0MA:9 a=CjuIK1q_8ugA:10 a=ULJyCAlmu-HQzLgF:21 a=dbzaI7CMo_VEE-uC:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 02:24:24 -0000 On Tue, 2 Jul 2013, Kirk McKusick wrote: > Log: > Make better use of metadata area by avoiding using it for data blocks > that no should no longer immediately follow their indirect blocks. I use the following changes for allocation at the start of cylinder group. They seem to be related. % diff -u2 ffs_alloc.c~ ffs_alloc.c % --- ffs_alloc.c~ Sun Jun 20 12:53:30 2004 % +++ ffs_alloc.c Mon Jan 2 16:52:39 2012 % @@ -1010,5 +1062,6 @@ % * Select the desired position for the next block in a file. The file is % * logically divided into sections. The first section is composed of the % - * direct blocks. Each additional section contains fs_maxbpg blocks. % + * direct blocks and the next fs_maxbpg blocks. Each additional section % + * contains fs_maxbpg blocks. % * % * If no blocks have been allocated in the first section, the policy is to % @@ -1022,12 +1075,11 @@ % * continues until a cylinder group with greater than the average number % * of free blocks is found. If the allocation is for the first block in an % - * indirect block, the information on the previous allocation is unavailable; % + * indirect block or the previous block is a hole, then the information on % + * the previous allocation is unavailable; % * here a best guess is made based upon the logical block number being % * allocated. % * % * If a section is already partially allocated, the policy is to % - * contiguously allocate fs_maxcontig blocks. The end of one of these % - * contiguous blocks and the beginning of the next is laid out % - * contiguously if possible. % + * allocate blocks contiguously within the section if possible. % */ % ufs2_daddr_t IIRC, the comments were out of date before this change. Especially the final paragraph -- fs_maxcontig is not used for anything. % @@ -1039,12 +1091,18 @@ % { % struct fs *fs; % - int cg; % - int avgbfree, startcg; % + int avgbfree, cg, firstsection, newsection, startcg; BTW, I don't like changing the type of these variables to u_int in -current. This asks for new sign extension bugs to break the warnings about old ones. Even 16-bit signed int is almost large enough for cg, so it is far from necessary to change it from signed to unsigned to double its range. % % fs = ip->i_fs; % - if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { % - if (lbn < NDADDR + NINDIR(fs)) { % + if (lbn < NDADDR + fs->fs_maxbpg) { % + firstsection = 1; % + newsection = 0; % + } else { % + firstsection = 0; % + newsection = ((lbn - NDADDR) % fs->fs_maxbpg == 0); % + } % + if (indx == 0 || bap[indx - 1] == 0 || newsection) { % + if (firstsection) { % cg = ino_to_cg(fs, ip->i_number); % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % /* % @@ -1052,8 +1110,17 @@ % * unused data blocks. % */ % - if (indx == 0 || bap[indx - 1] == 0) % - startcg = % - ino_to_cg(fs, ip->i_number) + lbn / fs->fs_maxbpg; % - else % + if (indx == 0 || bap[indx - 1] == 0) { % + cg = ino_to_cg(fs, ip->i_number) + % + (lbn - NDADDR) / fs->fs_maxbpg; % + if (!newsection) { % + /* % + * Actually, use our best guess if the % + * section is not new. % + */ % + cg %= fs->fs_ncg; % + return (cgdmin(fs, cg)); % + } % + startcg = cg; % + } else % startcg = dtog(fs, bap[indx - 1]) + 1; % startcg %= fs->fs_ncg; % @@ -1062,16 +1129,13 @@ % if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { % fs->fs_cgrotor = cg; % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % for (cg = 0; cg <= startcg; cg++) % if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { % fs->fs_cgrotor = cg; % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % return (0); % } % - /* % - * We just always try to lay things out contiguously. % - */ % return (bap[indx - 1] + fs->fs_frag); % } % @@ -1095,5 +1159,5 @@ % if (lbn < NDADDR + NINDIR(fs)) { % cg = ino_to_cg(fs, ip->i_number); % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % /* % @@ -1111,10 +1175,10 @@ % if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { % fs->fs_cgrotor = cg; % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % for (cg = 0; cg <= startcg; cg++) % if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { % fs->fs_cgrotor = cg; % - return (fs->fs_fpg * cg + fs->fs_frag); % + return (cgdmin(fs, cg)); % } % return (0); I remembered the changes to use cgdmin() as just style fixes, but looking at the macro expansions now, this is far from clear. The macros are deeply nested and depend on the ffs version. The inline expressions don't depend on the ffs version, and are also missing addition of fs_dblkno. I now remember that all the changes are related to correctly skipping over the early blocks whose count is given by fs_dblkno. The direct expression gives a block number that is too small to be for a data block. Blocks early in the cg are already allocated, so the preference for using them given by returning the too-small value is ignored and the caller skips over the allocated blocks. However, IIRC this results in a tiny cluster of data blocks being allocated early in the cg, probably because all the blocks before fs_dblkno are not allocated for metadata. This showed up in tests for contiguous allocation. Large files on new file systems should be allocated perfectly contiguously on each cg after the first (accept for indirect blocks), but instead they have a gap at the start of each cg. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 03:36:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 13B8D9F8; Wed, 3 Jul 2013 03:36:37 +0000 (UTC) (envelope-from lstewart@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 064341927; Wed, 3 Jul 2013 03:36:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r633aaVD003513; Wed, 3 Jul 2013 03:36:36 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r633aaqt003512; Wed, 3 Jul 2013 03:36:36 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030336.r633aaqt003512@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 03:36: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: r252532 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 03:36:37 -0000 Author: lstewart Date: Wed Jul 3 03:36:36 2013 New Revision: 252532 URL: http://svnweb.freebsd.org/changeset/base/252532 Log: When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an mbuf that was fully consumed by the previous call, the mbuf ptr returned by the current call ends up being the previous mbuf in the sb chain to the one that contains the data we want. This does not cause any observable issues because the mbuf copy routines happily walk the mbuf chain to get to the data at the moff offset, which in this case means they effectively skip over the mbuf returned by sbsndptr(). We can't adjust sb->sb_sndptr during the previous call for this case because the next mbuf in the chain may not exist yet. We therefore need to detect the condition and make the adjustment during the current call. Fix by detecting the special case of moff being at the start of the next mbuf in the chain and adjust the required accounting variables accordingly. Reviewed by: andre Modified: stable/9/sys/kern/uipc_sockbuf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/9/sys/kern/uipc_sockbuf.c Wed Jul 3 02:14:12 2013 (r252531) +++ stable/9/sys/kern/uipc_sockbuf.c Wed Jul 3 03:36:36 2013 (r252532) @@ -939,6 +939,13 @@ sbsndptr(struct sockbuf *sb, u_int off, /* Return closest mbuf in chain for current offset. */ *moff = off - sb->sb_sndptroff; m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; + if (*moff == m->m_len) { + *moff = 0; + sb->sb_sndptroff += m->m_len; + m = ret = m->m_next; + KASSERT(ret->m_len > 0, + ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); + } /* Advance by len to be as close as possible for the next transmit. */ for (off = off - sb->sb_sndptroff + len - 1; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 03:40:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8B0DC1E; Wed, 3 Jul 2013 03:40:06 +0000 (UTC) (envelope-from lstewart@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 BBA5A1951; Wed, 3 Jul 2013 03:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r633e6nV005392; Wed, 3 Jul 2013 03:40:06 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r633e6RZ005391; Wed, 3 Jul 2013 03:40:06 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030340.r633e6RZ005391@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 03:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252533 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 03:40:06 -0000 Author: lstewart Date: Wed Jul 3 03:40:06 2013 New Revision: 252533 URL: http://svnweb.freebsd.org/changeset/base/252533 Log: When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an mbuf that was fully consumed by the previous call, the mbuf ptr returned by the current call ends up being the previous mbuf in the sb chain to the one that contains the data we want. This does not cause any observable issues because the mbuf copy routines happily walk the mbuf chain to get to the data at the moff offset, which in this case means they effectively skip over the mbuf returned by sbsndptr(). We can't adjust sb->sb_sndptr during the previous call for this case because the next mbuf in the chain may not exist yet. We therefore need to detect the condition and make the adjustment during the current call. Fix by detecting the special case of moff being at the start of the next mbuf in the chain and adjust the required accounting variables accordingly. Reviewed by: andre Modified: stable/8/sys/kern/uipc_sockbuf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/8/sys/kern/uipc_sockbuf.c Wed Jul 3 03:36:36 2013 (r252532) +++ stable/8/sys/kern/uipc_sockbuf.c Wed Jul 3 03:40:06 2013 (r252533) @@ -939,6 +939,13 @@ sbsndptr(struct sockbuf *sb, u_int off, /* Return closest mbuf in chain for current offset. */ *moff = off - sb->sb_sndptroff; m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; + if (*moff == m->m_len) { + *moff = 0; + sb->sb_sndptroff += m->m_len; + m = ret = m->m_next; + KASSERT(ret->m_len > 0, + ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); + } /* Advance by len to be as close as possible for the next transmit. */ for (off = off - sb->sb_sndptroff + len - 1; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:11:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59E56375; Wed, 3 Jul 2013 04:11:53 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9761A74; Wed, 3 Jul 2013 04:11:52 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-226-51.lns20.per1.internode.on.net [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r634Bmtw084781 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 2 Jul 2013 21:11:50 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <51D3A47E.7070705@freebsd.org> Date: Wed, 03 Jul 2013 12:11:42 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r252346 - head/share/man/man9 References: <201306281633.r5SGXjFU017827@svn.freebsd.org> <51CEDE2B.60204@freebsd.org> <51CEE326.2010903@freebsd.org> <51D2F915.2070303@FreeBSD.org> In-Reply-To: <51D2F915.2070303@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:11:53 -0000 On 7/3/13 12:00 AM, John Baldwin wrote: > On 6/29/13 6:37 AM, Julian Elischer wrote: >> On 6/29/13 9:16 PM, Julian Elischer wrote: >>> thanks! >>> >>> >>>> -If the owner is not currently actually running then the spin step is >>>> skipped. >>>> +then a thread attempting to acquire the mutex will spin rather than >>>> yielding >>>> +the processor. >> Am I wrong in thinking that it will only spin for a short while, >> eventually yielding? >> >> The original text said this but the new text implies it will spin forever. > It does not use a spin timeout. I considered adding a separate note to > define adaptive spinning generically as it is used by multiple lock > types (mutexes, rwlocks, and sx locks). this would be a good idea. > From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:20:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B5955613; Wed, 3 Jul 2013 04:20:37 +0000 (UTC) (envelope-from lstewart@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 976FE1AB7; Wed, 3 Jul 2013 04:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r634KbgF017320; Wed, 3 Jul 2013 04:20:37 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r634Kbpo017318; Wed, 3 Jul 2013 04:20:37 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030420.r634Kbpo017318@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 04:20:37 +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: r252534 - in stable/9/sys: kern 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:20:37 -0000 Author: lstewart Date: Wed Jul 3 04:20:36 2013 New Revision: 252534 URL: http://svnweb.freebsd.org/changeset/base/252534 Log: MFC r251732,251752: Add support for non-virtualised hhook points, which are uniquely identified by type and id, as compared to virtualised hook points which are now uniquely identified by type, id and a vid (which for vimage is the pointer to the vnet that the hhook resides in). All hhook_head structs for both virtualised and non-virtualised hook points coexist in hhook_head_list, and a separate list is maintained for hhook points within each vnet to simplify some vimage-related housekeeping. Reviewed by: scottl Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/sys/hhook.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 03:40:06 2013 (r252533) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 04:20:36 2013 (r252534) @@ -61,8 +61,9 @@ struct hhook { static MALLOC_DEFINE(M_HHOOK, "hhook", "Helper hooks are linked off hhook_head lists"); LIST_HEAD(hhookheadhead, hhook_head); -VNET_DEFINE(struct hhookheadhead, hhook_head_list); -#define V_hhook_head_list VNET(hhook_head_list) +struct hhookheadhead hhook_head_list; +VNET_DEFINE(struct hhookheadhead, hhook_vhead_list); +#define V_hhook_vhead_list VNET(hhook_vhead_list) static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", @@ -245,13 +246,6 @@ hhook_head_register(int32_t hhook_type, return (EEXIST); } - /* XXXLAS: Need to implement support for non-virtualised hooks. */ - if ((flags & HHOOK_HEADISINVNET) == 0) { - printf("%s: only vnet-style virtualised hooks can be used\n", - __func__); - return (EINVAL); - } - tmphhh = malloc(sizeof(struct hhook_head), M_HHOOK, M_ZERO | ((flags & HHOOK_WAITOK) ? M_WAITOK : M_NOWAIT)); @@ -270,14 +264,17 @@ hhook_head_register(int32_t hhook_type, } else refcount_init(&tmphhh->hhh_refcount, 0); + HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { tmphhh->hhh_flags |= HHH_ISINVNET; - HHHLIST_LOCK(); - LIST_INSERT_HEAD(&V_hhook_head_list, tmphhh, hhh_next); - HHHLIST_UNLOCK(); - } else { - /* XXXLAS: Add tmphhh to the non-virtualised list. */ +#ifdef VIMAGE + KASSERT(curvnet != NULL, ("curvnet is NULL")); + tmphhh->hhh_vid = (uintptr_t)curvnet; + LIST_INSERT_HEAD(&V_hhook_vhead_list, tmphhh, hhh_vnext); +#endif } + LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + HHHLIST_UNLOCK(); return (0); } @@ -290,6 +287,10 @@ hhook_head_destroy(struct hhook_head *hh HHHLIST_LOCK_ASSERT(); LIST_REMOVE(hhh, hhh_next); +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) + LIST_REMOVE(hhh, hhh_vnext); +#endif HHH_WLOCK(hhh); STAILQ_FOREACH_SAFE(tmp, &hhh->hhh_hooks, hhk_next, tmp2) free(tmp, M_HHOOK); @@ -347,10 +348,17 @@ hhook_head_get(int32_t hhook_type, int32 { struct hhook_head *hhh; - /* XXXLAS: Pick hhook_head_list based on hhook_head flags. */ HHHLIST_LOCK(); - LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) { + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == + HHOOK_HEADISINVNET) { + KASSERT(curvnet != NULL, ("curvnet is NULL")); + if (hhh->hhh_vid != (uintptr_t)curvnet) + continue; + } +#endif refcount_acquire(&hhh->hhh_refcount); break; } @@ -412,7 +420,7 @@ static void hhook_vnet_init(const void *unused __unused) { - LIST_INIT(&V_hhook_head_list); + LIST_INIT(&V_hhook_vhead_list); } /* @@ -429,7 +437,7 @@ hhook_vnet_uninit(const void *unused __u * subsystem should have already called hhook_head_deregister(). */ HHHLIST_LOCK(); - LIST_FOREACH_SAFE(hhh, &V_hhook_head_list, hhh_next, tmphhh) { + LIST_FOREACH_SAFE(hhh, &V_hhook_vhead_list, hhh_vnext, tmphhh) { printf("%s: hhook_head type=%d, id=%d cleanup required\n", __func__, hhh->hhh_type, hhh->hhh_id); hhook_head_destroy(hhh); @@ -439,7 +447,7 @@ hhook_vnet_uninit(const void *unused __u /* - * When a vnet is created and being initialised, init the V_hhook_head_list. + * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, hhook_vnet_init, NULL); Modified: stable/9/sys/sys/hhook.h ============================================================================== --- stable/9/sys/sys/hhook.h Wed Jul 3 03:40:06 2013 (r252533) +++ stable/9/sys/sys/hhook.h Wed Jul 3 04:20:36 2013 (r252534) @@ -91,12 +91,14 @@ struct hookinfo { struct hhook_head { STAILQ_HEAD(hhook_list, hhook) hhh_hooks; struct rmlock hhh_lock; + uintptr_t hhh_vid; int32_t hhh_id; int32_t hhh_nhooks; int32_t hhh_type; uint32_t hhh_flags; volatile uint32_t hhh_refcount; LIST_ENTRY(hhook_head) hhh_next; + LIST_ENTRY(hhook_head) hhh_vnext; }; /* Public KPI functions. */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:21:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E0906743; Wed, 3 Jul 2013 04:21:29 +0000 (UTC) (envelope-from lstewart@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 C364B1ABF; Wed, 3 Jul 2013 04:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r634LTph017475; Wed, 3 Jul 2013 04:21:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r634LTgT017472; Wed, 3 Jul 2013 04:21:29 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030421.r634LTgT017472@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 04:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252535 - in stable/8/sys: kern sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:21:30 -0000 Author: lstewart Date: Wed Jul 3 04:21:29 2013 New Revision: 252535 URL: http://svnweb.freebsd.org/changeset/base/252535 Log: MFC r251732,251752: Add support for non-virtualised hhook points, which are uniquely identified by type and id, as compared to virtualised hook points which are now uniquely identified by type, id and a vid (which for vimage is the pointer to the vnet that the hhook resides in). All hhook_head structs for both virtualised and non-virtualised hook points coexist in hhook_head_list, and a separate list is maintained for hhook points within each vnet to simplify some vimage-related housekeeping. Reviewed by: scottl Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/sys/hhook.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 04:20:36 2013 (r252534) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 04:21:29 2013 (r252535) @@ -61,8 +61,9 @@ struct hhook { static MALLOC_DEFINE(M_HHOOK, "hhook", "Helper hooks are linked off hhook_head lists"); LIST_HEAD(hhookheadhead, hhook_head); -VNET_DEFINE(struct hhookheadhead, hhook_head_list); -#define V_hhook_head_list VNET(hhook_head_list) +struct hhookheadhead hhook_head_list; +VNET_DEFINE(struct hhookheadhead, hhook_vhead_list); +#define V_hhook_vhead_list VNET(hhook_vhead_list) static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", @@ -245,13 +246,6 @@ hhook_head_register(int32_t hhook_type, return (EEXIST); } - /* XXXLAS: Need to implement support for non-virtualised hooks. */ - if ((flags & HHOOK_HEADISINVNET) == 0) { - printf("%s: only vnet-style virtualised hooks can be used\n", - __func__); - return (EINVAL); - } - tmphhh = malloc(sizeof(struct hhook_head), M_HHOOK, M_ZERO | ((flags & HHOOK_WAITOK) ? M_WAITOK : M_NOWAIT)); @@ -270,14 +264,17 @@ hhook_head_register(int32_t hhook_type, } else refcount_init(&tmphhh->hhh_refcount, 0); + HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { tmphhh->hhh_flags |= HHH_ISINVNET; - HHHLIST_LOCK(); - LIST_INSERT_HEAD(&V_hhook_head_list, tmphhh, hhh_next); - HHHLIST_UNLOCK(); - } else { - /* XXXLAS: Add tmphhh to the non-virtualised list. */ +#ifdef VIMAGE + KASSERT(curvnet != NULL, ("curvnet is NULL")); + tmphhh->hhh_vid = (uintptr_t)curvnet; + LIST_INSERT_HEAD(&V_hhook_vhead_list, tmphhh, hhh_vnext); +#endif } + LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + HHHLIST_UNLOCK(); return (0); } @@ -290,6 +287,10 @@ hhook_head_destroy(struct hhook_head *hh HHHLIST_LOCK_ASSERT(); LIST_REMOVE(hhh, hhh_next); +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) + LIST_REMOVE(hhh, hhh_vnext); +#endif HHH_WLOCK(hhh); STAILQ_FOREACH_SAFE(tmp, &hhh->hhh_hooks, hhk_next, tmp2) free(tmp, M_HHOOK); @@ -347,10 +348,17 @@ hhook_head_get(int32_t hhook_type, int32 { struct hhook_head *hhh; - /* XXXLAS: Pick hhook_head_list based on hhook_head flags. */ HHHLIST_LOCK(); - LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) { + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == + HHOOK_HEADISINVNET) { + KASSERT(curvnet != NULL, ("curvnet is NULL")); + if (hhh->hhh_vid != (uintptr_t)curvnet) + continue; + } +#endif refcount_acquire(&hhh->hhh_refcount); break; } @@ -412,7 +420,7 @@ static void hhook_vnet_init(const void *unused __unused) { - LIST_INIT(&V_hhook_head_list); + LIST_INIT(&V_hhook_vhead_list); } /* @@ -429,7 +437,7 @@ hhook_vnet_uninit(const void *unused __u * subsystem should have already called hhook_head_deregister(). */ HHHLIST_LOCK(); - LIST_FOREACH_SAFE(hhh, &V_hhook_head_list, hhh_next, tmphhh) { + LIST_FOREACH_SAFE(hhh, &V_hhook_vhead_list, hhh_vnext, tmphhh) { printf("%s: hhook_head type=%d, id=%d cleanup required\n", __func__, hhh->hhh_type, hhh->hhh_id); hhook_head_destroy(hhh); @@ -439,7 +447,7 @@ hhook_vnet_uninit(const void *unused __u /* - * When a vnet is created and being initialised, init the V_hhook_head_list. + * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, hhook_vnet_init, NULL); Modified: stable/8/sys/sys/hhook.h ============================================================================== --- stable/8/sys/sys/hhook.h Wed Jul 3 04:20:36 2013 (r252534) +++ stable/8/sys/sys/hhook.h Wed Jul 3 04:21:29 2013 (r252535) @@ -91,12 +91,14 @@ struct hookinfo { struct hhook_head { STAILQ_HEAD(hhook_list, hhook) hhh_hooks; struct rmlock hhh_lock; + uintptr_t hhh_vid; int32_t hhh_id; int32_t hhh_nhooks; int32_t hhh_type; uint32_t hhh_flags; volatile uint32_t hhh_refcount; LIST_ENTRY(hhook_head) hhh_next; + LIST_ENTRY(hhook_head) hhh_vnext; }; /* Public KPI functions. */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:25:01 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 075FF88C; Wed, 3 Jul 2013 04:25:01 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 856C61AD5; Wed, 3 Jul 2013 04:24:54 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 589E27E84A; Wed, 3 Jul 2013 14:24:46 +1000 (EST) Message-ID: <51D3A78E.4070701@freebsd.org> Date: Wed, 03 Jul 2013 14:24:46 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: src-committers@FreeBSD.org Subject: Re: svn commit: r252532 - stable/9/sys/kern References: <201307030336.r633aaqt003512@svn.freebsd.org> In-Reply-To: <201307030336.r633aaqt003512@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:25:01 -0000 On 07/03/13 13:36, Lawrence Stewart wrote: > Author: lstewart > Date: Wed Jul 3 03:36:36 2013 > New Revision: 252532 > URL: http://svnweb.freebsd.org/changeset/base/252532 > > Log: MFC r251984: > When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an > mbuf that was fully consumed by the previous call, the mbuf ptr returned by the > current call ends up being the previous mbuf in the sb chain to the one that > contains the data we want. > > This does not cause any observable issues because the mbuf copy routines happily > walk the mbuf chain to get to the data at the moff offset, which in this case > means they effectively skip over the mbuf returned by sbsndptr(). > > We can't adjust sb->sb_sndptr during the previous call for this case because the > next mbuf in the chain may not exist yet. We therefore need to detect the > condition and make the adjustment during the current call. > > Fix by detecting the special case of moff being at the start of the next mbuf in > the chain and adjust the required accounting variables accordingly. > > Reviewed by: andre From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:26:06 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD0609FC; Wed, 3 Jul 2013 04:26:06 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 84F8A1AE1; Wed, 3 Jul 2013 04:26:03 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 224A67E84A; Wed, 3 Jul 2013 14:26:02 +1000 (EST) Message-ID: <51D3A7D9.8030200@freebsd.org> Date: Wed, 03 Jul 2013 14:26:01 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: src-committers@FreeBSD.org Subject: Re: svn commit: r252533 - stable/8/sys/kern References: <201307030340.r633e6RZ005391@svn.freebsd.org> In-Reply-To: <201307030340.r633e6RZ005391@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-8@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:26:06 -0000 On 07/03/13 13:40, Lawrence Stewart wrote: > Author: lstewart > Date: Wed Jul 3 03:40:06 2013 > New Revision: 252533 > URL: http://svnweb.freebsd.org/changeset/base/252533 > > Log: MFC r251984: > When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an > mbuf that was fully consumed by the previous call, the mbuf ptr returned by the > current call ends up being the previous mbuf in the sb chain to the one that > contains the data we want. > > This does not cause any observable issues because the mbuf copy routines happily > walk the mbuf chain to get to the data at the moff offset, which in this case > means they effectively skip over the mbuf returned by sbsndptr(). > > We can't adjust sb->sb_sndptr during the previous call for this case because the > next mbuf in the chain may not exist yet. We therefore need to detect the > condition and make the adjustment during the current call. > > Fix by detecting the special case of moff being at the start of the next mbuf in > the chain and adjust the required accounting variables accordingly. > > Reviewed by: andre From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:40:20 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C0A9CD8; Wed, 3 Jul 2013 04:40:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 112E51B4B; Wed, 3 Jul 2013 04:40:19 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id DF222421CCF; Wed, 3 Jul 2013 14:40:17 +1000 (EST) Date: Wed, 3 Jul 2013 14:40:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] In-Reply-To: <51D31724.6090807@FreeBSD.org> Message-ID: <20130703134115.C1064@besplex.bde.org> References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D30CE8.7030803@FreeBSD.org> <51D31724.6090807@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=leycMhyxsNAA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=qlnHYPZ3_KkA:10 a=8pif782wAAAA:8 a=t-c6XU3XfRrDXkAxBZQA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: attilio@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:40:20 -0000 On Tue, 2 Jul 2013, Andriy Gapon wrote: > on 02/07/2013 20:52 Attilio Rao said the following: >> I was just pointing out that the real bug is not in the subtraction >> itself but on the hogticks comparison. >> This is because hogticks is not an absolute measurement but it >> represents really a ticks difference. >> In my opinion we should define hogticks as an unsigned int and add a >> small comment saying that it is a differential. >> This will fix the issue. This is sort of backwards. hogticks is a small positive integer. Making it unsigned just asks for sign extension bugs when it is compared with signed values. However, the tick counters are circular counters. Making them signed asks for undefined behaviour when they overflow. > I think that my original suggestion is equivalently well if not more obvious. > This is a common knowledge: > http://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution > > distance = (signed)( i1 - i2 ) With 2's complement and benign overflow, this is no different from 'distance = i1 - i2'. But signed counters are not wanted here. A negative distance, or equivalently with 32-bit unsigned ints, an unsigned difference of >= 0x80000000 means overflow or an initialization error. Your bug is an initialization error. BTW, -ftrapv is broken in gcc-4.2.1. It seems to have worked in gcc-3.3, but gcc-3.3 generates pessimal code for it, with a call to an extern function even for adding ints. gcc-4.2.1 still generates an declaration of the extern function, but never calls it. The declaration is unnecessary even when it is used. These bugs seem to be fixed in clang, at least on amd64. clang generates an explicit inline check for overflow and executes an unsupported instruction on overflow. The code for the check is good with -O but bad (large and slow) with -O0. These bugs are still large at the hardware level. Overflow checking is handled correctly on x86 only for floating point. In floating point, you can set or clear the mode bit for trapping on overflow, so that programs can be tested without recompiling them and without adding slow runtime checks (the hardware has to pipleline the checks well so that they have low cost). Hardware support for trapping on integer overflow keeps getting worse since programmers never check for overflow. i386 has an "into" instruction that should have been used instead of "jo foo" to check for overflow. It should have been easier for hardware to optimize than the branch. But AFAIK, "into" has never been optimized and has always been slower than the branch, so programmers never used it, so AMD removed it in 64-bit mode. Speed tests for incrementing a volatile local variable on corei7 in 32-bit mode: - -fno-trapv: 6.2 cycles (clang bug: warn about -fno-trapv being unused) - add into: 12.3 cycles (error handling is SIGBUS) - -ftrapv: 6.7 cycles (error handling is SIGILL) - mod jo to into: 7.3 cycles (error handling is SIGBUS). Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 04:44:25 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46E89E32; Wed, 3 Jul 2013 04:44:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id F03CF1B7D; Wed, 3 Jul 2013 04:44:24 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 6F2424215B7; Wed, 3 Jul 2013 14:44:23 +1000 (EST) Date: Wed, 3 Jul 2013 14:43:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: RAND_MAX broken In-Reply-To: <51D33552.1030208@freebsd.org> Message-ID: <20130703144126.L1498@besplex.bde.org> References: <201307012143.r61Lhemi067176@svn.freebsd.org> <20130702130818.V865@besplex.bde.org> <20130702165642.X1571@besplex.bde.org> <51D2F571.8050108@freebsd.org> <20130703020550.E8632@besplex.bde.org> <51D33552.1030208@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=lqUz0ovpAEAA:10 a=uji_oyvObONoAZy2nP4A:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Pedro F. Giffuni" , src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 04:44:25 -0000 On Wed, 3 Jul 2013, Andrey Chernov wrote: > On 02.07.2013 20:33, Bruce Evans wrote: >> I checked the values returned by rand(). The ACM part works as >> intended, so it never returns RAND_MAX. It also never returns 0. So >> the distribution of values in the documented range [0, RAND_MAX] is >> very non-uniform. It is uniform in [1, RAND_MAX - 1]. To use this >> algorithm for rand(), 1 should have been subtracted, giving a range >> of [0, 0x7ffffffe]. > > Do you mean [0, 0x7ffffffd] (assuming 1 subtracted)? Yes. > See attached patch. > I don't see compatibility problems at least from POSIX specs point of > view - they don't say something specific about RAND_MAX. I like the patch. It is binary compatibility problems and maybe applications assuming that (RAND_MAX + 1) is 0x80000000 so as to do magic bit operations with it that may be problems. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:22:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E861713E; Wed, 3 Jul 2013 05:22:43 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id B77B51D58; Wed, 3 Jul 2013 05:22:43 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r635Mbg2066446; Tue, 2 Jul 2013 23:22:37 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r635Ma5w066445; Tue, 2 Jul 2013 23:22:36 -0600 (MDT) (envelope-from ken) Date: Tue, 2 Jul 2013 23:22:36 -0600 From: "Kenneth D. Merry" To: Andre Albsmeier Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130703052236.GA65730@nargothrond.kdm.org> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> <20130702055333.GA2729@bali> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130702055333.GA2729@bali> User-Agent: Mutt/1.4.2i Cc: "src-committers@freebsd.org" , asomers@freebsd.org, "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-9@freebsd.org" , gibbs@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:22:44 -0000 On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote: > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > > Author: ken > > Date: Tue Jun 25 21:43:49 2013 > > New Revision: 252214 > > URL: http://svnweb.freebsd.org/changeset/base/252214 > > Hi Ken, > > > Log: > > MFC: 249658, 249701 > > > > Update chio(1) and ch(4) to support reporting element designators. > > > > This allows mapping a tape drive in a changer (as reported by > > 'chio status') to a sa(4) driver instance by comparing the > > serial numbers. > > > > The designators can be ASCII (which is printed out directly), binary > > (which is printed in hex format) or UTF-8, which is printed in either > > native UTF-8 format if the terminal can support it, or in %XX notation > > for non-ASCII characters. Thanks to Hiroki Sato for the > > explanation and example UTF-8 printing code. > > > > chio.h: Modify the changer_element_status structure to add new > > fields and definitions from the SMC3r16 spec. > > > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > > define a new CHIOGSTATUS ioctl. > > > > Clean up some tab/space issues. > > > > chio.c: For the 'status' subcommand, print the designator field > > if it is supplied by a device. > > > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > > ELEMENT STATUS command structure. > > > > Add a read_element_status_device_id structure > > for the data fields in the new standard. Add new > > unions, dt_or_obsolete and voltage_devid, to hold > > and address data from either SCSI-2 or newer devices. > > > > scsi_ch.c: Implement support for fetching device IDs with READ > > ELEMENT STATUS data. > > > > Add new arguments to scsi_read_element_status() to > > allow the user to request the DVCID and CURDATA bits. > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library: > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use > this workaround to make it work again until a better solution is available: > > --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 > +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 > @@ -1245,8 +1245,8 @@ > /* tag_action */ MSG_SIMPLE_Q_TAG, > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet], > - /* dvcid */ 1, > - /* curdata */ 1, > + /* dvcid */ 0, > + /* curdata */ 0, > /* count */ 1, > /* data_ptr */ data, > /* dxfer_len */ 1024, > @@ -1284,8 +1284,8 @@ > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet] > + cesr->cesr_element_base, > - /* dvcid */ 1, > - /* curdata */ 1, > + /* dvcid */ 0, > + /* curdata */ 0, > /* count */ cesr->cesr_element_count, > /* data_ptr */ data, > /* dxfer_len */ size, > > -Andre Oops, sorry. We need to check the SCSI version to see whether to set those bits, and also fall back in case it doesn't work. I am on vacation and have very spotty net access. I can't do anything about it until I get back next week. Justin and Alan (CCed) can work on the fix, though. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:28:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 560FB794; Wed, 3 Jul 2013 05:28:23 +0000 (UTC) (envelope-from lstewart@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 380201DD1; Wed, 3 Jul 2013 05:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635SNsN035558; Wed, 3 Jul 2013 05:28:23 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635SMuq035555; Wed, 3 Jul 2013 05:28:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030528.r635SMuq035555@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:28: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: r252536 - in stable/9/sys: kern 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:28:23 -0000 Author: lstewart Date: Wed Jul 3 05:28:22 2013 New Revision: 252536 URL: http://svnweb.freebsd.org/changeset/base/252536 Log: MFC r251770: Internalise handling of virtualised hook points inside hhook_{add|remove}_hook_lookup() so that khelp (and other potential API consumers) do not have to care when they attempt to (un)hook a particular hook point identified by id and type. Reviewed by: scottl Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/kern/kern_khelp.c stable/9/sys/sys/hhook.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -69,6 +69,9 @@ static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", MTX_DEF); +/* Protected by hhook_head_list_lock. */ +static uint32_t n_hhookheads; + /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); @@ -165,21 +168,71 @@ hhook_add_hook(struct hhook_head *hhh, s } /* - * Lookup a helper hook point and register a new helper hook function with it. + * Register a helper hook function with a helper hook point (including all + * virtual instances of the hook point if it is virtualised). + * + * The logic is unfortunately far more complex than for + * hhook_remove_hook_lookup() because hhook_add_hook() can call malloc() with + * M_WAITOK and thus we cannot call hhook_add_hook() with the + * hhook_head_list_lock held. + * + * The logic assembles an array of hhook_head structs that correspond to the + * helper hook point being hooked and bumps the refcount on each (all done with + * the hhook_head_list_lock held). The hhook_head_list_lock is then dropped, and + * hhook_add_hook() is called and the refcount dropped for each hhook_head + * struct in the array. */ int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) { - struct hhook_head *hhh; - int error; + struct hhook_head **heads_to_hook, *hhh; + int error, i, n_heads_to_hook; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); +tryagain: + error = i = 0; + /* + * Accessing n_hhookheads without hhook_head_list_lock held opens up a + * race with hhook_head_register() which we are unlikely to lose, but + * nonetheless have to cope with - hence the complex goto logic. + */ + n_heads_to_hook = n_hhookheads; + heads_to_hook = malloc(n_heads_to_hook * sizeof(struct hhook_head *), + M_HHOOK, flags & HHOOK_WAITOK ? M_WAITOK : M_NOWAIT); + if (heads_to_hook == NULL) + return (ENOMEM); - if (hhh == NULL) - return (ENOENT); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) { + if (i < n_heads_to_hook) { + heads_to_hook[i] = hhh; + refcount_acquire(&heads_to_hook[i]->hhh_refcount); + i++; + } else { + /* + * We raced with hhook_head_register() which + * inserted a hhook_head that we need to hook + * but did not malloc space for. Abort this run + * and try again. + */ + for (i--; i >= 0; i--) + refcount_release(&heads_to_hook[i]->hhh_refcount); + free(heads_to_hook, M_HHOOK); + HHHLIST_UNLOCK(); + goto tryagain; + } + } + } + HHHLIST_UNLOCK(); - error = hhook_add_hook(hhh, hki, flags); - hhook_head_release(hhh); + for (i--; i >= 0; i--) { + if (!error) + error = hhook_add_hook(heads_to_hook[i], hki, flags); + refcount_release(&heads_to_hook[i]->hhh_refcount); + } + + free(heads_to_hook, M_HHOOK); return (error); } @@ -211,20 +264,21 @@ hhook_remove_hook(struct hhook_head *hhh } /* - * Lookup a helper hook point and remove a helper hook function from it. + * Remove a helper hook function from a helper hook point (including all + * virtual instances of the hook point if it is virtualised). */ int hhook_remove_hook_lookup(struct hookinfo *hki) { struct hhook_head *hhh; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); - - if (hhh == NULL) - return (ENOENT); - - hhook_remove_hook(hhh, hki); - hhook_head_release(hhh); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) + hhook_remove_hook(hhh, hki); + } + HHHLIST_UNLOCK(); return (0); } @@ -274,6 +328,7 @@ hhook_head_register(int32_t hhook_type, #endif } LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + n_hhookheads++; HHHLIST_UNLOCK(); return (0); @@ -285,6 +340,7 @@ hhook_head_destroy(struct hhook_head *hh struct hhook *tmp, *tmp2; HHHLIST_LOCK_ASSERT(); + KASSERT(n_hhookheads > 0, ("n_hhookheads should be > 0")); LIST_REMOVE(hhh, hhh_next); #ifdef VIMAGE @@ -297,6 +353,7 @@ hhook_head_destroy(struct hhook_head *hh HHH_WUNLOCK(hhh); HHH_LOCK_DESTROY(hhh); free(hhh, M_HHOOK); + n_hhookheads--; } /* Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -84,12 +84,13 @@ khelp_register_helper(struct helper *h) for (i = 0; i < h->h_nhooks && !error; i++) { /* We don't require the module to assign hook_helper. */ h->h_hooks[i].hook_helper = h; - error = khelp_add_hhook(&h->h_hooks[i], HHOOK_NOWAIT); + error = hhook_add_hook_lookup(&h->h_hooks[i], + HHOOK_WAITOK); } if (error) { for (i--; i >= 0; i--) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } @@ -144,7 +145,7 @@ khelp_deregister_helper(struct helper *h if (!error) { if (h->h_nhooks > 0) { for (i = 0; i < h->h_nhooks; i++) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); } osd_deregister(OSD_KHELP, h->h_id); } @@ -263,28 +264,13 @@ khelp_get_id(char *hname) int khelp_add_hhook(struct hookinfo *hki, uint32_t flags) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically adding a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to include the additional hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_add_hook_lookup(hki, flags); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_add_hook_lookup(hki, flags); return (error); } @@ -292,28 +278,13 @@ khelp_add_hhook(struct hookinfo *hki, ui int khelp_remove_hhook(struct hookinfo *hki) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically removing a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to remove the defunct hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_remove_hook_lookup(hki); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_remove_hook_lookup(hki); return (error); } Modified: stable/9/sys/sys/hhook.h ============================================================================== --- stable/9/sys/sys/hhook.h Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/sys/hhook.h Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95A018C0; Wed, 3 Jul 2013 05:29:22 +0000 (UTC) (envelope-from lstewart@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 78A071DD6; Wed, 3 Jul 2013 05:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635TMH1035709; Wed, 3 Jul 2013 05:29:22 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635TLje035704; Wed, 3 Jul 2013 05:29:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030529.r635TLje035704@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252537 - in stable/8/sys: kern sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:29:22 -0000 Author: lstewart Date: Wed Jul 3 05:29:21 2013 New Revision: 252537 URL: http://svnweb.freebsd.org/changeset/base/252537 Log: MFC r251770: Internalise handling of virtualised hook points inside hhook_{add|remove}_hook_lookup() so that khelp (and other potential API consumers) do not have to care when they attempt to (un)hook a particular hook point identified by id and type. Reviewed by: scottl Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/kern/kern_khelp.c stable/8/sys/sys/hhook.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -69,6 +69,9 @@ static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", MTX_DEF); +/* Protected by hhook_head_list_lock. */ +static uint32_t n_hhookheads; + /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); @@ -165,21 +168,71 @@ hhook_add_hook(struct hhook_head *hhh, s } /* - * Lookup a helper hook point and register a new helper hook function with it. + * Register a helper hook function with a helper hook point (including all + * virtual instances of the hook point if it is virtualised). + * + * The logic is unfortunately far more complex than for + * hhook_remove_hook_lookup() because hhook_add_hook() can call malloc() with + * M_WAITOK and thus we cannot call hhook_add_hook() with the + * hhook_head_list_lock held. + * + * The logic assembles an array of hhook_head structs that correspond to the + * helper hook point being hooked and bumps the refcount on each (all done with + * the hhook_head_list_lock held). The hhook_head_list_lock is then dropped, and + * hhook_add_hook() is called and the refcount dropped for each hhook_head + * struct in the array. */ int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) { - struct hhook_head *hhh; - int error; + struct hhook_head **heads_to_hook, *hhh; + int error, i, n_heads_to_hook; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); +tryagain: + error = i = 0; + /* + * Accessing n_hhookheads without hhook_head_list_lock held opens up a + * race with hhook_head_register() which we are unlikely to lose, but + * nonetheless have to cope with - hence the complex goto logic. + */ + n_heads_to_hook = n_hhookheads; + heads_to_hook = malloc(n_heads_to_hook * sizeof(struct hhook_head *), + M_HHOOK, flags & HHOOK_WAITOK ? M_WAITOK : M_NOWAIT); + if (heads_to_hook == NULL) + return (ENOMEM); - if (hhh == NULL) - return (ENOENT); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) { + if (i < n_heads_to_hook) { + heads_to_hook[i] = hhh; + refcount_acquire(&heads_to_hook[i]->hhh_refcount); + i++; + } else { + /* + * We raced with hhook_head_register() which + * inserted a hhook_head that we need to hook + * but did not malloc space for. Abort this run + * and try again. + */ + for (i--; i >= 0; i--) + refcount_release(&heads_to_hook[i]->hhh_refcount); + free(heads_to_hook, M_HHOOK); + HHHLIST_UNLOCK(); + goto tryagain; + } + } + } + HHHLIST_UNLOCK(); - error = hhook_add_hook(hhh, hki, flags); - hhook_head_release(hhh); + for (i--; i >= 0; i--) { + if (!error) + error = hhook_add_hook(heads_to_hook[i], hki, flags); + refcount_release(&heads_to_hook[i]->hhh_refcount); + } + + free(heads_to_hook, M_HHOOK); return (error); } @@ -211,20 +264,21 @@ hhook_remove_hook(struct hhook_head *hhh } /* - * Lookup a helper hook point and remove a helper hook function from it. + * Remove a helper hook function from a helper hook point (including all + * virtual instances of the hook point if it is virtualised). */ int hhook_remove_hook_lookup(struct hookinfo *hki) { struct hhook_head *hhh; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); - - if (hhh == NULL) - return (ENOENT); - - hhook_remove_hook(hhh, hki); - hhook_head_release(hhh); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) + hhook_remove_hook(hhh, hki); + } + HHHLIST_UNLOCK(); return (0); } @@ -274,6 +328,7 @@ hhook_head_register(int32_t hhook_type, #endif } LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + n_hhookheads++; HHHLIST_UNLOCK(); return (0); @@ -285,6 +340,7 @@ hhook_head_destroy(struct hhook_head *hh struct hhook *tmp, *tmp2; HHHLIST_LOCK_ASSERT(); + KASSERT(n_hhookheads > 0, ("n_hhookheads should be > 0")); LIST_REMOVE(hhh, hhh_next); #ifdef VIMAGE @@ -297,6 +353,7 @@ hhook_head_destroy(struct hhook_head *hh HHH_WUNLOCK(hhh); HHH_LOCK_DESTROY(hhh); free(hhh, M_HHOOK); + n_hhookheads--; } /* Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -84,12 +84,13 @@ khelp_register_helper(struct helper *h) for (i = 0; i < h->h_nhooks && !error; i++) { /* We don't require the module to assign hook_helper. */ h->h_hooks[i].hook_helper = h; - error = khelp_add_hhook(&h->h_hooks[i], HHOOK_NOWAIT); + error = hhook_add_hook_lookup(&h->h_hooks[i], + HHOOK_WAITOK); } if (error) { for (i--; i >= 0; i--) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } @@ -144,7 +145,7 @@ khelp_deregister_helper(struct helper *h if (!error) { if (h->h_nhooks > 0) { for (i = 0; i < h->h_nhooks; i++) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); } osd_deregister(OSD_KHELP, h->h_id); } @@ -263,28 +264,13 @@ khelp_get_id(char *hname) int khelp_add_hhook(struct hookinfo *hki, uint32_t flags) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically adding a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to include the additional hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_add_hook_lookup(hki, flags); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_add_hook_lookup(hki, flags); return (error); } @@ -292,28 +278,13 @@ khelp_add_hhook(struct hookinfo *hki, ui int khelp_remove_hhook(struct hookinfo *hki) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically removing a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to remove the defunct hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_remove_hook_lookup(hki); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_remove_hook_lookup(hki); return (error); } Modified: stable/8/sys/sys/hhook.h ============================================================================== --- stable/8/sys/sys/hhook.h Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/sys/hhook.h Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:43:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A228A68; Wed, 3 Jul 2013 05:43:58 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.freebsd.org (Postfix) with ESMTP id 9004B1E1E; Wed, 3 Jul 2013 05:43:56 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r635ho8g013734; Wed, 3 Jul 2013 07:43:50 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id r635hoI1021766; Wed, 3 Jul 2013 07:43:50 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.7/8.14.7) id r635hoEY010515; Date: Wed, 3 Jul 2013 07:43:49 +0200 From: Andre Albsmeier To: "Kenneth D. Merry" Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130703054349.GA13656@bali> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130703052236.GA65730@nargothrond.kdm.org> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "src-committers@freebsd.org" , "asomers@freebsd.org" , "Albsmeier, Andre" , "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-9@freebsd.org" , "gibbs@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:43:58 -0000 On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote: > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote: > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > > > Author: ken > > > Date: Tue Jun 25 21:43:49 2013 > > > New Revision: 252214 > > > URL: http://svnweb.freebsd.org/changeset/base/252214 > > > > Hi Ken, > > > > > Log: > > > MFC: 249658, 249701 > > > > > > Update chio(1) and ch(4) to support reporting element designators. > > > > > > This allows mapping a tape drive in a changer (as reported by > > > 'chio status') to a sa(4) driver instance by comparing the > > > serial numbers. > > > > > > The designators can be ASCII (which is printed out directly), binary > > > (which is printed in hex format) or UTF-8, which is printed in either > > > native UTF-8 format if the terminal can support it, or in %XX notation > > > for non-ASCII characters. Thanks to Hiroki Sato for the > > > explanation and example UTF-8 printing code. > > > > > > chio.h: Modify the changer_element_status structure to add new > > > fields and definitions from the SMC3r16 spec. > > > > > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > > > define a new CHIOGSTATUS ioctl. > > > > > > Clean up some tab/space issues. > > > > > > chio.c: For the 'status' subcommand, print the designator field > > > if it is supplied by a device. > > > > > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > > > ELEMENT STATUS command structure. > > > > > > Add a read_element_status_device_id structure > > > for the data fields in the new standard. Add new > > > unions, dt_or_obsolete and voltage_devid, to hold > > > and address data from either SCSI-2 or newer devices. > > > > > > scsi_ch.c: Implement support for fetching device IDs with READ > > > ELEMENT STATUS data. > > > > > > Add new arguments to scsi_read_element_status() to > > > allow the user to request the DVCID and CURDATA bits. > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library: > > > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use > > this workaround to make it work again until a better solution is available: > > > > --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 > > +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 > > @@ -1245,8 +1245,8 @@ > > /* tag_action */ MSG_SIMPLE_Q_TAG, > > /* voltag */ want_voltags, > > /* sea */ softc->sc_firsts[chet], > > - /* dvcid */ 1, > > - /* curdata */ 1, > > + /* dvcid */ 0, > > + /* curdata */ 0, > > /* count */ 1, > > /* data_ptr */ data, > > /* dxfer_len */ 1024, > > @@ -1284,8 +1284,8 @@ > > /* voltag */ want_voltags, > > /* sea */ softc->sc_firsts[chet] > > + cesr->cesr_element_base, > > - /* dvcid */ 1, > > - /* curdata */ 1, > > + /* dvcid */ 0, > > + /* curdata */ 0, > > /* count */ cesr->cesr_element_count, > > /* data_ptr */ data, > > /* dxfer_len */ size, > > > > -Andre > > Oops, sorry. > > We need to check the SCSI version to see whether to set those bits, and > also fall back in case it doesn't work. > > I am on vacation and have very spotty net access. I can't do anything > about it until I get back next week. > > Justin and Alan (CCed) can work on the fix, though. Take your time, for me it's working right now with the above patch... -Andre > > Ken > -- > Kenneth Merry > ken@FreeBSD.ORG > -- Linux: Sozialismus, der nicht funktioniert From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:47:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34BA2BB3; Wed, 3 Jul 2013 05:47:29 +0000 (UTC) (envelope-from lstewart@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 274FE1E30; Wed, 3 Jul 2013 05:47:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635lTd0041240; Wed, 3 Jul 2013 05:47:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635lS9o041236; Wed, 3 Jul 2013 05:47:28 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030547.r635lS9o041236@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252538 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:47:29 -0000 Author: lstewart Date: Wed Jul 3 05:47:28 2013 New Revision: 252538 URL: http://svnweb.freebsd.org/changeset/base/252538 Log: MFC r251774: Add a private KPI between hhook and khelp that allows khelp modules to insert hook functions into hhook points which register after the modules were loaded - potentially useful during boot or if hhook points are dynamically registered. Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/kern/kern_khelp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:29:21 2013 (r252537) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:47:28 2013 (r252538) @@ -74,6 +74,7 @@ static uint32_t n_hhookheads; /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define HHHLIST_LOCK() mtx_lock(&hhook_head_list_lock) #define HHHLIST_UNLOCK() mtx_unlock(&hhook_head_list_lock) @@ -311,12 +312,7 @@ hhook_head_register(int32_t hhook_type, tmphhh->hhh_nhooks = 0; STAILQ_INIT(&tmphhh->hhh_hooks); HHH_LOCK_INIT(tmphhh); - - if (hhh != NULL) { - refcount_init(&tmphhh->hhh_refcount, 1); - *hhh = tmphhh; - } else - refcount_init(&tmphhh->hhh_refcount, 0); + refcount_init(&tmphhh->hhh_refcount, 1); HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { @@ -331,6 +327,13 @@ hhook_head_register(int32_t hhook_type, n_hhookheads++; HHHLIST_UNLOCK(); + khelp_new_hhook_registered(tmphhh, flags); + + if (hhh != NULL) + *hhh = tmphhh; + else + refcount_release(&tmphhh->hhh_refcount); + return (0); } Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:29:21 2013 (r252537) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:47:28 2013 (r252538) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -52,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static struct rwlock khelp_list_lock; RW_SYSINIT(khelplistlock, &khelp_list_lock, "helper list lock"); @@ -61,6 +58,7 @@ static TAILQ_HEAD(helper_head, helper) h /* Private function prototypes. */ static inline void khelp_remove_osd(struct helper *h, struct osd *hosd); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define KHELP_LIST_WLOCK() rw_wlock(&khelp_list_lock) #define KHELP_LIST_WUNLOCK() rw_wunlock(&khelp_list_lock) @@ -289,6 +287,36 @@ khelp_remove_hhook(struct hookinfo *hki) return (error); } +/* + * Private KPI between hhook and khelp that allows khelp modules to insert hook + * functions into hhook points which register after the modules were loaded. + */ +void +khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags) +{ + struct helper *h; + int error, i; + + KHELP_LIST_RLOCK(); + TAILQ_FOREACH(h, &helpers, h_next) { + for (i = 0; i < h->h_nhooks; i++) { + if (hhh->hhh_type != h->h_hooks[i].hook_type || + hhh->hhh_id != h->h_hooks[i].hook_id) + continue; + error = hhook_add_hook(hhh, &h->h_hooks[i], flags); + if (error) { + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", + __func__, h->h_name, + h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); + error = 0; + } + } + } + KHELP_LIST_RUNLOCK(); +} + int khelp_modevent(module_t mod, int event_type, void *data) { @@ -348,95 +376,3 @@ khelp_modevent(module_t mod, int event_t return (error); } - -/* - * This function is called in two separate situations: - * - * - When the kernel is booting, it is called directly by the SYSINIT framework - * to allow Khelp modules which were compiled into the kernel or loaded by the - * boot loader to insert their non-virtualised hook functions into the kernel. - * - * - When the kernel is booting or a vnet is created, this function is also - * called indirectly through khelp_vnet_init() by the vnet initialisation code. - * In this situation, Khelp modules are able to insert their virtualised hook - * functions into the virtualised hook points in the vnet which is being - * initialised. In the case where the kernel is not compiled with "options - * VIMAGE", this step is still run once at boot, but the hook functions get - * transparently inserted into the standard unvirtualised network stack. - */ -static void -khelp_init(const void *vnet) -{ - struct helper *h; - int error, i, vinit; - int32_t htype, hid; - - error = 0; - vinit = vnet != NULL; - - KHELP_LIST_RLOCK(); - TAILQ_FOREACH(h, &helpers, h_next) { - for (i = 0; i < h->h_nhooks && !error; i++) { - htype = h->h_hooks[i].hook_type; - hid = h->h_hooks[i].hook_id; - - /* - * If we're doing a virtualised init (vinit != 0) and - * the hook point is virtualised, or we're doing a plain - * sysinit at boot and the hook point is not - * virtualised, insert the hook. - */ - if ((hhook_head_is_virtualised_lookup(htype, hid) == - HHOOK_HEADISINVNET && vinit) || - (!hhook_head_is_virtualised_lookup(htype, hid) && - !vinit)) { - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_NOWAIT); - } - } - - if (error) { - /* Remove any helper's hooks we successfully added. */ - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - printf("%s: Failed to add hooks for helper \"%s\" (%p)", - __func__, h->h_name, h); - if (vinit) - printf(" to vnet %p.\n", vnet); - else - printf(".\n"); - - error = 0; - } - } - KHELP_LIST_RUNLOCK(); -} - -/* - * Vnet created and being initialised. - */ -static void -khelp_vnet_init(const void *unused __unused) -{ - - khelp_init(TD_TO_VNET(curthread)); -} - - -/* - * As the kernel boots, allow Khelp modules which were compiled into the kernel - * or loaded by the boot loader to insert their non-virtualised hook functions - * into the kernel. - */ -SYSINIT(khelp_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, khelp_init, NULL); - -/* - * When a vnet is created and being initialised, we need to insert the helper - * hook functions for all currently registered Khelp modules into the vnet's - * helper hook points. The hhook KPI provides a mechanism for subsystems which - * export helper hook points to clean up on vnet shutdown, so we don't need a - * VNET_SYSUNINIT for Khelp. - */ -VNET_SYSINIT(khelp_vnet_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, - khelp_vnet_init, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:48:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C98FFDBE; Wed, 3 Jul 2013 05:48:46 +0000 (UTC) (envelope-from lstewart@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 BAD361E3A; Wed, 3 Jul 2013 05:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635mkua041486; Wed, 3 Jul 2013 05:48:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635mk93041484; Wed, 3 Jul 2013 05:48:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030548.r635mk93041484@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:48:46 +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: r252539 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:48:46 -0000 Author: lstewart Date: Wed Jul 3 05:48:46 2013 New Revision: 252539 URL: http://svnweb.freebsd.org/changeset/base/252539 Log: MFC r251774: Add a private KPI between hhook and khelp that allows khelp modules to insert hook functions into hhook points which register after the modules were loaded - potentially useful during boot or if hhook points are dynamically registered. Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/kern/kern_khelp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:47:28 2013 (r252538) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:48:46 2013 (r252539) @@ -74,6 +74,7 @@ static uint32_t n_hhookheads; /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define HHHLIST_LOCK() mtx_lock(&hhook_head_list_lock) #define HHHLIST_UNLOCK() mtx_unlock(&hhook_head_list_lock) @@ -311,12 +312,7 @@ hhook_head_register(int32_t hhook_type, tmphhh->hhh_nhooks = 0; STAILQ_INIT(&tmphhh->hhh_hooks); HHH_LOCK_INIT(tmphhh); - - if (hhh != NULL) { - refcount_init(&tmphhh->hhh_refcount, 1); - *hhh = tmphhh; - } else - refcount_init(&tmphhh->hhh_refcount, 0); + refcount_init(&tmphhh->hhh_refcount, 1); HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { @@ -331,6 +327,13 @@ hhook_head_register(int32_t hhook_type, n_hhookheads++; HHHLIST_UNLOCK(); + khelp_new_hhook_registered(tmphhh, flags); + + if (hhh != NULL) + *hhh = tmphhh; + else + refcount_release(&tmphhh->hhh_refcount); + return (0); } Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:47:28 2013 (r252538) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:48:46 2013 (r252539) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -52,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static struct rwlock khelp_list_lock; RW_SYSINIT(khelplistlock, &khelp_list_lock, "helper list lock"); @@ -61,6 +58,7 @@ static TAILQ_HEAD(helper_head, helper) h /* Private function prototypes. */ static inline void khelp_remove_osd(struct helper *h, struct osd *hosd); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define KHELP_LIST_WLOCK() rw_wlock(&khelp_list_lock) #define KHELP_LIST_WUNLOCK() rw_wunlock(&khelp_list_lock) @@ -289,6 +287,36 @@ khelp_remove_hhook(struct hookinfo *hki) return (error); } +/* + * Private KPI between hhook and khelp that allows khelp modules to insert hook + * functions into hhook points which register after the modules were loaded. + */ +void +khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags) +{ + struct helper *h; + int error, i; + + KHELP_LIST_RLOCK(); + TAILQ_FOREACH(h, &helpers, h_next) { + for (i = 0; i < h->h_nhooks; i++) { + if (hhh->hhh_type != h->h_hooks[i].hook_type || + hhh->hhh_id != h->h_hooks[i].hook_id) + continue; + error = hhook_add_hook(hhh, &h->h_hooks[i], flags); + if (error) { + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", + __func__, h->h_name, + h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); + error = 0; + } + } + } + KHELP_LIST_RUNLOCK(); +} + int khelp_modevent(module_t mod, int event_type, void *data) { @@ -348,95 +376,3 @@ khelp_modevent(module_t mod, int event_t return (error); } - -/* - * This function is called in two separate situations: - * - * - When the kernel is booting, it is called directly by the SYSINIT framework - * to allow Khelp modules which were compiled into the kernel or loaded by the - * boot loader to insert their non-virtualised hook functions into the kernel. - * - * - When the kernel is booting or a vnet is created, this function is also - * called indirectly through khelp_vnet_init() by the vnet initialisation code. - * In this situation, Khelp modules are able to insert their virtualised hook - * functions into the virtualised hook points in the vnet which is being - * initialised. In the case where the kernel is not compiled with "options - * VIMAGE", this step is still run once at boot, but the hook functions get - * transparently inserted into the standard unvirtualised network stack. - */ -static void -khelp_init(const void *vnet) -{ - struct helper *h; - int error, i, vinit; - int32_t htype, hid; - - error = 0; - vinit = vnet != NULL; - - KHELP_LIST_RLOCK(); - TAILQ_FOREACH(h, &helpers, h_next) { - for (i = 0; i < h->h_nhooks && !error; i++) { - htype = h->h_hooks[i].hook_type; - hid = h->h_hooks[i].hook_id; - - /* - * If we're doing a virtualised init (vinit != 0) and - * the hook point is virtualised, or we're doing a plain - * sysinit at boot and the hook point is not - * virtualised, insert the hook. - */ - if ((hhook_head_is_virtualised_lookup(htype, hid) == - HHOOK_HEADISINVNET && vinit) || - (!hhook_head_is_virtualised_lookup(htype, hid) && - !vinit)) { - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_NOWAIT); - } - } - - if (error) { - /* Remove any helper's hooks we successfully added. */ - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - printf("%s: Failed to add hooks for helper \"%s\" (%p)", - __func__, h->h_name, h); - if (vinit) - printf(" to vnet %p.\n", vnet); - else - printf(".\n"); - - error = 0; - } - } - KHELP_LIST_RUNLOCK(); -} - -/* - * Vnet created and being initialised. - */ -static void -khelp_vnet_init(const void *unused __unused) -{ - - khelp_init(TD_TO_VNET(curthread)); -} - - -/* - * As the kernel boots, allow Khelp modules which were compiled into the kernel - * or loaded by the boot loader to insert their non-virtualised hook functions - * into the kernel. - */ -SYSINIT(khelp_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, khelp_init, NULL); - -/* - * When a vnet is created and being initialised, we need to insert the helper - * hook functions for all currently registered Khelp modules into the vnet's - * helper hook points. The hhook KPI provides a mechanism for subsystems which - * export helper hook points to clean up on vnet shutdown, so we don't need a - * VNET_SYSUNINIT for Khelp. - */ -VNET_SYSINIT(khelp_vnet_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, - khelp_vnet_init, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:54:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B36BFA2; Wed, 3 Jul 2013 05:54:24 +0000 (UTC) (envelope-from trociny@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 5E3BF1E6C; Wed, 3 Jul 2013 05:54:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635sO4S043774; Wed, 3 Jul 2013 05:54:24 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635sOCW043773; Wed, 3 Jul 2013 05:54:24 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307030554.r635sOCW043773@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 3 Jul 2013 05:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252540 - head/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:54:24 -0000 Author: trociny Date: Wed Jul 3 05:54:23 2013 New Revision: 252540 URL: http://svnweb.freebsd.org/changeset/base/252540 Log: hastResourceWorkerPid is read-only. Submitted by: jilles MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Wed Jul 3 05:48:46 2013 (r252539) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Wed Jul 3 05:54:23 2013 (r252540) @@ -301,7 +301,7 @@ hastResourceFlushErrors OBJECT-TYPE hastResourceWorkerPid OBJECT-TYPE SYNTAX INTEGER - MAX-ACCESS read-write + MAX-ACCESS read-only STATUS current DESCRIPTION "Worker process ID." From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:57:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 233DE21B; Wed, 3 Jul 2013 05:57:57 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-x22c.google.com (mail-ea0-x22c.google.com [IPv6:2a00:1450:4013:c01::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 612F41E95; Wed, 3 Jul 2013 05:57:56 +0000 (UTC) Received: by mail-ea0-f172.google.com with SMTP id q10so3239078eaj.3 for ; Tue, 02 Jul 2013 22:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=YRWsMC0zPSOeXYSkcAURKKyDx7jtdgVRQR8/tM351xY=; b=UdvtdxhZrbaVwdpgQ9cWSNV5uTR4UDIPHkxA6PVSrSdCnRx5NnknqoVpvaTu+8PxvP y54lztbAKDQCGTflUHDJIMhZg3CxE3DmbXxh1KjWk2sfNjaFTL2ZWqdfL+8nl8R+ZGem JBQoqaX6+KoRVyFM7BGbul42uioHfhxXYYifyhxMhoDH3tVkVq5t0V9XALV5ecGYSg7Q BLlokL+oMZC0gk9GHclk5U1sqKu/vwgdNQVPJtKCrgqGebYa3nYBD81AzHleNDgP7C5M DHkAek0uOodQNcICBVvHP8wEZczqz9obJ9zd4dZJdmDxshHrVZKa1hHRj7ezVJL8ccu3 EhaQ== X-Received: by 10.14.173.70 with SMTP id u46mr29033274eel.92.1372831075589; Tue, 02 Jul 2013 22:57:55 -0700 (PDT) Received: from localhost ([188.230.122.226]) by mx.google.com with ESMTPSA id m1sm41865487eex.17.2013.07.02.22.57.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jul 2013 22:57:54 -0700 (PDT) Date: Wed, 3 Jul 2013 08:57:52 +0300 From: Mikolaj Golub To: Jilles Tjoelker Subject: Re: svn commit: r252516 - head/usr.sbin/bsnmpd/modules/snmp_hast Message-ID: <20130703055751.GA38024@gmail.com> References: <201307021854.r62Isd20043711@svn.freebsd.org> <20130702214050.GA73342@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130702214050.GA73342@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:57:57 -0000 On Tue, Jul 02, 2013 at 11:40:50PM +0200, Jilles Tjoelker wrote: > > +hastResourceWorkerPid OBJECT-TYPE > > + SYNTAX INTEGER > > + MAX-ACCESS read-write > > I think MAX-ACCESS should be read-only here. The process ID is assigned > when the worker process is created and it makes no sense for a network > management system to change it. Yes, it was intended to be read-only. Fixed. Thank you for spotting this. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:58:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23C22375; Wed, 3 Jul 2013 05:58:52 +0000 (UTC) (envelope-from lstewart@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 F24AD1EA3; Wed, 3 Jul 2013 05:58:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635wpvP044384; Wed, 3 Jul 2013 05:58:51 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635wpQc044383; Wed, 3 Jul 2013 05:58:51 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030558.r635wpQc044383@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:58: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: r252541 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:58:52 -0000 Author: lstewart Date: Wed Jul 3 05:58:51 2013 New Revision: 252541 URL: http://svnweb.freebsd.org/changeset/base/252541 Log: MFC r251778: Cleanup and simplification in khelp_{register|deregister}_helper(). No functional changes. Modified: stable/9/sys/kern/kern_khelp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:54:23 2013 (r252540) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:58:51 2013 (r252541) @@ -72,34 +72,32 @@ khelp_register_helper(struct helper *h) struct helper *tmph; int error, i, inserted; - error = 0; - inserted = 0; + error = inserted = 0; refcount_init(&h->h_refcount, 0); h->h_id = osd_register(OSD_KHELP, NULL, NULL); /* It's only safe to add the hooks after osd_register(). */ - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks && !error; i++) { - /* We don't require the module to assign hook_helper. */ - h->h_hooks[i].hook_helper = h; - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_WAITOK); - } - - if (error) { - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - osd_deregister(OSD_KHELP, h->h_id); - } + for (i = 0; i < h->h_nhooks && !error; i++) { + /* We don't require the module to assign hook_helper. */ + h->h_hooks[i].hook_helper = h; + error = hhook_add_hook_lookup(&h->h_hooks[i], HHOOK_WAITOK); + if (error) + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", __func__, + h->h_name, h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); } - if (!error) { + if (error) { + for (i--; i >= 0; i--) + hhook_remove_hook_lookup(&h->h_hooks[i]); + osd_deregister(OSD_KHELP, h->h_id); + } else { KHELP_LIST_WLOCK(); /* * Keep list of helpers sorted in descending h_id order. Due to * the way osd_set() works, a sorted list ensures - * init_helper_osd() will operate with improved efficiency. + * khelp_init_osd() will operate with improved efficiency. */ TAILQ_FOREACH(tmph, &helpers, h_next) { if (tmph->h_id < h->h_id) { @@ -123,8 +121,6 @@ khelp_deregister_helper(struct helper *h struct helper *tmph; int error, i; - error = 0; - KHELP_LIST_WLOCK(); if (h->h_refcount > 0) error = EBUSY; @@ -141,10 +137,8 @@ khelp_deregister_helper(struct helper *h KHELP_LIST_WUNLOCK(); if (!error) { - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks; i++) - hhook_remove_hook_lookup(&h->h_hooks[i]); - } + for (i = 0; i < h->h_nhooks; i++) + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 05:59:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C2774D6; Wed, 3 Jul 2013 05:59:49 +0000 (UTC) (envelope-from lstewart@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 04AA91EBA; Wed, 3 Jul 2013 05:59:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635xm9v044525; Wed, 3 Jul 2013 05:59:48 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635xmYq044524; Wed, 3 Jul 2013 05:59:48 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030559.r635xmYq044524@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252542 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 05:59:49 -0000 Author: lstewart Date: Wed Jul 3 05:59:48 2013 New Revision: 252542 URL: http://svnweb.freebsd.org/changeset/base/252542 Log: MFC r251778: Cleanup and simplification in khelp_{register|deregister}_helper(). No functional changes. Modified: stable/8/sys/kern/kern_khelp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:58:51 2013 (r252541) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:59:48 2013 (r252542) @@ -72,34 +72,32 @@ khelp_register_helper(struct helper *h) struct helper *tmph; int error, i, inserted; - error = 0; - inserted = 0; + error = inserted = 0; refcount_init(&h->h_refcount, 0); h->h_id = osd_register(OSD_KHELP, NULL, NULL); /* It's only safe to add the hooks after osd_register(). */ - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks && !error; i++) { - /* We don't require the module to assign hook_helper. */ - h->h_hooks[i].hook_helper = h; - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_WAITOK); - } - - if (error) { - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - osd_deregister(OSD_KHELP, h->h_id); - } + for (i = 0; i < h->h_nhooks && !error; i++) { + /* We don't require the module to assign hook_helper. */ + h->h_hooks[i].hook_helper = h; + error = hhook_add_hook_lookup(&h->h_hooks[i], HHOOK_WAITOK); + if (error) + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", __func__, + h->h_name, h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); } - if (!error) { + if (error) { + for (i--; i >= 0; i--) + hhook_remove_hook_lookup(&h->h_hooks[i]); + osd_deregister(OSD_KHELP, h->h_id); + } else { KHELP_LIST_WLOCK(); /* * Keep list of helpers sorted in descending h_id order. Due to * the way osd_set() works, a sorted list ensures - * init_helper_osd() will operate with improved efficiency. + * khelp_init_osd() will operate with improved efficiency. */ TAILQ_FOREACH(tmph, &helpers, h_next) { if (tmph->h_id < h->h_id) { @@ -123,8 +121,6 @@ khelp_deregister_helper(struct helper *h struct helper *tmph; int error, i; - error = 0; - KHELP_LIST_WLOCK(); if (h->h_refcount > 0) error = EBUSY; @@ -141,10 +137,8 @@ khelp_deregister_helper(struct helper *h KHELP_LIST_WUNLOCK(); if (!error) { - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks; i++) - hhook_remove_hook_lookup(&h->h_hooks[i]); - } + for (i = 0; i < h->h_nhooks; i++) + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 06:08:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 811B4706; Wed, 3 Jul 2013 06:08:37 +0000 (UTC) Date: Wed, 3 Jul 2013 06:08:37 +0000 From: Alexey Dokuchaev To: Xin LI Subject: Re: svn commit: r252514 - head/sbin/swapon Message-ID: <20130703060837.GA19366@FreeBSD.org> References: <201307021734.r62HYZ0V020447@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307021734.r62HYZ0V020447@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 06:08:37 -0000 On Tue, Jul 02, 2013 at 05:34:35PM +0000, Xin LI wrote: > New Revision: 252514 > URL: http://svnweb.freebsd.org/changeset/base/252514 > > Log: > Plug a memory leak. Is MFC to stable/[89] applicable? If yes, can it be scheduled? ;-) ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 06:20:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D2808CF; Wed, 3 Jul 2013 06:20:48 +0000 (UTC) (envelope-from lstewart@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 D9F481F4E; Wed, 3 Jul 2013 06:20:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r636Kl4u052545; Wed, 3 Jul 2013 06:20:47 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r636KlNF052544; Wed, 3 Jul 2013 06:20:47 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030620.r636KlNF052544@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 06:20:47 +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: r252543 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 06:20:48 -0000 Author: lstewart Date: Wed Jul 3 06:20:47 2013 New Revision: 252543 URL: http://svnweb.freebsd.org/changeset/base/252543 Log: MFC r251787: Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to ensure all per-vnet related hhook initialisation is completed prior to any virtualised hhook points attempting registration. vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen. There are no per-vnet initialisors in the source tree at this time which run earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates there are no subsystems pre SI_SUB_MBUF that would likely be interested in registering a virtualised hhook point. Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first overtly network-related initilisation stage to run after SI_SUB_VNET. If a subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which runs immediately after SI_SUB_VNET. Modified: stable/9/sys/kern/kern_hhook.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:59:48 2013 (r252542) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 06:20:47 2013 (r252543) @@ -509,7 +509,7 @@ hhook_vnet_uninit(const void *unused __u /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ -VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, hhook_vnet_init, NULL); /* @@ -517,5 +517,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PRO * points to clean up on vnet tear down, but in case the KPI is misused, * provide a function to clean up and free memory for a vnet being destroyed. */ -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, hhook_vnet_uninit, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 06:23:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B7D5AE8; Wed, 3 Jul 2013 06:23:47 +0000 (UTC) (envelope-from lstewart@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 7464E1F72; Wed, 3 Jul 2013 06:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r636NlDP053026; Wed, 3 Jul 2013 06:23:47 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r636NlcJ053025; Wed, 3 Jul 2013 06:23:47 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030623.r636NlcJ053025@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 06:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252544 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 06:23:47 -0000 Author: lstewart Date: Wed Jul 3 06:23:46 2013 New Revision: 252544 URL: http://svnweb.freebsd.org/changeset/base/252544 Log: MFC r251787: Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to ensure all per-vnet related hhook initialisation is completed prior to any virtualised hhook points attempting registration. vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen. There are no per-vnet initialisors in the source tree at this time which run earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates there are no subsystems pre SI_SUB_MBUF that would likely be interested in registering a virtualised hhook point. Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first overtly network-related initilisation stage to run after SI_SUB_VNET. If a subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which runs immediately after SI_SUB_VNET. Modified: stable/8/sys/kern/kern_hhook.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 06:20:47 2013 (r252543) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 06:23:46 2013 (r252544) @@ -509,7 +509,7 @@ hhook_vnet_uninit(const void *unused __u /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ -VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, hhook_vnet_init, NULL); /* @@ -517,5 +517,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PRO * points to clean up on vnet tear down, but in case the KPI is misused, * provide a function to clean up and free memory for a vnet being destroyed. */ -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, hhook_vnet_uninit, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 07:03:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B09225F2; Wed, 3 Jul 2013 07:03:20 +0000 (UTC) (envelope-from peter@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 92CD910E2; Wed, 3 Jul 2013 07:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6373KU6064515; Wed, 3 Jul 2013 07:03:20 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6373JCI064505; Wed, 3 Jul 2013 07:03:19 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307030703.r6373JCI064505@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 07:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252547 - in head: include lib/libc/iconv lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 07:03:20 -0000 Author: peter Date: Wed Jul 3 07:03:19 2013 New Revision: 252547 URL: http://svnweb.freebsd.org/changeset/base/252547 Log: Replace the #define for "iconv" so it is for the function name instead of a macro with parameters. Remove a __DECONST hack and add consts instead for gnu libiconv API compatability. This makes it work with things like devel/boost-libs that expects to use "iconv" as though it were a pointer. Modified: head/include/iconv.h head/lib/libc/iconv/citrus_iconv.h head/lib/libc/iconv/citrus_iconv_local.h head/lib/libc/iconv/iconv.c head/lib/libc/locale/cXXrtomb_iconv.h head/lib/libc/locale/mbrtocXX_iconv.h Modified: head/include/iconv.h ============================================================================== --- head/include/iconv.h Wed Jul 3 06:43:49 2013 (r252546) +++ head/include/iconv.h Wed Jul 3 07:03:19 2013 (r252547) @@ -43,7 +43,7 @@ #define iconv_open libiconv_open #define iconv_close libiconv_close -#define iconv(cd, in, insize, out, outsize) libiconv(cd, __DECONST(char **, in), insize, out, outsize) +#define iconv libiconv #define iconv_t libiconv_t struct __tag_iconv_t; @@ -51,7 +51,7 @@ typedef struct __tag_iconv_t *iconv_t; __BEGIN_DECLS iconv_t libiconv_open(const char *, const char *); -size_t libiconv(iconv_t, char ** __restrict, +size_t libiconv(iconv_t, const char ** __restrict, size_t * __restrict, char ** __restrict, size_t * __restrict); int libiconv_close(iconv_t); @@ -60,7 +60,7 @@ int libiconv_close(iconv_t); */ int __iconv_get_list(char ***, size_t *, bool); void __iconv_free_list(char **, size_t); -size_t __iconv(iconv_t, char **, size_t *, char **, +size_t __iconv(iconv_t, const char **, size_t *, char **, size_t *, __uint32_t, size_t *); #define __ICONV_F_HIDE_INVALID 0x0001 Modified: head/lib/libc/iconv/citrus_iconv.h ============================================================================== --- head/lib/libc/iconv/citrus_iconv.h Wed Jul 3 06:43:49 2013 (r252546) +++ head/lib/libc/iconv/citrus_iconv.h Wed Jul 3 07:03:19 2013 (r252547) @@ -52,7 +52,7 @@ __END_DECLS */ static __inline int _citrus_iconv_convert(struct _citrus_iconv * __restrict cv, - char * __restrict * __restrict in, size_t * __restrict inbytes, + const char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags, size_t * __restrict nresults) { Modified: head/lib/libc/iconv/citrus_iconv_local.h ============================================================================== --- head/lib/libc/iconv/citrus_iconv_local.h Wed Jul 3 06:43:49 2013 (r252546) +++ head/lib/libc/iconv/citrus_iconv_local.h Wed Jul 3 07:03:19 2013 (r252547) @@ -45,7 +45,7 @@ static void _citrus_##_m_##_iconv_unini (struct _citrus_iconv_shared *); \ static int _citrus_##_m_##_iconv_convert \ (struct _citrus_iconv * __restrict, \ - char * __restrict * __restrict, \ + const char * __restrict * __restrict, \ size_t * __restrict, \ char * __restrict * __restrict, \ size_t * __restrict outbytes, \ @@ -74,7 +74,7 @@ typedef void (*_citrus_iconv_uninit_shar (struct _citrus_iconv_shared *); typedef int (*_citrus_iconv_convert_t) (struct _citrus_iconv * __restrict, - char *__restrict* __restrict, size_t * __restrict, + const char *__restrict* __restrict, size_t * __restrict, char * __restrict * __restrict, size_t * __restrict, uint32_t, size_t * __restrict); typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *); Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Wed Jul 3 06:43:49 2013 (r252546) +++ head/lib/libc/iconv/iconv.c Wed Jul 3 07:03:19 2013 (r252547) @@ -130,7 +130,7 @@ libiconv_close(iconv_t handle) } size_t -libiconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout) +libiconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) { size_t ret; int err; @@ -151,7 +151,7 @@ libiconv(iconv_t handle, char **in, size } size_t -__iconv(iconv_t handle, char **in, size_t *szin, char **out, +__iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout, uint32_t flags, size_t *invalids) { size_t ret; Modified: head/lib/libc/locale/cXXrtomb_iconv.h ============================================================================== --- head/lib/libc/locale/cXXrtomb_iconv.h Wed Jul 3 06:43:49 2013 (r252546) +++ head/lib/libc/locale/cXXrtomb_iconv.h Wed Jul 3 07:03:19 2013 (r252547) @@ -57,7 +57,8 @@ cXXrtomb_l(char * __restrict s, charXX_t { _ConversionState *cs; struct _citrus_iconv *handle; - char *src, *dst; + const char *src; + char *dst; size_t srcleft, dstleft, invlen; int err; Modified: head/lib/libc/locale/mbrtocXX_iconv.h ============================================================================== --- head/lib/libc/locale/mbrtocXX_iconv.h Wed Jul 3 06:43:49 2013 (r252546) +++ head/lib/libc/locale/mbrtocXX_iconv.h Wed Jul 3 07:03:19 2013 (r252547) @@ -99,7 +99,8 @@ mbrtocXX_l(charXX_t * __restrict pc, con /* Convert as few characters to the dst buffer as possible. */ for (i = 0; ; i++) { - char *src, *dst; + const char *src; + char *dst; size_t srcleft, dstleft, invlen; int err; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 07:31:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76965A4A; Wed, 3 Jul 2013 07:31:08 +0000 (UTC) (envelope-from hrs@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 6974F11A7; Wed, 3 Jul 2013 07:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r637V8Kb073065; Wed, 3 Jul 2013 07:31:08 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r637V8am073064; Wed, 3 Jul 2013 07:31:08 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307030731.r637V8am073064@svn.freebsd.org> From: Hiroki Sato Date: Wed, 3 Jul 2013 07:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252548 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 07:31:08 -0000 Author: hrs Date: Wed Jul 3 07:31:07 2013 New Revision: 252548 URL: http://svnweb.freebsd.org/changeset/base/252548 Log: Fix a compiler warning. MFC after: 1 week Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Jul 3 07:03:19 2013 (r252547) +++ head/sys/net/if_bridge.c Wed Jul 3 07:31:07 2013 (r252548) @@ -1100,6 +1100,7 @@ bridge_ioctl_add(struct bridge_softc *sc * interfaces have inet6 address. If any, remove * inet6 addresses on the interface to be added. */ + ia6_m = NULL; BRIDGE_XLOCK(sc); LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { ia6_m = in6ifa_llaonifp(bif->bif_ifp); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 07:57:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C19AF33; Wed, 3 Jul 2013 07:57:23 +0000 (UTC) (envelope-from lstewart@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 F27A11270; Wed, 3 Jul 2013 07:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r637vMLU079446; Wed, 3 Jul 2013 07:57:22 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r637vM28079445; Wed, 3 Jul 2013 07:57:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030757.r637vM28079445@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 07: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: r252549 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 07:57:23 -0000 Author: lstewart Date: Wed Jul 3 07:57:22 2013 New Revision: 252549 URL: http://svnweb.freebsd.org/changeset/base/252549 Log: MFC r251789: Now that the necessary infrastructure is in place to ensure hhook points which register after a khelp module will get hooked, move khelp module initialisation to the earlier SI_SUB_KLD stage. Modified: stable/9/sys/sys/module_khelp.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/module_khelp.h ============================================================================== --- stable/9/sys/sys/module_khelp.h Wed Jul 3 07:31:07 2013 (r252548) +++ stable/9/sys/sys/module_khelp.h Wed Jul 3 07:57:22 2013 (r252549) @@ -85,8 +85,7 @@ struct khelp_modevent_data { .evhand = khelp_modevent, \ .priv = &kmd_##hname \ }; \ - DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY); \ + DECLARE_MODULE(hname, h_##hname, SI_SUB_KLD, SI_ORDER_ANY); \ MODULE_VERSION(hname, version) #define KHELP_DECLARE_MOD(hname, hdata, hhooks, version) \ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 07:58:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 526B7ED; Wed, 3 Jul 2013 07:58:15 +0000 (UTC) (envelope-from lstewart@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 44C361274; Wed, 3 Jul 2013 07:58:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r637wFui079597; Wed, 3 Jul 2013 07:58:15 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r637wFWW079596; Wed, 3 Jul 2013 07:58:15 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030758.r637wFWW079596@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 07:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252550 - stable/8/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 07:58:15 -0000 Author: lstewart Date: Wed Jul 3 07:58:14 2013 New Revision: 252550 URL: http://svnweb.freebsd.org/changeset/base/252550 Log: MFC r251789: Now that the necessary infrastructure is in place to ensure hhook points which register after a khelp module will get hooked, move khelp module initialisation to the earlier SI_SUB_KLD stage. Modified: stable/8/sys/sys/module_khelp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/sys/module_khelp.h ============================================================================== --- stable/8/sys/sys/module_khelp.h Wed Jul 3 07:57:22 2013 (r252549) +++ stable/8/sys/sys/module_khelp.h Wed Jul 3 07:58:14 2013 (r252550) @@ -85,8 +85,7 @@ struct khelp_modevent_data { .evhand = khelp_modevent, \ .priv = &kmd_##hname \ }; \ - DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY); \ + DECLARE_MODULE(hname, h_##hname, SI_SUB_KLD, SI_ORDER_ANY); \ MODULE_VERSION(hname, version) #define KHELP_DECLARE_MOD(hname, hdata, hhooks, version) \ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 08:20:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8882F584; Wed, 3 Jul 2013 08:20:40 +0000 (UTC) (envelope-from lstewart@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 794E7133C; Wed, 3 Jul 2013 08:20:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638KedP087851; Wed, 3 Jul 2013 08:20:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638Ke5I087850; Wed, 3 Jul 2013 08:20:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030820.r638Ke5I087850@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 08:20: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: r252551 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 08:20:40 -0000 Author: lstewart Date: Wed Jul 3 08:20:40 2013 New Revision: 252551 URL: http://svnweb.freebsd.org/changeset/base/252551 Log: MFC r252052: Non-virtualised hhook points are supported as of r251732. Modified: stable/9/share/man/man9/hhook.9 Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/hhook.9 ============================================================================== --- stable/9/share/man/man9/hhook.9 Wed Jul 3 07:58:14 2013 (r252550) +++ stable/9/share/man/man9/hhook.9 Wed Jul 3 08:20:40 2013 (r252551) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd June 21, 2013 .Dt HHOOK 9 .Os .Sh NAME @@ -380,9 +380,3 @@ This manual page was written by .An David Hayes Aq david.hayes@ieee.org and .An Lawrence Stewart Aq lstewart@FreeBSD.org . -.Sh BUGS -The framework does not currently support registering hook points in subsystems -which have not been virtualised with VIMAGE. -Fairly minimal internal changes to the -.Nm -implementation are required to address this. From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 08:21:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D04E76AF; Wed, 3 Jul 2013 08:21:05 +0000 (UTC) (envelope-from lstewart@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 C2B161342; Wed, 3 Jul 2013 08:21:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638L5rb088107; Wed, 3 Jul 2013 08:21:05 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638L5Ri088106; Wed, 3 Jul 2013 08:21:05 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030821.r638L5Ri088106@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 08:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252552 - stable/8/share/man/man9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 08:21:05 -0000 Author: lstewart Date: Wed Jul 3 08:21:05 2013 New Revision: 252552 URL: http://svnweb.freebsd.org/changeset/base/252552 Log: MFC r252052: Non-virtualised hhook points are supported as of r251732. Modified: stable/8/share/man/man9/hhook.9 Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/hhook.9 ============================================================================== --- stable/8/share/man/man9/hhook.9 Wed Jul 3 08:20:40 2013 (r252551) +++ stable/8/share/man/man9/hhook.9 Wed Jul 3 08:21:05 2013 (r252552) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd June 21, 2013 .Dt HHOOK 9 .Os .Sh NAME @@ -380,9 +380,3 @@ This manual page was written by .An David Hayes Aq david.hayes@ieee.org and .An Lawrence Stewart Aq lstewart@FreeBSD.org . -.Sh BUGS -The framework does not currently support registering hook points in subsystems -which have not been virtualised with VIMAGE. -Fairly minimal internal changes to the -.Nm -implementation are required to address this. From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 08:24:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F0BB884; Wed, 3 Jul 2013 08:24:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABF8136E; Wed, 3 Jul 2013 08:24:34 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA09236; Wed, 03 Jul 2013 11:24:21 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UuIMP-0009IC-BI; Wed, 03 Jul 2013 11:24:21 +0300 Message-ID: <51D3DF64.8040500@FreeBSD.org> Date: Wed, 03 Jul 2013 11:23:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Bruce Evans Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D30CE8.7030803@FreeBSD.org> <51D31724.6090807@FreeBSD.org> <20130703134115.C1064@besplex.bde.org> In-Reply-To: <20130703134115.C1064@besplex.bde.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: attilio@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 08:24:36 -0000 on 03/07/2013 07:40 Bruce Evans said the following: > On Tue, 2 Jul 2013, Andriy Gapon wrote: >> distance = (signed)( i1 - i2 ) > > With 2's complement and benign overflow, this is no different from > 'distance = i1 - i2'. Given the particular context I'd say that there is a difference. > But signed counters are not wanted here. A > negative distance, or equivalently with 32-bit unsigned ints, an unsigned > difference of >= 0x80000000 means overflow or an initialization error. > Your bug is an initialization error. Right. But I'd rather produce a positive (unsigned) number than a negative number when such an error happens (and is detectable). Again, I am speaking about the concrete context. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 08:35:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6550B64; Wed, 3 Jul 2013 08:35:14 +0000 (UTC) (envelope-from smh@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 B82B91447; Wed, 3 Jul 2013 08:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638ZE1d091548; Wed, 3 Jul 2013 08:35:14 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638ZEkL091547; Wed, 3 Jul 2013 08:35:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307030835.r638ZEkL091547@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 08:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252553 - stable/8/sys/dev/mfi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 08:35:14 -0000 Author: smh Date: Wed Jul 3 08:35:14 2013 New Revision: 252553 URL: http://svnweb.freebsd.org/changeset/base/252553 Log: MFC r252471: Remove forced timeout of in-flight commands from mfi_timeout. While this prevents commands getting stuck forever there is no way to guarantee that data from the command hasn't been committed to the device. In addition older mfi firmware has a bug that would cause the controller to frequently stall IO for over our timeout value, which when combined with a forced timeout often resulted in panics in UFS; which would otherwise be avoided when the command eventually completed if left alone. For reference this timeout issue is resolved in Dell FW package 21.2.1-0000. Fixed FW package version for none Dell controller will likely vary. Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Jul 3 08:21:05 2013 (r252552) +++ stable/8/sys/dev/mfi/mfi.c Wed Jul 3 08:35:14 2013 (r252553) @@ -3762,12 +3762,15 @@ mfi_timeout(void *data) MFI_PRINT_CMD(cm); MFI_VALIDATE_CMD(sc, cm); /* - * Fail the command instead of leaving it on - * the queue where it could remain stuck forever + * While commands can get stuck forever we do + * not fail them as there is no way to tell if + * the controller has actually processed them + * or not. + * + * In addition its very likely that force + * failing a command here would cause a panic + * e.g. in UFS. */ - mfi_remove_busy(cm); - cm->cm_error = ETIMEDOUT; - mfi_complete(sc, cm); timedout++; } } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 08:39:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CF27E34; Wed, 3 Jul 2013 08:39:19 +0000 (UTC) (envelope-from smh@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 297B815BF; Wed, 3 Jul 2013 08:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638dJj9092033; Wed, 3 Jul 2013 08:39:19 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638dJX3092031; Wed, 3 Jul 2013 08:39:19 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307030839.r638dJX3092031@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 08:39: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: r252554 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 08:39:19 -0000 Author: smh Date: Wed Jul 3 08:39:18 2013 New Revision: 252554 URL: http://svnweb.freebsd.org/changeset/base/252554 Log: MFC r252471: Remove forced timeout of in-flight commands from mfi_timeout. While this prevents commands getting stuck forever there is no way to guarantee that data from the command hasn't been committed to the device. In addition older mfi firmware has a bug that would cause the controller to frequently stall IO for over our timeout value, which when combined with a forced timeout often resulted in panics in UFS; which would otherwise be avoided when the command eventually completed if left alone. For reference this timeout issue is resolved in Dell FW package 21.2.1-0000. Fixed FW package version for none Dell controller will likely vary. Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Jul 3 08:35:14 2013 (r252553) +++ stable/9/sys/dev/mfi/mfi.c Wed Jul 3 08:39:18 2013 (r252554) @@ -3768,12 +3768,15 @@ mfi_timeout(void *data) MFI_PRINT_CMD(cm); MFI_VALIDATE_CMD(sc, cm); /* - * Fail the command instead of leaving it on - * the queue where it could remain stuck forever + * While commands can get stuck forever we do + * not fail them as there is no way to tell if + * the controller has actually processed them + * or not. + * + * In addition its very likely that force + * failing a command here would cause a panic + * e.g. in UFS. */ - mfi_remove_busy(cm); - cm->cm_error = ETIMEDOUT; - mfi_complete(sc, cm); timedout++; } } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 09:23:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 78DCFB38; Wed, 3 Jul 2013 09:23:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 16A9B1843; Wed, 3 Jul 2013 09:23:09 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.7) with ESMTP id r639N7TS070189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jul 2013 11:23:08 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Wed, 3 Jul 2013 11:23:07 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Hiroki Sato Subject: Re: svn commit: r252408 - head/sbin/ifconfig Message-ID: <20130703092307.GA2294@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201306300737.r5U7bWkB096070@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306300737.r5U7bWkB096070@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 09:23:10 -0000 On Sun, 2013-06-30 at 07:37:32 +0000, Hiroki Sato wrote: > Author: hrs > Date: Sun Jun 30 07:37:31 2013 > New Revision: 252408 > URL: http://svnweb.freebsd.org/changeset/base/252408 > > Log: > Do not display a warning message in a jail without AF_INET6 support. > > MFC after: 3 days > > Modified: > head/sbin/ifconfig/af_nd6.c > > Modified: head/sbin/ifconfig/af_nd6.c > ============================================================================== > --- head/sbin/ifconfig/af_nd6.c Sun Jun 30 06:44:31 2013 (r252407) > +++ head/sbin/ifconfig/af_nd6.c Sun Jun 30 07:37:31 2013 (r252408) > @@ -148,7 +148,7 @@ nd6_status(int s) > memset(&nd, 0, sizeof(nd)); > strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); > if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { > - if (errno != EAFNOSUPPORT) > + if (errno != EAFNOSUPPORT && error != EPROTONOSUPPORT) > warn("socket(AF_INET6, SOCK_DGRAM)"); > return; > } This gives undefined behavior, error is uninitialized at this point. Found by: Coverity Scan, CID 1042128 Cheers, Uli From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 09:25:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90C34D27; Wed, 3 Jul 2013 09:25:34 +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 80324185A; Wed, 3 Jul 2013 09:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r639PYb2006394; Wed, 3 Jul 2013 09:25:34 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r639PTUL006359; Wed, 3 Jul 2013 09:25:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307030925.r639PTUL006359@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 3 Jul 2013 09:25:29 +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: r252555 - in stable/9: sbin/ifconfig sys/amd64/conf sys/conf sys/contrib/rdma sys/contrib/rdma/krping sys/dev/cxgb/ulp/tom sys/i386/conf sys/modules sys/modules/rdma/krping sys/modules/... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 09:25:34 -0000 Author: np Date: Wed Jul 3 09:25:29 2013 New Revision: 252555 URL: http://svnweb.freebsd.org/changeset/base/252555 Log: MFC/backport core kernel and userspace parts of r237263 (TCP_OFFLOAD rework). MFC r237563, r239511, r243603, r245915, r245916, r245919, r245921, r245922, r245924, r245925, r245932, r245934 too. Build tested with make universe. r237263: - Updated TOE support in the kernel. ... r237563: Fix clang warning when compiling iw_cxgb. r239511: Correctly handle the case where an inp has already been dropped by the time the TOE driver reports that an active open failed. toe_connect_failed is supposed to handle this but it should be provided the inpcb instead of the tcpcb which may no longer be around. r243603: Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not). r245915: Heed SO_NO_OFFLOAD. r245916: Teach toe_4tuple_check() to deal with IPv6 4-tuples too. r245919: Add TCP_OFFLOAD hook in syncache_respond for IPv6 too, just like the one that exists for IPv4. r245921: There is no need to call into the TOE driver twice in pru_rcvd (tod_rcvd and then tod_output right after that). r245922: Avoid NULL dereference in nd6_storelladdr when no mbuf is provided. It is called this way from a couple of places in the OFED code. (toecore calls it too but that's going to change shortly). r245924: Move lle_event to if_llatbl.h lle_event replaced arp_update_event after the ARP rewrite and ended up in if_ether.h simply because arp_update_event used to be there too. IPv6 neighbor discovery is going to grow lle_event support and this is a good time to move it to if_llatbl.h. The two in-tree consumers of this event - OFED and toecore - are not affected. r245925: Generate lle_event in the IPv6 neighbor discovery code too. r245932: Teach toe_l2_resolve to resolve IPv6 destinations too. r245934: Add checks for SO_NO_OFFLOAD in a couple of places that I missed earlier in r245915. Added: stable/9/sys/modules/toecore/ - copied from r237263, head/sys/modules/toecore/ stable/9/sys/netinet/toecore.c - copied, changed from r237263, head/sys/netinet/toecore.c stable/9/sys/netinet/toecore.h - copied, changed from r237263, head/sys/netinet/toecore.h Deleted: stable/9/sys/netinet/toedev.h Modified: stable/9/sbin/ifconfig/ifconfig.c stable/9/sys/amd64/conf/GENERIC stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/conf/options stable/9/sys/contrib/rdma/krping/krping.c stable/9/sys/contrib/rdma/krping/krping.h stable/9/sys/contrib/rdma/krping/krping_dev.c stable/9/sys/contrib/rdma/rdma_addr.c stable/9/sys/contrib/rdma/rdma_cache.c stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/XEN stable/9/sys/modules/Makefile stable/9/sys/modules/rdma/krping/Makefile stable/9/sys/net/if_llatbl.h stable/9/sys/net/if_var.h stable/9/sys/net/if_vlan.c stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/if_ether.h stable/9/sys/netinet/in.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_offload.c stable/9/sys/netinet/tcp_offload.h stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_syncache.h stable/9/sys/netinet/tcp_timer.c stable/9/sys/netinet/tcp_usrreq.c stable/9/sys/netinet/tcp_var.h stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_nbr.c stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/iwcm.c stable/9/sys/ofed/include/linux/net.h stable/9/sys/ofed/include/linux/workqueue.h stable/9/sys/ofed/include/net/netevent.h stable/9/sys/ofed/include/rdma/iw_cm.h stable/9/usr.bin/netstat/inet.c stable/9/usr.bin/sockstat/sockstat.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/usr.bin/netstat/ (props changed) stable/9/usr.bin/sockstat/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sbin/ifconfig/ifconfig.c Wed Jul 3 09:25:29 2013 (r252555) @@ -910,7 +910,7 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ +"\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ "\26RXCSUM_IPV6\27TXCSUM_IPV6" /* @@ -1189,6 +1189,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-tso4", -IFCAP_TSO4, setifcap), DEF_CMD("tso", IFCAP_TSO, setifcap), DEF_CMD("-tso", -IFCAP_TSO, setifcap), + DEF_CMD("toe", IFCAP_TOE, setifcap), + DEF_CMD("-toe", -IFCAP_TOE, setifcap), DEF_CMD("lro", IFCAP_LRO, setifcap), DEF_CMD("-lro", -IFCAP_LRO, setifcap), DEF_CMD("wol", IFCAP_WOL, setifcap), Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/amd64/conf/GENERIC Wed Jul 3 09:25:29 2013 (r252555) @@ -28,6 +28,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/NOTES Wed Jul 3 09:25:29 2013 (r252555) @@ -545,6 +545,8 @@ options INET6 #IPv6 communications pr options ROUTETABLES=2 # max 16. 1 is back compatible. +options TCP_OFFLOAD # TCP offload support. + # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration options IPSEC #IP security (requires device crypto) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/files Wed Jul 3 09:25:29 2013 (r252555) @@ -2886,7 +2886,7 @@ netinet/tcp_hostcache.c optional inet | netinet/tcp_input.c optional inet | inet6 netinet/tcp_lro.c optional inet | inet6 netinet/tcp_output.c optional inet | inet6 -netinet/tcp_offload.c optional inet | inet6 +netinet/tcp_offload.c optional tcp_offload inet | tcp_offload inet6 netinet/tcp_reass.c optional inet | inet6 netinet/tcp_sack.c optional inet | inet6 netinet/tcp_subr.c optional inet | inet6 Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/options Wed Jul 3 09:25:29 2013 (r252555) @@ -431,7 +431,7 @@ RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG -TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading +TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK Modified: stable/9/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping.c Wed Jul 3 09:25:29 2013 (r252555) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -53,11 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include +#include +#include #include "getopt.h" #include "krping.h" @@ -83,6 +84,7 @@ static const struct krping_option krping {"bw", OPT_NOPARAM, 'B'}, {"tx-depth", OPT_INT, 't'}, {"poll", OPT_NOPARAM, 'P'}, + {"memlimit", OPT_INT, 'm'}, {NULL, 0, 0} }; @@ -254,10 +256,14 @@ static void krping_cq_event_handler(stru ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP); while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { - if (wc.status != IB_WC_WR_FLUSH_ERR) - log(LOG_ERR, "cq completion failed status %d\n", + if (wc.status == IB_WC_WR_FLUSH_ERR) { + DEBUG_LOG("cq flushed\n"); + continue; + } else { + log(LOG_CRIT, "cq completion failed status %d\n", wc.status); - goto error; + goto error; + } } switch (wc.opcode) { @@ -432,8 +438,17 @@ static int krping_setup_buffers(struct k } } - cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, -1UL, - PAGE_SIZE, 0); + /* RNIC adapters have a limit upto which it can register physical memory + * If DMA-MR memory mode is set then normally driver registers maximum + * supported memory. After that if contigmalloc allocates memory beyond the + * specified RNIC limit then Krping may not work. + */ + if (cb->use_dmamr && cb->memlimit) + cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, cb->memlimit, + PAGE_SIZE, 0); + else + cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, -1UL, + PAGE_SIZE, 0); if (!cb->rdma_buf) { log(LOG_ERR, "rdma_buf malloc failed\n"); @@ -458,8 +473,12 @@ static int krping_setup_buffers(struct k } if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, - 0, -1UL, PAGE_SIZE, 0); + if (cb->use_dmamr && cb->memlimit) + cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, + 0, cb->memlimit, PAGE_SIZE, 0); + else + cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, + 0, -1UL, PAGE_SIZE, 0); if (!cb->start_buf) { log(LOG_ERR, "start_buf malloc failed\n"); ret = ENOMEM; @@ -1636,6 +1655,8 @@ int krping_doit(char *cmd) cb->state = IDLE; cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; + cb->use_dmamr = 1; + cb->memlimit = 0; mtx_init(&cb->lock, "krping mtx", NULL, MTX_DUPOK|MTX_DEF); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -1713,6 +1734,15 @@ int krping_doit(char *cmd) case 'd': debug++; break; + case 'm': + cb->memlimit = optint; + if (cb->memlimit < 1) { + log(LOG_ERR, "Invalid memory limit %ju\n", + cb->memlimit); + ret = EINVAL; + } else + DEBUG_LOG(PFX "memory limit %d\n", (int)optint); + break; default: log(LOG_ERR, "unknown opt %s\n", optarg); ret = EINVAL; Modified: stable/9/sys/contrib/rdma/krping/krping.h ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping.h Wed Jul 3 09:25:29 2013 (r252555) @@ -1,7 +1,7 @@ /* * $FreeBSD$ */ -#include +#include #include /* @@ -92,6 +92,8 @@ struct krping_cb { int count; /* ping count */ int size; /* ping data size */ int validate; /* validate ping data */ + uint64_t memlimit; /* limit of the physical memory that + can be registered with dma_mr mode */ /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ Modified: stable/9/sys/contrib/rdma/krping/krping_dev.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping_dev.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping_dev.c Wed Jul 3 09:25:29 2013 (r252555) @@ -14,7 +14,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include /* uprintf */ #include #include /* defines used in kernel.h */ @@ -51,6 +50,9 @@ typedef struct s_krping { /* vars */ static struct cdev *krping_dev; +#undef MODULE_VERSION +#include + static int krping_loader(struct module *m, int what, void *arg) { @@ -175,6 +177,4 @@ krping_write(struct cdev *dev, struct ui return(err); } -MODULE_DEPEND(krping, rdma_core, 1, 1, 1); -MODULE_DEPEND(krping, rdma_cma, 1, 1, 1); DEV_MODULE(krping,krping_loader,NULL); Modified: stable/9/sys/contrib/rdma/rdma_addr.c ============================================================================== --- stable/9/sys/contrib/rdma/rdma_addr.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/rdma_addr.c Wed Jul 3 09:25:29 2013 (r252555) @@ -117,7 +117,8 @@ int rdma_copy_addr(struct rdma_dev_addr const unsigned char *dst_dev_addr) { dev_addr->dev_type = RDMA_NODE_RNIC; - memcpy(dev_addr->src_dev_addr, IF_LLADDR(dev), MAX_ADDR_LEN); + memset(dev_addr->src_dev_addr, 0, MAX_ADDR_LEN); + memcpy(dev_addr->src_dev_addr, IF_LLADDR(dev), dev->if_addrlen); memcpy(dev_addr->broadcast, dev->if_broadcastaddr, MAX_ADDR_LEN); if (dst_dev_addr) memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN); @@ -207,7 +208,7 @@ static int addr_resolve_remote(struct so goto put; } ret = arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, - rt_key(iproute.ro_rt), dmac, &lle); + (struct sockaddr *)dst_in, dmac, &lle); if (ret) { goto put; } Modified: stable/9/sys/contrib/rdma/rdma_cache.c ============================================================================== --- stable/9/sys/contrib/rdma/rdma_cache.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/rdma_cache.c Wed Jul 3 09:25:29 2013 (r252555) @@ -132,7 +132,7 @@ int ib_find_cached_gid(struct ib_device for (p = 0; p <= end_port(device) - start_port(device); ++p) { cache = device->cache.gid_cache[p]; for (i = 0; i < cache->table_len; ++i) { - if (!memcmp(gid, &cache->table[i], 6)) { /* XXX */ + if (!memcmp(gid, &cache->table[i], sizeof *gid)) { *port_num = p + start_port(device); if (index) *index = i; Modified: stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jul 3 09:25:29 2013 (r252555) @@ -880,10 +880,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -912,8 +912,7 @@ do_act_open_rpl(struct sge_qset *qs, str unsigned int atid = G_TID(ntohl(rpl->atid)); struct toepcb *toep = lookup_atid(&td->tid_maps, atid); struct inpcb *inp = toep->tp_inp; - struct tcpcb *tp = intotcpcb(inp); - int s = rpl->status; + int s = rpl->status, rc; CTR3(KTR_CXGB, "%s: atid %u, status %u ", __func__, atid, s); @@ -923,17 +922,14 @@ do_act_open_rpl(struct sge_qset *qs, str if (act_open_has_tid(s)) queue_tid_release(tod, GET_TID(rpl)); - if (s == CPL_ERR_TCAM_FULL || s == CPL_ERR_CONN_EXIST) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - toepcb_release(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(s); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(s)); - toepcb_release(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + toepcb_release(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } m_freem(m); return (0); Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/i386/conf/GENERIC Wed Jul 3 09:25:29 2013 (r252555) @@ -30,6 +30,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: stable/9/sys/i386/conf/XEN ============================================================================== --- stable/9/sys/i386/conf/XEN Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/i386/conf/XEN Wed Jul 3 09:25:29 2013 (r252555) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/modules/Makefile Wed Jul 3 09:25:29 2013 (r252555) @@ -313,6 +313,7 @@ SUBDIR= \ ${_ti} \ tl \ tmpfs \ + ${_toecore} \ ${_tpm} \ trm \ ${_twa} \ @@ -395,6 +396,7 @@ _if_gre= if_gre .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _if_carp= if_carp +_toecore= toecore .endif .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) Modified: stable/9/sys/modules/rdma/krping/Makefile ============================================================================== --- stable/9/sys/modules/rdma/krping/Makefile Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/modules/rdma/krping/Makefile Wed Jul 3 09:25:29 2013 (r252555) @@ -6,5 +6,7 @@ RDMA= ${.CURDIR}/../../../contrib/rdma/k KMOD= krping SRCS= krping.c krping_dev.c getopt.c SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h +SRCS+= vnode_if.h +CFLAGS+= -I${.CURDIR}/../../../ofed/include .include Modified: stable/9/sys/net/if_llatbl.h ============================================================================== --- stable/9/sys/net/if_llatbl.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_llatbl.h Wed Jul 3 09:25:29 2013 (r252555) @@ -205,4 +205,14 @@ lla_lookup(struct lltable *llt, u_int fl } int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); + +#include +enum { + LLENTRY_RESOLVED, + LLENTRY_TIMEDOUT, + LLENTRY_DELETED, + LLENTRY_EXPIRED, +}; +typedef void (*lle_event_fn)(void *, struct llentry *, int); +EVENTHANDLER_DECLARE(lle_event, lle_event_fn); #endif /* _NET_IF_LLATBL_H_ */ Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_var.h Wed Jul 3 09:25:29 2013 (r252555) @@ -755,6 +755,8 @@ drbr_inuse(struct ifnet *ifp, struct buf #define IF_MINMTU 72 #define IF_MAXMTU 65535 +#define TOEDEV(ifp) ((ifp)->if_llsoftc) + #endif /* _KERNEL */ /* Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_vlan.c Wed Jul 3 09:25:29 2013 (r252555) @@ -748,8 +748,8 @@ vlan_modevent(module_t mod, int type, vo vlan_trunk_cap_p = NULL; vlan_trunkdev_p = NULL; vlan_tag_p = NULL; - vlan_cookie_p = vlan_cookie; - vlan_setcookie_p = vlan_setcookie; + vlan_cookie_p = NULL; + vlan_setcookie_p = NULL; vlan_devat_p = NULL; VLAN_LOCK_DESTROY(); if (bootverbose) @@ -1510,6 +1510,22 @@ vlan_capabilities(struct ifvlan *ifv) ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO); ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO); } + + /* + * If the parent interface can offload TCP connections over VLANs then + * propagate its TOE capability to the VLAN interface. + * + * All TOE drivers in the tree today can deal with VLANs. If this + * changes then IFCAP_VLAN_TOE should be promoted to a full capability + * with its own bit. + */ +#define IFCAP_VLAN_TOE IFCAP_TOE + if (p->if_capabilities & IFCAP_VLAN_TOE) + ifp->if_capabilities |= p->if_capabilities & IFCAP_TOE; + if (p->if_capenable & IFCAP_VLAN_TOE) { + TOEDEV(ifp) = TOEDEV(p); + ifp->if_capenable |= p->if_capenable & IFCAP_TOE; + } } static void Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/if_ether.c Wed Jul 3 09:25:29 2013 (r252555) @@ -178,6 +178,16 @@ arptimer(void *arg) ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); + if ((lle->la_flags & LLE_DELETED) == 0) { + int evt; + + if (lle->la_flags & LLE_VALID) + evt = LLENTRY_EXPIRED; + else + evt = LLENTRY_TIMEDOUT; + EVENTHANDLER_INVOKE(lle_event, lle, evt); + } + callout_stop(&lle->la_timer); /* XXX: LOR avoidance. We still have ref on lle. */ @@ -730,7 +740,7 @@ match: (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen); la->la_flags |= LLE_VALID; - EVENTHANDLER_INVOKE(arp_update_event, la); + EVENTHANDLER_INVOKE(lle_event, la, LLENTRY_RESOLVED); if (!(la->la_flags & LLE_STATIC)) { int canceled; Modified: stable/9/sys/netinet/if_ether.h ============================================================================== --- stable/9/sys/netinet/if_ether.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/if_ether.h Wed Jul 3 09:25:29 2013 (r252555) @@ -117,11 +117,6 @@ int arpresolve(struct ifnet *ifp, struct struct llentry **lle); void arp_ifinit(struct ifnet *, struct ifaddr *); void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *); - -#include -typedef void (*llevent_arp_update_fn)(void *, struct llentry *); -EVENTHANDLER_DECLARE(arp_update_event, llevent_arp_update_fn); - #endif #endif Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/in.c Wed Jul 3 09:25:29 2013 (r252555) @@ -1527,7 +1527,7 @@ in_lltable_lookup(struct lltable *llt, u if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; - EVENTHANDLER_INVOKE(arp_update_event, lle); + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); #ifdef DIAGNOSTIC log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_input.c Wed Jul 3 09:25:29 2013 (r252555) @@ -105,6 +105,9 @@ __FBSDID("$FreeBSD$"); #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ +#ifdef TCP_OFFLOAD +#include +#endif #ifdef IPSEC #include @@ -995,6 +998,14 @@ relocked: goto dropwithreset; } +#ifdef TCP_OFFLOAD + if (tp->t_flags & TF_TOE) { + tcp_offload_input(tp, m); + m = NULL; /* consumed by the TOE driver */ + goto dropunlock; + } +#endif + /* * We've identified a valid inpcb, but it could be that we need an * inpcbinfo write lock but don't hold it. In this case, attempt to Modified: stable/9/sys/netinet/tcp_offload.c ============================================================================== --- stable/9/sys/netinet/tcp_offload.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_offload.c Wed Jul 3 09:25:29 2013 (r252555) @@ -1,145 +1,176 @@ /*- - * Copyright (c) 2007, Chelsio Inc. + * Copyright (c) 2012 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of the Chelsio Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" + #include #include #include -#include -#include -#include #include #include #include - +#include #include -#include -#include #include -#include - #include -#include #include #include #include #include -#include +#define TCPOUTFLAGS +#include +#include -uint32_t toedev_registration_count; +int registered_toedevs; +/* + * Provide an opportunity for a TOE driver to offload. + */ int tcp_offload_connect(struct socket *so, struct sockaddr *nam) { struct ifnet *ifp; - struct toedev *tdev; + struct toedev *tod; struct rtentry *rt; - int error; + int error = EOPNOTSUPP; + + INP_WLOCK_ASSERT(sotoinpcb(so)); + KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, + ("%s: called with sa_family %d", __func__, nam->sa_family)); - if (toedev_registration_count == 0) - return (EINVAL); - - /* - * Look up the route used for the connection to - * determine if it uses an interface capable of - * offloading the connection. - */ - rt = rtalloc1(nam, 0 /*report*/, 0 /*ignflags*/); - if (rt) + if (registered_toedevs == 0) + return (error); + + rt = rtalloc1(nam, 0, 0); + if (rt) RT_UNLOCK(rt); - else + else return (EHOSTUNREACH); ifp = rt->rt_ifp; - if ((ifp->if_capenable & IFCAP_TOE) == 0) { - error = EINVAL; - goto fail; - } - - tdev = TOEDEV(ifp); - if (tdev == NULL) { - error = EPERM; - goto fail; - } - - if (tdev->tod_can_offload(tdev, so) == 0) { - error = EPERM; - goto fail; - } - - return (tdev->tod_connect(tdev, so, rt, nam)); -fail: + + if (nam->sa_family == AF_INET && !(ifp->if_capenable & IFCAP_TOE4)) + goto done; + if (nam->sa_family == AF_INET6 && !(ifp->if_capenable & IFCAP_TOE6)) + goto done; + + tod = TOEDEV(ifp); + if (tod != NULL) + error = tod->tod_connect(tod, so, rt, nam); +done: RTFREE(rt); return (error); } +void +tcp_offload_listen_start(struct tcpcb *tp) +{ -/* - * This file contains code as a short-term staging area before it is moved in - * to sys/netinet/tcp_offload.c - */ + INP_WLOCK_ASSERT(tp->t_inpcb); + + EVENTHANDLER_INVOKE(tcp_offload_listen_start, tp); +} void -tcp_offload_twstart(struct tcpcb *tp) +tcp_offload_listen_stop(struct tcpcb *tp) { - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tcp_twstart(tp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_WLOCK_ASSERT(tp->t_inpcb); + + EVENTHANDLER_INVOKE(tcp_offload_listen_stop, tp); } -struct tcpcb * -tcp_offload_close(struct tcpcb *tp) +void +tcp_offload_input(struct tcpcb *tp, struct mbuf *m) { + struct toedev *tod = tp->tod; - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tp = tcp_close(tp); - INP_INFO_WUNLOCK(&V_tcbinfo); - if (tp) - INP_WUNLOCK(tp->t_inpcb); + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); - return (tp); + tod->tod_input(tod, tp, m); } -struct tcpcb * -tcp_offload_drop(struct tcpcb *tp, int error) +int +tcp_offload_output(struct tcpcb *tp) { + struct toedev *tod = tp->tod; + int error, flags; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tp = tcp_drop(tp, error); - INP_INFO_WUNLOCK(&V_tcbinfo); - if (tp) - INP_WUNLOCK(tp->t_inpcb); + flags = tcp_outflags[tp->t_state]; - return (tp); + if (flags & TH_RST) { + /* XXX: avoid repeated calls like we do for FIN */ + error = tod->tod_send_rst(tod, tp); + } else if ((flags & TH_FIN || tp->t_flags & TF_NEEDFIN) && + (tp->t_flags & TF_SENTFIN) == 0) { + error = tod->tod_send_fin(tod, tp); + if (error == 0) + tp->t_flags |= TF_SENTFIN; + } else + error = tod->tod_output(tod, tp); + + return (error); +} + +void +tcp_offload_rcvd(struct tcpcb *tp) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_rcvd(tod, tp); } +void +tcp_offload_ctloutput(struct tcpcb *tp, int sopt_dir, int sopt_name) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_ctloutput(tod, tp, sopt_dir, sopt_name); +} + +void +tcp_offload_detach(struct tcpcb *tp) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_pcb_detach(tod, tp); +} Modified: stable/9/sys/netinet/tcp_offload.h ============================================================================== --- stable/9/sys/netinet/tcp_offload.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_offload.h Wed Jul 3 09:25:29 2013 (r252555) @@ -1,30 +1,30 @@ /*- - * Copyright (c) 2007, Chelsio Inc. + * Copyright (c) 2012 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of the Chelsio Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ + * */ #ifndef _NETINET_TCP_OFFLOAD_H_ @@ -34,321 +34,15 @@ #error "no user-serviceable parts inside" #endif -/* - * A driver publishes that it provides offload services - * by setting IFCAP_TOE in the ifnet. The offload connect - * will bypass any further work if the interface that a - * connection would use does not support TCP offload. - * - * The TOE API assumes that the tcp offload engine can offload the - * the entire connection from set up to teardown, with some provision - * being made to allowing the software stack to handle time wait. If - * the device does not meet these criteria, it is the driver's responsibility - * to overload the functions that it needs to in tcp_usrreqs and make - * its own calls to tcp_output if it needs to do so. - * - * There is currently no provision for the device advertising the congestion - * control algorithms it supports as there is currently no API for querying - * an operating system for the protocols that it has loaded. This is a desirable - * future extension. - * - * - * - * It is assumed that individuals deploying TOE will want connections - * to be offloaded without software changes so all connections on an - * interface providing TOE are offloaded unless the SO_NO_OFFLOAD - * flag is set on the socket. - * - * - * The toe_usrreqs structure constitutes the TOE driver's - * interface to the TCP stack for functionality that doesn't - * interact directly with userspace. If one wants to provide - * (optional) functionality to do zero-copy to/from - * userspace one still needs to override soreceive/sosend - * with functions that fault in and pin the user buffers. - * - * + tu_send - * - tells the driver that new data may have been added to the - * socket's send buffer - the driver should not fail if the - * buffer is in fact unchanged - * - the driver is responsible for providing credits (bytes in the send window) - * back to the socket by calling sbdrop() as segments are acknowledged. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_rcvd - * - returns credits to the driver and triggers window updates - * to the peer (a credit as used here is a byte in the peer's receive window) - * - the driver is expected to determine how many bytes have been - * consumed and credit that back to the card so that it can grow - * the window again by maintaining its own state between invocations. - * - In principle this could be used to shrink the window as well as - * grow the window, although it is not used for that now. - * - this function needs to correctly handle being called any number of - * times without any bytes being consumed from the receive buffer. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_disconnect - * - tells the driver to send FIN to peer - * - driver is expected to send the remaining data and then do a clean half close - * - disconnect implies at least half-close so only send, reset, and detach - * are legal - * - the driver is expected to handle transition through the shutdown - * state machine and allow the stack to support SO_LINGER. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_reset - * - closes the connection and sends a RST to peer - * - driver is expectd to trigger an RST and detach the toepcb - * - no further calls are legal after reset - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * The following fields in the tcpcb are expected to be referenced by the driver: - * + iss - * + rcv_nxt - * + rcv_wnd - * + snd_isn - * + snd_max - * + snd_nxt - * + snd_una - * + t_flags - * + t_inpcb - * + t_maxseg - * + t_toe - * - * The following fields in the inpcb are expected to be referenced by the driver: - * + inp_lport - * + inp_fport - * + inp_laddr - * + inp_fport - * + inp_socket - * + inp_ip_tos - * - * The following fields in the socket are expected to be referenced by the - * driver: - * + so_comp - * + so_error - * + so_linger - * + so_options - * + so_rcv - * + so_snd - * + so_state - * + so_timeo - * - * These functions all return 0 on success and can return the following errors - * as appropriate: - * + EPERM: - * + ENOBUFS: memory allocation failed - * + EMSGSIZE: MTU changed during the call - * + EHOSTDOWN: - * + EHOSTUNREACH: - * + ENETDOWN: - * * ENETUNREACH: the peer is no longer reachable - * - * + tu_detach - * - tells driver that the socket is going away so disconnect - * the toepcb and free appropriate resources - * - allows the driver to cleanly handle the case of connection state - * outliving the socket - * - no further calls are legal after detach - * - the driver is expected to provide its own synchronization between - * detach and receiving new data. - * - * + tu_syncache_event - * - even if it is not actually needed, the driver is expected to - * call syncache_add for the initial SYN and then syncache_expand - * for the SYN,ACK - * - tells driver that a connection either has not been added or has - * been dropped from the syncache - * - the driver is expected to maintain state that lives outside the - * software stack so the syncache needs to be able to notify the - * toe driver that the software stack is not going to create a connection - * for a received SYN - * - The driver is responsible for any synchronization required between - * the syncache dropping an entry and the driver processing the SYN,ACK. - * - */ -struct toe_usrreqs { - int (*tu_send)(struct tcpcb *tp); - int (*tu_rcvd)(struct tcpcb *tp); - int (*tu_disconnect)(struct tcpcb *tp); - int (*tu_reset)(struct tcpcb *tp); - void (*tu_detach)(struct tcpcb *tp); - void (*tu_syncache_event)(int event, void *toep); -}; - -/* - * Proxy for struct tcpopt between TOE drivers and TCP functions. - */ -struct toeopt { - u_int64_t to_flags; /* see tcpopt in tcp_var.h */ - u_int16_t to_mss; /* maximum segment size */ - u_int8_t to_wscale; /* window scaling */ - - u_int8_t _pad1; /* explicit pad for 64bit alignment */ - u_int32_t _pad2; /* explicit pad for 64bit alignment */ - u_int64_t _pad3[4]; /* TBD */ -}; - -#define TOE_SC_ENTRY_PRESENT 1 /* 4-tuple already present */ -#define TOE_SC_DROP 2 /* connection was timed out */ - -/* - * Because listen is a one-to-many relationship (a socket can be listening - * on all interfaces on a machine some of which may be using different TCP - * offload devices), listen uses a publish/subscribe mechanism. The TCP - * offload driver registers a listen notification function with the stack. - * When a listen socket is created all TCP offload devices are notified - * so that they can do the appropriate set up to offload connections on the - * port to which the socket is bound. When the listen socket is closed, - * the offload devices are notified so that they will stop listening on that - * port and free any associated resources as well as sending RSTs on any - * connections in the SYN_RCVD state. - * - */ - -typedef void (*tcp_offload_listen_start_fn)(void *, struct tcpcb *); -typedef void (*tcp_offload_listen_stop_fn)(void *, struct tcpcb *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 09:28:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DCE7FE71; Wed, 3 Jul 2013 09:28:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7AD49186A; Wed, 3 Jul 2013 09:28:08 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.7/8.14.7) with ESMTP id r639S7O9070292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jul 2013 11:28:07 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Wed, 3 Jul 2013 11:28:07 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Davide Italiano Subject: Re: svn commit: r252356 - in head: contrib/smbfs/mount_smbfs etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sys... Message-ID: <20130703092807.GB2294@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Davide Italiano , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201306282100.r5SL08kx093999@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306282100.r5SL08kx093999@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 09:28:08 -0000 On Fri, 2013-06-28 at 21:00:08 +0000, Davide Italiano wrote: > Author: davide > Date: Fri Jun 28 21:00:08 2013 > New Revision: 252356 > URL: http://svnweb.freebsd.org/changeset/base/252356 > > Log: > - Trim an unused and bogus Makefile for mount_smbfs. > - Reconnect with some minor modifications, in particular now selsocket() > internals are adapted to use sbintime units after recent'ish calloutng > switch. yay, for reconnecting this to the build. Now Coverity Scan is "seeing" this code and there are dozens of double frees in the form: smb_rq_done(rqp); free(rqp, M_SMBFSDATA); But smb_rq_done() is already calling free(rqp). This seems easy to audit and fix. (sometimes the order is swapped, so it's a USE_AFTER_FREE instead) This is CIDs 1042109 -- 1042126, all in smbfs_smb.c. Thanks for looking into this Uli From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 09:48:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD8CA3B6; Wed, 3 Jul 2013 09:48:24 +0000 (UTC) (envelope-from des@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 AFF831945; Wed, 3 Jul 2013 09:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r639mORP012343; Wed, 3 Jul 2013 09:48:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r639mOMN012342; Wed, 3 Jul 2013 09:48:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307030948.r639mOMN012342@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 3 Jul 2013 09:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252556 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 09:48:24 -0000 Author: des Date: Wed Jul 3 09:48:24 2013 New Revision: 252556 URL: http://svnweb.freebsd.org/changeset/base/252556 Log: There is no reason to disallow setting the password or account expiry date to the current date. MFC after: 3 days Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Wed Jul 3 09:25:29 2013 (r252555) +++ head/usr.sbin/pw/pw_user.c Wed Jul 3 09:48:24 2013 (r252556) @@ -513,8 +513,6 @@ pw_user(struct userconf * cnf, int mode, time_t now = time(NULL); time_t expire = parse_date(now, arg->val); - if (now == expire) - errx(EX_DATAERR, "invalid password change date `%s'", arg->val); if (pwd->pw_change != expire) { pwd->pw_change = expire; edited = 1; @@ -533,8 +531,6 @@ pw_user(struct userconf * cnf, int mode, time_t now = time(NULL); time_t expire = parse_date(now, arg->val); - if (now == expire) - errx(EX_DATAERR, "invalid account expiry date `%s'", arg->val); if (pwd->pw_expire != expire) { pwd->pw_expire = expire; edited = 1; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 09:51:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34753530; Wed, 3 Jul 2013 09:51:00 +0000 (UTC) (envelope-from hrs@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 273BC1969; Wed, 3 Jul 2013 09:51:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r639p0fN014301; Wed, 3 Jul 2013 09:51:00 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r639p0Ux014296; Wed, 3 Jul 2013 09:51:00 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307030951.r639p0Ux014296@svn.freebsd.org> From: Hiroki Sato Date: Wed, 3 Jul 2013 09:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252557 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 09:51:00 -0000 Author: hrs Date: Wed Jul 3 09:50:59 2013 New Revision: 252557 URL: http://svnweb.freebsd.org/changeset/base/252557 Log: Fix a typo (s/error/errno/). Modified: head/sbin/ifconfig/af_nd6.c Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Wed Jul 3 09:48:24 2013 (r252556) +++ head/sbin/ifconfig/af_nd6.c Wed Jul 3 09:50:59 2013 (r252557) @@ -148,7 +148,7 @@ nd6_status(int s) memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - if (errno != EAFNOSUPPORT && error != EPROTONOSUPPORT) + if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); return; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 10:31:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F02D3272; Wed, 3 Jul 2013 10:31:45 +0000 (UTC) (envelope-from davide@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 E1F121BAC; Wed, 3 Jul 2013 10:31:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63AVjQs026409; Wed, 3 Jul 2013 10:31:45 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63AVjPL026408; Wed, 3 Jul 2013 10:31:45 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201307031031.r63AVjPL026408@svn.freebsd.org> From: Davide Italiano Date: Wed, 3 Jul 2013 10:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252558 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 10:31:46 -0000 Author: davide Date: Wed Jul 3 10:31:45 2013 New Revision: 252558 URL: http://svnweb.freebsd.org/changeset/base/252558 Log: - Fix double frees/user after free. - Allocate using smb_rq_alloc() instead of inlining it. Reported by: uqs Found with: Coverity Scan Modified: head/sys/fs/smbfs/smbfs_smb.c Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Wed Jul 3 09:50:59 2013 (r252557) +++ head/sys/fs/smbfs/smbfs_smb.c Wed Jul 3 10:31:45 2013 (r252558) @@ -94,12 +94,10 @@ smbfs_smb_lockandx(struct smbnode *np, i if (op == SMB_LOCK_SHARED) ltype |= SMB_LOCKING_ANDX_SHARED_LOCK; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_LOCKING_ANDX, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_LOCKING_ANDX, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint8(mbp, 0xff); /* secondary command */ @@ -119,7 +117,6 @@ smbfs_smb_lockandx(struct smbnode *np, i smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -188,19 +185,16 @@ smbfs_smb_statfs(struct smb_share *ssp, u_int16_t units, bpu, bsize, funits; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_QUERY_INFORMATION_DISK, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_QUERY_INFORMATION_DISK, + scred, &rqp); + if (error) + return (error); smb_rq_wstart(rqp); smb_rq_wend(rqp); smb_rq_bstart(rqp); smb_rq_bend(rqp); error = smb_rq_simple(rqp); if (error) { - free(rqp, M_SMBFSDATA); smb_rq_done(rqp); return error; } @@ -216,7 +210,6 @@ smbfs_smb_statfs(struct smb_share *ssp, sbp->f_files = 0xffff; /* total file nodes in filesystem */ sbp->f_ffree = 0xffff; /* free file nodes in fs */ smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return 0; } @@ -260,12 +253,9 @@ smb_smb_flush(struct smbnode *np, struct if ((np->n_flag & NOPEN) == 0 || !SMBTOV(np) || SMBTOV(np)->v_type != VREG) return 0; /* not a regular open file */ - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_FLUSH, scred); - if (error) { - free(rqp, M_SMBFSDATA); + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_FLUSH, scred, &rqp); + if (error) return (error); - } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); @@ -274,7 +264,6 @@ smb_smb_flush(struct smbnode *np, struct smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); if (!error) np->n_flag &= ~NFLUSHWIRE; return (error); @@ -301,12 +290,9 @@ smbfs_smb_setfsize(struct smbnode *np, i return (0); } - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_WRITE, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_WRITE, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); @@ -320,7 +306,6 @@ smbfs_smb_setfsize(struct smbnode *np, i smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -337,12 +322,10 @@ smbfs_smb_query_info(struct smbnode *np, u_int16_t wattr; u_int32_t lint; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_QUERY_INFORMATION, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_QUERY_INFORMATION, scred, + &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -377,7 +360,6 @@ smbfs_smb_query_info(struct smbnode *np, fap->fa_size = lint; } while(0); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -394,12 +376,10 @@ smbfs_smb_setpattr(struct smbnode *np, u u_long time; int error, svtz; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_SET_INFORMATION, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_SET_INFORMATION, scred, + &rqp); + if (error) + return (error); svtz = SSTOVC(ssp)->vc_sopt.sv_tz; smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); @@ -431,7 +411,6 @@ smbfs_smb_setpattr(struct smbnode *np, u } } while(0); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -554,12 +533,10 @@ smbfs_smb_setftime(struct smbnode *np, s u_int16_t date, time; int error, tzoff; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_SET_INFORMATION2, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_SET_INFORMATION2, scred, + &rqp); + if (error) + return (error); tzoff = SSTOVC(ssp)->vc_sopt.sv_tz; smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); @@ -584,7 +561,6 @@ smbfs_smb_setftime(struct smbnode *np, s error = smb_rq_simple(rqp); SMBSDEBUG("%d\n", error); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -648,12 +624,9 @@ smbfs_smb_open(struct smbnode *np, int a u_int16_t fid, wattr, grantedmode; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_OPEN, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_OPEN, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, accmode); @@ -684,7 +657,6 @@ smbfs_smb_open(struct smbnode *np, int a */ } while(0); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); if (error) return error; np->n_fid = fid; @@ -702,12 +674,9 @@ smbfs_smb_close(struct smb_share *ssp, u u_long time; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CLOSE, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_CLOSE, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&fid, sizeof(fid), MB_MSYSTEM); @@ -721,7 +690,6 @@ smbfs_smb_close(struct smb_share *ssp, u smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -739,12 +707,9 @@ smbfs_smb_create(struct smbnode *dnp, co u_long tm; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CREATE, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_CREATE, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_ARCHIVE); /* attributes */ @@ -771,7 +736,6 @@ smbfs_smb_create(struct smbnode *dnp, co if (error) return error; smbfs_smb_close(ssp, fid, &ctime, scred); - free(rqp, M_SMBFSDATA); return error; } @@ -783,12 +747,9 @@ smbfs_smb_delete(struct smbnode *np, str struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_DELETE, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_DELETE, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_SYSTEM | SMB_FA_HIDDEN); @@ -801,7 +762,6 @@ smbfs_smb_delete(struct smbnode *np, str error = smb_rq_simple(rqp); } smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -814,12 +774,9 @@ smbfs_smb_rename(struct smbnode *src, st struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_RENAME, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_RENAME, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_SYSTEM | SMB_FA_HIDDEN); @@ -838,7 +795,6 @@ smbfs_smb_rename(struct smbnode *src, st error = smb_rq_simple(rqp); } while(0); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -851,12 +807,9 @@ smbfs_smb_move(struct smbnode *src, stru struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_MOVE, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_MOVE, scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_TID_UNKNOWN); @@ -877,7 +830,6 @@ smbfs_smb_move(struct smbnode *src, stru error = smb_rq_simple(rqp); } while(0); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -890,12 +842,10 @@ smbfs_smb_mkdir(struct smbnode *dnp, con struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CREATE_DIRECTORY, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_CREATE_DIRECTORY, scred, + &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -907,7 +857,6 @@ smbfs_smb_mkdir(struct smbnode *dnp, con error = smb_rq_simple(rqp); } smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -919,12 +868,10 @@ smbfs_smb_rmdir(struct smbnode *np, stru struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_DELETE_DIRECTORY, scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ssp), SMB_COM_DELETE_DIRECTORY, scred, + &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -936,7 +883,6 @@ smbfs_smb_rmdir(struct smbnode *np, stru error = smb_rq_simple(rqp); } smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } @@ -958,7 +904,7 @@ smbfs_smb_search(struct smbfs_fctx *ctx) } error = smb_rq_alloc(SSTOCP(ctx->f_ssp), SMB_COM_SEARCH, ctx->f_scred, &rqp); if (error) - return error; + return (error); ctx->f_rq = rqp; smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); @@ -1204,12 +1150,10 @@ smbfs_smb_findclose2(struct smbfs_fctx * struct mbchain *mbp; int error; - rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); - error = smb_rq_init(rqp, SSTOCP(ctx->f_ssp), SMB_COM_FIND_CLOSE2, ctx->f_scred); - if (error) { - free(rqp, M_SMBFSDATA); - return error; - } + error = smb_rq_alloc(SSTOCP(ctx->f_ssp), SMB_COM_FIND_CLOSE2, + ctx->f_scred, &rqp); + if (error) + return (error); smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&ctx->f_Sid, 2, MB_MSYSTEM); @@ -1218,7 +1162,6 @@ smbfs_smb_findclose2(struct smbfs_fctx * smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); - free(rqp, M_SMBFSDATA); return error; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 10:33:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8D383DA; Wed, 3 Jul 2013 10:33:37 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [IPv6:2607:f8b0:400c:c01::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 2B06D1BC7; Wed, 3 Jul 2013 10:33:37 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id da11so5798366veb.34 for ; Wed, 03 Jul 2013 03:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5ymsap6FFTpKn5RQGS9oo6fqKIjtwJEFDYAfbC93Yok=; b=pqJpvHBM4BuJnbgyFsPUWFE82OyGjtmeyX5RKWeVkkZvKp8hfws9n0NlWeWUVCRGb2 IF6k27Ta3Xo3UJPqHmD6gj7FVVgjPdg3i99msLo2hFlau6eVee3KEVsjYmwGUlQvJZNA AJM2snSB5EgHTPniQ47HYGa9DOwMH9vqx/HnnrQPKHqY/Tt9CNhAkq0YSSahLmwFtt5Y LxLU5BLe4sbxQLKdcnj3qfc4gSpVBtK2D+r0DjEuTBgaq0jytVmXrmfI7VA7a7vxbvVZ 1aE+84Q4/kKAYG7R1HuW3hxv3c9JE3AkPrDOhXA55sECeDdlflz/uNKxlZDbhq9MNvL1 K2XA== MIME-Version: 1.0 X-Received: by 10.52.158.164 with SMTP id wv4mr32188vdb.106.1372847616194; Wed, 03 Jul 2013 03:33:36 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.206.202 with HTTP; Wed, 3 Jul 2013 03:33:36 -0700 (PDT) In-Reply-To: <20130703092807.GB2294@acme.spoerlein.net> References: <201306282100.r5SL08kx093999@svn.freebsd.org> <20130703092807.GB2294@acme.spoerlein.net> Date: Wed, 3 Jul 2013 12:33:36 +0200 X-Google-Sender-Auth: gIzdUc5dqRKPN_UPB6-xpfZLnjM Message-ID: Subject: Re: svn commit: r252356 - in head: contrib/smbfs/mount_smbfs etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sys... From: Davide Italiano To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , Davide Italiano , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 10:33:37 -0000 On Wed, Jul 3, 2013 at 11:28 AM, Ulrich Sp=F6rlein wrote: > On Fri, 2013-06-28 at 21:00:08 +0000, Davide Italiano wrote: >> Author: davide >> Date: Fri Jun 28 21:00:08 2013 >> New Revision: 252356 >> URL: http://svnweb.freebsd.org/changeset/base/252356 >> >> Log: >> - Trim an unused and bogus Makefile for mount_smbfs. >> - Reconnect with some minor modifications, in particular now selsocket= () >> internals are adapted to use sbintime units after recent'ish calloutng >> switch. > > yay, for reconnecting this to the build. Now Coverity Scan is "seeing" > this code and there are dozens of double frees in the form: > > smb_rq_done(rqp); > free(rqp, M_SMBFSDATA); > > But smb_rq_done() is already calling free(rqp). This seems easy to audit > and fix. > (sometimes the order is swapped, so it's a USE_AFTER_FREE instead) > > This is CIDs 1042109 -- 1042126, all in smbfs_smb.c. > > Thanks for looking into this > Uli I've just committed a fix. If there's something I missed don't hesitate to poke me privately. Thanks, --=20 Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 10:36:42 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B14946AA; Wed, 3 Jul 2013 10:36:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 2B1111C02; Wed, 3 Jul 2013 10:36:42 +0000 (UTC) Received: from alph.d.allbsd.org (p3086-ipbf906funabasi.chiba.ocn.ne.jp [122.26.46.86]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r63AaOse033466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Jul 2013 19:36:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r63AaNnU041671; Wed, 3 Jul 2013 19:36:24 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 03 Jul 2013 18:51:50 +0900 (JST) Message-Id: <20130703.185150.1466238345990988743.hrs@allbsd.org> To: uqs@FreeBSD.org Subject: Re: svn commit: r252408 - head/sbin/ifconfig From: Hiroki Sato In-Reply-To: <20130703092307.GA2294@acme.spoerlein.net> References: <201306300737.r5U7bWkB096070@svn.freebsd.org> <20130703092307.GA2294@acme.spoerlein.net> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jul__3_18_51_50_2013_293)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 03 Jul 2013 19:36:35 +0900 (JST) X-Spam-Status: No, score=-88.9 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,MIMEQENC,ONLY1HOPDIRECT,QENCPTR1,QENCPTR2,RCVD_IN_PBL, SAMEHELOBY2HOP,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 10:36:42 -0000 ----Security_Multipart(Wed_Jul__3_18_51_50_2013_293)-- Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Ulrich Sp=F6rlein wrote in <20130703092307.GA2294@acme.spoerlein.net>: uq> > if ((s6 =3D socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { uq> > - if (errno !=3D EAFNOSUPPORT) uq> > + if (errno !=3D EAFNOSUPPORT && error !=3D EPROTONOSUPPORT) uq> > warn("socket(AF_INET6, SOCK_DGRAM)"); uq> > return; uq> > } uq> = uq> This gives undefined behavior, error is uninitialized at this point= .= uq> = uq> Found by: Coverity Scan, CID 1042128 = Gr, fixed just now. Thank you for the report! -- Hiroki ----Security_Multipart(Wed_Jul__3_18_51_50_2013_293)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHT9DYACgkQTyzT2CeTzy3fnACgjvHVE7v9LSAF+Ju0D1sfamB3 t4UAoM7oXuub3FJ1FlcQ8mYahZncpeRl =OJBL -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jul__3_18_51_50_2013_293)---- From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 12:36:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 794C38D6; Wed, 3 Jul 2013 12:36:48 +0000 (UTC) (envelope-from zeising@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 6C24A1912; Wed, 3 Jul 2013 12:36:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63CamF1062714; Wed, 3 Jul 2013 12:36:48 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63CamFd062712; Wed, 3 Jul 2013 12:36:48 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201307031236.r63CamFd062712@svn.freebsd.org> From: Niclas Zeising Date: Wed, 3 Jul 2013 12:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252561 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:36:48 -0000 Author: zeising (doc,ports committer) Date: Wed Jul 3 12:36:47 2013 New Revision: 252561 URL: http://svnweb.freebsd.org/changeset/base/252561 Log: Document WITHOUT_SVNLITE and WITH_SVN. PR: docs/180025 Submitted by: Garrett Cooper Added: head/tools/build/options/WITHOUT_SVNLITE (contents, props changed) head/tools/build/options/WITH_SVN (contents, props changed) Added: head/tools/build/options/WITHOUT_SVNLITE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SVNLITE Wed Jul 3 12:36:47 2013 (r252561) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr svnlite 1 +and related programs. Added: head/tools/build/options/WITH_SVN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SVN Wed Jul 3 12:36:47 2013 (r252561) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to install +.Xr svnlite 1 +as +.Xr svn 1 . From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 12:51:12 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2991F15C; Wed, 3 Jul 2013 12:51:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9CCDE1A30; Wed, 3 Jul 2013 12:51:10 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA15255; Wed, 03 Jul 2013 15:51:08 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UuMWa-0009ic-7y; Wed, 03 Jul 2013 15:51:08 +0300 Message-ID: <51D41E17.5020904@FreeBSD.org> Date: Wed, 03 Jul 2013 15:50:31 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ed Maste Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D317BC.9020204@FreeBSD.org> In-Reply-To: <51D317BC.9020204@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:51:12 -0000 on 02/07/2013 21:11 Andriy Gapon said the following: > on 02/07/2013 20:59 Ed Maste said the following: >> What about just initializing td_swvoltick to ticks at td creation? > > I like this idea. What would be the best place(s) to do the initialization? Or, perhaps, td_swvoltick should be moved to td_startcopy-td_endcopy section? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 12:53:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5A0C2B4; Wed, 3 Jul 2013 12:53:06 +0000 (UTC) (envelope-from zeising@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 BFAE11A45; Wed, 3 Jul 2013 12:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Cr6qe068059; Wed, 3 Jul 2013 12:53:06 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Cr6wM068057; Wed, 3 Jul 2013 12:53:06 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201307031253.r63Cr6wM068057@svn.freebsd.org> From: Niclas Zeising Date: Wed, 3 Jul 2013 12:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252562 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:53:07 -0000 Author: zeising (doc,ports committer) Date: Wed Jul 3 12:53:06 2013 New Revision: 252562 URL: http://svnweb.freebsd.org/changeset/base/252562 Log: Regenerate after r252561 PR: docs/180025 Submitted by: Garrett Cooper Modified: head/share/man/man5/rc.conf.5 head/share/man/man5/src.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Jul 3 12:36:47 2013 (r252561) +++ head/share/man/man5/rc.conf.5 Wed Jul 3 12:53:06 2013 (r252562) @@ -3449,6 +3449,40 @@ For example, will set the .Xr syscons 4 scrollback (history) buffer to 200 lines. +.It Va auditd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr auditd 8 +daemon at system boot time. +.It Va auditd_program +.Pq Vt str +Path to +.Xr autitd 8 +(default +.Pa /usr/sbin/auditd ) . +.It Va auditd_flags +.Pq Vt str +Flags to pass to +.Xr audtid 8 . +.It Va auditdistd_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr auditdistd 8 +daemon at system boot time. +.It Va auditdistd_program +.Pq Vt str +Path to +.Xr auditdistd 8 +(default +.Pa /usr/sbin/auditdistd ) . +.It Va auditdistd_flags +.Pq Vt str +Flags to pass to +.Xr auditdistd 8 . .It Va cron_enable .Pq Vt bool If set to Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jul 3 12:36:47 2013 (r252561) +++ head/share/man/man5/src.conf.5 Wed Jul 3 12:53:06 2013 (r252562) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 251685 2013-06-13 13:05:08Z emaste .\" $FreeBSD$ -.Dd June 16, 2013 +.Dd July 3, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1055,6 +1055,17 @@ Set to not build kernel modules that inc .It Va WITHOUT_SSP .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. +.It Va WITH_SVN +.\" from FreeBSD: head/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising +Set to install +.Xr svnlite 1 +as +.Xr svn 1 . +.It Va WITHOUT_SVNLITE +.\" from FreeBSD: head/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising +Set to not build +.Xr svnlite 1 +and related programs. .It Va WITHOUT_SYMVER .\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen Set to disable symbol versioning when building shared libraries. From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 12:58:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6BDA5567; Wed, 3 Jul 2013 12:58:18 +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 5D8FF1A9C; Wed, 3 Jul 2013 12:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63CwIpF068820; Wed, 3 Jul 2013 12:58:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63CwIV3068819; Wed, 3 Jul 2013 12:58:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031258.r63CwIV3068819@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 12:58:18 +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: r252563 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:58:18 -0000 Author: ae Date: Wed Jul 3 12:58:17 2013 New Revision: 252563 URL: http://svnweb.freebsd.org/changeset/base/252563 Log: MFC r251995: Use ICMP6STAT_INC() macro for ICMPv6 errors accounting. Modified: stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Wed Jul 3 12:53:06 2013 (r252562) +++ stable/9/sys/netinet6/icmp6.c Wed Jul 3 12:58:17 2013 (r252563) @@ -130,7 +130,7 @@ VNET_DECLARE(int, icmp6_nodeinfo); #define V_icmp6errppslim_last VNET(icmp6errppslim_last) #define V_icmp6_nodeinfo VNET(icmp6_nodeinfo) -static void icmp6_errcount(struct icmp6errstat *, int, int); +static void icmp6_errcount(int, int); static int icmp6_rip6_input(struct mbuf **, int); static int icmp6_ratelimit(const struct in6_addr *, const int, const int); static const char *icmp6_redirect_diag(struct in6_addr *, @@ -159,59 +159,59 @@ kmod_icmp6stat_inc(int statnum) } static void -icmp6_errcount(struct icmp6errstat *stat, int type, int code) +icmp6_errcount(int type, int code) { switch (type) { case ICMP6_DST_UNREACH: switch (code) { case ICMP6_DST_UNREACH_NOROUTE: - stat->icp6errs_dst_unreach_noroute++; + ICMP6STAT_INC(icp6s_odst_unreach_noroute); return; case ICMP6_DST_UNREACH_ADMIN: - stat->icp6errs_dst_unreach_admin++; + ICMP6STAT_INC(icp6s_odst_unreach_admin); return; case ICMP6_DST_UNREACH_BEYONDSCOPE: - stat->icp6errs_dst_unreach_beyondscope++; + ICMP6STAT_INC(icp6s_odst_unreach_beyondscope); return; case ICMP6_DST_UNREACH_ADDR: - stat->icp6errs_dst_unreach_addr++; + ICMP6STAT_INC(icp6s_odst_unreach_addr); return; case ICMP6_DST_UNREACH_NOPORT: - stat->icp6errs_dst_unreach_noport++; + ICMP6STAT_INC(icp6s_odst_unreach_noport); return; } break; case ICMP6_PACKET_TOO_BIG: - stat->icp6errs_packet_too_big++; + ICMP6STAT_INC(icp6s_opacket_too_big); return; case ICMP6_TIME_EXCEEDED: switch (code) { case ICMP6_TIME_EXCEED_TRANSIT: - stat->icp6errs_time_exceed_transit++; + ICMP6STAT_INC(icp6s_otime_exceed_transit); return; case ICMP6_TIME_EXCEED_REASSEMBLY: - stat->icp6errs_time_exceed_reassembly++; + ICMP6STAT_INC(icp6s_otime_exceed_reassembly); return; } break; case ICMP6_PARAM_PROB: switch (code) { case ICMP6_PARAMPROB_HEADER: - stat->icp6errs_paramprob_header++; + ICMP6STAT_INC(icp6s_oparamprob_header); return; case ICMP6_PARAMPROB_NEXTHEADER: - stat->icp6errs_paramprob_nextheader++; + ICMP6STAT_INC(icp6s_oparamprob_nextheader); return; case ICMP6_PARAMPROB_OPTION: - stat->icp6errs_paramprob_option++; + ICMP6STAT_INC(icp6s_oparamprob_option); return; } break; case ND_REDIRECT: - stat->icp6errs_redirect++; + ICMP6STAT_INC(icp6s_oredirect); return; } - stat->icp6errs_unknown++; + ICMP6STAT_INC(icp6s_ounknown); } /* @@ -262,7 +262,7 @@ icmp6_error(struct mbuf *m, int type, in ICMP6STAT_INC(icp6s_error); /* count per-type-code statistics */ - icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, type, code); + icmp6_errcount(type, code); #ifdef M_DECRYPTED /*not openbsd*/ if (m->m_flags & M_DECRYPTED) { @@ -2558,7 +2558,7 @@ icmp6_redirect_output(struct mbuf *m0, s struct ifnet *outif = NULL; struct sockaddr_in6 src_sa; - icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, ND_REDIRECT, 0); + icmp6_errcount(ND_REDIRECT, 0); /* if we are not router, we don't send icmp6 redirect */ if (!V_ip6_forwarding) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 12:58:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44AF0725; Wed, 3 Jul 2013 12:58:54 +0000 (UTC) (envelope-from zeising@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 3766A1AAA; Wed, 3 Jul 2013 12:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63CwsB7068922; Wed, 3 Jul 2013 12:58:54 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63CwsJ3068921; Wed, 3 Jul 2013 12:58:54 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201307031258.r63CwsJ3068921@svn.freebsd.org> From: Niclas Zeising Date: Wed, 3 Jul 2013 12:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252564 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:58:54 -0000 Author: zeising (doc,ports committer) Date: Wed Jul 3 12:58:53 2013 New Revision: 252564 URL: http://svnweb.freebsd.org/changeset/base/252564 Log: Revert previous revision, local change that accidentally snuck in. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Jul 3 12:58:17 2013 (r252563) +++ head/share/man/man5/rc.conf.5 Wed Jul 3 12:58:53 2013 (r252564) @@ -3449,40 +3449,6 @@ For example, will set the .Xr syscons 4 scrollback (history) buffer to 200 lines. -.It Va auditd_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the -.Xr auditd 8 -daemon at system boot time. -.It Va auditd_program -.Pq Vt str -Path to -.Xr autitd 8 -(default -.Pa /usr/sbin/auditd ) . -.It Va auditd_flags -.Pq Vt str -Flags to pass to -.Xr audtid 8 . -.It Va auditdistd_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the -.Xr auditdistd 8 -daemon at system boot time. -.It Va auditdistd_program -.Pq Vt str -Path to -.Xr auditdistd 8 -(default -.Pa /usr/sbin/auditdistd ) . -.It Va auditdistd_flags -.Pq Vt str -Flags to pass to -.Xr auditdistd 8 . .It Va cron_enable .Pq Vt bool If set to From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 13:00:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BC828B1; Wed, 3 Jul 2013 13:00:36 +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 33EA01AE3; Wed, 3 Jul 2013 13:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63D0agA070806; Wed, 3 Jul 2013 13:00:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63D0Zqw070804; Wed, 3 Jul 2013 13:00:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031300.r63D0Zqw070804@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 13:00: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: r252565 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 13:00:36 -0000 Author: ae Date: Wed Jul 3 13:00:35 2013 New Revision: 252565 URL: http://svnweb.freebsd.org/changeset/base/252565 Log: MFC r252007: Use RIP6STAT_INC() macro for raw ip6 statistics accounting. Modified: stable/9/sys/netinet6/raw_ip6.c stable/9/sys/netinet6/raw_ip6.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/raw_ip6.c ============================================================================== --- stable/9/sys/netinet6/raw_ip6.c Wed Jul 3 12:58:53 2013 (r252564) +++ stable/9/sys/netinet6/raw_ip6.c Wed Jul 3 13:00:35 2013 (r252565) @@ -160,7 +160,7 @@ rip6_input(struct mbuf **mp, int *offp, struct mbuf *opts = NULL; struct sockaddr_in6 fromsa; - V_rip6stat.rip6s_ipackets++; + RIP6STAT_INC(rip6s_ipackets); if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { /* XXX Send icmp6 host/port unreach? */ @@ -199,11 +199,11 @@ rip6_input(struct mbuf **mp, int *offp, } INP_RLOCK(in6p); if (in6p->in6p_cksum != -1) { - V_rip6stat.rip6s_isum++; + RIP6STAT_INC(rip6s_isum); if (in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { INP_RUNLOCK(in6p); - V_rip6stat.rip6s_badsum++; + RIP6STAT_INC(rip6s_badsum); continue; } } @@ -279,7 +279,7 @@ rip6_input(struct mbuf **mp, int *offp, m_freem(n); if (opts) m_freem(opts); - V_rip6stat.rip6s_fullsock++; + RIP6STAT_INC(rip6s_fullsock); } else sorwakeup(last->inp_socket); opts = NULL; @@ -312,14 +312,14 @@ rip6_input(struct mbuf **mp, int *offp, m_freem(m); if (opts) m_freem(opts); - V_rip6stat.rip6s_fullsock++; + RIP6STAT_INC(rip6s_fullsock); } else sorwakeup(last->inp_socket); INP_RUNLOCK(last); } else { - V_rip6stat.rip6s_nosock++; + RIP6STAT_INC(rip6s_nosock); if (m->m_flags & M_MCAST) - V_rip6stat.rip6s_nosockmcast++; + RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); else { @@ -559,7 +559,7 @@ rip6_output(m, va_alist) icmp6_ifoutstat_inc(oifp, type, code); ICMP6STAT_INC(icp6s_outhist[type]); } else - V_rip6stat.rip6s_opackets++; + RIP6STAT_INC(rip6s_opackets); goto freectl; Modified: stable/9/sys/netinet6/raw_ip6.h ============================================================================== --- stable/9/sys/netinet6/raw_ip6.h Wed Jul 3 12:58:53 2013 (r252564) +++ stable/9/sys/netinet6/raw_ip6.h Wed Jul 3 13:00:35 2013 (r252565) @@ -48,6 +48,8 @@ struct rip6stat { }; #ifdef _KERNEL +#define RIP6STAT_ADD(name, val) V_rip6stat.name += (val) +#define RIP6STAT_INC(name) RIP6STAT_ADD(name, 1) VNET_DECLARE(struct rip6stat, rip6stat); #define V_rip6stat VNET(rip6stat) #endif From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 13:03:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32EFDA1D; Wed, 3 Jul 2013 13:03:10 +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 153F01B02; Wed, 3 Jul 2013 13:03:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63D39aO071423; Wed, 3 Jul 2013 13:03:09 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63D39qE071422; Wed, 3 Jul 2013 13:03:09 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031303.r63D39qE071422@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 13:03: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: r252566 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 13:03:10 -0000 Author: ae Date: Wed Jul 3 13:03:09 2013 New Revision: 252566 URL: http://svnweb.freebsd.org/changeset/base/252566 Log: MFC r252009: Use PIM6STAT_INC() and MRT6STAT_INC() macros for IPv6 multicast statistics accounting. Modified: stable/9/sys/netinet6/ip6_mroute.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Wed Jul 3 13:00:35 2013 (r252565) +++ stable/9/sys/netinet6/ip6_mroute.c Wed Jul 3 13:03:09 2013 (r252566) @@ -162,6 +162,7 @@ SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, &mrt6stat, mrt6stat, "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); +#define MRT6STAT_INC(name) mrt6stat.name += 1 #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 @@ -251,8 +252,9 @@ static mifi_t reg_mif_num = (mifi_t)-1; static struct pim6stat pim6stat; SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RW, &pim6stat, pim6stat, - "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); + "PIM Statistics (struct pim6stat, netinet6/pim6_var.h)"); +#define PIM6STAT_INC(name) pim6stat.name += 1 static VNET_DEFINE(int, pim6); #define V_pim6 VNET(pim6) @@ -270,7 +272,7 @@ static VNET_DEFINE(int, pim6); #define MF6CFIND(o, g, rt) do { \ struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \ rt = NULL; \ - mrt6stat.mrt6s_mfc_lookups++; \ + MRT6STAT_INC(mrt6s_mfc_lookups); \ while (_rt) { \ if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \ IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \ @@ -281,7 +283,7 @@ static VNET_DEFINE(int, pim6); _rt = _rt->mf6c_next; \ } \ if (rt == NULL) { \ - mrt6stat.mrt6s_mfc_misses++; \ + MRT6STAT_INC(mrt6s_mfc_misses); \ } \ } while (/*CONSTCOND*/ 0) @@ -1142,7 +1144,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru GET_TIME(tp); #endif /* UPCALL_TIMING */ - mrt6stat.mrt6s_no_route++; + MRT6STAT_INC(mrt6s_no_route); #ifdef MRT6DEBUG if (V_mrt6debug & (DEBUG_FORWARD | DEBUG_MFC)) log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n", @@ -1269,7 +1271,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { log(LOG_WARNING, "ip6_mforward: ip6_mrouter " "socket queue full\n"); - mrt6stat.mrt6s_upq_sockfull++; + MRT6STAT_INC(mrt6s_upq_sockfull); free(rte, M_MRTABLE6); m_freem(mb0); free(rt, M_MRTABLE6); @@ -1277,7 +1279,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru return (ENOBUFS); } - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); /* insert new entry at head of hash chain */ bzero(rt, sizeof(*rt)); @@ -1303,7 +1305,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next) if (++npkts > MAX_UPQ6) { - mrt6stat.mrt6s_upq_ovflw++; + MRT6STAT_INC(mrt6s_upq_ovflw); free(rte, M_MRTABLE6); m_freem(mb0); MFC6_UNLOCK(); @@ -1372,7 +1374,7 @@ expire_upcalls(void *unused) free(rte, M_MRTABLE6); rte = n; } while (rte != NULL); - mrt6stat.mrt6s_cache_cleanups++; + MRT6STAT_INC(mrt6s_cache_cleanups); n6expire[i]--; *nptr = mfc->mf6c_next; @@ -1428,7 +1430,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if ifp->if_index, mifi, mif6table[mifi].m6_ifp->if_index); #endif - mrt6stat.mrt6s_wrong_if++; + MRT6STAT_INC(mrt6s_wrong_if); rt->mf6c_wrong_if++; /* * If we are doing PIM processing, and we are forwarding @@ -1501,14 +1503,14 @@ ip6_mdq(struct mbuf *m, struct ifnet *if break; } - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { #ifdef MRT6DEBUG if (V_mrt6debug) log(LOG_WARNING, "mdq, ip6_mrouter socket queue full\n"); #endif - ++mrt6stat.mrt6s_upq_sockfull; + MRT6STAT_INC(mrt6s_upq_sockfull); return (ENOBUFS); } /* if socket Q full */ } /* if PIM */ @@ -1696,7 +1698,7 @@ register_send(struct ip6_hdr *ip6, struc ip6_sprintf(ip6bufd, &ip6->ip6_dst)); } #endif - ++pim6stat.pim6s_snd_registers; + PIM6STAT_INC(pim6s_snd_registers); /* Make a copy of the packet to send to the user level process */ MGETHDR(mm, M_DONTWAIT, MT_HEADER); @@ -1731,7 +1733,7 @@ register_send(struct ip6_hdr *ip6, struc im6->im6_mif = mif - mif6table; /* iif info is not given for reg. encap.n */ - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { #ifdef MRT6DEBUG @@ -1739,7 +1741,7 @@ register_send(struct ip6_hdr *ip6, struc log(LOG_WARNING, "register_send: ip6_mrouter socket queue full\n"); #endif - ++mrt6stat.mrt6s_upq_sockfull; + MRT6STAT_INC(mrt6s_upq_sockfull); return (ENOBUFS); } return (0); @@ -1780,7 +1782,7 @@ pim6_input(struct mbuf **mp, int *offp, int minlen; int off = *offp; - ++pim6stat.pim6s_rcv_total; + PIM6STAT_INC(pim6s_rcv_total); ip6 = mtod(m, struct ip6_hdr *); pimlen = m->m_pkthdr.len - *offp; @@ -1789,7 +1791,7 @@ pim6_input(struct mbuf **mp, int *offp, * Validate lengths */ if (pimlen < PIM_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; + PIM6STAT_INC(pim6s_rcv_tooshort); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG,"pim6_input: PIM packet too short\n"); @@ -1822,7 +1824,7 @@ pim6_input(struct mbuf **mp, int *offp, #else IP6_EXTHDR_GET(pim, struct pim *, m, off, minlen); if (pim == NULL) { - pim6stat.pim6s_rcv_tooshort++; + PIM6STAT_INC(pim6s_rcv_tooshort); return (IPPROTO_DONE); } #endif @@ -1842,7 +1844,7 @@ pim6_input(struct mbuf **mp, int *offp, cksumlen = pimlen; if (in6_cksum(m, IPPROTO_PIM, off, cksumlen)) { - ++pim6stat.pim6s_rcv_badsum; + PIM6STAT_INC(pim6s_rcv_badsum); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG, @@ -1856,7 +1858,7 @@ pim6_input(struct mbuf **mp, int *offp, /* PIM version check */ if (pim->pim_ver != PIM_VERSION) { - ++pim6stat.pim6s_rcv_badversion; + PIM6STAT_INC(pim6s_rcv_badversion); #ifdef MRT6DEBUG log(LOG_ERR, "pim6_input: incorrect version %d, expecting %d\n", @@ -1882,7 +1884,7 @@ pim6_input(struct mbuf **mp, int *offp, char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; #endif - ++pim6stat.pim6s_rcv_registers; + PIM6STAT_INC(pim6s_rcv_registers); if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) { #ifdef MRT6DEBUG @@ -1904,8 +1906,8 @@ pim6_input(struct mbuf **mp, int *offp, * Validate length */ if (pimlen < PIM6_REG_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_tooshort); + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG log(LOG_ERR, "pim6_input: register packet size too " @@ -1929,7 +1931,7 @@ pim6_input(struct mbuf **mp, int *offp, /* verify the version number of the inner packet */ if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG log(LOG_DEBUG, "pim6_input: invalid IP version (%d) " "of the inner packet\n", @@ -1941,7 +1943,7 @@ pim6_input(struct mbuf **mp, int *offp, /* verify the inner packet is destined to a mcast group */ if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG, From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 13:16:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F9B1F65; Wed, 3 Jul 2013 13:16:59 +0000 (UTC) (envelope-from adrian@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 323441C01; Wed, 3 Jul 2013 13:16:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63DGx0l075134; Wed, 3 Jul 2013 13:16:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63DGwEi075132; Wed, 3 Jul 2013 13:16:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307031316.r63DGwEi075132@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Jul 2013 13:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252567 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 13:16:59 -0000 Author: adrian Date: Wed Jul 3 13:16:58 2013 New Revision: 252567 URL: http://svnweb.freebsd.org/changeset/base/252567 Log: Add loos into the committers list, mentored by yours truely. Approved by: core (implicit) Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Jul 3 13:03:09 2013 (r252566) +++ svnadmin/conf/access Wed Jul 3 13:16:58 2013 (r252567) @@ -130,6 +130,7 @@ kevlo kib kientzle kuriyama +loos lstewart luigi marcel Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Jul 3 13:03:09 2013 (r252566) +++ svnadmin/conf/mentors Wed Jul 3 13:16:58 2013 (r252567) @@ -23,6 +23,7 @@ jceel wkoszek Co-mentor: cognet jinmei gnn jonathan rwatson jwd rmacklem +loos adrian miwi rwatson monthadar adrian peterj jhb Co-mentor: grog From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 14:58:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCFF4305; Wed, 3 Jul 2013 14:58:12 +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 AF9B81121; Wed, 3 Jul 2013 14:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63EwCML004030; Wed, 3 Jul 2013 14:58:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63EwC7g004029; Wed, 3 Jul 2013 14:58:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307031458.r63EwC7g004029@svn.freebsd.org> From: Alexander Motin Date: Wed, 3 Jul 2013 14:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252569 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 14:58:12 -0000 Author: mav Date: Wed Jul 3 14:58:11 2013 New Revision: 252569 URL: http://svnweb.freebsd.org/changeset/base/252569 Log: Fix NULL-deference kernel panic on attempt of destroying non-existing ramdisk-backed CTL LUN. Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 3 13:57:36 2013 (r252568) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 3 14:58:11 2013 (r252569) @@ -441,6 +441,9 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram snprintf(req->error_str, sizeof(req->error_str), "%s: error %d returned from ctl_invalidate_lun() for " "LUN %d", __func__, retval, params->lun_id); + mtx_lock(&softc->lock); + be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING; + mtx_unlock(&softc->lock); goto bailout_error; } @@ -475,14 +478,6 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram return (retval); bailout_error: - - /* - * Don't leave the waiting flag set. - */ - mtx_lock(&softc->lock); - be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING; - mtx_unlock(&softc->lock); - req->status = CTL_LUN_ERROR; return (0); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:26:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BB35C87; Wed, 3 Jul 2013 17:26:06 +0000 (UTC) (envelope-from jhb@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 EA22D1A16; Wed, 3 Jul 2013 17:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63HQ5dt048684; Wed, 3 Jul 2013 17:26:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63HQ5rQ048682; Wed, 3 Jul 2013 17:26:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201307031726.r63HQ5rQ048682@svn.freebsd.org> From: John Baldwin Date: Wed, 3 Jul 2013 17:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252576 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:26:06 -0000 Author: jhb Date: Wed Jul 3 17:26:05 2013 New Revision: 252576 URL: http://svnweb.freebsd.org/changeset/base/252576 Log: Don't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges. If we are probing a PCI-PCI bridge it is because we found one by enumerating the devices on a PCI bus, so the bridge is definitely present. A few BIOSes report incorrect status (_STA) for some bridges that claimed they were not present when in fact they were. While here, move this check earlier for Host-PCI bridges so attach fails before doing any work that needs to be torn down. PR: kern/91594 Tested by: Jack Vogel @ Intel MFC after: 1 week Modified: head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Wed Jul 3 17:23:51 2013 (r252575) +++ head/sys/dev/acpica/acpi_pcib.c Wed Jul 3 17:26:05 2013 (r252576) @@ -135,15 +135,6 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* - * Don't attach if we're not really there. - * - * XXX: This isn't entirely correct since we may be a PCI bus - * on a hot-plug docking station, etc. - */ - if (!acpi_DeviceIsPresent(dev)) - return_VALUE(ENXIO); - - /* * Get the PCI interrupt routing table for this bus. If we can't * get it, this is not an error but may reduce functionality. There * are several valid bridges in the field that do not have a _PRT, so Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jul 3 17:23:51 2013 (r252575) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jul 3 17:26:05 2013 (r252576) @@ -287,6 +287,12 @@ acpi_pcib_acpi_attach(device_t dev) sc->ap_handle = acpi_get_handle(dev); /* + * Don't attach if we're not really there. + */ + if (!acpi_DeviceIsPresent(dev)) + return (ENXIO); + + /* * Get our segment number by evaluating _SEG. * It's OK for this to not exist. */ @@ -353,7 +359,7 @@ acpi_pcib_acpi_attach(device_t dev) if (status != AE_NOT_FOUND) { device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status)); - return_VALUE (ENXIO); + return (ENXIO); } else { /* If it's not found, assume 0. */ sc->ap_bus = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:27:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 13597DC1; Wed, 3 Jul 2013 17:27:33 +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 04A6B1A21; Wed, 3 Jul 2013 17:27:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63HRWo8048887; Wed, 3 Jul 2013 17:27:32 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63HRWO6048886; Wed, 3 Jul 2013 17:27:32 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307031727.r63HRWO6048886@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 3 Jul 2013 17:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252577 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:27:33 -0000 Author: np Date: Wed Jul 3 17:27:32 2013 New Revision: 252577 URL: http://svnweb.freebsd.org/changeset/base/252577 Log: Catch up with r238990. LLE_DELETED does not clobber everything else in la_flags since said revision. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Jul 3 17:26:05 2013 (r252576) +++ head/sys/netinet/if_ether.c Wed Jul 3 17:27:32 2013 (r252577) @@ -174,7 +174,7 @@ arptimer(void *arg) ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); - if (lle->la_flags != LLE_DELETED) { + if ((lle->la_flags & LLE_DELETED) == 0) { int evt; if (lle->la_flags & LLE_VALID) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:28:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 758F0F03; Wed, 3 Jul 2013 17:28:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id EA95B1A2D; Wed, 3 Jul 2013 17:28:24 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id l10so258832qcy.4 for ; Wed, 03 Jul 2013 10:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZnbpXzS1bnwhbOvXWq+O/LqEVMOQILV8yng0GzexH9g=; b=RubOx8MGo2TJ21yTDI+d86n/Hx4wRo7lzZV7POIqgTE6v06OiMrEkS4Xhx3Yg3Whc7 Rjx99NDX6EUunHI9/iAtfyqMS05NleaiAxKz9TbsFLDx+pqnEDGj+t/RVjbWN+3qYY6B gvTMVob0WmXM/VEtbn8J/ZlzvCRS3XvH5Rhit4UV32dyB/+MlAHc7U0ucpKEmd8tjtU/ 21Fbomka/d4muImW7DYPJz3ekuH12hzoOHLLy0KSL6ggf96WNrUCz3pB3HwSPl69wLDU 06vQHKwyFF+SnqvD0tJ48oekpEM8HsZxm9cR+gZpXyzRiDhmqSbO1FTnlqXmB4Lt5I6R aD+A== MIME-Version: 1.0 X-Received: by 10.224.8.130 with SMTP id h2mr4419754qah.9.1372872504437; Wed, 03 Jul 2013 10:28:24 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.49.37.226 with HTTP; Wed, 3 Jul 2013 10:28:24 -0700 (PDT) In-Reply-To: <201305240329.r4O3TWnU016249@svn.freebsd.org> References: <201305240329.r4O3TWnU016249@svn.freebsd.org> Date: Wed, 3 Jul 2013 11:28:24 -0600 X-Google-Sender-Auth: 2th67sNXrlPVScZx1Wb1lQ5r_J0 Message-ID: Subject: Re: svn commit: r250953 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace From: Alan Somers To: Mark Johnston , Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:28:25 -0000 This creates another panic on module unload when WITNESS is enabled, because the module exits while holding the fasttrap_cleanup_mtx. This patch fixes the problem. I'm not sure if the mtx_destroy() is necessary, but I would feel dirty to leave it out. Does this patch look good to you? Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (revision 252490) +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (working copy) @@ -2434,6 +2434,7 @@ wakeup(&fasttrap_cleanup_cv); mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", 0); + mtx_unlock(&fasttrap_cleanup_mtx); fasttrap_cleanup_proc = NULL; #ifdef DEBUG @@ -2473,6 +2474,7 @@ #if !defined(sun) destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); + mtx_destroy(&fasttrap_cleanup_mtx); CPU_FOREACH(i) { mutex_destroy(&fasttrap_cpuc_pid_lock[i]); } On Thu, May 23, 2013 at 9:29 PM, Mark Johnston wrote: > Author: markj > Date: Fri May 24 03:29:32 2013 > New Revision: 250953 > URL: http://svnweb.freebsd.org/changeset/base/250953 > > Log: > The fasttrap provider cleans up probes asynchronously when a process with > USDT probes exits. This was previously done with a callout; however, it is > possible to sleep while holding the DTrace mutexes, so a panic will occur > on INVARIANTS kernels if the callout handler can't immediately acquire one > of these mutexes. This panic will be frequently triggered on systems where > a USDT-enabled program (perl, for instance) is often run. > > This revision changes the fasttrap cleanup mechanism so that a dedicated > thread is used instead of a callout. The old behaviour is otherwise > preserved. > > Reviewed by: rpaulo > MFC after: 1 month > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 24 02:18:37 2013 (r250952) > +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri May 24 03:29:32 2013 (r250953) > @@ -155,9 +155,9 @@ static struct cdevsw fasttrap_cdevsw = { > static struct cdev *fasttrap_cdev; > static dtrace_meta_provider_id_t fasttrap_meta_id; > > -static struct callout fasttrap_timeout; > +static struct proc *fasttrap_cleanup_proc; > static struct mtx fasttrap_cleanup_mtx; > -static uint_t fasttrap_cleanup_work; > +static uint_t fasttrap_cleanup_work, fasttrap_cleanup_drain, fasttrap_cleanup_cv; > > /* > * Generation count on modifications to the global tracepoint lookup table. > @@ -310,8 +310,11 @@ fasttrap_mod_barrier(uint64_t gen) > } > > /* > - * This is the timeout's callback for cleaning up the providers and their > - * probes. > + * This function performs asynchronous cleanup of fasttrap providers. The > + * Solaris implementation of this mechanism use a timeout that's activated in > + * fasttrap_pid_cleanup(), but this doesn't work in FreeBSD: one may sleep while > + * holding the DTrace mutexes, but it is unsafe to sleep in a callout handler. > + * Thus we use a dedicated process to perform the cleanup when requested. > */ > /*ARGSUSED*/ > static void > @@ -322,11 +325,8 @@ fasttrap_pid_cleanup_cb(void *data) > dtrace_provider_id_t provid; > int i, later = 0, rval; > > - static volatile int in = 0; > - ASSERT(in == 0); > - in = 1; > - > - while (fasttrap_cleanup_work) { > + mtx_lock(&fasttrap_cleanup_mtx); > + while (!fasttrap_cleanup_drain || later > 0) { > fasttrap_cleanup_work = 0; > mtx_unlock(&fasttrap_cleanup_mtx); > > @@ -397,39 +397,32 @@ fasttrap_pid_cleanup_cb(void *data) > } > mutex_exit(&bucket->ftb_mtx); > } > - > mtx_lock(&fasttrap_cleanup_mtx); > - } > > -#if 0 > - ASSERT(fasttrap_timeout != 0); > -#endif > + /* > + * If we were unable to retire a provider, try again after a > + * second. This situation can occur in certain circumstances > + * where providers cannot be unregistered even though they have > + * no probes enabled because of an execution of dtrace -l or > + * something similar. > + */ > + if (later > 0 || fasttrap_cleanup_work || > + fasttrap_cleanup_drain) { > + mtx_unlock(&fasttrap_cleanup_mtx); > + pause("ftclean", hz); > + mtx_lock(&fasttrap_cleanup_mtx); > + } else > + mtx_sleep(&fasttrap_cleanup_cv, &fasttrap_cleanup_mtx, > + 0, "ftcl", 0); > + } > > /* > - * If we were unable to remove a retired provider, try again after > - * a second. This situation can occur in certain circumstances where > - * providers cannot be unregistered even though they have no probes > - * enabled because of an execution of dtrace -l or something similar. > - * If the timeout has been disabled (set to 1 because we're trying > - * to detach), we set fasttrap_cleanup_work to ensure that we'll > - * get a chance to do that work if and when the timeout is reenabled > - * (if detach fails). > - */ > - if (later > 0) { > - if (callout_active(&fasttrap_timeout)) { > - callout_reset(&fasttrap_timeout, hz, > - &fasttrap_pid_cleanup_cb, NULL); > - } > - > - else if (later > 0) > - fasttrap_cleanup_work = 1; > - } else { > -#if !defined(sun) > - /* Nothing to be done for FreeBSD */ > -#endif > - } > + * Wake up the thread in fasttrap_unload() now that we're done. > + */ > + wakeup(&fasttrap_cleanup_drain); > + mtx_unlock(&fasttrap_cleanup_mtx); > > - in = 0; > + kthread_exit(); > } > > /* > @@ -440,8 +433,10 @@ fasttrap_pid_cleanup(void) > { > > mtx_lock(&fasttrap_cleanup_mtx); > - fasttrap_cleanup_work = 1; > - callout_reset(&fasttrap_timeout, 1, &fasttrap_pid_cleanup_cb, NULL); > + if (!fasttrap_cleanup_work) { > + fasttrap_cleanup_work = 1; > + wakeup(&fasttrap_cleanup_cv); > + } > mtx_unlock(&fasttrap_cleanup_mtx); > } > > @@ -991,7 +986,6 @@ fasttrap_pid_enable(void *arg, dtrace_id > proc_t *p = NULL; > int i, rc; > > - > ASSERT(probe != NULL); > ASSERT(!probe->ftp_enabled); > ASSERT(id == probe->ftp_id); > @@ -2272,17 +2266,23 @@ static int > fasttrap_load(void) > { > ulong_t nent; > - int i; > + int i, ret; > > /* Create the /dev/dtrace/fasttrap entry. */ > fasttrap_cdev = make_dev(&fasttrap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, > "dtrace/fasttrap"); > > mtx_init(&fasttrap_cleanup_mtx, "fasttrap clean", "dtrace", MTX_DEF); > - callout_init_mtx(&fasttrap_timeout, &fasttrap_cleanup_mtx, 0); > mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, > NULL); > > + ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, > + &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); > + if (ret != 0) { > + destroy_dev(fasttrap_cdev); > + return (ret); > + } > + > /* > * Install our hooks into fork(2), exec(2), and exit(2). > */ > @@ -2389,15 +2389,6 @@ fasttrap_unload(void) > return (-1); > > /* > - * Prevent any new timeouts from running by setting fasttrap_timeout > - * to a non-zero value, and wait for the current timeout to complete. > - */ > - mtx_lock(&fasttrap_cleanup_mtx); > - fasttrap_cleanup_work = 0; > - callout_drain(&fasttrap_timeout); > - mtx_unlock(&fasttrap_cleanup_mtx); > - > - /* > * Iterate over all of our providers. If there's still a process > * that corresponds to that pid, fail to detach. > */ > @@ -2431,26 +2422,20 @@ fasttrap_unload(void) > } > > if (fail) { > - uint_t work; > - /* > - * If we're failing to detach, we need to unblock timeouts > - * and start a new timeout if any work has accumulated while > - * we've been unsuccessfully trying to detach. > - */ > - mtx_lock(&fasttrap_cleanup_mtx); > - work = fasttrap_cleanup_work; > - callout_drain(&fasttrap_timeout); > - mtx_unlock(&fasttrap_cleanup_mtx); > - > - if (work) > - fasttrap_pid_cleanup(); > - > (void) dtrace_meta_register("fasttrap", &fasttrap_mops, NULL, > &fasttrap_meta_id); > > return (-1); > } > > + mtx_lock(&fasttrap_cleanup_mtx); > + fasttrap_cleanup_drain = 1; > + /* Wait for the cleanup thread to finish up and signal us. */ > + wakeup(&fasttrap_cleanup_cv); > + mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", > + 0); > + fasttrap_cleanup_proc = NULL; > + > #ifdef DEBUG > mutex_enter(&fasttrap_count_mtx); > ASSERT(fasttrap_pid_count == 0); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:35:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4D7DA180; Wed, 3 Jul 2013 17:35:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) by mx1.freebsd.org (Postfix) with ESMTP id 179FC1A8B; Wed, 3 Jul 2013 17:35:16 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id c10so6511276wiw.0 for ; Wed, 03 Jul 2013 10:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gTuAYRUXyPCv0v+F+m/vSTzCWqzzTK+XKz2iL1dx9j0=; b=f+0Fa3Ne0VH13DyPZnR48alrLeU6F2jYGfm8S6BdsniudYk+rsfAhBHH0yVk9wNgXb t2amSoX6WBEfObJdI4YgZASoYiqaSt/CwyU9dRHq0e4BgrnHyOhku8WnFCtbPj/xgp85 uIuhWEDisW2zAYq8iQHaxl1ThxFeXRBK5YPmfQpfIeOp1zAX4yzxI1nKR65au01Alyvb +5zo3ilxxGlRUjOMD6lzyMFW+w85yemyCG8VVmM9ybZZ2pRO1Ajh4fzjKAxN2eHiEWmO GZs6bCHu0PIrkBGRXrMnf3feU+/t1m7rrdz5/bgHT6otsucUc0pumuaNF6VFyTf6d7iO Katg== MIME-Version: 1.0 X-Received: by 10.194.133.106 with SMTP id pb10mr1216634wjb.62.1372872916192; Wed, 03 Jul 2013 10:35:16 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.194.242.195 with HTTP; Wed, 3 Jul 2013 10:35:16 -0700 (PDT) In-Reply-To: References: <201305240329.r4O3TWnU016249@svn.freebsd.org> Date: Wed, 3 Jul 2013 13:35:16 -0400 X-Google-Sender-Auth: khPUuHRdNcUTr1IdeW9kXtvUBvo Message-ID: Subject: Re: svn commit: r250953 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace From: Mark Johnston To: Alan Somers Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , Rui Paulo , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:35:18 -0000 On Wed, Jul 3, 2013 at 1:28 PM, Alan Somers wrote: > This creates another panic on module unload when WITNESS is enabled, > because the module exits while holding the fasttrap_cleanup_mtx. This > patch fixes the problem. I'm not sure if the mtx_destroy() is > necessary, but I would feel dirty to leave it out. Does this patch > look good to you? Hi Alan, Sorry about that - I noticed this mistake recently and fixed it in r252493: http://svnweb.freebsd.org/base?view=revision&revision=252493 DTrace module unloading is now working properly for me with WITNESS enabled. Thanks, -Mark > > Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c > =================================================================== > --- sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (revision 252490) > +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (working copy) > @@ -2434,6 +2434,7 @@ > wakeup(&fasttrap_cleanup_cv); > mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", > 0); > + mtx_unlock(&fasttrap_cleanup_mtx); > fasttrap_cleanup_proc = NULL; > > #ifdef DEBUG > @@ -2473,6 +2474,7 @@ > #if !defined(sun) > destroy_dev(fasttrap_cdev); > mutex_destroy(&fasttrap_count_mtx); > + mtx_destroy(&fasttrap_cleanup_mtx); > CPU_FOREACH(i) { > mutex_destroy(&fasttrap_cpuc_pid_lock[i]); > } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:37:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD27932F; Wed, 3 Jul 2013 17:37:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id 4C6FF1A9F; Wed, 3 Jul 2013 17:37:07 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id bv4so297099qab.4 for ; Wed, 03 Jul 2013 10:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lt8VLKjfI9kE8+wH52KXs7GfDyXQFKAVWiO5zuR9xfo=; b=yd7r96Mq0MWnBxscr7xSQJb8CulG1qIGGDZEBJ51E+g8Ya97R2GeRE/ab4OABwaNWK 67Z1laPvyckoxjZL00CEn5xY/x9Kx+5r+aWMamdtGoZ1KmKQzeaFUK3pcvMjqX7I5XD+ 7vo7kD5X08WiUzSjswce8PGREYg/DCoQ0v/iKAwFvz0qxrKrEzyoCLaDq9zVp2xNa1fn apD/1jm3MyGHeFpJlqVpn2VlOi393jGnIpZnubdRzTRbUAnF9uR/aZrij11rXHo33b8K zas/mkE7MfGkMQ3irrmeE6k6AyuwnmSldgrb3uHml9eU4eYZiUIWSJT0D9tcOdBnyRp8 Dwqw== MIME-Version: 1.0 X-Received: by 10.229.31.202 with SMTP id z10mr662349qcc.36.1372873026785; Wed, 03 Jul 2013 10:37:06 -0700 (PDT) Received: by 10.49.37.226 with HTTP; Wed, 3 Jul 2013 10:37:06 -0700 (PDT) In-Reply-To: References: <201305240329.r4O3TWnU016249@svn.freebsd.org> Date: Wed, 3 Jul 2013 11:37:06 -0600 Message-ID: Subject: Re: svn commit: r250953 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace From: asomers@gmail.com To: Mark Johnston Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo , Alan Somers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:37:08 -0000 Great timing. I think that's only a few hours more recent than my latest src checkout. On Wed, Jul 3, 2013 at 11:35 AM, Mark Johnston wrote: > On Wed, Jul 3, 2013 at 1:28 PM, Alan Somers wrote: >> This creates another panic on module unload when WITNESS is enabled, >> because the module exits while holding the fasttrap_cleanup_mtx. This >> patch fixes the problem. I'm not sure if the mtx_destroy() is >> necessary, but I would feel dirty to leave it out. Does this patch >> look good to you? > > Hi Alan, > > Sorry about that - I noticed this mistake recently and fixed it in r252493: > http://svnweb.freebsd.org/base?view=revision&revision=252493 > > DTrace module unloading is now working properly for me with WITNESS enabled. > > Thanks, > -Mark > >> >> Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c >> =================================================================== >> --- sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (revision 252490) >> +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c (working copy) >> @@ -2434,6 +2434,7 @@ >> wakeup(&fasttrap_cleanup_cv); >> mtx_sleep(&fasttrap_cleanup_drain, &fasttrap_cleanup_mtx, 0, "ftcld", >> 0); >> + mtx_unlock(&fasttrap_cleanup_mtx); >> fasttrap_cleanup_proc = NULL; >> >> #ifdef DEBUG >> @@ -2473,6 +2474,7 @@ >> #if !defined(sun) >> destroy_dev(fasttrap_cdev); >> mutex_destroy(&fasttrap_count_mtx); >> + mtx_destroy(&fasttrap_cleanup_mtx); >> CPU_FOREACH(i) { >> mutex_destroy(&fasttrap_cpuc_pid_lock[i]); >> } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 17:57:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A24599F3; Wed, 3 Jul 2013 17:57:35 +0000 (UTC) (envelope-from davidcs@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 957411B40; Wed, 3 Jul 2013 17:57:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63HvZ26057685; Wed, 3 Jul 2013 17:57:35 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63HvZvN057684; Wed, 3 Jul 2013 17:57:35 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201307031757.r63HvZvN057684@svn.freebsd.org> From: David C Somayajulu Date: Wed, 3 Jul 2013 17:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252580 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 17:57:35 -0000 Author: davidcs Date: Wed Jul 3 17:57:35 2013 New Revision: 252580 URL: http://svnweb.freebsd.org/changeset/base/252580 Log: Port 0 needs to wait for ACK only if it issued the RESET. Modified: head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Jul 3 17:47:48 2013 (r252579) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 3 17:57:35 2013 (r252580) @@ -1646,11 +1646,13 @@ qla_error_recovery(void *context, int pe if ((ha->pci_func & 0x1) == 0) { - if (!ha->msg_from_peer) + if (!ha->msg_from_peer) { qla_send_msg_to_peer(ha, QL_PEER_MSG_RESET); - while ((ha->msg_from_peer != QL_PEER_MSG_ACK) && msecs_100--) - qla_mdelay(__func__, 100); + while ((ha->msg_from_peer != QL_PEER_MSG_ACK) && + msecs_100--) + qla_mdelay(__func__, 100); + } ha->msg_from_peer = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:04:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82C24D1B; Wed, 3 Jul 2013 18:04:47 +0000 (UTC) (envelope-from gavin@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 750CE1BCB; Wed, 3 Jul 2013 18:04:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63I4l0N060446; Wed, 3 Jul 2013 18:04:47 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63I4lHe060444; Wed, 3 Jul 2013 18:04:47 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307031804.r63I4lHe060444@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 3 Jul 2013 18:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252581 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:04:47 -0000 Author: gavin Date: Wed Jul 3 18:04:46 2013 New Revision: 252581 URL: http://svnweb.freebsd.org/changeset/base/252581 Log: Remove jinmei, as he handed his commit bit back for safekeeping. This should have been committed as part of r252465. Approved by: core Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Jul 3 17:57:35 2013 (r252580) +++ svnadmin/conf/mentors Wed Jul 3 18:04:46 2013 (r252581) @@ -20,7 +20,6 @@ erwin delphij gjb kib hiren sbruno jceel wkoszek Co-mentor: cognet -jinmei gnn jonathan rwatson jwd rmacklem loos adrian From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:25:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A0D1B5B7; Wed, 3 Jul 2013 18:25:28 +0000 (UTC) (envelope-from peter@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 92C1C1D76; Wed, 3 Jul 2013 18:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63IPSQF066863; Wed, 3 Jul 2013 18:25:28 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63IPSuJ066859; Wed, 3 Jul 2013 18:25:28 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307031825.r63IPSuJ066859@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 18:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252582 - in head/usr.bin: mkcsmapper mkesdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:25:28 -0000 Author: peter Date: Wed Jul 3 18:25:27 2013 New Revision: 252582 URL: http://svnweb.freebsd.org/changeset/base/252582 Log: Attempt to deal with a compile failure that shows up with gcc, which has -Werror on. Without this, yylex() is inconsistently or redundantly defined. Modified: head/usr.bin/mkcsmapper/lex.l head/usr.bin/mkesdb/lex.l Modified: head/usr.bin/mkcsmapper/lex.l ============================================================================== --- head/usr.bin/mkcsmapper/lex.l Wed Jul 3 18:04:46 2013 (r252581) +++ head/usr.bin/mkcsmapper/lex.l Wed Jul 3 18:25:27 2013 (r252582) @@ -41,6 +41,8 @@ #include "ldef.h" #include "yacc.h" +#define YY_DECL int yylex(void) + int linenumber = 1; %} %option noinput Modified: head/usr.bin/mkesdb/lex.l ============================================================================== --- head/usr.bin/mkesdb/lex.l Wed Jul 3 18:04:46 2013 (r252581) +++ head/usr.bin/mkesdb/lex.l Wed Jul 3 18:25:27 2013 (r252582) @@ -43,6 +43,8 @@ #include "ldef.h" #include "yacc.h" +#define YY_DECL int yylex(void) + int linenumber = 1; %} %option noinput From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:27:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 13E9E76F; Wed, 3 Jul 2013 18:27:50 +0000 (UTC) (envelope-from peter@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 046A91D8F; Wed, 3 Jul 2013 18:27:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63IRnsq067236; Wed, 3 Jul 2013 18:27:50 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63IRjnx067207; Wed, 3 Jul 2013 18:27:45 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307031827.r63IRjnx067207@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 18:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252583 - in head: lib/libc/iconv lib/libiconv_modules/BIG5 lib/libiconv_modules/DECHanyu lib/libiconv_modules/EUC lib/libiconv_modules/EUCTW lib/libiconv_modules/GBK2K lib/libiconv_mod... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:27:50 -0000 Author: peter Date: Wed Jul 3 18:27:45 2013 New Revision: 252583 URL: http://svnweb.freebsd.org/changeset/base/252583 Log: As a followup to r252547, propate const down the call stack. Modified: head/lib/libc/iconv/citrus_none.c head/lib/libc/iconv/citrus_stdenc.h head/lib/libc/iconv/citrus_stdenc_local.h head/lib/libc/iconv/citrus_stdenc_template.h head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c head/lib/libiconv_modules/EUC/citrus_euc.c head/lib/libiconv_modules/EUCTW/citrus_euctw.c head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c head/lib/libiconv_modules/HZ/citrus_hz.c head/lib/libiconv_modules/ISO2022/citrus_iso2022.c head/lib/libiconv_modules/JOHAB/citrus_johab.c head/lib/libiconv_modules/MSKanji/citrus_mskanji.c head/lib/libiconv_modules/UES/citrus_ues.c head/lib/libiconv_modules/UTF1632/citrus_utf1632.c head/lib/libiconv_modules/UTF7/citrus_utf7.c head/lib/libiconv_modules/UTF8/citrus_utf8.c head/lib/libiconv_modules/VIQR/citrus_viqr.c head/lib/libiconv_modules/ZW/citrus_zw.c head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c head/usr.bin/iconv/iconv.c Modified: head/lib/libc/iconv/citrus_none.c ============================================================================== --- head/lib/libc/iconv/citrus_none.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libc/iconv/citrus_none.c Wed Jul 3 18:27:45 2013 (r252583) @@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _c static int _citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused, - _csid_t *csid, _index_t *idx, char **s, size_t n, + _csid_t *csid, _index_t *idx, const char **s, size_t n, void *ps __unused, size_t *nresult, struct iconv_hooks *hooks) { @@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citru static int _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused, - _wc_t * __restrict pwc, char ** __restrict s, size_t n, + _wc_t * __restrict pwc, const char ** __restrict s, size_t n, void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libc/iconv/citrus_stdenc.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc.h Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libc/iconv/citrus_stdenc.h Wed Jul 3 18:27:45 2013 (r252583) @@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus static __inline int _citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce, _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, - char ** __restrict s, size_t n, void * __restrict ps, + const char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libc/iconv/citrus_stdenc_local.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc_local.h Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libc/iconv/citrus_stdenc_local.h Wed Jul 3 18:27:45 2013 (r252583) @@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtoc (struct _citrus_stdenc * __restrict, \ _citrus_csid_t * __restrict, \ _citrus_index_t * __restrict, \ - char ** __restrict, size_t, \ + const char ** __restrict, size_t, \ void * __restrict, size_t * __restrict, \ struct iconv_hooks *); \ static int _citrus_##_e_##_stdenc_cstomb \ @@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstom static int _citrus_##_e_##_stdenc_mbtowc \ (struct _citrus_stdenc * __restrict, \ _citrus_wc_t * __restrict, \ - char ** __restrict, size_t, \ + const char ** __restrict, size_t, \ void * __restrict, size_t * __restrict, \ struct iconv_hooks *); \ static int _citrus_##_e_##_stdenc_wctomb \ @@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_ typedef int (*_citrus_stdenc_mbtocs_t) (struct _citrus_stdenc * __restrict, _citrus_csid_t * __restrict, _citrus_index_t * __restrict, - char ** __restrict, size_t, + const char ** __restrict, size_t, void * __restrict, size_t * __restrict, struct iconv_hooks *); typedef int (*_citrus_stdenc_cstomb_t) @@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t) typedef int (*_citrus_stdenc_mbtowc_t) (struct _citrus_stdenc * __restrict, _citrus_wc_t * __restrict, - char ** __restrict, size_t, + const char ** __restrict, size_t, void * __restrict, size_t * __restrict, struct iconv_hooks *); typedef int (*_citrus_stdenc_wctomb_t) Modified: head/lib/libc/iconv/citrus_stdenc_template.h ============================================================================== --- head/lib/libc/iconv/citrus_stdenc_template.h Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libc/iconv/citrus_stdenc_template.h Wed Jul 3 18:27:45 2013 (r252583) @@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _cit static int _FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce, _citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx, - char ** __restrict s, size_t n, void * __restrict ps, + const char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { wchar_t wc; @@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_ static int _FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce, - _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n, + _citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Wed Jul 3 18:27:45 2013 (r252583) @@ -268,12 +268,12 @@ static int /*ARGSUSED*/ _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei, wchar_t * __restrict pwc, - char ** __restrict s, size_t n, + const char ** __restrict s, size_t n, _BIG5State * __restrict psenc, size_t * __restrict nresult) { wchar_t wchar; - char *s0; + const char *s0; int c, chlenbak; s0 = *s; Modified: head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c ============================================================================== --- head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Wed Jul 3 18:27:45 2013 (r252583) @@ -163,10 +163,10 @@ is_94charset(int c) static int /*ARGSUSED*/ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; wchar_t wc; int ch; Modified: head/lib/libiconv_modules/EUC/citrus_euc.c ============================================================================== --- head/lib/libiconv_modules/EUC/citrus_euc.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/EUC/citrus_euc.c Wed Jul 3 18:27:45 2013 (r252583) @@ -188,12 +188,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInf } static int -_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s, +_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s, size_t n, _EUCState *psenc, size_t *nresult) { wchar_t wchar; int c, chlenbak, cs, len; - char *s0, *s1 = NULL; + const char *s0, *s1 = NULL; s0 = *s; Modified: head/lib/libiconv_modules/EUCTW/citrus_euctw.c ============================================================================== --- head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/EUCTW/citrus_euctw.c Wed Jul 3 18:27:45 2013 (r252583) @@ -174,10 +174,10 @@ _citrus_EUCTW_encoding_module_uninit(_EU static int _citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; wchar_t wchar; int c, chlenbak, cs; Modified: head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c ============================================================================== --- head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c Wed Jul 3 18:27:45 2013 (r252583) @@ -147,10 +147,10 @@ _mb_count(wchar_t v) static int _citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _GBK2KState * __restrict psenc, size_t * __restrict nresult) { - char *s0, *s1; + const char *s0, *s1; wchar_t wc; int chlenbak, len; Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Wed Jul 3 18:27:45 2013 (r252583) @@ -173,13 +173,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo static int _citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _HZState * __restrict psenc, size_t * __restrict nresult) { escape_t *candidate, *init; graphic_t *graphic; const range_t *range; - char *s0; + const char *s0; wchar_t wc; int bit, ch, head, len, tail; Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Wed Jul 3 18:27:45 2013 (r252583) @@ -572,7 +572,7 @@ terminate: static wchar_t _ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused, - char * __restrict string, size_t n, char ** __restrict result, + const char * __restrict string, size_t n, const char ** __restrict result, _ISO2022State * __restrict psenc) { const struct seqtable *sp; @@ -840,10 +840,10 @@ asis: static int _citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult) { - char *p, *result, *s0; + const char *p, *result, *s0; wchar_t wchar; int c, chlenbak; Modified: head/lib/libiconv_modules/JOHAB/citrus_johab.c ============================================================================== --- head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/JOHAB/citrus_johab.c Wed Jul 3 18:27:45 2013 (r252583) @@ -143,10 +143,10 @@ ishanja(int l, int t) static int /*ARGSUSED*/ _citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _JOHABState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; int l, t; if (*s == NULL) { Modified: head/lib/libiconv_modules/MSKanji/citrus_mskanji.c ============================================================================== --- head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/MSKanji/citrus_mskanji.c Wed Jul 3 18:27:45 2013 (r252583) @@ -151,10 +151,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEnc static int /*ARGSUSED*/ _citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _MSKanjiState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; wchar_t wchar; int chlenbak, len; Modified: head/lib/libiconv_modules/UES/citrus_ues.c ============================================================================== --- head/lib/libiconv_modules/UES/citrus_ues.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/UES/citrus_ues.c Wed Jul 3 18:27:45 2013 (r252583) @@ -183,10 +183,10 @@ is_basic(wchar_t wc) static int _citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _UESState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; int ch, head, num, tail; wchar_t hi, wc; Modified: head/lib/libiconv_modules/UTF1632/citrus_utf1632.c ============================================================================== --- head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/UTF1632/citrus_utf1632.c Wed Jul 3 18:27:45 2013 (r252583) @@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632Encod static int _citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc, - char **s, size_t n, _UTF1632State *psenc, size_t *nresult) + const char **s, size_t n, _UTF1632State *psenc, size_t *nresult) { - char *s0; + const char *s0; size_t result; wchar_t wc = L'\0'; int chlenbak, endian, needlen; Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c ============================================================================== --- head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.c Wed Jul 3 18:27:45 2013 (r252583) @@ -149,11 +149,11 @@ static const char spaces[] = " \t\r\n"; static int _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei, - uint16_t * __restrict u16, char ** __restrict s, size_t n, + uint16_t * __restrict u16, const char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { _UTF7State sv; - char *s0; + const char *s0; int done, i, len; s0 = *s; @@ -238,10 +238,10 @@ ilseq: static int _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; uint32_t u32; uint16_t hi, lo; size_t nr, siz; Modified: head/lib/libiconv_modules/UTF8/citrus_utf8.c ============================================================================== --- head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/UTF8/citrus_utf8.c Wed Jul 3 18:27:45 2013 (r252583) @@ -175,10 +175,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingI } static int -_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s, +_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s, size_t n, _UTF8State *psenc, size_t *nresult) { - char *s0; + const char *s0; wchar_t wchar; int i; uint8_t c; Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Wed Jul 3 18:27:45 2013 (r252583) @@ -250,11 +250,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingI static int _citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m, *m0; - char *s0; + const char *s0; wchar_t wc; ssize_t i; int ch, escape; Modified: head/lib/libiconv_modules/ZW/citrus_zw.c ============================================================================== --- head/lib/libiconv_modules/ZW/citrus_zw.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/ZW/citrus_zw.c Wed Jul 3 18:27:45 2013 (r252583) @@ -105,10 +105,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo static int _citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, char **__restrict s, size_t n, + wchar_t * __restrict pwc, const char **__restrict s, size_t n, _ZWState * __restrict psenc, size_t * __restrict nresult) { - char *s0; + const char *s0; wchar_t wc; int ch, len; Modified: head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c ============================================================================== --- head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Wed Jul 3 18:27:45 2013 (r252583) @@ -97,7 +97,7 @@ _citrus_iconv_none_iconv_uninit_context( static int /*ARGSUSED*/ _citrus_iconv_none_iconv_convert(struct _citrus_iconv * __restrict ci __unused, - char * __restrict * __restrict in, size_t * __restrict inbytes, + const char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags __unused, size_t * __restrict invalids) { Modified: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c ============================================================================== --- head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Wed Jul 3 18:27:45 2013 (r252583) @@ -104,7 +104,7 @@ init_encoding_state(struct _citrus_iconv static __inline int mbtocsx(struct _citrus_iconv_std_encoding *se, - _csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult, + _csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult, struct iconv_hooks *hooks) { @@ -461,7 +461,7 @@ _citrus_iconv_std_iconv_uninit_context(s static int _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv, - char * __restrict * __restrict in, size_t * __restrict inbytes, + const char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags, size_t * __restrict invalids) { @@ -469,7 +469,7 @@ _citrus_iconv_std_iconv_convert(struct _ struct _citrus_iconv_std_context *sc = cv->cv_closure; _csid_t csid; _index_t idx; - char *tmpin; + const char *tmpin; size_t inval, szrin, szrout; int ret, state = 0; Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Wed Jul 3 18:25:27 2013 (r252582) +++ head/usr.bin/iconv/iconv.c Wed Jul 3 18:27:45 2013 (r252583) @@ -74,7 +74,7 @@ do_conv(FILE *fp, const char *from, cons { iconv_t cd; char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out; - char *in; + const char *in; size_t inbytes, outbytes, ret; if ((cd = iconv_open(to, from)) == (iconv_t)-1) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:35:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73951939; Wed, 3 Jul 2013 18:35:22 +0000 (UTC) (envelope-from peter@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 5438E1DE0; Wed, 3 Jul 2013 18:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63IZMJh069971; Wed, 3 Jul 2013 18:35:22 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63IZLaL069967; Wed, 3 Jul 2013 18:35:21 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307031835.r63IZLaL069967@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 18:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252584 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:35:22 -0000 Author: peter Date: Wed Jul 3 18:35:21 2013 New Revision: 252584 URL: http://svnweb.freebsd.org/changeset/base/252584 Log: Make it clear that there are three separate internal locks. Modified: head/lib/libc/iconv/citrus_csmapper.c head/lib/libc/iconv/citrus_iconv.c head/lib/libc/iconv/citrus_lock.h head/lib/libc/iconv/citrus_mapper.c Modified: head/lib/libc/iconv/citrus_csmapper.c ============================================================================== --- head/lib/libc/iconv/citrus_csmapper.c Wed Jul 3 18:27:45 2013 (r252583) +++ head/lib/libc/iconv/citrus_csmapper.c Wed Jul 3 18:35:21 2013 (r252584) @@ -58,6 +58,8 @@ static struct _citrus_mapper_area *maparea = NULL; +static pthread_rwlock_t ma_lock = PTHREAD_RWLOCK_INITIALIZER; + #define CS_ALIAS _PATH_CSMAPPER "/charset.alias" #define CS_PIVOT _PATH_CSMAPPER "/charset.pivot" @@ -314,7 +316,7 @@ get_none(struct _citrus_mapper_area *__r { int ret; - WLOCK; + WLOCK(&ma_lock); if (csm_none) { *rcsm = csm_none; ret = 0; @@ -329,7 +331,7 @@ get_none(struct _citrus_mapper_area *__r *rcsm = csm_none; ret = 0; quit: - UNLOCK; + UNLOCK(&ma_lock); return (ret); } Modified: head/lib/libc/iconv/citrus_iconv.c ============================================================================== --- head/lib/libc/iconv/citrus_iconv.c Wed Jul 3 18:27:45 2013 (r252583) +++ head/lib/libc/iconv/citrus_iconv.c Wed Jul 3 18:35:21 2013 (r252584) @@ -68,11 +68,13 @@ static int shared_max_reuse, shared_n static _CITRUS_HASH_HEAD(, _citrus_iconv_shared, CI_HASH_SIZE) shared_pool; static TAILQ_HEAD(, _citrus_iconv_shared) shared_unused; +static pthread_rwlock_t ci_lock = PTHREAD_RWLOCK_INITIALIZER; + static __inline void init_cache(void) { - WLOCK; + WLOCK(&ci_lock); if (!isinit) { _CITRUS_HASH_INIT(&shared_pool, CI_HASH_SIZE); TAILQ_INIT(&shared_unused); @@ -83,7 +85,7 @@ init_cache(void) shared_max_reuse = CI_INITIAL_MAX_REUSE; isinit = true; } - UNLOCK; + UNLOCK(&ci_lock); } static __inline void @@ -195,7 +197,7 @@ get_shared(struct _citrus_iconv_shared * snprintf(convname, sizeof(convname), "%s/%s", src, dst); - WLOCK; + WLOCK(&ci_lock); /* lookup alread existing entry */ hashval = hash_func(convname); @@ -222,7 +224,7 @@ get_shared(struct _citrus_iconv_shared * *rci = ci; quit: - UNLOCK; + UNLOCK(&ci_lock); return (ret); } @@ -231,7 +233,7 @@ static void release_shared(struct _citrus_iconv_shared * __restrict ci) { - WLOCK; + WLOCK(&ci_lock); ci->ci_used_count--; if (ci->ci_used_count == 0) { /* put it into unused list */ @@ -247,7 +249,7 @@ release_shared(struct _citrus_iconv_shar } } - UNLOCK; + UNLOCK(&ci_lock); } /* Modified: head/lib/libc/iconv/citrus_lock.h ============================================================================== --- head/lib/libc/iconv/citrus_lock.h Wed Jul 3 18:27:45 2013 (r252583) +++ head/lib/libc/iconv/citrus_lock.h Wed Jul 3 18:35:21 2013 (r252584) @@ -27,10 +27,7 @@ #include -/* XXX Yes, the original code has three separate file-local lock instances */ -static pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER; - -#define WLOCK if (__isthreaded) \ - pthread_rwlock_wrlock(&lock); -#define UNLOCK if (__isthreaded) \ - pthread_rwlock_unlock(&lock); +#define WLOCK(lock) if (__isthreaded) \ + pthread_rwlock_wrlock(lock); +#define UNLOCK(lock) if (__isthreaded) \ + pthread_rwlock_unlock(lock); Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Wed Jul 3 18:27:45 2013 (r252583) +++ head/lib/libc/iconv/citrus_mapper.c Wed Jul 3 18:35:21 2013 (r252584) @@ -55,6 +55,8 @@ #define CM_HASH_SIZE 101 #define REFCOUNT_PERSISTENT -1 +static pthread_rwlock_t cm_lock = PTHREAD_RWLOCK_INITIALIZER; + struct _citrus_mapper_area { _CITRUS_HASH_HEAD(, _citrus_mapper, CM_HASH_SIZE) ma_cache; char *ma_dir; @@ -75,7 +77,7 @@ _citrus_mapper_create_area( char path[PATH_MAX]; int ret; - WLOCK; + WLOCK(&cm_lock); if (*rma != NULL) { ret = 0; @@ -104,7 +106,7 @@ _citrus_mapper_create_area( *rma = ma; ret = 0; quit: - UNLOCK; + UNLOCK(&cm_lock); return (ret); } @@ -316,7 +318,7 @@ _citrus_mapper_open(struct _citrus_mappe variable = NULL; - WLOCK; + WLOCK(&cm_lock); /* search in the cache */ hashval = hash_func(mapname); @@ -337,9 +339,9 @@ _citrus_mapper_open(struct _citrus_mappe goto quit; /* open mapper */ - UNLOCK; + UNLOCK(&cm_lock); ret = mapper_open(ma, &cm, module, variable); - WLOCK; + WLOCK(&cm_lock); if (ret) goto quit; cm->cm_key = strdup(mapname); @@ -356,7 +358,7 @@ _citrus_mapper_open(struct _citrus_mappe *rcm = cm; ret = 0; quit: - UNLOCK; + UNLOCK(&cm_lock); return (ret); } @@ -370,7 +372,7 @@ _citrus_mapper_close(struct _citrus_mapp { if (cm) { - WLOCK; + WLOCK(&cm_lock); if (cm->cm_refcount == REFCOUNT_PERSISTENT) goto quit; if (cm->cm_refcount > 0) { @@ -381,7 +383,7 @@ _citrus_mapper_close(struct _citrus_mapp } mapper_close(cm); quit: - UNLOCK; + UNLOCK(&cm_lock); } } @@ -393,7 +395,7 @@ void _citrus_mapper_set_persistent(struct _citrus_mapper * __restrict cm) { - WLOCK; + WLOCK(&cm_lock); cm->cm_refcount = REFCOUNT_PERSISTENT; - UNLOCK; + UNLOCK(&cm_lock); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:48:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 20A9DF10; Wed, 3 Jul 2013 18:48:45 +0000 (UTC) (envelope-from tuexen@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 125A51ED7; Wed, 3 Jul 2013 18:48:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63ImicP073620; Wed, 3 Jul 2013 18:48:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63ImiJK073616; Wed, 3 Jul 2013 18:48:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307031848.r63ImiJK073616@svn.freebsd.org> From: Michael Tuexen Date: Wed, 3 Jul 2013 18:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252585 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:48:45 -0000 Author: tuexen Date: Wed Jul 3 18:48:43 2013 New Revision: 252585 URL: http://svnweb.freebsd.org/changeset/base/252585 Log: Code cleanups. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jul 3 18:35:21 2013 (r252584) +++ head/sys/netinet/sctp_indata.c Wed Jul 3 18:48:43 2013 (r252585) @@ -1729,7 +1729,6 @@ sctp_process_a_data_chunk(struct sctp_tc sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); @@ -1857,7 +1856,6 @@ failed_pdapi_express_del: sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Wed Jul 3 18:35:21 2013 (r252584) +++ head/sys/netinet/sctp_indata.h Wed Jul 3 18:48:43 2013 (r252585) @@ -47,14 +47,14 @@ sctp_build_readq_entry(struct sctp_tcb * struct mbuf *dm); -#define sctp_build_readq_entry_mac(_ctl, in_it, a, net, tsn, ppid, context, stream_no, stream_seq, flags, dm) do { \ +#define sctp_build_readq_entry_mac(_ctl, in_it, context, net, tsn, ppid, stream_no, stream_seq, flags, dm) do { \ if (_ctl) { \ atomic_add_int(&((net)->ref_count), 1); \ (_ctl)->sinfo_stream = stream_no; \ (_ctl)->sinfo_ssn = stream_seq; \ (_ctl)->sinfo_flags = (flags << 8); \ (_ctl)->sinfo_ppid = ppid; \ - (_ctl)->sinfo_context = a; \ + (_ctl)->sinfo_context = context; \ (_ctl)->sinfo_timetolive = 0; \ (_ctl)->sinfo_tsn = tsn; \ (_ctl)->sinfo_cumtsn = tsn; \ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Jul 3 18:35:21 2013 (r252584) +++ head/sys/netinet/sctp_input.c Wed Jul 3 18:48:43 2013 (r252585) @@ -1028,12 +1028,13 @@ sctp_handle_shutdown_ack(struct sctp_shu SCTP_SOCKET_UNLOCK(so, 1); #endif } - /* are the queues empty? */ +#ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); + panic("Queues are not empty when handling SHUTDOWN-ACK"); } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); /* send SHUTDOWN-COMPLETE */ @@ -1875,9 +1876,14 @@ sctp_process_cookie_existing(struct mbuf cookie->tie_tag_peer_vtag != 0) { struct sctpasochead *head; +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + struct socket *so; + +#endif + if (asoc->peer_supports_nat) { /* - * This is a gross gross hack. just call the + * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ @@ -1939,6 +1945,10 @@ sctp_process_cookie_existing(struct mbuf asoc->mapping_array_size); } SCTP_TCB_UNLOCK(stcb); +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + so = SCTP_INP_SO(stcb->sctp_ep); + SCTP_SOCKET_LOCK(so, 1); +#endif SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); @@ -1946,7 +1956,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; @@ -1968,11 +1978,15 @@ sctp_process_cookie_existing(struct mbuf */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - /* process the INIT info (peer's info) */ SCTP_TCB_SEND_UNLOCK(stcb); SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); - +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + SCTP_SOCKET_UNLOCK(so, 1); +#endif + asoc->total_flight = 0; + asoc->total_flight_count = 0; + /* process the INIT info (peer's info) */ retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) @@ -3196,13 +3210,14 @@ sctp_handle_shutdown_complete(struct sct /* notify upper layer protocol */ if (stcb->sctp_socket) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - /* are the queues empty? they should be */ - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); - } } +#ifdef INVARIANTS + if (!TAILQ_EMPTY(&asoc->send_queue) || + !TAILQ_EMPTY(&asoc->sent_queue) || + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); + } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -3491,18 +3506,13 @@ sctp_reset_in_stream(struct sctp_tcb *st } static void -sctp_reset_out_streams(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_out_streams(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; + uint16_t temp; - if (number_entries == 0) { - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; - } - } else if (number_entries) { + if (number_entries > 0) { for (i = 0; i < number_entries; i++) { - uint16_t temp; - temp = ntohs(list[i]); if (temp >= stcb->asoc.streamoutcnt) { /* no such stream */ @@ -3510,6 +3520,10 @@ sctp_reset_out_streams(struct sctp_tcb * } stcb->asoc.strmout[temp].next_sequence_send = 0; } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_send = 0; + } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); } @@ -3596,7 +3610,7 @@ sctp_handle_stream_reset_response(struct struct sctp_association *asoc = &stcb->asoc; struct sctp_tmit_chunk *chk; struct sctp_stream_reset_out_request *srparam; - int number_entries; + uint32_t number_entries; if (asoc->stream_reset_outstanding == 0) { /* duplicate */ Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jul 3 18:35:21 2013 (r252584) +++ head/sys/netinet/sctp_pcb.c Wed Jul 3 18:48:43 2013 (r252585) @@ -4451,23 +4451,21 @@ sctp_delete_from_timewait(uint32_t tag, int i; chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + found = 1; break; + } } + if (found) + break; } } @@ -4481,19 +4479,17 @@ sctp_is_in_timewait(uint32_t tag, uint16 SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + found = 1; break; + } } + if (found) + break; } SCTP_INP_INFO_WUNLOCK(); return (found); @@ -4515,42 +4511,40 @@ sctp_add_vtag_to_timewait(uint32_t tag, (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* Block(s) present, lets find space, and expire on the fly */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == 0) && - !set) { - twait_block->vtag_block[i].tv_sec_at_expire = - now.tv_sec + time; + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == 0) && + !set) { + twait_block->vtag_block[i].tv_sec_at_expire = + now.tv_sec + time; + twait_block->vtag_block[i].v_tag = tag; + twait_block->vtag_block[i].lport = lport; + twait_block->vtag_block[i].rport = rport; + set = 1; + } else if ((twait_block->vtag_block[i].v_tag) && + ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + if (set == 0) { + /* Reuse it for my new tag */ + twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; twait_block->vtag_block[i].v_tag = tag; twait_block->vtag_block[i].lport = lport; twait_block->vtag_block[i].rport = rport; set = 1; - } else if ((twait_block->vtag_block[i].v_tag) && - ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - if (set == 0) { - /* Reuse it for my new tag */ - twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; - } } } - if (set) { - /* - * We only do up to the block where we can - * place our tag for audits - */ - break; - } + } + if (set) { + /* + * We only do up to the block where we can place our + * tag for audits + */ + break; } } /* Need to add a new block to chain */ @@ -6700,30 +6694,28 @@ skip_vtag_check: chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* * Block(s) are present, lets see if we have this tag in the * list */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if (twait_block->vtag_block[i].v_tag == 0) { - /* not used */ - continue; - } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < - now->tv_sec) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - } else if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - /* Bad tag, sorry :< */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if (twait_block->vtag_block[i].v_tag == 0) { + /* not used */ + continue; + } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < + now->tv_sec) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + } else if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + /* Bad tag, sorry :< */ + SCTP_INP_INFO_RUNLOCK(); + return (0); } } } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 18:53:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE6031A3; Wed, 3 Jul 2013 18:53:36 +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 A0F061F31; Wed, 3 Jul 2013 18:53:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Ira7r075785; Wed, 3 Jul 2013 18:53:36 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Iraww075784; Wed, 3 Jul 2013 18:53:36 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307031853.r63Iraww075784@svn.freebsd.org> From: Warren Block Date: Wed, 3 Jul 2013 18:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252586 - head/sys/boot/i386/gptboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 18:53:36 -0000 Author: wblock (doc committer) Date: Wed Jul 3 18:53:36 2013 New Revision: 252586 URL: http://svnweb.freebsd.org/changeset/base/252586 Log: Add descriptions to the FILES list, fix some mdoc complaints, move the "neither" entry out of the table in BOOTING. Submitted by: joeld Reviewed by: joeld MFC after: 1 week Modified: head/sys/boot/i386/gptboot/gptboot.8 Modified: head/sys/boot/i386/gptboot/gptboot.8 ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.8 Wed Jul 3 18:48:43 2013 (r252585) +++ head/sys/boot/i386/gptboot/gptboot.8 Wed Jul 3 18:53:36 2013 (r252586) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2013 +.Dd July 3, 2013 .Dt GPTBOOT 8 .Os .Sh NAME @@ -147,7 +147,8 @@ Middle priority: booting is attempted fr partitions with the .Cm bootme attribute. -.It neither +.El +.Pp If neither .Cm bootonce nor @@ -156,7 +157,6 @@ attributes are found on any partitions, first .Cm freebsd-ufs partition on the disk. -.El .Sh POST-BOOT ACTIONS The startup script .Pa /etc/rc.d/gptboot @@ -181,9 +181,12 @@ The attribute is cleared from the partition that successfully booted. There is normally only one of these. .Sh FILES -.Bl -tag -width /boot/loader -compact +.Bl -tag -width /boot/gptboot -compact .It Pa /boot/gptboot +bootcode binary .It Pa /boot.config +parameters for the boot blocks +.Pq optional .El .Sh EXAMPLES .Nm @@ -223,7 +226,6 @@ attribute: .Bd -literal -offset indent gpart set -a bootonce -i 2 ada0 .Ed -.Pp .Sh SEE ALSO .Xr boot.config 5 , .Xr rc.conf 5 , From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 19:08:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B2008D9; Wed, 3 Jul 2013 19:08:11 +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 6DD6E104F; Wed, 3 Jul 2013 19:08:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63J8BRY079825; Wed, 3 Jul 2013 19:08:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63J8B9r079824; Wed, 3 Jul 2013 19:08:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307031908.r63J8B9r079824@svn.freebsd.org> From: Dimitry Andric Date: Wed, 3 Jul 2013 19:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252587 - head/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 19:08:11 -0000 Author: dim Date: Wed Jul 3 19:08:10 2013 New Revision: 252587 URL: http://svnweb.freebsd.org/changeset/base/252587 Log: Pull in r185446 from clang trunk: Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout. Reported by: glebius Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed Jul 3 18:53:36 2013 (r252586) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed Jul 3 19:08:10 2013 (r252587) @@ -10296,7 +10296,8 @@ void Sema::ActOnTagFinishDefinition(Scop Tag->setTopLevelDeclInObjCContainer(); // Notify the consumer that we've defined a tag. - Consumer.HandleTagDeclDefinition(Tag); + if (!Tag->isInvalidDecl()) + Consumer.HandleTagDeclDefinition(Tag); } void Sema::ActOnObjCContainerFinishDefinition() { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 19:12:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A87C9AA1; Wed, 3 Jul 2013 19:12:36 +0000 (UTC) (envelope-from obrien@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 9B1A71084; Wed, 3 Jul 2013 19:12:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63JCaju082222; Wed, 3 Jul 2013 19:12:36 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63JCaTU082220; Wed, 3 Jul 2013 19:12:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307031912.r63JCaTU082220@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 19:12: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: r252588 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 19:12:36 -0000 Author: obrien Date: Wed Jul 3 19:12:35 2013 New Revision: 252588 URL: http://svnweb.freebsd.org/changeset/base/252588 Log: MFC: r238051: Add "hier" as an alternate spelling of "hierarchy" to match hier(9). Modified: stable/9/Makefile (contents, props changed) stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Wed Jul 3 19:08:10 2013 (r252587) +++ stable/9/Makefile Wed Jul 3 19:12:35 2013 (r252588) @@ -91,7 +91,7 @@ TGTS= all all-man buildenv buildenvvars delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ - everything hierarchy install installcheck installkernel \ + everything hier hierarchy install installcheck installkernel \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Wed Jul 3 19:08:10 2013 (r252587) +++ stable/9/Makefile.inc1 Wed Jul 3 19:12:35 2013 (r252588) @@ -1272,7 +1272,7 @@ cross-tools: # # hierarchy - ensure that all the needed directories are present # -hierarchy: +hierarchy hier: .if defined(NO_ROOT) cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \ -DNO_ROOT METALOG=${METALOG} distrib-dirs From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 19:56:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 017ED67B; Wed, 3 Jul 2013 19:56:40 +0000 (UTC) (envelope-from netchild@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 E5E8A127E; Wed, 3 Jul 2013 19:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63JudiT094273; Wed, 3 Jul 2013 19:56:39 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Judax094272; Wed, 3 Jul 2013 19:56:39 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201307031956.r63Judax094272@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 3 Jul 2013 19:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r252590 - vendor/v4l/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 19:56:40 -0000 Author: netchild Date: Wed Jul 3 19:56:39 2013 New Revision: 252590 URL: http://svnweb.freebsd.org/changeset/base/252590 Log: Update videodev2.h to the version from linux kernel 2.6.34.14. This version is dual-licensed: 3 clause BSD license and GPL v2+. Modified: vendor/v4l/dist/videodev2.h Modified: vendor/v4l/dist/videodev2.h ============================================================================== --- vendor/v4l/dist/videodev2.h Wed Jul 3 19:55:24 2013 (r252589) +++ vendor/v4l/dist/videodev2.h Wed Jul 3 19:56:39 2013 (r252590) @@ -1,37 +1,81 @@ -#ifndef __LINUX_VIDEODEV2_H -#define __LINUX_VIDEODEV2_H /* - * Video for Linux Two + * Video for Linux Two header file + * + * Copyright (C) 1999-2007 the contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * Header file for v4l or V4L2 drivers and applications, for - * Linux kernels 2.2.x or 2.4.x. + * Alternatively you can redistribute this file under the terms of the + * BSD license as stated below: * - * See http://bytesex.org/v4l/ for API specs and other - * v4l2 documentation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. * - * Author: Bill Dirks + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Header file for v4l or V4L2 drivers and applications + * with public API. + * All kernel-specific stuff were moved to media/v4l2-dev.h, so + * no #if __KERNEL tests are allowed here + * + * See http://linuxtv.org for more info + * + * Author: Bill Dirks * Justin Schoeman + * Hans Verkuil * et al. */ +#ifndef __LINUX_VIDEODEV2_H +#define __LINUX_VIDEODEV2_H + #ifdef __KERNEL__ -#include /* need struct timeval */ -#include -#include -#include +#include /* need struct timeval */ +#else +#include #endif -#include /* need __user */ - - -#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */ -#define HAVE_V4L2 1 +#include +#include +#include /* * Common stuff for both V4L1 and V4L2 * Moved from videodev.h */ - #define VIDEO_MAX_FRAME 32 +#ifndef __KERNEL__ + +/* These defines are V4L1 specific and should not be used with the V4L2 API! + They will be removed from this header in the future. */ + #define VID_TYPE_CAPTURE 1 /* Can capture */ #define VID_TYPE_TUNER 2 /* Can tune */ #define VID_TYPE_TELETEXT 4 /* Does teletext */ @@ -46,70 +90,6 @@ #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ - -#ifdef __KERNEL__ - -/* Minor device allocation */ -#define MINOR_VFL_TYPE_GRABBER_MIN 0 -#define MINOR_VFL_TYPE_GRABBER_MAX 63 -#define MINOR_VFL_TYPE_RADIO_MIN 64 -#define MINOR_VFL_TYPE_RADIO_MAX 127 -#define MINOR_VFL_TYPE_VTX_MIN 192 -#define MINOR_VFL_TYPE_VTX_MAX 223 -#define MINOR_VFL_TYPE_VBI_MIN 224 -#define MINOR_VFL_TYPE_VBI_MAX 255 - -#define VFL_TYPE_GRABBER 0 -#define VFL_TYPE_VBI 1 -#define VFL_TYPE_RADIO 2 -#define VFL_TYPE_VTX 3 - -struct video_device -{ - /* device info */ - struct device *dev; - char name[32]; - int type; /* v4l1 */ - int type2; /* v4l2 */ - int hardware; - int minor; - - /* device ops + callbacks */ - const struct file_operations *fops; - void (*release)(struct video_device *vfd); - - -#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ - /* obsolete -- fops->owner is used instead */ - struct module *owner; - /* dev->driver_data will be used instead some day. - * Use the video_{get|set}_drvdata() helper functions, - * so the switch over will be transparent for you. - * Or use {pci|usb}_{get|set}_drvdata() directly. */ - void *priv; -#endif - - /* for videodev.c intenal usage -- please don't touch */ - int users; /* video_exclusive_{open|close} ... */ - struct mutex lock; /* ... helper function uses these */ - char devfs_name[64]; /* devfs */ - struct class_device class_dev; /* sysfs */ -}; - -#define VIDEO_MAJOR 81 - -extern int video_register_device(struct video_device *, int type, int nr); -extern void video_unregister_device(struct video_device *); -extern int video_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)); - -/* helper functions to alloc / release struct video_device, the - later can be used for video_device->release() */ -struct video_device *video_device_alloc(void); -void video_device_release(struct video_device *vfd); - #endif /* @@ -117,54 +97,67 @@ void video_device_release(struct video_d */ /* Four-character-code (FOURCC) */ -#define v4l2_fourcc(a,b,c,d)\ - (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) +#define v4l2_fourcc(a, b, c, d)\ + ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) /* * E N U M S */ enum v4l2_field { - V4L2_FIELD_ANY = 0, /* driver can choose from none, - top, bottom, interlaced - depending on whatever it thinks - is approximate ... */ - V4L2_FIELD_NONE = 1, /* this device has no fields ... */ - V4L2_FIELD_TOP = 2, /* top field only */ - V4L2_FIELD_BOTTOM = 3, /* bottom field only */ - V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ - V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one - buffer, top-bottom order */ - V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ - V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into - separate buffers */ + V4L2_FIELD_ANY = 0, /* driver can choose from none, + top, bottom, interlaced + depending on whatever it thinks + is approximate ... */ + V4L2_FIELD_NONE = 1, /* this device has no fields ... */ + V4L2_FIELD_TOP = 2, /* top field only */ + V4L2_FIELD_BOTTOM = 3, /* bottom field only */ + V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ + V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one + buffer, top-bottom order */ + V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ + V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into + separate buffers */ + V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field + first and the top field is + transmitted first */ + V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field + first and the bottom field is + transmitted first */ }; #define V4L2_FIELD_HAS_TOP(field) \ ((field) == V4L2_FIELD_TOP ||\ (field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) #define V4L2_FIELD_HAS_BOTTOM(field) \ ((field) == V4L2_FIELD_BOTTOM ||\ (field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) #define V4L2_FIELD_HAS_BOTH(field) \ ((field) == V4L2_FIELD_INTERLACED ||\ - (field) == V4L2_FIELD_SEQ_TB ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ + (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) enum v4l2_buf_type { - V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, - V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, - V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, - V4L2_BUF_TYPE_VBI_CAPTURE = 4, - V4L2_BUF_TYPE_VBI_OUTPUT = 5, + V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, + V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, + V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, + V4L2_BUF_TYPE_VBI_CAPTURE = 4, + V4L2_BUF_TYPE_VBI_OUTPUT = 5, + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, + V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, #if 1 - /* Experimental Sliced VBI */ - V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, - V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, + /* Experimental */ + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, #endif - V4L2_BUF_TYPE_PRIVATE = 0x80, + V4L2_BUF_TYPE_PRIVATE = 0x80, }; enum v4l2_ctrl_type { @@ -172,6 +165,9 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_BOOLEAN = 2, V4L2_CTRL_TYPE_MENU = 3, V4L2_CTRL_TYPE_BUTTON = 4, + V4L2_CTRL_TYPE_INTEGER64 = 5, + V4L2_CTRL_TYPE_CTRL_CLASS = 6, + V4L2_CTRL_TYPE_STRING = 7, }; enum v4l2_tuner_type { @@ -237,8 +233,7 @@ struct v4l2_fract { /* * D R I V E R C A P A B I L I T I E S */ -struct v4l2_capability -{ +struct v4l2_capability { __u8 driver[16]; /* i.e. "bttv" */ __u8 card[32]; /* i.e. "Hauppauge WinTV" */ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ @@ -253,15 +248,17 @@ struct v4l2_capability #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ -#if 1 #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ -#endif #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ +#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ +#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ +#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ +#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ @@ -270,9 +267,7 @@ struct v4l2_capability /* * V I D E O I M A G E F O R M A T */ - -struct v4l2_pix_format -{ +struct v4l2_pix_format { __u32 width; __u32 height; __u32 pixelformat; @@ -283,56 +278,102 @@ struct v4l2_pix_format __u32 priv; /* private data, depends on pixelformat */ }; -/* Pixel format FOURCC depth Description */ -#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ -#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ -#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ -#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */ -#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */ -#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */ -#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */ -#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ -#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ -#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ -#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ -#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ -#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */ -#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */ -#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */ +/* Pixel format FOURCC depth Description */ -/* two planes -- one Y, one Cr + Cb interleaved */ -#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */ -#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */ +/* RGB formats */ +#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ +#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ +#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ +#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ +#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ +#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ +#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ +#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ +#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ +#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ + +/* Grey formats */ +#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ +#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ +#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ + +/* Palette formats */ +#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ + +/* Luminance+Chrominance formats */ +#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ +#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ +#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ +#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ +#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ +#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ +#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ +#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ +#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ +#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ +#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ +#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ +#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ +#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ -/* The following formats are not defined in the V4L2 specification */ -#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */ -#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ -#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ -#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ - -/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ -#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ +/* two planes -- one Y, one Cr + Cb interleaved */ +#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ +#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ +#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ +#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ + +/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ +#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ +#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */ +#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ +#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ + /* 10bit raw bayer DPCM compressed to 8 bits */ +#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') + /* + * 10bit raw bayer, expanded to 16 bits + * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... + */ +#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ /* compressed formats */ -#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ -#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ -#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ -#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ +#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ +#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ +#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ /* Vendor-specific formats */ -#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ -#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ -#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ -#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ -#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ +#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ +#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ +#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ +#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ +#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ +#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ +#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ +#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */ +#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */ +#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ +#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ +#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ +#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ +#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ +#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ +#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ +#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ /* * F O R M A T E N U M E R A T I O N */ -struct v4l2_fmtdesc -{ +struct v4l2_fmtdesc { __u32 index; /* Format number */ enum v4l2_buf_type type; /* buffer type */ __u32 flags; @@ -342,13 +383,81 @@ struct v4l2_fmtdesc }; #define V4L2_FMT_FLAG_COMPRESSED 0x0001 +#define V4L2_FMT_FLAG_EMULATED 0x0002 + +#if 1 + /* Experimental Frame Size and frame rate enumeration */ +/* + * F R A M E S I Z E E N U M E R A T I O N + */ +enum v4l2_frmsizetypes { + V4L2_FRMSIZE_TYPE_DISCRETE = 1, + V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, + V4L2_FRMSIZE_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmsize_discrete { + __u32 width; /* Frame width [pixel] */ + __u32 height; /* Frame height [pixel] */ +}; + +struct v4l2_frmsize_stepwise { + __u32 min_width; /* Minimum frame width [pixel] */ + __u32 max_width; /* Maximum frame width [pixel] */ + __u32 step_width; /* Frame width step size [pixel] */ + __u32 min_height; /* Minimum frame height [pixel] */ + __u32 max_height; /* Maximum frame height [pixel] */ + __u32 step_height; /* Frame height step size [pixel] */ +}; +struct v4l2_frmsizeenum { + __u32 index; /* Frame size number */ + __u32 pixel_format; /* Pixel format */ + __u32 type; /* Frame size type the device supports. */ + + union { /* Frame size */ + struct v4l2_frmsize_discrete discrete; + struct v4l2_frmsize_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; + +/* + * F R A M E R A T E E N U M E R A T I O N + */ +enum v4l2_frmivaltypes { + V4L2_FRMIVAL_TYPE_DISCRETE = 1, + V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, + V4L2_FRMIVAL_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmival_stepwise { + struct v4l2_fract min; /* Minimum frame interval [s] */ + struct v4l2_fract max; /* Maximum frame interval [s] */ + struct v4l2_fract step; /* Frame interval step size [s] */ +}; + +struct v4l2_frmivalenum { + __u32 index; /* Frame format index */ + __u32 pixel_format; /* Pixel format */ + __u32 width; /* Frame width */ + __u32 height; /* Frame height */ + __u32 type; /* Frame interval type the device supports. */ + + union { /* Frame interval */ + struct v4l2_fract discrete; + struct v4l2_frmival_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; +#endif /* * T I M E C O D E */ -struct v4l2_timecode -{ +struct v4l2_timecode { __u32 type; __u32 flags; __u8 frames; @@ -373,96 +482,7 @@ struct v4l2_timecode #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ - -/* - * M P E G C O M P R E S S I O N P A R A M E T E R S - * - * ### WARNING: this is still work-in-progress right now, most likely - * ### there will be some incompatible changes. - * - */ - - -enum v4l2_bitrate_mode { - V4L2_BITRATE_NONE = 0, /* not specified */ - V4L2_BITRATE_CBR, /* constant bitrate */ - V4L2_BITRATE_VBR, /* variable bitrate */ -}; -struct v4l2_bitrate { - /* rates are specified in kbit/sec */ - enum v4l2_bitrate_mode mode; - __u32 min; - __u32 target; /* use this one for CBR */ - __u32 max; -}; - -enum v4l2_mpeg_streamtype { - V4L2_MPEG_SS_1, /* MPEG-1 system stream */ - V4L2_MPEG_PS_2, /* MPEG-2 program stream */ - V4L2_MPEG_TS_2, /* MPEG-2 transport stream */ - V4L2_MPEG_PS_DVD, /* MPEG-2 program stream with DVD header fixups */ -}; -enum v4l2_mpeg_audiotype { - V4L2_MPEG_AU_2_I, /* MPEG-2 layer 1 */ - V4L2_MPEG_AU_2_II, /* MPEG-2 layer 2 */ - V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */ - V4L2_MPEG_AC3, /* AC3 */ - V4L2_MPEG_LPCM, /* LPCM */ -}; -enum v4l2_mpeg_videotype { - V4L2_MPEG_VI_1, /* MPEG-1 */ - V4L2_MPEG_VI_2, /* MPEG-2 */ -}; -enum v4l2_mpeg_aspectratio { - V4L2_MPEG_ASPECT_SQUARE = 1, /* square pixel */ - V4L2_MPEG_ASPECT_4_3 = 2, /* 4 : 3 */ - V4L2_MPEG_ASPECT_16_9 = 3, /* 16 : 9 */ - V4L2_MPEG_ASPECT_1_221 = 4, /* 1 : 2,21 */ -}; - -struct v4l2_mpeg_compression { - /* general */ - enum v4l2_mpeg_streamtype st_type; - struct v4l2_bitrate st_bitrate; - - /* transport streams */ - __u16 ts_pid_pmt; - __u16 ts_pid_audio; - __u16 ts_pid_video; - __u16 ts_pid_pcr; - - /* program stream */ - __u16 ps_size; - __u16 reserved_1; /* align */ - - /* audio */ - enum v4l2_mpeg_audiotype au_type; - struct v4l2_bitrate au_bitrate; - __u32 au_sample_rate; - __u8 au_pesid; - __u8 reserved_2[3]; /* align */ - - /* video */ - enum v4l2_mpeg_videotype vi_type; - enum v4l2_mpeg_aspectratio vi_aspect_ratio; - struct v4l2_bitrate vi_bitrate; - __u32 vi_frame_rate; - __u16 vi_frames_per_gop; - __u16 vi_bframes_count; - __u8 vi_pesid; - __u8 reserved_3[3]; /* align */ - - /* misc flags */ - __u32 closed_gops:1; - __u32 pulldown:1; - __u32 reserved_4:30; /* align */ - - /* I don't expect the above being perfect yet ;) */ - __u32 reserved_5[8]; -}; - -struct v4l2_jpegcompression -{ +struct v4l2_jpegcompression { int quality; int APPn; /* Number of APP segment to be written, @@ -478,7 +498,7 @@ struct v4l2_jpegcompression * you do, leave them untouched. * Inluding less markers will make the * resulting code smaller, but there will - * be fewer aplications which can read it. + * be fewer applications which can read it. * The presence of the APP and COM marker * is influenced by APP_len and COM_len * ONLY, not by this property! */ @@ -491,20 +511,17 @@ struct v4l2_jpegcompression * allways use APP0 */ }; - /* * M E M O R Y - M A P P I N G B U F F E R S */ -struct v4l2_requestbuffers -{ +struct v4l2_requestbuffers { __u32 count; enum v4l2_buf_type type; enum v4l2_memory memory; __u32 reserved[2]; }; -struct v4l2_buffer -{ +struct v4l2_buffer { __u32 index; enum v4l2_buf_type type; __u32 bytesused; @@ -538,13 +555,12 @@ struct v4l2_buffer /* * O V E R L A Y P R E V I E W */ -struct v4l2_framebuffer -{ +struct v4l2_framebuffer { __u32 capability; __u32 flags; /* FIXME: in theory we should pass something like PCI device + memory * region + offset instead of some physical address */ - void* base; + void *base; struct v4l2_pix_format fmt; }; /* Flags for the 'capability' field. Read only */ @@ -552,33 +568,38 @@ struct v4l2_framebuffer #define V4L2_FBUF_CAP_CHROMAKEY 0x0002 #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004 #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 +#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 +#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 +#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 +#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080 /* Flags for the 'flags' field. */ #define V4L2_FBUF_FLAG_PRIMARY 0x0001 #define V4L2_FBUF_FLAG_OVERLAY 0x0002 #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 +#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 +#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 +#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 +#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040 -struct v4l2_clip -{ +struct v4l2_clip { struct v4l2_rect c; struct v4l2_clip __user *next; }; -struct v4l2_window -{ +struct v4l2_window { struct v4l2_rect w; enum v4l2_field field; __u32 chromakey; struct v4l2_clip __user *clips; __u32 clipcount; void __user *bitmap; + __u8 global_alpha; }; - /* * C A P T U R E P A R A M E T E R S */ -struct v4l2_captureparm -{ +struct v4l2_captureparm { __u32 capability; /* Supported modes */ __u32 capturemode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in .1us units */ @@ -586,12 +607,12 @@ struct v4l2_captureparm __u32 readbuffers; /* # of buffers for read */ __u32 reserved[4]; }; + /* Flags for 'capability' and 'capturemode' fields */ #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ -struct v4l2_outputparm -{ +struct v4l2_outputparm { __u32 capability; /* Supported modes */ __u32 outputmode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in seconds */ @@ -603,7 +624,6 @@ struct v4l2_outputparm /* * I N P U T I M A G E C R O P P I N G */ - struct v4l2_cropcap { enum v4l2_buf_type type; struct v4l2_rect bounds; @@ -655,6 +675,15 @@ typedef __u64 v4l2_std_id; #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) +/* FIXME: + Although std_id is 64 bits, there is an issue on PPC32 architecture that + makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding + this value to 32 bits. + As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide), + it should work fine. However, if needed to add more than two standards, + v4l2-common.c should be fixed. + */ + /* some merged standards */ #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) @@ -700,8 +729,7 @@ typedef __u64 v4l2_std_id; #define V4L2_STD_ALL (V4L2_STD_525_60 |\ V4L2_STD_625_50) -struct v4l2_standard -{ +struct v4l2_standard { __u32 index; v4l2_std_id id; __u8 name[24]; @@ -710,12 +738,103 @@ struct v4l2_standard __u32 reserved[4]; }; +/* + * V I D E O T I M I N G S D V P R E S E T + */ +struct v4l2_dv_preset { + __u32 preset; + __u32 reserved[4]; +}; + +/* + * D V P R E S E T S E N U M E R A T I O N + */ +struct v4l2_dv_enum_preset { + __u32 index; + __u32 preset; + __u8 name[32]; /* Name of the preset timing */ + __u32 width; + __u32 height; + __u32 reserved[4]; +}; + +/* + * D V P R E S E T V A L U E S + */ +#define V4L2_DV_INVALID 0 +#define V4L2_DV_480P59_94 1 /* BT.1362 */ +#define V4L2_DV_576P50 2 /* BT.1362 */ +#define V4L2_DV_720P24 3 /* SMPTE 296M */ +#define V4L2_DV_720P25 4 /* SMPTE 296M */ +#define V4L2_DV_720P30 5 /* SMPTE 296M */ +#define V4L2_DV_720P50 6 /* SMPTE 296M */ +#define V4L2_DV_720P59_94 7 /* SMPTE 274M */ +#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */ +#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */ +#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */ +#define V4L2_DV_1080I25 11 /* BT.1120 */ +#define V4L2_DV_1080I50 12 /* SMPTE 296M */ +#define V4L2_DV_1080I60 13 /* SMPTE 296M */ +#define V4L2_DV_1080P24 14 /* SMPTE 296M */ +#define V4L2_DV_1080P25 15 /* SMPTE 296M */ +#define V4L2_DV_1080P30 16 /* SMPTE 296M */ +#define V4L2_DV_1080P50 17 /* BT.1120 */ +#define V4L2_DV_1080P60 18 /* BT.1120 */ + +/* + * D V B T T I M I N G S + */ + +/* BT.656/BT.1120 timing data */ +struct v4l2_bt_timings { + __u32 width; /* width in pixels */ + __u32 height; /* height in lines */ + __u32 interlaced; /* Interlaced or progressive */ + __u32 polarities; /* Positive or negative polarity */ + __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ + __u32 hfrontporch; /* Horizpontal front porch in pixels */ + __u32 hsync; /* Horizontal Sync length in pixels */ + __u32 hbackporch; /* Horizontal back porch in pixels */ + __u32 vfrontporch; /* Vertical front porch in pixels */ + __u32 vsync; /* Vertical Sync length in lines */ + __u32 vbackporch; /* Vertical back porch in lines */ + __u32 il_vfrontporch; /* Vertical front porch for bottom field of + * interlaced field formats + */ + __u32 il_vsync; /* Vertical sync length for bottom field of + * interlaced field formats + */ + __u32 il_vbackporch; /* Vertical back porch for bottom field of + * interlaced field formats + */ + __u32 reserved[16]; +} __attribute__ ((packed)); + +/* Interlaced or progressive format */ +#define V4L2_DV_PROGRESSIVE 0 +#define V4L2_DV_INTERLACED 1 + +/* Polarities. If bit is not set, it is assumed to be negative polarity */ +#define V4L2_DV_VSYNC_POS_POL 0x00000001 +#define V4L2_DV_HSYNC_POS_POL 0x00000002 + + +/* DV timings */ +struct v4l2_dv_timings { + __u32 type; + union { + struct v4l2_bt_timings bt; + __u32 reserved[32]; + }; +} __attribute__ ((packed)); + +/* Values for the type field */ +#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ /* * V I D E O I N P U T S */ -struct v4l2_input -{ +struct v4l2_input { __u32 index; /* Which input */ __u8 name[32]; /* Label */ __u32 type; /* Type of input */ @@ -723,8 +842,10 @@ struct v4l2_input __u32 tuner; /* Associated tuner */ v4l2_std_id std; __u32 status; - __u32 reserved[4]; + __u32 capabilities; + __u32 reserved[3]; }; + /* Values for the 'type' field */ #define V4L2_INPUT_TYPE_TUNER 1 #define V4L2_INPUT_TYPE_CAMERA 2 @@ -734,6 +855,11 @@ struct v4l2_input #define V4L2_IN_ST_NO_SIGNAL 0x00000002 #define V4L2_IN_ST_NO_COLOR 0x00000004 +/* field 'status' - sensor orientation */ +/* If sensor is mounted upside down set both bits */ +#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */ +#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */ + /* field 'status' - analog */ #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ @@ -748,36 +874,73 @@ struct v4l2_input #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ +/* capabilities flags */ +#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ +#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ +#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ + /* * V I D E O O U T P U T S */ -struct v4l2_output -{ +struct v4l2_output { __u32 index; /* Which output */ __u8 name[32]; /* Label */ __u32 type; /* Type of output */ __u32 audioset; /* Associated audios (bitfield) */ __u32 modulator; /* Associated modulator */ v4l2_std_id std; - __u32 reserved[4]; + __u32 capabilities; + __u32 reserved[3]; }; /* Values for the 'type' field */ #define V4L2_OUTPUT_TYPE_MODULATOR 1 #define V4L2_OUTPUT_TYPE_ANALOG 2 #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 +/* capabilities flags */ +#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ +#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ +#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ + /* * C O N T R O L S */ -struct v4l2_control -{ +struct v4l2_control { __u32 id; __s32 value; }; +struct v4l2_ext_control { + __u32 id; + __u32 size; + __u32 reserved2[1]; + union { + __s32 value; + __s64 value64; + char *string; + }; +} __attribute__ ((packed)); + +struct v4l2_ext_controls { + __u32 ctrl_class; + __u32 count; + __u32 error_idx; + __u32 reserved[2]; + struct v4l2_ext_control *controls; +}; + +/* Values for ctrl_class field */ +#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ +#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ +#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ +#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ + +#define V4L2_CTRL_ID_MASK (0x0fffffff) +#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) +#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) + /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ -struct v4l2_queryctrl -{ +struct v4l2_queryctrl { __u32 id; enum v4l2_ctrl_type type; __u8 name[32]; /* Whatever */ @@ -790,8 +953,7 @@ struct v4l2_queryctrl }; /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:08:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01263959; Wed, 3 Jul 2013 20:08:22 +0000 (UTC) (envelope-from netchild@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 E6FBD1336; Wed, 3 Jul 2013 20:08:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63K8M1c097765; Wed, 3 Jul 2013 20:08:22 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63K8M9Z097764; Wed, 3 Jul 2013 20:08:22 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201307032008.r63K8M9Z097764@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 3 Jul 2013 20:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r252591 - vendor/v4l/2.6.34.14 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:08:23 -0000 Author: netchild Date: Wed Jul 3 20:08:22 2013 New Revision: 252591 URL: http://svnweb.freebsd.org/changeset/base/252591 Log: Tag 2.6.34.14. Added: vendor/v4l/2.6.34.14/ - copied from r252372, vendor/v4l/dist/ Replaced: vendor/v4l/2.6.34.14/videodev2.h - copied unchanged from r252590, vendor/v4l/dist/videodev2.h Copied: vendor/v4l/2.6.34.14/videodev2.h (from r252590, vendor/v4l/dist/videodev2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/v4l/2.6.34.14/videodev2.h Wed Jul 3 20:08:22 2013 (r252591, copy of r252590, vendor/v4l/dist/videodev2.h) @@ -0,0 +1,1761 @@ +/* + * Video for Linux Two header file + * + * Copyright (C) 1999-2007 the contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Alternatively you can redistribute this file under the terms of the + * BSD license as stated below: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Header file for v4l or V4L2 drivers and applications + * with public API. + * All kernel-specific stuff were moved to media/v4l2-dev.h, so + * no #if __KERNEL tests are allowed here + * + * See http://linuxtv.org for more info + * + * Author: Bill Dirks + * Justin Schoeman + * Hans Verkuil + * et al. + */ +#ifndef __LINUX_VIDEODEV2_H +#define __LINUX_VIDEODEV2_H + +#ifdef __KERNEL__ +#include /* need struct timeval */ +#else +#include +#endif +#include +#include +#include + +/* + * Common stuff for both V4L1 and V4L2 + * Moved from videodev.h + */ +#define VIDEO_MAX_FRAME 32 + +#ifndef __KERNEL__ + +/* These defines are V4L1 specific and should not be used with the V4L2 API! + They will be removed from this header in the future. */ + +#define VID_TYPE_CAPTURE 1 /* Can capture */ +#define VID_TYPE_TUNER 2 /* Can tune */ +#define VID_TYPE_TELETEXT 4 /* Does teletext */ +#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ +#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ +#define VID_TYPE_CLIPPING 32 /* Can clip */ +#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ +#define VID_TYPE_SCALES 128 /* Scalable */ +#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ +#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ +#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ +#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ +#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ +#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ +#endif + +/* + * M I S C E L L A N E O U S + */ + +/* Four-character-code (FOURCC) */ +#define v4l2_fourcc(a, b, c, d)\ + ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) + +/* + * E N U M S + */ +enum v4l2_field { + V4L2_FIELD_ANY = 0, /* driver can choose from none, + top, bottom, interlaced + depending on whatever it thinks + is approximate ... */ + V4L2_FIELD_NONE = 1, /* this device has no fields ... */ + V4L2_FIELD_TOP = 2, /* top field only */ + V4L2_FIELD_BOTTOM = 3, /* bottom field only */ + V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ + V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one + buffer, top-bottom order */ + V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ + V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into + separate buffers */ + V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field + first and the top field is + transmitted first */ + V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field + first and the bottom field is + transmitted first */ +}; +#define V4L2_FIELD_HAS_TOP(field) \ + ((field) == V4L2_FIELD_TOP ||\ + (field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ + (field) == V4L2_FIELD_SEQ_TB ||\ + (field) == V4L2_FIELD_SEQ_BT) +#define V4L2_FIELD_HAS_BOTTOM(field) \ + ((field) == V4L2_FIELD_BOTTOM ||\ + (field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ + (field) == V4L2_FIELD_SEQ_TB ||\ + (field) == V4L2_FIELD_SEQ_BT) +#define V4L2_FIELD_HAS_BOTH(field) \ + ((field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT ||\ + (field) == V4L2_FIELD_SEQ_TB ||\ + (field) == V4L2_FIELD_SEQ_BT) + +enum v4l2_buf_type { + V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, + V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, + V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, + V4L2_BUF_TYPE_VBI_CAPTURE = 4, + V4L2_BUF_TYPE_VBI_OUTPUT = 5, + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, + V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, +#if 1 + /* Experimental */ + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, +#endif + V4L2_BUF_TYPE_PRIVATE = 0x80, +}; + +enum v4l2_ctrl_type { + V4L2_CTRL_TYPE_INTEGER = 1, + V4L2_CTRL_TYPE_BOOLEAN = 2, + V4L2_CTRL_TYPE_MENU = 3, + V4L2_CTRL_TYPE_BUTTON = 4, + V4L2_CTRL_TYPE_INTEGER64 = 5, + V4L2_CTRL_TYPE_CTRL_CLASS = 6, + V4L2_CTRL_TYPE_STRING = 7, +}; + +enum v4l2_tuner_type { + V4L2_TUNER_RADIO = 1, + V4L2_TUNER_ANALOG_TV = 2, + V4L2_TUNER_DIGITAL_TV = 3, +}; + +enum v4l2_memory { + V4L2_MEMORY_MMAP = 1, + V4L2_MEMORY_USERPTR = 2, + V4L2_MEMORY_OVERLAY = 3, +}; + +/* see also http://vektor.theorem.ca/graphics/ycbcr/ */ +enum v4l2_colorspace { + /* ITU-R 601 -- broadcast NTSC/PAL */ + V4L2_COLORSPACE_SMPTE170M = 1, + + /* 1125-Line (US) HDTV */ + V4L2_COLORSPACE_SMPTE240M = 2, + + /* HD and modern captures. */ + V4L2_COLORSPACE_REC709 = 3, + + /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */ + V4L2_COLORSPACE_BT878 = 4, + + /* These should be useful. Assume 601 extents. */ + V4L2_COLORSPACE_470_SYSTEM_M = 5, + V4L2_COLORSPACE_470_SYSTEM_BG = 6, + + /* I know there will be cameras that send this. So, this is + * unspecified chromaticities and full 0-255 on each of the + * Y'CbCr components + */ + V4L2_COLORSPACE_JPEG = 7, + + /* For RGB colourspaces, this is probably a good start. */ + V4L2_COLORSPACE_SRGB = 8, +}; + +enum v4l2_priority { + V4L2_PRIORITY_UNSET = 0, /* not initialized */ + V4L2_PRIORITY_BACKGROUND = 1, + V4L2_PRIORITY_INTERACTIVE = 2, + V4L2_PRIORITY_RECORD = 3, + V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE, +}; + +struct v4l2_rect { + __s32 left; + __s32 top; + __s32 width; + __s32 height; +}; + +struct v4l2_fract { + __u32 numerator; + __u32 denominator; +}; + +/* + * D R I V E R C A P A B I L I T I E S + */ +struct v4l2_capability { + __u8 driver[16]; /* i.e. "bttv" */ + __u8 card[32]; /* i.e. "Hauppauge WinTV" */ + __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ + __u32 version; /* should use KERNEL_VERSION() */ + __u32 capabilities; /* Device capabilities */ + __u32 reserved[4]; +}; + +/* Values for 'capabilities' field */ +#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ +#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ +#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ +#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ +#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ +#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ +#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ +#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ +#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ +#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ +#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ + +#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ +#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ +#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ +#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ + +#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ +#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ +#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ + +/* + * V I D E O I M A G E F O R M A T + */ +struct v4l2_pix_format { + __u32 width; + __u32 height; + __u32 pixelformat; + enum v4l2_field field; + __u32 bytesperline; /* for padding, zero if unused */ + __u32 sizeimage; + enum v4l2_colorspace colorspace; + __u32 priv; /* private data, depends on pixelformat */ +}; + +/* Pixel format FOURCC depth Description */ + +/* RGB formats */ +#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ +#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ +#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ +#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ +#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ +#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ +#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ +#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ +#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ +#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ + +/* Grey formats */ +#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ +#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ +#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ + +/* Palette formats */ +#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ + +/* Luminance+Chrominance formats */ +#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ +#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ +#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ +#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ +#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ +#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ +#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ +#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ +#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ +#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ +#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ +#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ +#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ +#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ +#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ + +/* two planes -- one Y, one Cr + Cb interleaved */ +#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ +#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ +#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ +#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ + +/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ +#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ +#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */ +#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ +#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ + /* 10bit raw bayer DPCM compressed to 8 bits */ +#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') + /* + * 10bit raw bayer, expanded to 16 bits + * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... + */ +#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ + +/* compressed formats */ +#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ +#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ +#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ + +/* Vendor-specific formats */ +#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ +#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ +#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ +#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ +#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ +#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ +#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ +#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */ +#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */ +#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ +#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ +#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ +#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ +#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ +#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ +#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ +#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ + +/* + * F O R M A T E N U M E R A T I O N + */ +struct v4l2_fmtdesc { + __u32 index; /* Format number */ + enum v4l2_buf_type type; /* buffer type */ + __u32 flags; + __u8 description[32]; /* Description string */ + __u32 pixelformat; /* Format fourcc */ + __u32 reserved[4]; +}; + +#define V4L2_FMT_FLAG_COMPRESSED 0x0001 +#define V4L2_FMT_FLAG_EMULATED 0x0002 + +#if 1 + /* Experimental Frame Size and frame rate enumeration */ +/* + * F R A M E S I Z E E N U M E R A T I O N + */ +enum v4l2_frmsizetypes { + V4L2_FRMSIZE_TYPE_DISCRETE = 1, + V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, + V4L2_FRMSIZE_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmsize_discrete { + __u32 width; /* Frame width [pixel] */ + __u32 height; /* Frame height [pixel] */ +}; + +struct v4l2_frmsize_stepwise { + __u32 min_width; /* Minimum frame width [pixel] */ + __u32 max_width; /* Maximum frame width [pixel] */ + __u32 step_width; /* Frame width step size [pixel] */ + __u32 min_height; /* Minimum frame height [pixel] */ + __u32 max_height; /* Maximum frame height [pixel] */ + __u32 step_height; /* Frame height step size [pixel] */ +}; + +struct v4l2_frmsizeenum { + __u32 index; /* Frame size number */ + __u32 pixel_format; /* Pixel format */ + __u32 type; /* Frame size type the device supports. */ + + union { /* Frame size */ + struct v4l2_frmsize_discrete discrete; + struct v4l2_frmsize_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; + +/* + * F R A M E R A T E E N U M E R A T I O N + */ +enum v4l2_frmivaltypes { + V4L2_FRMIVAL_TYPE_DISCRETE = 1, + V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, + V4L2_FRMIVAL_TYPE_STEPWISE = 3, +}; + +struct v4l2_frmival_stepwise { + struct v4l2_fract min; /* Minimum frame interval [s] */ + struct v4l2_fract max; /* Maximum frame interval [s] */ + struct v4l2_fract step; /* Frame interval step size [s] */ +}; + +struct v4l2_frmivalenum { + __u32 index; /* Frame format index */ + __u32 pixel_format; /* Pixel format */ + __u32 width; /* Frame width */ + __u32 height; /* Frame height */ + __u32 type; /* Frame interval type the device supports. */ + + union { /* Frame interval */ + struct v4l2_fract discrete; + struct v4l2_frmival_stepwise stepwise; + }; + + __u32 reserved[2]; /* Reserved space for future use */ +}; +#endif + +/* + * T I M E C O D E + */ +struct v4l2_timecode { + __u32 type; + __u32 flags; + __u8 frames; + __u8 seconds; + __u8 minutes; + __u8 hours; + __u8 userbits[4]; +}; + +/* Type */ +#define V4L2_TC_TYPE_24FPS 1 +#define V4L2_TC_TYPE_25FPS 2 +#define V4L2_TC_TYPE_30FPS 3 +#define V4L2_TC_TYPE_50FPS 4 +#define V4L2_TC_TYPE_60FPS 5 + +/* Flags */ +#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */ +#define V4L2_TC_FLAG_COLORFRAME 0x0002 +#define V4L2_TC_USERBITS_field 0x000C +#define V4L2_TC_USERBITS_USERDEFINED 0x0000 +#define V4L2_TC_USERBITS_8BITCHARS 0x0008 +/* The above is based on SMPTE timecodes */ + +struct v4l2_jpegcompression { + int quality; + + int APPn; /* Number of APP segment to be written, + * must be 0..15 */ + int APP_len; /* Length of data in JPEG APPn segment */ + char APP_data[60]; /* Data in the JPEG APPn segment. */ + + int COM_len; /* Length of data in JPEG COM segment */ + char COM_data[60]; /* Data in JPEG COM segment */ + + __u32 jpeg_markers; /* Which markers should go into the JPEG + * output. Unless you exactly know what + * you do, leave them untouched. + * Inluding less markers will make the + * resulting code smaller, but there will + * be fewer applications which can read it. + * The presence of the APP and COM marker + * is influenced by APP_len and COM_len + * ONLY, not by this property! */ + +#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */ +#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */ +#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ +#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ +#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will + * allways use APP0 */ +}; + +/* + * M E M O R Y - M A P P I N G B U F F E R S + */ +struct v4l2_requestbuffers { + __u32 count; + enum v4l2_buf_type type; + enum v4l2_memory memory; + __u32 reserved[2]; +}; + +struct v4l2_buffer { + __u32 index; + enum v4l2_buf_type type; + __u32 bytesused; + __u32 flags; + enum v4l2_field field; + struct timeval timestamp; + struct v4l2_timecode timecode; + __u32 sequence; + + /* memory location */ + enum v4l2_memory memory; + union { + __u32 offset; + unsigned long userptr; + } m; + __u32 length; + __u32 input; + __u32 reserved; +}; + +/* Flags for 'flags' field */ +#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */ +#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */ +#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */ +#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ +#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ +#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ +#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ +#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ + +/* + * O V E R L A Y P R E V I E W + */ +struct v4l2_framebuffer { + __u32 capability; + __u32 flags; +/* FIXME: in theory we should pass something like PCI device + memory + * region + offset instead of some physical address */ + void *base; + struct v4l2_pix_format fmt; +}; +/* Flags for the 'capability' field. Read only */ +#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001 +#define V4L2_FBUF_CAP_CHROMAKEY 0x0002 +#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004 +#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 +#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 +#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 +#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 +#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080 +/* Flags for the 'flags' field. */ +#define V4L2_FBUF_FLAG_PRIMARY 0x0001 +#define V4L2_FBUF_FLAG_OVERLAY 0x0002 +#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 +#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 +#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 +#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 +#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040 + +struct v4l2_clip { + struct v4l2_rect c; + struct v4l2_clip __user *next; +}; + +struct v4l2_window { + struct v4l2_rect w; + enum v4l2_field field; + __u32 chromakey; + struct v4l2_clip __user *clips; + __u32 clipcount; + void __user *bitmap; + __u8 global_alpha; +}; + +/* + * C A P T U R E P A R A M E T E R S + */ +struct v4l2_captureparm { + __u32 capability; /* Supported modes */ + __u32 capturemode; /* Current mode */ + struct v4l2_fract timeperframe; /* Time per frame in .1us units */ + __u32 extendedmode; /* Driver-specific extensions */ + __u32 readbuffers; /* # of buffers for read */ + __u32 reserved[4]; +}; + +/* Flags for 'capability' and 'capturemode' fields */ +#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ +#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ + +struct v4l2_outputparm { + __u32 capability; /* Supported modes */ + __u32 outputmode; /* Current mode */ + struct v4l2_fract timeperframe; /* Time per frame in seconds */ + __u32 extendedmode; /* Driver-specific extensions */ + __u32 writebuffers; /* # of buffers for write */ + __u32 reserved[4]; +}; + +/* + * I N P U T I M A G E C R O P P I N G + */ +struct v4l2_cropcap { + enum v4l2_buf_type type; + struct v4l2_rect bounds; + struct v4l2_rect defrect; + struct v4l2_fract pixelaspect; +}; + +struct v4l2_crop { + enum v4l2_buf_type type; + struct v4l2_rect c; +}; + +/* + * A N A L O G V I D E O S T A N D A R D + */ + +typedef __u64 v4l2_std_id; + +/* one bit for each */ +#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001) +#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002) +#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004) +#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008) +#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010) +#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020) +#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040) +#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080) + +#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100) +#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200) +#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400) +#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) + +#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) +#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) +#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) +#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) + +#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) +#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) +#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000) +#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000) +#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000) +#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000) +#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000) +#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000) + +/* ATSC/HDTV */ +#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) +#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) + +/* FIXME: + Although std_id is 64 bits, there is an issue on PPC32 architecture that + makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding + this value to 32 bits. + As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide), + it should work fine. However, if needed to add more than two standards, + v4l2-common.c should be fixed. + */ + +/* some merged standards */ +#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) +#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) +#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) +#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK) + +/* some common needed stuff */ +#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ + V4L2_STD_PAL_B1 |\ + V4L2_STD_PAL_G) +#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ + V4L2_STD_PAL_D1 |\ + V4L2_STD_PAL_K) +#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ + V4L2_STD_PAL_DK |\ + V4L2_STD_PAL_H |\ + V4L2_STD_PAL_I) +#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ + V4L2_STD_NTSC_M_JP |\ + V4L2_STD_NTSC_M_KR) +#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ + V4L2_STD_SECAM_K |\ + V4L2_STD_SECAM_K1) +#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ + V4L2_STD_SECAM_G |\ + V4L2_STD_SECAM_H |\ + V4L2_STD_SECAM_DK |\ + V4L2_STD_SECAM_L |\ + V4L2_STD_SECAM_LC) + +#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ + V4L2_STD_PAL_60 |\ + V4L2_STD_NTSC |\ + V4L2_STD_NTSC_443) +#define V4L2_STD_625_50 (V4L2_STD_PAL |\ + V4L2_STD_PAL_N |\ + V4L2_STD_PAL_Nc |\ + V4L2_STD_SECAM) +#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ + V4L2_STD_ATSC_16_VSB) + +#define V4L2_STD_UNKNOWN 0 +#define V4L2_STD_ALL (V4L2_STD_525_60 |\ + V4L2_STD_625_50) + +struct v4l2_standard { + __u32 index; + v4l2_std_id id; + __u8 name[24]; + struct v4l2_fract frameperiod; /* Frames, not fields */ + __u32 framelines; + __u32 reserved[4]; +}; + +/* + * V I D E O T I M I N G S D V P R E S E T + */ +struct v4l2_dv_preset { + __u32 preset; + __u32 reserved[4]; +}; + +/* + * D V P R E S E T S E N U M E R A T I O N + */ +struct v4l2_dv_enum_preset { + __u32 index; + __u32 preset; + __u8 name[32]; /* Name of the preset timing */ + __u32 width; + __u32 height; + __u32 reserved[4]; +}; + +/* + * D V P R E S E T V A L U E S + */ +#define V4L2_DV_INVALID 0 +#define V4L2_DV_480P59_94 1 /* BT.1362 */ +#define V4L2_DV_576P50 2 /* BT.1362 */ +#define V4L2_DV_720P24 3 /* SMPTE 296M */ +#define V4L2_DV_720P25 4 /* SMPTE 296M */ +#define V4L2_DV_720P30 5 /* SMPTE 296M */ +#define V4L2_DV_720P50 6 /* SMPTE 296M */ +#define V4L2_DV_720P59_94 7 /* SMPTE 274M */ +#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */ +#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */ +#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */ +#define V4L2_DV_1080I25 11 /* BT.1120 */ +#define V4L2_DV_1080I50 12 /* SMPTE 296M */ +#define V4L2_DV_1080I60 13 /* SMPTE 296M */ +#define V4L2_DV_1080P24 14 /* SMPTE 296M */ +#define V4L2_DV_1080P25 15 /* SMPTE 296M */ +#define V4L2_DV_1080P30 16 /* SMPTE 296M */ +#define V4L2_DV_1080P50 17 /* BT.1120 */ +#define V4L2_DV_1080P60 18 /* BT.1120 */ + +/* + * D V B T T I M I N G S + */ + +/* BT.656/BT.1120 timing data */ +struct v4l2_bt_timings { + __u32 width; /* width in pixels */ + __u32 height; /* height in lines */ + __u32 interlaced; /* Interlaced or progressive */ + __u32 polarities; /* Positive or negative polarity */ + __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ + __u32 hfrontporch; /* Horizpontal front porch in pixels */ + __u32 hsync; /* Horizontal Sync length in pixels */ + __u32 hbackporch; /* Horizontal back porch in pixels */ + __u32 vfrontporch; /* Vertical front porch in pixels */ + __u32 vsync; /* Vertical Sync length in lines */ + __u32 vbackporch; /* Vertical back porch in lines */ + __u32 il_vfrontporch; /* Vertical front porch for bottom field of + * interlaced field formats + */ + __u32 il_vsync; /* Vertical sync length for bottom field of + * interlaced field formats + */ + __u32 il_vbackporch; /* Vertical back porch for bottom field of + * interlaced field formats + */ + __u32 reserved[16]; +} __attribute__ ((packed)); + +/* Interlaced or progressive format */ +#define V4L2_DV_PROGRESSIVE 0 +#define V4L2_DV_INTERLACED 1 + +/* Polarities. If bit is not set, it is assumed to be negative polarity */ +#define V4L2_DV_VSYNC_POS_POL 0x00000001 +#define V4L2_DV_HSYNC_POS_POL 0x00000002 + + +/* DV timings */ +struct v4l2_dv_timings { + __u32 type; + union { + struct v4l2_bt_timings bt; + __u32 reserved[32]; + }; +} __attribute__ ((packed)); + +/* Values for the type field */ +#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ + +/* + * V I D E O I N P U T S + */ +struct v4l2_input { + __u32 index; /* Which input */ + __u8 name[32]; /* Label */ + __u32 type; /* Type of input */ + __u32 audioset; /* Associated audios (bitfield) */ + __u32 tuner; /* Associated tuner */ + v4l2_std_id std; + __u32 status; + __u32 capabilities; + __u32 reserved[3]; +}; + +/* Values for the 'type' field */ +#define V4L2_INPUT_TYPE_TUNER 1 +#define V4L2_INPUT_TYPE_CAMERA 2 + +/* field 'status' - general */ +#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */ +#define V4L2_IN_ST_NO_SIGNAL 0x00000002 +#define V4L2_IN_ST_NO_COLOR 0x00000004 + +/* field 'status' - sensor orientation */ +/* If sensor is mounted upside down set both bits */ +#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */ +#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */ + +/* field 'status' - analog */ +#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ +#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ + +/* field 'status' - digital */ +#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */ +#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */ +#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */ + +/* field 'status' - VCR and set-top box */ +#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */ +#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ +#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ + +/* capabilities flags */ +#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ +#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ +#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ + +/* + * V I D E O O U T P U T S + */ +struct v4l2_output { + __u32 index; /* Which output */ + __u8 name[32]; /* Label */ + __u32 type; /* Type of output */ + __u32 audioset; /* Associated audios (bitfield) */ + __u32 modulator; /* Associated modulator */ + v4l2_std_id std; + __u32 capabilities; + __u32 reserved[3]; +}; +/* Values for the 'type' field */ +#define V4L2_OUTPUT_TYPE_MODULATOR 1 +#define V4L2_OUTPUT_TYPE_ANALOG 2 +#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 + +/* capabilities flags */ +#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ +#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ +#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ + +/* + * C O N T R O L S + */ +struct v4l2_control { + __u32 id; + __s32 value; +}; + +struct v4l2_ext_control { + __u32 id; + __u32 size; + __u32 reserved2[1]; + union { + __s32 value; + __s64 value64; + char *string; + }; +} __attribute__ ((packed)); + +struct v4l2_ext_controls { + __u32 ctrl_class; + __u32 count; + __u32 error_idx; + __u32 reserved[2]; + struct v4l2_ext_control *controls; +}; + +/* Values for ctrl_class field */ +#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ +#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ +#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ +#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ + +#define V4L2_CTRL_ID_MASK (0x0fffffff) +#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) +#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) + +/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ +struct v4l2_queryctrl { + __u32 id; + enum v4l2_ctrl_type type; + __u8 name[32]; /* Whatever */ + __s32 minimum; /* Note signedness */ + __s32 maximum; + __s32 step; + __s32 default_value; + __u32 flags; + __u32 reserved[2]; +}; + +/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ +struct v4l2_querymenu { + __u32 id; + __u32 index; + __u8 name[32]; /* Whatever */ + __u32 reserved; +}; + +/* Control flags */ +#define V4L2_CTRL_FLAG_DISABLED 0x0001 +#define V4L2_CTRL_FLAG_GRABBED 0x0002 +#define V4L2_CTRL_FLAG_READ_ONLY 0x0004 +#define V4L2_CTRL_FLAG_UPDATE 0x0008 +#define V4L2_CTRL_FLAG_INACTIVE 0x0010 +#define V4L2_CTRL_FLAG_SLIDER 0x0020 +#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 + +/* Query flag, to be ORed with the control ID */ +#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 + +/* User-class control IDs defined by V4L2 */ +#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) +#define V4L2_CID_USER_BASE V4L2_CID_BASE +/* IDs reserved for driver specific controls */ +#define V4L2_CID_PRIVATE_BASE 0x08000000 + +#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) +#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) +#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) +#define V4L2_CID_SATURATION (V4L2_CID_BASE+2) +#define V4L2_CID_HUE (V4L2_CID_BASE+3) +#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5) +#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6) +#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7) +#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8) +#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9) +#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10) +#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */ +#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12) +#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13) +#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14) +#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15) +#define V4L2_CID_GAMMA (V4L2_CID_BASE+16) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:19:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DB25DDE; Wed, 3 Jul 2013 20:19:24 +0000 (UTC) (envelope-from rpaulo@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 5EC03144B; Wed, 3 Jul 2013 20:19:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KJOYc001218; Wed, 3 Jul 2013 20:19:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KJOM1001217; Wed, 3 Jul 2013 20:19:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307032019.r63KJOM1001217@svn.freebsd.org> From: Rui Paulo Date: Wed, 3 Jul 2013 20:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252592 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:19:24 -0000 Author: rpaulo Date: Wed Jul 3 20:19:23 2013 New Revision: 252592 URL: http://svnweb.freebsd.org/changeset/base/252592 Log: Typos in comments. Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Wed Jul 3 20:08:22 2013 (r252591) +++ head/sys/dev/cpuctl/cpuctl.c Wed Jul 3 20:19:23 2013 (r252592) @@ -326,7 +326,7 @@ update_intel(int cpu, cpuctl_update_args is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); critical_enter(); - rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current micorcode revision. */ + rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current microcode revision. */ /* * Perform update. @@ -339,7 +339,7 @@ update_intel(int cpu, cpuctl_update_args */ do_cpuid(0, tmp); critical_exit(); - rdmsr_safe(MSR_BIOS_SIGN, &rev1); /* Get new micorcode revision. */ + rdmsr_safe(MSR_BIOS_SIGN, &rev1); /* Get new microcode revision. */ restore_cpu(oldcpu, is_bound, td); if (rev1 > rev0) ret = 0; @@ -440,7 +440,7 @@ update_via(int cpu, cpuctl_update_args_t is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); critical_enter(); - rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current micorcode revision. */ + rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current microcode revision. */ /* * Perform update. From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:21:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 914201D3; Wed, 3 Jul 2013 20:21:39 +0000 (UTC) (envelope-from peter@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 83B401481; Wed, 3 Jul 2013 20:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KLd4v003258; Wed, 3 Jul 2013 20:21:39 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KLdCR003257; Wed, 3 Jul 2013 20:21:39 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307032021.r63KLdCR003257@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 20:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252593 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:21:39 -0000 Author: peter Date: Wed Jul 3 20:21:39 2013 New Revision: 252593 URL: http://svnweb.freebsd.org/changeset/base/252593 Log: Move static ZFS compile option to the other static file system options. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jul 3 20:19:23 2013 (r252592) +++ head/sys/conf/options Wed Jul 3 20:21:39 2013 (r252593) @@ -226,6 +226,7 @@ SMBFS opt_dontuse.h TMPFS opt_dontuse.h UDF opt_dontuse.h UNIONFS opt_dontuse.h +ZFS opt_dontuse.h # Pseudofs debugging PSEUDOFS_TRACE opt_pseudofs.h @@ -840,8 +841,6 @@ HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h # XBOX options for FreeBSD/i386, but some files are MI XBOX opt_xbox.h -ZFS opt_dontuse.h - # Interrupt filtering INTR_FILTER From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:22:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80CA430E; Wed, 3 Jul 2013 20:22:13 +0000 (UTC) (envelope-from peter@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 73AC51489; Wed, 3 Jul 2013 20:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KMDl3003428; Wed, 3 Jul 2013 20:22:13 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KMDNW003426; Wed, 3 Jul 2013 20:22:13 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201307032022.r63KMDNW003426@svn.freebsd.org> From: Peter Wemm Date: Wed, 3 Jul 2013 20:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252594 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:22:13 -0000 Author: peter Date: Wed Jul 3 20:22:12 2013 New Revision: 252594 URL: http://svnweb.freebsd.org/changeset/base/252594 Log: Add an entry for filemon. Modified: head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 3 20:21:39 2013 (r252593) +++ head/sys/conf/files Wed Jul 3 20:22:12 2013 (r252594) @@ -1369,6 +1369,7 @@ dev/fdt/fdtbus.c optional fdt dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard +dev/filemon/filemon.c optional filemon dev/firewire/firewire.c optional firewire dev/firewire/fwcrom.c optional firewire dev/firewire/fwdev.c optional firewire Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jul 3 20:21:39 2013 (r252593) +++ head/sys/conf/options Wed Jul 3 20:22:12 2013 (r252594) @@ -85,6 +85,7 @@ COMPRESS_USER_CORES opt_core.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h DIRECTIO +FILEMON opt_dontuse.h FFCLOCK FULL_PREEMPTION opt_sched.h IPI_PREEMPTION opt_sched.h From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:24:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D7294C0; Wed, 3 Jul 2013 20:24:38 +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 6F67F15ED; Wed, 3 Jul 2013 20:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KOcbG003750; Wed, 3 Jul 2013 20:24:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KOcts003749; Wed, 3 Jul 2013 20:24:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307032024.r63KOcts003749@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 3 Jul 2013 20:24:38 +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: r252595 - stable/9/usr.bin/truss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:24:38 -0000 Author: mjg Date: Wed Jul 3 20:24:37 2013 New Revision: 252595 URL: http://svnweb.freebsd.org/changeset/base/252595 Log: MFC r252414: truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC Modified: stable/9/usr.bin/truss/syscalls.c Directory Properties: stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/truss/syscalls.c ============================================================================== --- stable/9/usr.bin/truss/syscalls.c Wed Jul 3 20:22:12 2013 (r252594) +++ stable/9/usr.bin/truss/syscalls.c Wed Jul 3 20:24:37 2013 (r252595) @@ -343,7 +343,7 @@ static struct xlat open_flags[] = { X(O_RDONLY) X(O_WRONLY) X(O_RDWR) X(O_ACCMODE) X(O_NONBLOCK) X(O_APPEND) X(O_SHLOCK) X(O_EXLOCK) X(O_ASYNC) X(O_FSYNC) X(O_NOFOLLOW) X(O_CREAT) X(O_TRUNC) X(O_EXCL) X(O_NOCTTY) - X(O_DIRECT) XEND + X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) XEND }; static struct xlat shutdown_arg[] = { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:28:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 788087F9; Wed, 3 Jul 2013 20:28:34 +0000 (UTC) (envelope-from pjd@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 5A8A61624; Wed, 3 Jul 2013 20:28:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KSYNW004380; Wed, 3 Jul 2013 20:28:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KSYqA004379; Wed, 3 Jul 2013 20:28:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032028.r63KSYqA004379@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 20:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252596 - head/usr.bin/rwho X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:28:34 -0000 Author: pjd Date: Wed Jul 3 20:28:33 2013 New Revision: 252596 URL: http://svnweb.freebsd.org/changeset/base/252596 Log: Style cleanups. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Modified: head/usr.bin/rwho/rwho.c Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Wed Jul 3 20:24:37 2013 (r252595) +++ head/usr.bin/rwho/rwho.c Wed Jul 3 20:28:33 2013 (r252596) @@ -1,6 +1,6 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. +/*- + * Copyright (c) 1983, 1993 The Regents of the University of California. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,22 +58,21 @@ __FBSDID("$FreeBSD$"); #include #include -static DIR *dirp; +#define NUSERS 1000 +#define WHDRSIZE (ssize_t)(sizeof (wd) - sizeof (wd.wd_we)) +/* + * this macro should be shared with ruptime. + */ +#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) +static DIR *dirp; static struct whod wd; -#define NUSERS 1000 +static int nusers; static struct myutmp { char myhost[sizeof(wd.wd_hostname)]; int myidle; struct outmp myutmp; } myutmp[NUSERS]; -static int nusers; - -#define WHDRSIZE (ssize_t)(sizeof (wd) - sizeof (wd.wd_we)) -/* - * this macro should be shared with ruptime. - */ -#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) static time_t now; static int aflg; @@ -88,17 +87,18 @@ main(int argc, char *argv[]) struct dirent *dp; int width; ssize_t cc; - register struct whod *w = &wd; - register struct whoent *we; - register struct myutmp *mp; + struct whod *w; + struct whoent *we; + struct myutmp *mp; int f, n, i; int d_first; + w = &wd; (void) setlocale(LC_TIME, ""); d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - while ((ch = getopt(argc, argv, "a")) != -1) - switch((char)ch) { + while ((ch = getopt(argc, argv, "a")) != -1) { + switch ((char)ch) { case 'a': aflg = 1; break; @@ -106,6 +106,7 @@ main(int argc, char *argv[]) default: usage(); } + } argc -= optind; argv += optind; @@ -115,9 +116,9 @@ main(int argc, char *argv[]) if (chdir(_PATH_RWHODIR) || (dirp = opendir(".")) == NULL) err(1, "%s", _PATH_RWHODIR); mp = myutmp; - (void)time(&now); - while ((dp = readdir(dirp))) { - if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5)) + (void) time(&now); + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5) != 0) continue; f = open(dp->d_name, O_RDONLY); if (f < 0) @@ -127,22 +128,25 @@ main(int argc, char *argv[]) (void) close(f); continue; } - if (down(w,now)) { + if (down(w,now) != 0) { (void) close(f); continue; } cc -= WHDRSIZE; we = w->wd_we; for (n = cc / sizeof (struct whoent); n > 0; n--) { - if (aflg == 0 && we->we_idle >= 60*60) { + if (aflg == 0 && we->we_idle >= 60 * 60) { we++; continue; } if (nusers >= NUSERS) errx(1, "too many users"); - mp->myutmp = we->we_utmp; mp->myidle = we->we_idle; + mp->myutmp = we->we_utmp; + mp->myidle = we->we_idle; (void) strcpy(mp->myhost, w->wd_hostname); - nusers++; we++; mp++; + nusers++; + we++; + mp++; } (void) close(f); } @@ -151,7 +155,9 @@ main(int argc, char *argv[]) width = 0; for (i = 0; i < nusers; i++) { /* append one for the blank and use 8 for the out_line */ - int j = strlen(mp->myhost) + 1 + sizeof(mp->myutmp.out_line); + int j; + + j = strlen(mp->myhost) + 1 + sizeof(mp->myutmp.out_line); if (j > width) width = j; mp++; @@ -159,31 +165,33 @@ main(int argc, char *argv[]) mp = myutmp; for (i = 0; i < nusers; i++) { char buf[BUFSIZ], cbuf[80]; - time_t t = _int_to_time(mp->myutmp.out_time); + time_t t; + t = _int_to_time(mp->myutmp.out_time); strftime(cbuf, sizeof(cbuf), - d_first ? "%e %b %R" : "%b %e %R", - localtime(&t)); - (void)sprintf(buf, "%s:%-.*s", mp->myhost, - (int)sizeof(mp->myutmp.out_line), mp->myutmp.out_line); + d_first ? "%e %b %R" : "%b %e %R", + localtime(&t)); + (void) sprintf(buf, "%s:%-.*s", mp->myhost, + (int)sizeof(mp->myutmp.out_line), mp->myutmp.out_line); printf("%-*.*s %-*s %s", - (int)sizeof(mp->myutmp.out_name), - (int)sizeof(mp->myutmp.out_name), - mp->myutmp.out_name, - width, - buf, - cbuf); + (int)sizeof(mp->myutmp.out_name), + (int)sizeof(mp->myutmp.out_name), + mp->myutmp.out_name, + width, + buf, + cbuf); mp->myidle /= 60; - if (mp->myidle) { - if (aflg) { - if (mp->myidle >= 100*60) - mp->myidle = 100*60 - 1; + if (mp->myidle != 0) { + if (aflg != 0) { + if (mp->myidle >= 100 * 60) + mp->myidle = 100 * 60 - 1; if (mp->myidle >= 60) printf(" %2d", mp->myidle / 60); else printf(" "); - } else + } else { printf(" "); + } printf(":%02d", mp->myidle % 60); } printf("\n"); @@ -208,12 +216,12 @@ utmpcmp(const void *u1, const void *u2) int rc; rc = strncmp(MYUTMP(u1)->myutmp.out_name, MYUTMP(u2)->myutmp.out_name, - sizeof(MYUTMP(u2)->myutmp.out_name)); - if (rc) + sizeof(MYUTMP(u2)->myutmp.out_name)); + if (rc != 0) return (rc); rc = strcmp(MYUTMP(u1)->myhost, MYUTMP(u2)->myhost); - if (rc) + if (rc != 0) return (rc); return (strncmp(MYUTMP(u1)->myutmp.out_line, MYUTMP(u2)->myutmp.out_line, - sizeof(MYUTMP(u2)->myutmp.out_line))); + sizeof(MYUTMP(u2)->myutmp.out_line))); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:29:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2D8E945; Wed, 3 Jul 2013 20:29:15 +0000 (UTC) (envelope-from rpaulo@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 D4E23162A; Wed, 3 Jul 2013 20:29:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KTF7W004496; Wed, 3 Jul 2013 20:29:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KTFTr004495; Wed, 3 Jul 2013 20:29:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307032029.r63KTFTr004495@svn.freebsd.org> From: Rui Paulo Date: Wed, 3 Jul 2013 20:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252597 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:29:16 -0000 Author: rpaulo Date: Wed Jul 3 20:29:15 2013 New Revision: 252597 URL: http://svnweb.freebsd.org/changeset/base/252597 Log: Increase the microcode max size to 16K to accomodate more recent Intel firmware. Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Wed Jul 3 20:28:33 2013 (r252596) +++ head/sys/dev/cpuctl/cpuctl.c Wed Jul 3 20:29:15 2013 (r252597) @@ -63,7 +63,7 @@ static d_ioctl_t cpuctl_ioctl; # define DPRINTF(...) #endif -#define UCODE_SIZE_MAX (10 * 1024) +#define UCODE_SIZE_MAX (16 * 1024) static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:42:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 14447FF8; Wed, 3 Jul 2013 20:42:11 +0000 (UTC) (envelope-from pjd@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 E0B4316C7; Wed, 3 Jul 2013 20:42:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KgAi5009388; Wed, 3 Jul 2013 20:42:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KgAru009387; Wed, 3 Jul 2013 20:42:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032042.r63KgAru009387@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 20:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252598 - head/usr.bin/rwho X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:42:11 -0000 Author: pjd Date: Wed Jul 3 20:42:10 2013 New Revision: 252598 URL: http://svnweb.freebsd.org/changeset/base/252598 Log: Sandbox rwho(1) using capability mode and Capsicum capabilities. rwho(1) gets only read-only access to /var/rwho/ directory. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Modified: head/usr.bin/rwho/rwho.c Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Wed Jul 3 20:29:15 2013 (r252597) +++ head/usr.bin/rwho/rwho.c Wed Jul 3 20:42:10 2013 (r252598) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1983, 1993 The Regents of the University of California. + * Copyright (c) 2013 Mariusz Zaborski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +43,7 @@ static char sccsid[] = "@(#)rwho.c 8.1 ( #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -49,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -92,6 +95,8 @@ main(int argc, char *argv[]) struct myutmp *mp; int f, n, i; int d_first; + int dfd; + time_t ct; w = &wd; (void) setlocale(LC_TIME, ""); @@ -113,16 +118,31 @@ main(int argc, char *argv[]) if (argc != 0) usage(); - if (chdir(_PATH_RWHODIR) || (dirp = opendir(".")) == NULL) - err(1, "%s", _PATH_RWHODIR); + if (chdir(_PATH_RWHODIR) < 0) + err(1, "chdir(%s)", _PATH_RWHODIR); + if ((dirp = opendir(".")) == NULL) + err(1, "opendir(%s)", _PATH_RWHODIR); + dfd = dirfd(dirp); mp = myutmp; + if (cap_rights_limit(dfd, CAP_READ | CAP_LOOKUP) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit failed: %s", _PATH_RWHODIR); + /* + * Cache files required for time(3) and localtime(3) before entering + * capability mode. + */ + (void) time(&ct); + (void) localtime(&ct); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "cap_enter"); (void) time(&now); while ((dp = readdir(dirp)) != NULL) { if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5) != 0) continue; - f = open(dp->d_name, O_RDONLY); + f = openat(dfd, dp->d_name, O_RDONLY); if (f < 0) continue; + if (cap_rights_limit(f, CAP_READ) < 0 && errno != ENOSYS) + err(1, "cap_rights_limit failed: %s", dp->d_name); cc = read(f, (char *)&wd, sizeof (struct whod)); if (cc < WHDRSIZE) { (void) close(f); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:44:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CFB832DC; Wed, 3 Jul 2013 20:44:47 +0000 (UTC) (envelope-from pjd@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 A5AB516EF; Wed, 3 Jul 2013 20:44:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Kilpx009820; Wed, 3 Jul 2013 20:44:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Kil9d009819; Wed, 3 Jul 2013 20:44:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032044.r63Kil9d009819@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 20:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252599 - head/usr.bin/rwho X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:44:47 -0000 Author: pjd Date: Wed Jul 3 20:44:47 2013 New Revision: 252599 URL: http://svnweb.freebsd.org/changeset/base/252599 Log: Few more style nits. MFC after: 1 month Modified: head/usr.bin/rwho/rwho.c Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Wed Jul 3 20:42:10 2013 (r252598) +++ head/usr.bin/rwho/rwho.c Wed Jul 3 20:44:47 2013 (r252599) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #define NUSERS 1000 -#define WHDRSIZE (ssize_t)(sizeof (wd) - sizeof (wd.wd_we)) +#define WHDRSIZE (ssize_t)(sizeof(wd) - sizeof(wd.wd_we)) /* * this macro should be shared with ruptime. */ @@ -143,18 +143,18 @@ main(int argc, char *argv[]) continue; if (cap_rights_limit(f, CAP_READ) < 0 && errno != ENOSYS) err(1, "cap_rights_limit failed: %s", dp->d_name); - cc = read(f, (char *)&wd, sizeof (struct whod)); + cc = read(f, (char *)&wd, sizeof(struct whod)); if (cc < WHDRSIZE) { (void) close(f); continue; } - if (down(w,now) != 0) { + if (down(w, now) != 0) { (void) close(f); continue; } cc -= WHDRSIZE; we = w->wd_we; - for (n = cc / sizeof (struct whoent); n > 0; n--) { + for (n = cc / sizeof(struct whoent); n > 0; n--) { if (aflg == 0 && we->we_idle >= 60 * 60) { we++; continue; @@ -170,7 +170,7 @@ main(int argc, char *argv[]) } (void) close(f); } - qsort((char *)myutmp, nusers, sizeof (struct myutmp), utmpcmp); + qsort((char *)myutmp, nusers, sizeof(struct myutmp), utmpcmp); mp = myutmp; width = 0; for (i = 0; i < nusers; i++) { @@ -188,18 +188,14 @@ main(int argc, char *argv[]) time_t t; t = _int_to_time(mp->myutmp.out_time); - strftime(cbuf, sizeof(cbuf), - d_first ? "%e %b %R" : "%b %e %R", + strftime(cbuf, sizeof(cbuf), d_first ? "%e %b %R" : "%b %e %R", localtime(&t)); (void) sprintf(buf, "%s:%-.*s", mp->myhost, (int)sizeof(mp->myutmp.out_line), mp->myutmp.out_line); printf("%-*.*s %-*s %s", (int)sizeof(mp->myutmp.out_name), (int)sizeof(mp->myutmp.out_name), - mp->myutmp.out_name, - width, - buf, - cbuf); + mp->myutmp.out_name, width, buf, cbuf); mp->myidle /= 60; if (mp->myidle != 0) { if (aflg != 0) { @@ -224,6 +220,7 @@ main(int argc, char *argv[]) static void usage(void) { + fprintf(stderr, "usage: rwho [-a]\n"); exit(1); } @@ -242,6 +239,6 @@ utmpcmp(const void *u1, const void *u2) rc = strcmp(MYUTMP(u1)->myhost, MYUTMP(u2)->myhost); if (rc != 0) return (rc); - return (strncmp(MYUTMP(u1)->myutmp.out_line, MYUTMP(u2)->myutmp.out_line, - sizeof(MYUTMP(u2)->myutmp.out_line))); + return (strncmp(MYUTMP(u1)->myutmp.out_line, + MYUTMP(u2)->myutmp.out_line, sizeof(MYUTMP(u2)->myutmp.out_line))); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:54:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DE1C6C6; Wed, 3 Jul 2013 20:54:26 +0000 (UTC) (envelope-from dteske@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 1FBAD17BD; Wed, 3 Jul 2013 20:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KsQ3m012578; Wed, 3 Jul 2013 20:54:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KsPkM012577; Wed, 3 Jul 2013 20:54:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307032054.r63KsPkM012577@svn.freebsd.org> From: Devin Teske Date: Wed, 3 Jul 2013 20:54:25 +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: r252600 - stable/9/usr.sbin/sysinstall X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:54:26 -0000 Author: dteske Date: Wed Jul 3 20:54:25 2013 New Revision: 252600 URL: http://svnweb.freebsd.org/changeset/base/252600 Log: Fix grammar in a comment. Modified: stable/9/usr.sbin/sysinstall/package.c Modified: stable/9/usr.sbin/sysinstall/package.c ============================================================================== --- stable/9/usr.sbin/sysinstall/package.c Wed Jul 3 20:44:47 2013 (r252599) +++ stable/9/usr.sbin/sysinstall/package.c Wed Jul 3 20:54:25 2013 (r252600) @@ -106,7 +106,7 @@ package_installed(char *name) /* XXX KLUDGE ALERT! This makes evil assumptions about how XXX * packages register themselves and should *really be done with - * `pkg_info -e ' except that this it's too slow for an + * `pkg_info -e ' except that this is too slow for an * item check routine.. :-( */ snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:55:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B85BB7FA; Wed, 3 Jul 2013 20:55:49 +0000 (UTC) (envelope-from dteske@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 AA11717C6; Wed, 3 Jul 2013 20:55:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KtnKG012856; Wed, 3 Jul 2013 20:55:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KtnMM012855; Wed, 3 Jul 2013 20:55:49 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307032055.r63KtnMM012855@svn.freebsd.org> From: Devin Teske Date: Wed, 3 Jul 2013 20:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252601 - stable/8/usr.sbin/sysinstall X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:55:49 -0000 Author: dteske Date: Wed Jul 3 20:55:49 2013 New Revision: 252601 URL: http://svnweb.freebsd.org/changeset/base/252601 Log: MFC r252600: Fix grammar in a comment. Modified: stable/8/usr.sbin/sysinstall/package.c Modified: stable/8/usr.sbin/sysinstall/package.c ============================================================================== --- stable/8/usr.sbin/sysinstall/package.c Wed Jul 3 20:54:25 2013 (r252600) +++ stable/8/usr.sbin/sysinstall/package.c Wed Jul 3 20:55:49 2013 (r252601) @@ -106,7 +106,7 @@ package_installed(char *name) /* XXX KLUDGE ALERT! This makes evil assumptions about how XXX * packages register themselves and should *really be done with - * `pkg_info -e ' except that this it's too slow for an + * `pkg_info -e ' except that this is too slow for an * item check routine.. :-( */ snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 20:58:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C33E969; Wed, 3 Jul 2013 20:58:59 +0000 (UTC) (envelope-from pjd@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 F07E117EA; Wed, 3 Jul 2013 20:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KwwSD013248; Wed, 3 Jul 2013 20:58:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KwwF7013247; Wed, 3 Jul 2013 20:58:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032058.r63KwwF7013247@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 20:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252602 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 20:58:59 -0000 Author: pjd Date: Wed Jul 3 20:58:58 2013 New Revision: 252602 URL: http://svnweb.freebsd.org/changeset/base/252602 Log: Style cleanups. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Wed Jul 3 20:55:49 2013 (r252601) +++ head/usr.sbin/rwhod/rwhod.c Wed Jul 3 20:58:58 2013 (r252602) @@ -1,6 +1,6 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. +/*- + * Copyright (c) 1983, 1993 The Regents of the University of California. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,47 +60,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include #include #include -#include #include -#include -#include - -/* - * This version of Berkeley's rwhod has been modified to use IP multicast - * datagrams, under control of a new command-line option: - * - * rwhod -m causes rwhod to use IP multicast (instead of - * broadcast or unicast) on all interfaces that have - * the IFF_MULTICAST flag set in their "ifnet" structs - * (excluding the loopback interface). The multicast - * reports are sent with a time-to-live of 1, to prevent - * forwarding beyond the directly-connected subnet(s). - * - * rwhod -m causes rwhod to send IP multicast datagrams with a - * time-to-live of , via a SINGLE interface rather - * than all interfaces. must be between 0 and - * MAX_MULTICAST_SCOPE, defined below. Note that "-m 1" - * is different than "-m", in that "-m 1" specifies - * transmission on one interface only. - * - * When "-m" is used without a argument, the program accepts multicast - * rwhod reports from all multicast-capable interfaces. If a argument - * is given, it accepts multicast reports from only one interface, the one - * on which reports are sent (which may be controlled via the host's routing - * table). Regardless of the "-m" option, the program accepts broadcast or - * unicast reports from all interfaces. Thus, this program will hear the - * reports of old, non-multicasting rwhods, but, if multicasting is used, - * those old rwhods won't hear the reports generated by this program. - * - * -- Steve Deering, Stanford University, February 1989 - */ +#include #define UNPRIV_USER "daemon" #define UNPRIV_GROUP "daemon" @@ -112,15 +82,15 @@ __FBSDID("$FreeBSD$"); #define MAX_MULTICAST_SCOPE 32 /* "site-wide", by convention */ #define INADDR_WHOD_GROUP (u_long)0xe0000103 /* 224.0.1.3 */ - /* (belongs in protocols/rwhod.h) */ + /* (belongs in protocols/rwhod.h) */ -int insecure_mode; -int quiet_mode; -int iff_flag = IFF_POINTOPOINT; -int multicast_mode = NO_MULTICAST; -int multicast_scope; -struct sockaddr_in multicast_addr = - { sizeof multicast_addr, AF_INET, 0, { 0 }, { 0 } }; +int insecure_mode; +int quiet_mode; +int iff_flag = IFF_POINTOPOINT; +int multicast_mode = NO_MULTICAST; +int multicast_scope; +struct sockaddr_in multicast_addr = + { sizeof(multicast_addr), AF_INET, 0, { 0 }, { 0 } }; /* * Alarm interval. Don't forget to change the down time check in ruptime @@ -137,72 +107,109 @@ char myname[MAXHOSTNAMELEN]; */ struct neighbor { struct neighbor *n_next; - char *n_name; /* interface name */ + char *n_name; /* interface name */ struct sockaddr *n_addr; /* who to send to */ - int n_addrlen; /* size of address */ - int n_flags; /* should forward?, interface flags */ + int n_addrlen; /* size of address */ + int n_flags; /* should forward?, interface flags */ }; struct neighbor *neighbors; struct whod mywd; -struct servent *sp; +struct servent *sp; int s; #define WHDRSIZE (int)(sizeof(mywd) - sizeof(mywd.wd_we)) -void run_as(uid_t *, gid_t *); -int configure(int); -void getboottime(int); -void onalrm(int); -void quit(const char *); -void rt_xaddrs(caddr_t, caddr_t, struct rt_addrinfo *); -int verify(char *, int); +int configure(int so); +void getboottime(int signo __unused); +void onalrm(int signo __unused); +void rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo); +void run_as(uid_t *uid, gid_t *gid); +void quit(const char *msg); +int verify(char *name, int maxlen); static void usage(void); + #ifdef DEBUG -char *interval(int, char *); -void Sendto(int, const void *, size_t, int, const struct sockaddr *, int); +char *interval(int time, char *updown); +void Sendto(int s, const void *buf, size_t cc, int flags, + const struct sockaddr *to, int tolen); #define sendto Sendto #endif +/* + * This version of Berkeley's rwhod has been modified to use IP multicast + * datagrams, under control of a new command-line option: + * + * rwhod -m causes rwhod to use IP multicast (instead of + * broadcast or unicast) on all interfaces that have + * the IFF_MULTICAST flag set in their "ifnet" structs + * (excluding the loopback interface). The multicast + * reports are sent with a time-to-live of 1, to prevent + * forwarding beyond the directly-connected subnet(s). + * + * rwhod -m causes rwhod to send IP multicast datagrams with a + * time-to-live of , via a SINGLE interface rather + * than all interfaces. must be between 0 and + * MAX_MULTICAST_SCOPE, defined below. Note that "-m 1" + * is different than "-m", in that "-m 1" specifies + * transmission on one interface only. + * + * When "-m" is used without a argument, the program accepts multicast + * rwhod reports from all multicast-capable interfaces. If a argument + * is given, it accepts multicast reports from only one interface, the one + * on which reports are sent (which may be controlled via the host's routing + * table). Regardless of the "-m" option, the program accepts broadcast or + * unicast reports from all interfaces. Thus, this program will hear the + * reports of old, non-multicasting rwhods, but, if multicasting is used, + * those old rwhods won't hear the reports generated by this program. + * + * -- Steve Deering, Stanford University, February 1989 + */ int main(int argc, char *argv[]) { struct sockaddr_in from; struct stat st; char path[64]; - int on = 1; + int on; char *cp; struct sockaddr_in soin; uid_t unpriv_uid; gid_t unpriv_gid; + on = 1; if (getuid()) errx(1, "not super user"); run_as(&unpriv_uid, &unpriv_gid); - argv++; argc--; + argv++; + argc--; while (argc > 0 && *argv[0] == '-') { if (strcmp(*argv, "-m") == 0) { if (argc > 1 && isdigit(*(argv + 1)[0])) { - argv++, argc--; + argv++; + argc--; multicast_mode = SCOPED_MULTICAST; multicast_scope = atoi(*argv); - if (multicast_scope > MAX_MULTICAST_SCOPE) + if (multicast_scope > MAX_MULTICAST_SCOPE) { errx(1, "ttl must not exceed %u", - MAX_MULTICAST_SCOPE); + MAX_MULTICAST_SCOPE); + } + } else { + multicast_mode = PER_INTERFACE_MULTICAST; } - else multicast_mode = PER_INTERFACE_MULTICAST; - } - else if (strcmp(*argv, "-i") == 0) + } else if (strcmp(*argv, "-i") == 0) { insecure_mode = 1; - else if (strcmp(*argv, "-l") == 0) + } else if (strcmp(*argv, "-l") == 0) { quiet_mode = 1; - else if (strcmp(*argv, "-p") == 0) + } else if (strcmp(*argv, "-p") == 0) { iff_flag = 0; - else + } else { usage(); - argv++, argc--; + } + argv++; + argc--; } if (argc > 0) usage(); @@ -229,8 +236,7 @@ main(int argc, char *argv[]) } if ((cp = strchr(myname, '.')) != NULL) *cp = '\0'; - strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1); - mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0'; + strlcpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname)); getboottime(0); if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "socket: %m"); @@ -252,7 +258,7 @@ main(int argc, char *argv[]) syslog(LOG_ERR, "setgid: %m"); exit(1); } - if (setgroups(1, &unpriv_gid) != 0) { /* XXX BOGUS groups[0] = egid */ + if (setgroups(1, &unpriv_gid) != 0) { /* XXX BOGUS groups[0] = egid */ syslog(LOG_ERR, "setgroups: %m"); exit(1); } @@ -268,12 +274,13 @@ main(int argc, char *argv[]) } for (;;) { struct whod wd; - socklen_t len = sizeof(from); + socklen_t len; int cc, whod; time_t t; - cc = recvfrom(s, (char *)&wd, sizeof(struct whod), 0, - (struct sockaddr *)&from, &len); + len = sizeof(from); + cc = recvfrom(s, &wd, sizeof(wd), 0, (struct sockaddr *)&from, + &len); if (cc <= 0) { if (cc < 0 && errno != EINTR) syslog(LOG_WARNING, "recv: %m"); @@ -293,12 +300,12 @@ main(int argc, char *argv[]) continue; if (wd.wd_type != WHODTYPE_STATUS) continue; - if (!verify(wd.wd_hostname, sizeof wd.wd_hostname)) { + if (!verify(wd.wd_hostname, sizeof(wd.wd_hostname))) { syslog(LOG_WARNING, "malformed host name from %s", inet_ntoa(from.sin_addr)); continue; } - (void) snprintf(path, sizeof path, "whod.%s", wd.wd_hostname); + (void) snprintf(path, sizeof(path), "whod.%s", wd.wd_hostname); /* * Rather than truncating and growing the file each time, * use ftruncate if size is less than previous size. @@ -310,9 +317,10 @@ main(int argc, char *argv[]) } #if ENDIAN != BIG_ENDIAN { - int i, n = (cc - WHDRSIZE)/sizeof(struct whoent); struct whoent *we; + int i, n; + n = (cc - WHDRSIZE) / sizeof(struct whoent); /* undo header byte swapping before writing to file */ wd.wd_sendtime = ntohl(wd.wd_sendtime); for (i = 0; i < 3; i++) @@ -337,29 +345,28 @@ main(int argc, char *argv[]) } static void -usage() +usage(void) { + fprintf(stderr, "usage: rwhod [-i] [-p] [-l] [-m [ttl]]\n"); exit(1); } void -run_as(uid, gid) - uid_t *uid; - gid_t *gid; +run_as(uid_t *uid, gid_t *gid) { struct passwd *pw; struct group *gr; pw = getpwnam(UNPRIV_USER); - if (!pw) { + if (pw == NULL) { syslog(LOG_ERR, "getpwnam(%s): %m", UNPRIV_USER); exit(1); } *uid = pw->pw_uid; gr = getgrnam(UNPRIV_GROUP); - if (!gr) { + if (gr == NULL) { syslog(LOG_ERR, "getgrnam(%s): %m", UNPRIV_GROUP); exit(1); } @@ -372,16 +379,16 @@ run_as(uid, gid) * to be created. Sorry, but blanks aren't allowed. */ int -verify(name, maxlen) - register char *name; - register int maxlen; +verify(char *name, int maxlen) { - register int size = 0; + int size; - while (*name && size < maxlen - 1) { - if (!isascii(*name) || !(isalnum(*name) || ispunct(*name))) + size = 0; + while (*name != '\0' && size < maxlen - 1) { + if (!isascii(*name) || !isalnum(*name) || ispunct(*name)) return (0); - name++, size++; + name++; + size++; } *name = '\0'; return (size > 0); @@ -390,15 +397,16 @@ verify(name, maxlen) void onalrm(int signo __unused) { - struct neighbor *np; - struct whoent *we = mywd.wd_we, *wend; - struct stat stb; - struct utmpx *ut; static int alarmcount = 0; double avenrun[3]; time_t now; int i, cc; + struct utmpx *ut; + struct stat stb; + struct neighbor *np; + struct whoent *we, *wend; + we = mywd.wd_we; now = time(NULL); if (alarmcount % 10 == 0) getboottime(0); @@ -418,7 +426,7 @@ onalrm(int signo __unused) } endutxent(); - if (chdir(_PATH_DEV)) { + if (chdir(_PATH_DEV) < 0) { syslog(LOG_ERR, "chdir(%s): %m", _PATH_DEV); exit(1); } @@ -428,7 +436,7 @@ onalrm(int signo __unused) we->we_idle = htonl(now - stb.st_atime); we++; } - (void)getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); + (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); for (i = 0; i < 3; i++) mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); cc = (char *)wend - (char *)&mywd; @@ -439,27 +447,32 @@ onalrm(int signo __unused) (void) sendto(s, (char *)&mywd, cc, 0, (struct sockaddr *)&multicast_addr, sizeof(multicast_addr)); - } - else for (np = neighbors; np != NULL; np = np->n_next) { - if (multicast_mode == PER_INTERFACE_MULTICAST && - np->n_flags & IFF_MULTICAST) { - /* - * Select the outgoing interface for the multicast. - */ - if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, - &(((struct sockaddr_in *)np->n_addr)->sin_addr), - sizeof(struct in_addr)) < 0) { - syslog(LOG_ERR, - "setsockopt IP_MULTICAST_IF: %m"); - exit(1); + } else { + for (np = neighbors; np != NULL; np = np->n_next) { + if (multicast_mode == PER_INTERFACE_MULTICAST && + (np->n_flags & IFF_MULTICAST) != 0) { + /* + * Select the outgoing interface for the + * multicast. + */ + if (setsockopt(s, IPPROTO_IP, + IP_MULTICAST_IF, + &(((struct sockaddr_in *)np->n_addr)->sin_addr), + sizeof(struct in_addr)) < 0) { + syslog(LOG_ERR, + "setsockopt IP_MULTICAST_IF: %m"); + exit(1); + } + (void) sendto(s, (char *)&mywd, cc, 0, + (struct sockaddr *)&multicast_addr, + sizeof(multicast_addr)); + } else { + (void) sendto(s, (char *)&mywd, cc, 0, + np->n_addr, np->n_addrlen); } - (void) sendto(s, (char *)&mywd, cc, 0, - (struct sockaddr *)&multicast_addr, - sizeof(multicast_addr)); - } else (void) sendto(s, (char *)&mywd, cc, 0, - np->n_addr, np->n_addrlen); + } } - if (chdir(_PATH_RWHODIR)) { + if (chdir(_PATH_RWHODIR) < 0) { syslog(LOG_ERR, "chdir(%s): %m", _PATH_RWHODIR); exit(1); } @@ -467,8 +480,7 @@ onalrm(int signo __unused) } void -getboottime(signo) - int signo __unused; +getboottime(int signo __unused) { int mib[2]; size_t size; @@ -485,26 +497,25 @@ getboottime(signo) } void -quit(msg) - const char *msg; +quit(const char *msg) { + syslog(LOG_ERR, "%s", msg); exit(1); } void -rt_xaddrs(cp, cplim, rtinfo) - register caddr_t cp, cplim; - register struct rt_addrinfo *rtinfo; +rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo) { - register struct sockaddr *sa; - register int i; + struct sockaddr *sa; + int i; memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info)); - for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) { + for (i = 0; i < RTAX_MAX && cp < cplim; i++) { if ((rtinfo->rti_addrs & (1 << i)) == 0) continue; - rtinfo->rti_info[i] = sa = (struct sockaddr *)cp; + sa = (struct sockaddr *)cp; + rtinfo->rti_info[i] = sa; cp += SA_SIZE(sa); } } @@ -514,18 +525,18 @@ rt_xaddrs(cp, cplim, rtinfo) * networks which deserve status information. */ int -configure(so) - int so; +configure(int so) { - register struct neighbor *np; - register struct if_msghdr *ifm; - register struct ifa_msghdr *ifam; + struct neighbor *np; + struct if_msghdr *ifm; + struct ifa_msghdr *ifam; struct sockaddr_dl *sdl; size_t needed; - int mib[6], flags = 0, len; + int mib[6], flags, lflags, len; char *buf, *lim, *next; struct rt_addrinfo info; + flags = 0; if (multicast_mode != NO_MULTICAST) { multicast_addr.sin_addr.s_addr = htonl(INADDR_WHOD_GROUP); multicast_addr.sin_port = sp->s_port; @@ -538,19 +549,19 @@ configure(so) mreq.imr_multiaddr.s_addr = htonl(INADDR_WHOD_GROUP); mreq.imr_interface.s_addr = htonl(INADDR_ANY); if (setsockopt(so, IPPROTO_IP, IP_ADD_MEMBERSHIP, - &mreq, sizeof(mreq)) < 0) { + &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, - "setsockopt IP_ADD_MEMBERSHIP: %m"); - return(0); + "setsockopt IP_ADD_MEMBERSHIP: %m"); + return (0); } ttl = multicast_scope; - if (setsockopt(so, IPPROTO_IP, IP_MULTICAST_TTL, - &ttl, sizeof(ttl)) < 0) { + if (setsockopt(so, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, + sizeof(ttl)) < 0) { syslog(LOG_ERR, - "setsockopt IP_MULTICAST_TTL: %m"); - return(0); + "setsockopt IP_MULTICAST_TTL: %m"); + return (0); } - return(1); + return (1); } mib[0] = CTL_NET; @@ -575,34 +586,38 @@ configure(so) flags = ifm->ifm_flags; continue; } - if ((flags & IFF_UP) == 0 || - (flags & (((multicast_mode == PER_INTERFACE_MULTICAST) ? - IFF_MULTICAST : 0) | - IFF_BROADCAST|iff_flag)) == 0) + if ((flags & IFF_UP) == 0) + continue; + lflags = IFF_BROADCAST | iff_flag; + if (multicast_mode == PER_INTERFACE_MULTICAST) + lflags |= IFF_MULTICAST; + if ((flags & lflags) == 0) continue; if (ifm->ifm_type != RTM_NEWADDR) quit("out of sync parsing NET_RT_IFLIST"); ifam = (struct ifa_msghdr *)ifm; info.rti_addrs = ifam->ifam_addrs; rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam, - &info); + &info); /* gag, wish we could get rid of Internet dependencies */ -#define dstaddr info.rti_info[RTAX_BRD] -#define ifaddr info.rti_info[RTAX_IFA] -#define IPADDR_SA(x) ((struct sockaddr_in *)(x))->sin_addr.s_addr -#define PORT_SA(x) ((struct sockaddr_in *)(x))->sin_port +#define dstaddr info.rti_info[RTAX_BRD] +#define ifaddr info.rti_info[RTAX_IFA] +#define IPADDR_SA(x) ((struct sockaddr_in *)(x))->sin_addr.s_addr +#define PORT_SA(x) ((struct sockaddr_in *)(x))->sin_port if (dstaddr == 0 || dstaddr->sa_family != AF_INET) continue; PORT_SA(dstaddr) = sp->s_port; - for (np = neighbors; np != NULL; np = np->n_next) + for (np = neighbors; np != NULL; np = np->n_next) { if (memcmp(sdl->sdl_data, np->n_name, - sdl->sdl_nlen) == 0 && - IPADDR_SA(np->n_addr) == IPADDR_SA(dstaddr)) + sdl->sdl_nlen) == 0 && + IPADDR_SA(np->n_addr) == IPADDR_SA(dstaddr)) { break; + } + } if (np != NULL) continue; len = sizeof(*np) + dstaddr->sa_len + sdl->sdl_nlen + 1; - np = (struct neighbor *)malloc(len); + np = malloc(len); if (np == NULL) quit("malloc of neighbor structure"); memset(np, 0, len); @@ -613,24 +628,24 @@ configure(so) memcpy((char *)np->n_addr, (char *)dstaddr, np->n_addrlen); memcpy(np->n_name, sdl->sdl_data, sdl->sdl_nlen); if (multicast_mode == PER_INTERFACE_MULTICAST && - (flags & IFF_MULTICAST) && - !(flags & IFF_LOOPBACK)) { + (flags & IFF_MULTICAST) != 0 && + (flags & IFF_LOOPBACK) == 0) { struct ip_mreq mreq; memcpy((char *)np->n_addr, (char *)ifaddr, - np->n_addrlen); + np->n_addrlen); mreq.imr_multiaddr.s_addr = htonl(INADDR_WHOD_GROUP); mreq.imr_interface.s_addr = - ((struct sockaddr_in *)np->n_addr)->sin_addr.s_addr; + ((struct sockaddr_in *)np->n_addr)->sin_addr.s_addr; if (setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, - &mreq, sizeof(mreq)) < 0) { + &mreq, sizeof(mreq)) < 0) { syslog(LOG_ERR, "setsockopt IP_ADD_MEMBERSHIP: %m"); #if 0 /* Fall back to broadcast on this if. */ np->n_flags &= ~IFF_MULTICAST; #else - free((char *)np); + free(np); continue; #endif } @@ -644,36 +659,32 @@ configure(so) #ifdef DEBUG void -Sendto(s, buf, cc, flags, to, tolen) - int s; - const void *buf; - size_t cc; - int flags; - const struct sockaddr *to; - int tolen; -{ - register struct whod *w = (struct whod *)buf; - register struct whoent *we; - struct sockaddr_in *sin = (struct sockaddr_in *)to; +Sendto(int s, const void *buf, size_t cc, int flags, const struct sockaddr *to, + int tolen) +{ + struct whod *w; + struct whoent *we; + struct sockaddr_in *sin; + w = (struct whod *)buf; + sin = (struct sockaddr_in *)to; printf("sendto %x.%d\n", ntohl(sin->sin_addr.s_addr), - ntohs(sin->sin_port)); + ntohs(sin->sin_port)); printf("hostname %s %s\n", w->wd_hostname, - interval(ntohl(w->wd_sendtime) - ntohl(w->wd_boottime), " up")); + interval(ntohl(w->wd_sendtime) - ntohl(w->wd_boottime), " up")); printf("load %4.2f, %4.2f, %4.2f\n", ntohl(w->wd_loadav[0]) / 100.0, ntohl(w->wd_loadav[1]) / 100.0, ntohl(w->wd_loadav[2]) / 100.0); cc -= WHDRSIZE; for (we = w->wd_we, cc /= sizeof(struct whoent); cc > 0; cc--, we++) { time_t t = _time32_to_time(ntohl(we->we_utmp.out_time)); - printf("%-8.8s %s:%s %.12s", - we->we_utmp.out_name, - w->wd_hostname, we->we_utmp.out_line, - ctime(&t)+4); + + printf("%-8.8s %s:%s %.12s", we->we_utmp.out_name, + w->wd_hostname, we->we_utmp.out_line, ctime(&t) + 4); we->we_idle = ntohl(we->we_idle) / 60; - if (we->we_idle) { - if (we->we_idle >= 100*60) - we->we_idle = 100*60 - 1; + if (we->we_idle != 0) { + if (we->we_idle >= 100 * 60) + we->we_idle = 100 * 60 - 1; if (we->we_idle >= 60) printf(" %2d", we->we_idle / 60); else @@ -685,26 +696,27 @@ Sendto(s, buf, cc, flags, to, tolen) } char * -interval(time, updown) - int time; - char *updown; +interval(int time, char *updown) { static char resbuf[32]; int days, hours, minutes; - if (time < 0 || time > 3*30*24*60*60) { + if (time < 0 || time > 3 * 30 * 24 * 60 * 60) { (void) sprintf(resbuf, " %s ??:??", updown); return (resbuf); } minutes = (time + 59) / 60; /* round to minutes */ - hours = minutes / 60; minutes %= 60; - days = hours / 24; hours %= 24; - if (days) + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; + if (days > 0) { (void) sprintf(resbuf, "%s %2d+%02d:%02d", updown, days, hours, minutes); - else + } else { (void) sprintf(resbuf, "%s %2d:%02d", updown, hours, minutes); + } return (resbuf); } #endif From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:04:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B93BAC7E; Wed, 3 Jul 2013 21:04:20 +0000 (UTC) (envelope-from pjd@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 AB9C51842; Wed, 3 Jul 2013 21:04:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63L4KiX015938; Wed, 3 Jul 2013 21:04:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63L4KEE015937; Wed, 3 Jul 2013 21:04:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032104.r63L4KEE015937@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252603 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:04:20 -0000 Author: pjd Date: Wed Jul 3 21:04:20 2013 New Revision: 252603 URL: http://svnweb.freebsd.org/changeset/base/252603 Log: The whole sending functionality was implemented within signal handler, which is very bad idea. Split sending and receiving in two processes, which fixes this problem and will help to sandbox rwhod. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Wed Jul 3 20:58:58 2013 (r252602) +++ head/usr.sbin/rwhod/rwhod.c Wed Jul 3 21:04:20 2013 (r252603) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1983, 1993 The Regents of the University of California. + * Copyright (c) 2013 Mariusz Zaborski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -93,10 +96,10 @@ struct sockaddr_in multicast_addr = { sizeof(multicast_addr), AF_INET, 0, { 0 }, { 0 } }; /* - * Alarm interval. Don't forget to change the down time check in ruptime + * Sleep interval. Don't forget to change the down time check in ruptime * if this is changed. */ -#define AL_INTERVAL (3 * 60) +#define SL_INTERVAL (3 * 60) char myname[MAXHOSTNAMELEN]; @@ -117,15 +120,18 @@ struct neighbor *neighbors; struct whod mywd; struct servent *sp; int s; +int fdp; +pid_t pid_child_receiver; #define WHDRSIZE (int)(sizeof(mywd) - sizeof(mywd.wd_we)) int configure(int so); void getboottime(int signo __unused); -void onalrm(int signo __unused); +void receiver_process(void); void rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo); void run_as(uid_t *uid, gid_t *gid); void quit(const char *msg); +void sender_process(void); int verify(char *name, int maxlen); static void usage(void); @@ -168,9 +174,6 @@ void Sendto(int s, const void *buf, size int main(int argc, char *argv[]) { - struct sockaddr_in from; - struct stat st; - char path[64]; int on; char *cp; struct sockaddr_in soin; @@ -269,16 +272,83 @@ main(int argc, char *argv[]) if (!configure(s)) exit(1); if (!quiet_mode) { - signal(SIGALRM, onalrm); - onalrm(0); + pid_child_receiver = pdfork(&fdp, 0); + if (pid_child_receiver == 0) { + receiver_process(); + } else if (pid_child_receiver > 0) { + sender_process(); + } else if (pid_child_receiver == -1) { + syslog(LOG_ERR, "pdfork: %m"); + exit(1); + } + } else { + receiver_process(); } - for (;;) { - struct whod wd; - socklen_t len; - int cc, whod; - time_t t; +} + +static void +usage(void) +{ + + fprintf(stderr, "usage: rwhod [-i] [-p] [-l] [-m [ttl]]\n"); + exit(1); +} + +void +run_as(uid_t *uid, gid_t *gid) +{ + struct passwd *pw; + struct group *gr; + + pw = getpwnam(UNPRIV_USER); + if (pw == NULL) { + syslog(LOG_ERR, "getpwnam(%s): %m", UNPRIV_USER); + exit(1); + } + *uid = pw->pw_uid; + + gr = getgrnam(UNPRIV_GROUP); + if (gr == NULL) { + syslog(LOG_ERR, "getgrnam(%s): %m", UNPRIV_GROUP); + exit(1); + } + *gid = gr->gr_gid; +} + +/* + * Check out host name for unprintables + * and other funnies before allowing a file + * to be created. Sorry, but blanks aren't allowed. + */ +int +verify(char *name, int maxlen) +{ + int size; + + size = 0; + while (*name != '\0' && size < maxlen - 1) { + if (!isascii(*name) || !isalnum(*name) || ispunct(*name)) + return (0); + name++; + size++; + } + *name = '\0'; + return (size > 0); +} + +void +receiver_process(void) +{ + struct sockaddr_in from; + struct stat st; + char path[64]; + struct whod wd; + socklen_t len; + int cc, whod; + time_t t; - len = sizeof(from); + len = sizeof(from); + for (;;) { cc = recvfrom(s, &wd, sizeof(wd), 0, (struct sockaddr *)&from, &len); if (cc <= 0) { @@ -344,139 +414,97 @@ main(int argc, char *argv[]) } } -static void -usage(void) -{ - - fprintf(stderr, "usage: rwhod [-i] [-p] [-l] [-m [ttl]]\n"); - exit(1); -} - -void -run_as(uid_t *uid, gid_t *gid) -{ - struct passwd *pw; - struct group *gr; - - pw = getpwnam(UNPRIV_USER); - if (pw == NULL) { - syslog(LOG_ERR, "getpwnam(%s): %m", UNPRIV_USER); - exit(1); - } - *uid = pw->pw_uid; - - gr = getgrnam(UNPRIV_GROUP); - if (gr == NULL) { - syslog(LOG_ERR, "getgrnam(%s): %m", UNPRIV_GROUP); - exit(1); - } - *gid = gr->gr_gid; -} - -/* - * Check out host name for unprintables - * and other funnies before allowing a file - * to be created. Sorry, but blanks aren't allowed. - */ -int -verify(char *name, int maxlen) -{ - int size; - - size = 0; - while (*name != '\0' && size < maxlen - 1) { - if (!isascii(*name) || !isalnum(*name) || ispunct(*name)) - return (0); - name++; - size++; - } - *name = '\0'; - return (size > 0); -} - void -onalrm(int signo __unused) +sender_process(void) { - static int alarmcount = 0; + int sendcount; double avenrun[3]; time_t now; - int i, cc; + int i, cc, status; struct utmpx *ut; struct stat stb; struct neighbor *np; struct whoent *we, *wend; - we = mywd.wd_we; - now = time(NULL); - if (alarmcount % 10 == 0) - getboottime(0); - alarmcount++; - wend = &mywd.wd_we[1024 / sizeof(struct whoent)]; - setutxent(); - while ((ut = getutxent()) != NULL && we < wend) { - if (ut->ut_type != USER_PROCESS) - continue; - strncpy(we->we_utmp.out_line, ut->ut_line, - sizeof(we->we_utmp.out_line)); - strncpy(we->we_utmp.out_name, ut->ut_user, - sizeof(we->we_utmp.out_name)); - we->we_utmp.out_time = - htonl(_time_to_time32(ut->ut_tv.tv_sec)); - we++; - } - endutxent(); - - if (chdir(_PATH_DEV) < 0) { - syslog(LOG_ERR, "chdir(%s): %m", _PATH_DEV); - exit(1); - } - wend = we; - for (we = mywd.wd_we; we < wend; we++) { - if (stat(we->we_utmp.out_line, &stb) >= 0) - we->we_idle = htonl(now - stb.st_atime); - we++; - } - (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); - for (i = 0; i < 3; i++) - mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); - cc = (char *)wend - (char *)&mywd; - mywd.wd_sendtime = htonl(_time_to_time32(time(NULL))); - mywd.wd_vers = WHODVERSION; - mywd.wd_type = WHODTYPE_STATUS; - if (multicast_mode == SCOPED_MULTICAST) { - (void) sendto(s, (char *)&mywd, cc, 0, - (struct sockaddr *)&multicast_addr, - sizeof(multicast_addr)); - } else { - for (np = neighbors; np != NULL; np = np->n_next) { - if (multicast_mode == PER_INTERFACE_MULTICAST && - (np->n_flags & IFF_MULTICAST) != 0) { - /* - * Select the outgoing interface for the - * multicast. - */ - if (setsockopt(s, IPPROTO_IP, - IP_MULTICAST_IF, - &(((struct sockaddr_in *)np->n_addr)->sin_addr), - sizeof(struct in_addr)) < 0) { - syslog(LOG_ERR, - "setsockopt IP_MULTICAST_IF: %m"); - exit(1); + sendcount = 0; + for (;;) { + we = mywd.wd_we; + now = time(NULL); + if (sendcount % 10 == 0) + getboottime(0); + sendcount++; + wend = &mywd.wd_we[1024 / sizeof(struct whoent)]; + setutxent(); + while ((ut = getutxent()) != NULL && we < wend) { + if (ut->ut_type != USER_PROCESS) + continue; + strncpy(we->we_utmp.out_line, ut->ut_line, + sizeof(we->we_utmp.out_line)); + strncpy(we->we_utmp.out_name, ut->ut_user, + sizeof(we->we_utmp.out_name)); + we->we_utmp.out_time = + htonl(_time_to_time32(ut->ut_tv.tv_sec)); + we++; + } + endutxent(); + + if (chdir(_PATH_DEV) < 0) { + syslog(LOG_ERR, "chdir(%s): %m", _PATH_DEV); + exit(1); + } + wend = we; + for (we = mywd.wd_we; we < wend; we++) { + if (stat(we->we_utmp.out_line, &stb) >= 0) + we->we_idle = htonl(now - stb.st_atime); + we++; + } + (void) getloadavg(avenrun, + sizeof(avenrun) / sizeof(avenrun[0])); + for (i = 0; i < 3; i++) + mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); + cc = (char *)wend - (char *)&mywd; + mywd.wd_sendtime = htonl(_time_to_time32(time(NULL))); + mywd.wd_vers = WHODVERSION; + mywd.wd_type = WHODTYPE_STATUS; + if (multicast_mode == SCOPED_MULTICAST) { + (void) sendto(s, (char *)&mywd, cc, 0, + (struct sockaddr *)&multicast_addr, + sizeof(multicast_addr)); + } else { + for (np = neighbors; np != NULL; np = np->n_next) { + if (multicast_mode == PER_INTERFACE_MULTICAST && + (np->n_flags & IFF_MULTICAST) != 0) { + /* + * Select the outgoing interface for the + * multicast. + */ + if (setsockopt(s, IPPROTO_IP, + IP_MULTICAST_IF, + &(((struct sockaddr_in *)np->n_addr)->sin_addr), + sizeof(struct in_addr)) < 0) { + syslog(LOG_ERR, + "setsockopt IP_MULTICAST_IF: %m"); + exit(1); + } + (void) sendto(s, (char *)&mywd, cc, 0, + (struct sockaddr *)&multicast_addr, + sizeof(multicast_addr)); + } else { + (void) sendto(s, (char *)&mywd, cc, 0, + np->n_addr, np->n_addrlen); } - (void) sendto(s, (char *)&mywd, cc, 0, - (struct sockaddr *)&multicast_addr, - sizeof(multicast_addr)); - } else { - (void) sendto(s, (char *)&mywd, cc, 0, - np->n_addr, np->n_addrlen); } } + if (chdir(_PATH_RWHODIR) < 0) { + syslog(LOG_ERR, "chdir(%s): %m", _PATH_RWHODIR); + exit(1); + } + if (waitpid(pid_child_receiver, &status, WNOHANG) == + pid_child_receiver) { + break; + } + sleep(SL_INTERVAL); } - if (chdir(_PATH_RWHODIR) < 0) { - syslog(LOG_ERR, "chdir(%s): %m", _PATH_RWHODIR); - exit(1); - } - (void) alarm(AL_INTERVAL); } void From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:05:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA9C0DF9; Wed, 3 Jul 2013 21:05:35 +0000 (UTC) (envelope-from jilles@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 CCAB61852; Wed, 3 Jul 2013 21:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63L5ZLw016181; Wed, 3 Jul 2013 21:05:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63L5ZMK016180; Wed, 3 Jul 2013 21:05:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032105.r63L5ZMK016180@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:05: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: r252604 - stable/9/lib/libc/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:05:35 -0000 Author: jilles Date: Wed Jul 3 21:05:35 2013 New Revision: 252604 URL: http://svnweb.freebsd.org/changeset/base/252604 Log: MFC r250982: sigreturn(2): Remove ancient compatibility warning about 4.2BSD The HISTORY subsection still says that sigreturn() was added in 4.3BSD. Modified: stable/9/lib/libc/sys/sigreturn.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/sigreturn.2 ============================================================================== --- stable/9/lib/libc/sys/sigreturn.2 Wed Jul 3 21:04:20 2013 (r252603) +++ stable/9/lib/libc/sys/sigreturn.2 Wed Jul 3 21:05:35 2013 (r252604) @@ -56,10 +56,6 @@ Execution resumes at the specified pc. This system call is used by the trampoline code and .Xr longjmp 3 when returning from a signal to the previously executing program. -.Sh NOTES -This system call is not available in -.Bx 4.2 -hence it should not be used if backward compatibility is needed. .Sh RETURN VALUES If successful, the system call does not return. Otherwise, a value of -1 is returned and From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB5ABF4B; Wed, 3 Jul 2013 21:07:02 +0000 (UTC) (envelope-from pjd@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 83EF61867; Wed, 3 Jul 2013 21:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63L72s3016460; Wed, 3 Jul 2013 21:07:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63L72rV016459; Wed, 3 Jul 2013 21:07:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032107.r63L72rV016459@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252605 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:07:02 -0000 Author: pjd Date: Wed Jul 3 21:07:02 2013 New Revision: 252605 URL: http://svnweb.freebsd.org/changeset/base/252605 Log: Sandbox rwhod(8) receiver process using capability mode and Capsicum capabilities. rwhod(8) receiver can now only receive packages, write to /var/rwho/ directory and log to syslog. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Reviewed by: pjd MFC after: 1 month Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Wed Jul 3 21:05:35 2013 (r252604) +++ head/usr.sbin/rwhod/rwhod.c Wed Jul 3 21:07:02 2013 (r252605) @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -220,7 +221,7 @@ main(int argc, char *argv[]) daemon(1, 0); #endif (void) signal(SIGHUP, getboottime); - openlog("rwhod", LOG_PID, LOG_DAEMON); + openlog("rwhod", LOG_PID | LOG_NDELAY, LOG_DAEMON); sp = getservbyname("who", "udp"); if (sp == NULL) { syslog(LOG_ERR, "who/udp: unknown service"); @@ -342,12 +343,27 @@ receiver_process(void) struct sockaddr_in from; struct stat st; char path[64]; + int dirfd; struct whod wd; socklen_t len; int cc, whod; time_t t; len = sizeof(from); + dirfd = open(".", O_RDONLY | O_DIRECTORY); + if (dirfd < 0) { + syslog(LOG_WARNING, "%s: %m", _PATH_RWHODIR); + exit(1); + } + if (cap_rights_limit(dirfd, CAP_CREATE | CAP_WRITE | CAP_FTRUNCATE | + CAP_SEEK | CAP_LOOKUP | CAP_FSTAT) < 0 && errno != ENOSYS) { + syslog(LOG_WARNING, "cap_rights_limit: %m"); + exit(1); + } + if (cap_enter() < 0 && errno != ENOSYS) { + syslog(LOG_ERR, "cap_enter: %m"); + exit(1); + } for (;;) { cc = recvfrom(s, &wd, sizeof(wd), 0, (struct sockaddr *)&from, &len); @@ -380,11 +396,16 @@ receiver_process(void) * Rather than truncating and growing the file each time, * use ftruncate if size is less than previous size. */ - whod = open(path, O_WRONLY | O_CREAT, 0644); + whod = openat(dirfd, path, O_WRONLY | O_CREAT, 0644); if (whod < 0) { syslog(LOG_WARNING, "%s: %m", path); continue; } + if (cap_rights_limit(whod, CAP_WRITE | CAP_FTRUNCATE | + CAP_FSTAT) < 0 && errno != ENOSYS) { + syslog(LOG_WARNING, "cap_rights_limit: %m"); + exit(1); + } #if ENDIAN != BIG_ENDIAN { struct whoent *we; @@ -412,6 +433,7 @@ receiver_process(void) ftruncate(whod, cc); (void) close(whod); } + (void) close(dirfd); } void From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:11:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD6BF2AC; Wed, 3 Jul 2013 21:11:56 +0000 (UTC) (envelope-from jilles@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 AF8EA18BC; Wed, 3 Jul 2013 21:11:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LBubr018978; Wed, 3 Jul 2013 21:11:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LBuY2018977; Wed, 3 Jul 2013 21:11:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032111.r63LBuY2018977@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:11:56 +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: r252606 - stable/9/bin/sleep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:11:56 -0000 Author: jilles Date: Wed Jul 3 21:11:56 2013 New Revision: 252606 URL: http://svnweb.freebsd.org/changeset/base/252606 Log: MFC r251078,r251433: sleep: Improve nanosleep() error handling: * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Modified: stable/9/bin/sleep/sleep.c Directory Properties: stable/9/bin/sleep/ (props changed) Modified: stable/9/bin/sleep/sleep.c ============================================================================== --- stable/9/bin/sleep/sleep.c Wed Jul 3 21:07:02 2013 (r252605) +++ stable/9/bin/sleep/sleep.c Wed Jul 3 21:11:56 2013 (r252606) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -81,14 +82,20 @@ main(int argc, char *argv[]) time_to_sleep.tv_nsec = 1e9 * (d - time_to_sleep.tv_sec); signal(SIGINFO, report_request); + + /* + * Note: [EINTR] is supposed to happen only when a signal was handled + * but the kernel also returns it when a ptrace-based debugger + * attaches. This is a bug but it is hard to fix. + */ while (nanosleep(&time_to_sleep, &time_to_sleep) != 0) { if (report_requested) { /* Reporting does not bother with nanoseconds. */ warnx("about %d second(s) left out of the original %d", (int)time_to_sleep.tv_sec, (int)original); report_requested = 0; - } else - break; + } else if (errno != EINTR) + err(1, "nanosleep"); } return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:14:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AD64F413; Wed, 3 Jul 2013 21:14:57 +0000 (UTC) (envelope-from jilles@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 9F0F118DF; Wed, 3 Jul 2013 21:14:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LEvOG019452; Wed, 3 Jul 2013 21:14:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LEvO4019451; Wed, 3 Jul 2013 21:14:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032114.r63LEvO4019451@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:14: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: r252607 - stable/9/bin/test X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:14:57 -0000 Author: jilles Date: Wed Jul 3 21:14:57 2013 New Revision: 252607 URL: http://svnweb.freebsd.org/changeset/base/252607 Log: MFC r251209: test(1): List non-standard primaries. Modified: stable/9/bin/test/test.1 Directory Properties: stable/9/bin/test/ (props changed) Modified: stable/9/bin/test/test.1 ============================================================================== --- stable/9/bin/test/test.1 Wed Jul 3 21:11:56 2013 (r252606) +++ stable/9/bin/test/test.1 Wed Jul 3 21:14:57 2013 (r252607) @@ -32,7 +32,7 @@ .\" @(#)test.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd December 27, 2012 +.Dd June 1, 2013 .Dt TEST 1 .Os .Sh NAME @@ -349,6 +349,17 @@ The utility implements a superset of the .St -p1003.2 specification. +The primaries +.Cm < , +.Cm == , +.Cm > , +.Fl ef , +.Fl nt , +.Fl ot , +.Fl G , +and +.Fl O +are extensions. .Sh BUGS Both sides are always evaluated in .Fl a From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:21:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A766F667; Wed, 3 Jul 2013 21:21:55 +0000 (UTC) (envelope-from ache@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 80226191A; Wed, 3 Jul 2013 21:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LLtaW022013; Wed, 3 Jul 2013 21:21:55 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LLtkk022011; Wed, 3 Jul 2013 21:21:55 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201307032121.r63LLtkk022011@svn.freebsd.org> From: "Andrey A. Chernov" Date: Wed, 3 Jul 2013 21:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252608 - in head: include lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:21:55 -0000 Author: ache Date: Wed Jul 3 21:21:54 2013 New Revision: 252608 URL: http://svnweb.freebsd.org/changeset/base/252608 Log: 1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range, but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached because it is off by one, zero is not reached too. Correct both RAND_MAX and rand(3) return value, shifting last one to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] range. 2) Add a checks for not overflowing on too big seeds. It may happens on the machines, where sizeof(unsigned int) > 32 bits. Reviewed by: bde [1] MFC after: 2 weeks Modified: head/include/stdlib.h head/lib/libc/stdlib/rand.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Jul 3 21:14:57 2013 (r252607) +++ head/include/stdlib.h Wed Jul 3 21:21:54 2013 (r252608) @@ -69,7 +69,7 @@ typedef struct { #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -#define RAND_MAX 0x7fffffff +#define RAND_MAX 0x7ffffffd __BEGIN_DECLS #ifdef _XLOCALE_H_ Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Wed Jul 3 21:14:57 2013 (r252607) +++ head/lib/libc/stdlib/rand.c Wed Jul 3 21:21:54 2013 (r252608) @@ -67,15 +67,15 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Can't be initialized with 0, so use another value. */ - if (*ctx == 0) - *ctx = 123459876; + /* Must be in [1, 0x7ffffffe] range at this point. */ hi = *ctx / 127773; lo = *ctx % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - return ((*ctx = x) % ((u_long)RAND_MAX + 1)); + *ctx = x; + /* Transform to [0, 0x7ffffffd] range. */ + return (x - 1); #endif /* !USE_WEAK_SEEDING */ } @@ -84,6 +84,10 @@ int rand_r(unsigned int *ctx) { u_long val = (u_long) *ctx; +#ifndef USE_WEAK_SEEDING + /* Transform to [1, 0x7ffffffe] range. */ + val = (val % 0x7ffffffe) + 1; +#endif int r = do_rand(&val); *ctx = (unsigned int) val; @@ -104,6 +108,10 @@ srand(seed) u_int seed; { next = seed; +#ifndef USE_WEAK_SEEDING + /* Transform to [1, 0x7ffffffe] range. */ + next = (next % 0x7ffffffe) + 1; +#endif } @@ -125,6 +133,10 @@ sranddev() mib[0] = CTL_KERN; mib[1] = KERN_ARND; sysctl(mib, 2, (void *)&next, &len, NULL, 0); +#ifndef USE_WEAK_SEEDING + /* Transform to [1, 0x7ffffffe] range. */ + next = (next % 0x7ffffffe) + 1; +#endif } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:22:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B376E7A7; Wed, 3 Jul 2013 21:22:47 +0000 (UTC) (envelope-from jilles@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 A586C1925; Wed, 3 Jul 2013 21:22:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LMlNn022205; Wed, 3 Jul 2013 21:22:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LMlgV022204; Wed, 3 Jul 2013 21:22:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032122.r63LMlgV022204@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:22:47 +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: r252609 - stable/9/bin/sh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:22:47 -0000 Author: jilles Date: Wed Jul 3 21:22:47 2013 New Revision: 252609 URL: http://svnweb.freebsd.org/changeset/base/252609 Log: MFC r248692: sh(1): Mention possible ambiguities with $(( and ((. In some other shells, things like $((a);(b)) are command substitutions. Also, there are shells that have an extension ((ARITH)) that evaluates an arithmetic expression and returns status 1 if the result is zero, 0 otherwise. This extension may lead to ambiguity with two subshells starting in sequence. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:21:54 2013 (r252608) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:22:47 2013 (r252609) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd November 5, 2011 +.Dd March 24, 2013 .Dt SH 1 .Os .Sh NAME @@ -1061,6 +1061,9 @@ A subshell environment may be implemente If job control is enabled in an interactive shell, commands grouped in parentheses can be suspended and continued as a unit. .Pp +For compatibility with other shells, +two open parentheses in sequence should be separated by whitespace. +.Pp The second form never forks another shell, so it is slightly more efficient. Grouping commands together this way allows the user to @@ -1604,6 +1607,16 @@ and .Ic times returns information about the same process if they are the only command in a command substitution. +.Pp +If a command substitution of the +.Li $( +form begins with a subshell, +the +.Li $( +and +.Li ( +must be separated by whitespace +to avoid ambiguity with arithmetic expansion. .Ss Arithmetic Expansion Arithmetic expansion provides a mechanism for evaluating an arithmetic expression and substituting its value. From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:25:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D43190A; Wed, 3 Jul 2013 21:25:47 +0000 (UTC) (envelope-from jilles@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 2DFFD1946; Wed, 3 Jul 2013 21:25:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LPk9q022609; Wed, 3 Jul 2013 21:25:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LPkq4022608; Wed, 3 Jul 2013 21:25:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032125.r63LPkq4022608@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:25:46 +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: r252610 - stable/9/bin/sh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:25:47 -0000 Author: jilles Date: Wed Jul 3 21:25:46 2013 New Revision: 252610 URL: http://svnweb.freebsd.org/changeset/base/252610 Log: MFC r248870 by joel: Minor mdoc fix in previous commit. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:22:47 2013 (r252609) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:25:46 2013 (r252610) @@ -1614,7 +1614,7 @@ form begins with a subshell, the .Li $( and -.Li ( +.Li (\& must be separated by whitespace to avoid ambiguity with arithmetic expansion. .Ss Arithmetic Expansion From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:31:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAC38CE6; Wed, 3 Jul 2013 21:31:13 +0000 (UTC) (envelope-from jilles@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 AD16D1995; Wed, 3 Jul 2013 21:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LVDer024995; Wed, 3 Jul 2013 21:31:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LVDO1024994; Wed, 3 Jul 2013 21:31:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032131.r63LVDO1024994@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:31:13 +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: r252611 - stable/9/bin/sh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:31:13 -0000 Author: jilles Date: Wed Jul 3 21:31:13 2013 New Revision: 252611 URL: http://svnweb.freebsd.org/changeset/base/252611 Log: MFC r251763: sh(1): A subshell environment has its own rlimits (ulimit). This has always been the case and is intended (just like cd). This matches Austin group issue #706. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:25:46 2013 (r252610) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:31:13 2013 (r252611) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd March 24, 2013 +.Dd June 14, 2013 .Dt SH 1 .Os .Sh NAME @@ -1036,6 +1036,9 @@ The current working directory as set by The file creation mask as set by .Ic umask . .It +Resource limits as set by +.Ic ulimit . +.It References to open files. .It Traps as set by From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:41:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79CF027B; Wed, 3 Jul 2013 21:41:36 +0000 (UTC) (envelope-from pjd@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 6C6971A12; Wed, 3 Jul 2013 21:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LfasL027905; Wed, 3 Jul 2013 21:41:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Lfaqk027903; Wed, 3 Jul 2013 21:41:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032141.r63Lfaqk027903@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252612 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:41:36 -0000 Author: pjd Date: Wed Jul 3 21:41:35 2013 New Revision: 252612 URL: http://svnweb.freebsd.org/changeset/base/252612 Log: MFp4: @229469: Garbage-collect dead prototypes. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhcpd.h head/sbin/dhclient/packet.c Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:31:13 2013 (r252611) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 21:41:35 2013 (r252612) @@ -413,12 +413,6 @@ ssize_t decode_hw_header(unsigned char * ssize_t decode_udp_ip_header(unsigned char *, int, struct sockaddr_in *, unsigned char *, int); -/* ethernet.c */ -void assemble_ethernet_header(struct interface_info *, unsigned char *, - int *, struct hardware *); -ssize_t decode_ethernet_header(struct interface_info *, unsigned char *, - int, struct hardware *); - /* clparse.c */ int read_client_conf(void); void read_client_leases(void); Modified: head/sbin/dhclient/packet.c ============================================================================== --- head/sbin/dhclient/packet.c Wed Jul 3 21:31:13 2013 (r252611) +++ head/sbin/dhclient/packet.c Wed Jul 3 21:41:35 2013 (r252612) @@ -55,11 +55,6 @@ __FBSDID("$FreeBSD$"); u_int32_t checksum(unsigned char *, unsigned, u_int32_t); u_int32_t wrapsum(u_int32_t); -void assemble_ethernet_header(struct interface_info *, unsigned char *, - int *, struct hardware *); -ssize_t decode_ethernet_header(struct interface_info *, unsigned char *, - int bufix, struct hardware *); - u_int32_t checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:43:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0A833FA; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) (envelope-from jilles@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 A224A1A27; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Lhi5E028190; Wed, 3 Jul 2013 21:43:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LhgTQ028171; Wed, 3 Jul 2013 21:43:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032143.r63LhgTQ028171@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:43:42 +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: r252613 - in stable/9/tools/regression/bin/sh: builtins execution expansion X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:43:44 -0000 Author: jilles Date: Wed Jul 3 21:43:41 2013 New Revision: 252613 URL: http://svnweb.freebsd.org/changeset/base/252613 Log: MFC r245383,245392,247190,249220,251180,251797: New sh testcases. These already work on stable/9. Added: stable/9/tools/regression/bin/sh/builtins/break4.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break4.4 stable/9/tools/regression/bin/sh/builtins/break5.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break5.4 stable/9/tools/regression/bin/sh/builtins/eval6.0 - copied unchanged from r249220, head/tools/regression/bin/sh/builtins/eval6.0 stable/9/tools/regression/bin/sh/builtins/local2.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local2.0 stable/9/tools/regression/bin/sh/builtins/local3.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local3.0 stable/9/tools/regression/bin/sh/builtins/read6.0 - copied unchanged from r247190, head/tools/regression/bin/sh/builtins/read6.0 stable/9/tools/regression/bin/sh/execution/subshell1.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0 stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout stable/9/tools/regression/bin/sh/execution/subshell2.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell2.0 stable/9/tools/regression/bin/sh/execution/subshell3.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell3.0 stable/9/tools/regression/bin/sh/execution/subshell4.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell4.0 stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 - copied unchanged from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/break4.4 (from r251180, head/tools/regression/bin/sh/builtins/break4.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break4.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break4.4) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/break5.4 (from r251180, head/tools/regression/bin/sh/builtins/break5.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break5.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break5.4) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/eval6.0 (from r249220, head/tools/regression/bin/sh/builtins/eval6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/eval6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r249220, head/tools/regression/bin/sh/builtins/eval6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# eval should preserve $? from command substitutions when starting +# the parsed command. +[ $(false; eval 'echo $?' $(:)) = 0 ] Copied: stable/9/tools/regression/bin/sh/builtins/local2.0 (from r251797, head/tools/regression/bin/sh/builtins/local2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local2.0) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +f() { + local - + set -a + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac +} +case $- in +*a*) echo Initial \$- bad +esac +f +case $- in +*a*) echo Final \$- bad +esac Copied: stable/9/tools/regression/bin/sh/builtins/local3.0 (from r251797, head/tools/regression/bin/sh/builtins/local3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local3.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +f() { + local "$@" + set -a + x=7 + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac + [ "$x" = 7 ] || echo In-function \$x bad +} +x=1 +case $- in +*a*) echo Initial \$- bad +esac +f x - +case $- in +*a*) echo Intermediate \$- bad +esac +[ "$x" = 1 ] || echo Intermediate \$x bad +f - x +case $- in +*a*) echo Final \$- bad +esac +[ "$x" = 1 ] || echo Final \$x bad Copied: stable/9/tools/regression/bin/sh/builtins/read6.0 (from r247190, head/tools/regression/bin/sh/builtins/read6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/read6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r247190, head/tools/regression/bin/sh/builtins/read6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +: | read x +r=$? +[ "$r" = 1 ] Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0 (from r245383, head/tools/regression/bin/sh/execution/subshell1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +(eval "cd / +v=$(printf %0100000d 1) +echo \${#v}") +echo end Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout (from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) @@ -0,0 +1,2 @@ +100000 +end Copied: stable/9/tools/regression/bin/sh/execution/subshell2.0 (from r245383, head/tools/regression/bin/sh/execution/subshell2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell2.0) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + x=2 +} +( + x=1 + f + [ "$x" = 2 ] +) Copied: stable/9/tools/regression/bin/sh/execution/subshell3.0 (from r245383, head/tools/regression/bin/sh/execution/subshell3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell3.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +(false; exit) && exit 3 +exit 0 Copied: stable/9/tools/regression/bin/sh/execution/subshell4.0 (from r245383, head/tools/regression/bin/sh/execution/subshell4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell4.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell4.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +(eval "set v=1"; false) && echo bad; : Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 (from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 3; } +f +[ `echo $?` = 3 ] From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:45:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85C33542; Wed, 3 Jul 2013 21:45:30 +0000 (UTC) (envelope-from pjd@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 6846F1A37; Wed, 3 Jul 2013 21:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LjUbq028513; Wed, 3 Jul 2013 21:45:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LjTLt028507; Wed, 3 Jul 2013 21:45:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032145.r63LjTLt028507@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252614 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:45:30 -0000 Author: pjd Date: Wed Jul 3 21:45:29 2013 New Revision: 252614 URL: http://svnweb.freebsd.org/changeset/base/252614 Log: MFp4 @229470: Remove unused argument from send_packet(). Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:43:41 2013 (r252613) +++ head/sbin/dhclient/bpf.c Wed Jul 3 21:45:29 2013 (r252614) @@ -251,8 +251,7 @@ if_register_receive(struct interface_inf ssize_t send_packet(struct interface_info *interface, struct dhcp_packet *raw, - size_t len, struct in_addr from, struct sockaddr_in *to, - struct hardware *hto) + size_t len, struct in_addr from, struct sockaddr_in *to) { unsigned char buf[256]; struct iovec iov[2]; @@ -261,7 +260,7 @@ send_packet(struct interface_info *inter /* Assemble the headers... */ if (to->sin_addr.s_addr == INADDR_BROADCAST) - assemble_hw_header(interface, buf, &bufp, hto); + assemble_hw_header(interface, buf, &bufp, NULL); assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 21:43:41 2013 (r252613) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 21:45:29 2013 (r252614) @@ -1232,7 +1232,7 @@ again: /* Send out a packet. */ (void)send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, &sockaddr_broadcast, NULL); + inaddr_any, &sockaddr_broadcast); add_timeout(cur_time + ip->client->interval, send_discover, ip); } @@ -1463,7 +1463,7 @@ cancel: /* Send out a packet. */ (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, - from, &destination, NULL); + from, &destination); add_timeout(cur_time + ip->client->interval, send_request, ip); } @@ -1479,7 +1479,7 @@ send_decline(void *ipp) /* Send out a packet. */ (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, &sockaddr_broadcast, NULL); + inaddr_any, &sockaddr_broadcast); } void Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:43:41 2013 (r252613) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 21:45:29 2013 (r252614) @@ -301,7 +301,7 @@ int if_register_bpf(struct interface_inf void if_register_send(struct interface_info *); void if_register_receive(struct interface_info *); ssize_t send_packet(struct interface_info *, struct dhcp_packet *, size_t, - struct in_addr, struct sockaddr_in *, struct hardware *); + struct in_addr, struct sockaddr_in *); ssize_t receive_packet(struct interface_info *, unsigned char *, size_t, struct sockaddr_in *, struct hardware *); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:49:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 70D116AB; Wed, 3 Jul 2013 21:49:11 +0000 (UTC) (envelope-from pjd@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 493501A70; Wed, 3 Jul 2013 21:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LnBEp028982; Wed, 3 Jul 2013 21:49:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LnAj9028979; Wed, 3 Jul 2013 21:49:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032149.r63LnAj9028979@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252615 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:49:11 -0000 Author: pjd Date: Wed Jul 3 21:49:10 2013 New Revision: 252615 URL: http://svnweb.freebsd.org/changeset/base/252615 Log: MFp4 @229471: Remove unused argument from assemble_hw_header(). Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhcpd.h head/sbin/dhclient/packet.c Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:45:29 2013 (r252614) +++ head/sbin/dhclient/bpf.c Wed Jul 3 21:49:10 2013 (r252615) @@ -260,7 +260,7 @@ send_packet(struct interface_info *inter /* Assemble the headers... */ if (to->sin_addr.s_addr == INADDR_BROADCAST) - assemble_hw_header(interface, buf, &bufp, NULL); + assemble_hw_header(interface, buf, &bufp); assemble_udp_ip_header(buf, &bufp, from.s_addr, to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:45:29 2013 (r252614) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 21:49:10 2013 (r252615) @@ -405,8 +405,7 @@ void bootp(struct packet *); void dhcp(struct packet *); /* packet.c */ -void assemble_hw_header(struct interface_info *, unsigned char *, - int *, struct hardware *); +void assemble_hw_header(struct interface_info *, unsigned char *, int *); void assemble_udp_ip_header(unsigned char *, int *, u_int32_t, u_int32_t, unsigned int, unsigned char *, int); ssize_t decode_hw_header(unsigned char *, int, struct hardware *); Modified: head/sbin/dhclient/packet.c ============================================================================== --- head/sbin/dhclient/packet.c Wed Jul 3 21:45:29 2013 (r252614) +++ head/sbin/dhclient/packet.c Wed Jul 3 21:49:10 2013 (r252615) @@ -90,14 +90,11 @@ wrapsum(u_int32_t sum) void assemble_hw_header(struct interface_info *interface, unsigned char *buf, - int *bufix, struct hardware *to) + int *bufix) { struct ether_header eh; - if (to != NULL && to->hlen == 6) /* XXX */ - memcpy(eh.ether_dhost, to->haddr, sizeof(eh.ether_dhost)); - else - memset(eh.ether_dhost, 0xff, sizeof(eh.ether_dhost)); + memset(eh.ether_dhost, 0xff, sizeof(eh.ether_dhost)); if (interface->hw_address.hlen == sizeof(eh.ether_shost)) memcpy(eh.ether_shost, interface->hw_address.haddr, sizeof(eh.ether_shost)); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:53:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 421BB940; Wed, 3 Jul 2013 21:53:55 +0000 (UTC) (envelope-from pjd@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 33FCD1AA9; Wed, 3 Jul 2013 21:53:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LrtOH031150; Wed, 3 Jul 2013 21:53:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LrsYi031144; Wed, 3 Jul 2013 21:53:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032153.r63LrsYi031144@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252616 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:53:55 -0000 Author: pjd Date: Wed Jul 3 21:53:54 2013 New Revision: 252616 URL: http://svnweb.freebsd.org/changeset/base/252616 Log: MFp4 @229472: Use the same type for 'from' and 'to' argument in send_packet(). Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:49:10 2013 (r252615) +++ head/sbin/dhclient/bpf.c Wed Jul 3 21:53:54 2013 (r252616) @@ -251,7 +251,7 @@ if_register_receive(struct interface_inf ssize_t send_packet(struct interface_info *interface, struct dhcp_packet *raw, - size_t len, struct in_addr from, struct sockaddr_in *to) + size_t len, struct in_addr from, struct in_addr to) { unsigned char buf[256]; struct iovec iov[2]; @@ -259,10 +259,10 @@ send_packet(struct interface_info *inter int result, bufp = 0; /* Assemble the headers... */ - if (to->sin_addr.s_addr == INADDR_BROADCAST) + if (to.s_addr == INADDR_BROADCAST) assemble_hw_header(interface, buf, &bufp); - assemble_udp_ip_header(buf, &bufp, from.s_addr, - to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len); + assemble_udp_ip_header(buf, &bufp, from.s_addr, to.s_addr, + htons(REMOTE_PORT), (unsigned char *)raw, len); iov[0].iov_base = (char *)buf; iov[0].iov_len = bufp; @@ -270,12 +270,19 @@ send_packet(struct interface_info *inter iov[1].iov_len = len; /* Fire it off */ - if (to->sin_addr.s_addr == INADDR_BROADCAST) + if (to.s_addr == INADDR_BROADCAST) result = writev(interface->wfdesc, iov, 2); else { + struct sockaddr_in sato; + + sato.sin_addr = to; + sato.sin_port = htons(REMOTE_PORT); + sato.sin_family = AF_INET; + sato.sin_len = sizeof(sato); + memset(&msg, 0, sizeof(msg)); - msg.msg_name = (struct sockaddr *)to; - msg.msg_namelen = sizeof(*to); + msg.msg_name = (struct sockaddr *)&sato; + msg.msg_namelen = sizeof(sato); msg.msg_iov = iov; msg.msg_iovlen = 2; result = sendmsg(interface->ufdesc, &msg, 0); Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 21:49:10 2013 (r252615) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 21:53:54 2013 (r252616) @@ -92,8 +92,7 @@ int privfd; int nullfd = -1; struct iaddr iaddr_broadcast = { 4, { 255, 255, 255, 255 } }; -struct in_addr inaddr_any; -struct sockaddr_in sockaddr_broadcast; +struct in_addr inaddr_any, inaddr_broadcast; char *path_dhclient_pidfile; struct pidfh *pidfile; @@ -410,11 +409,7 @@ main(int argc, char *argv[]) tzset(); time(&cur_time); - memset(&sockaddr_broadcast, 0, sizeof(sockaddr_broadcast)); - sockaddr_broadcast.sin_family = AF_INET; - sockaddr_broadcast.sin_port = htons(REMOTE_PORT); - sockaddr_broadcast.sin_addr.s_addr = INADDR_BROADCAST; - sockaddr_broadcast.sin_len = sizeof(sockaddr_broadcast); + inaddr_broadcast.s_addr = INADDR_BROADCAST; inaddr_any.s_addr = INADDR_ANY; read_client_conf(); @@ -1226,13 +1221,12 @@ again: ip->client->secs = ip->client->packet.secs; note("DHCPDISCOVER on %s to %s port %d interval %d", - ip->name, inet_ntoa(sockaddr_broadcast.sin_addr), - ntohs(sockaddr_broadcast.sin_port), + ip->name, inet_ntoa(inaddr_broadcast), REMOTE_PORT, (int)ip->client->interval); /* Send out a packet. */ (void)send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, &sockaddr_broadcast); + inaddr_any, inaddr_broadcast); add_timeout(cur_time + ip->client->interval, send_discover, ip); } @@ -1340,8 +1334,7 @@ void send_request(void *ipp) { struct interface_info *ip = ipp; - struct sockaddr_in destination; - struct in_addr from; + struct in_addr from, to; int interval; /* Figure out how long it's been since we started transmitting. */ @@ -1429,18 +1422,13 @@ cancel: /* If the lease T2 time has elapsed, or if we're not yet bound, broadcast the DHCPREQUEST rather than unicasting. */ - memset(&destination, 0, sizeof(destination)); if (ip->client->state == S_REQUESTING || ip->client->state == S_REBOOTING || cur_time > ip->client->active->rebind) - destination.sin_addr.s_addr = INADDR_BROADCAST; + to.s_addr = INADDR_BROADCAST; else - memcpy(&destination.sin_addr.s_addr, - ip->client->destination.iabuf, - sizeof(destination.sin_addr.s_addr)); - destination.sin_port = htons(REMOTE_PORT); - destination.sin_family = AF_INET; - destination.sin_len = sizeof(destination); + memcpy(&to.s_addr, ip->client->destination.iabuf, + sizeof(to.s_addr)); if (ip->client->state != S_REQUESTING) memcpy(&from, ip->client->active->address.iabuf, @@ -1458,12 +1446,12 @@ cancel: ip->client->packet.secs = htons(65535); } - note("DHCPREQUEST on %s to %s port %d", ip->name, - inet_ntoa(destination.sin_addr), ntohs(destination.sin_port)); + note("DHCPREQUEST on %s to %s port %d", ip->name, inet_ntoa(to), + REMOTE_PORT); /* Send out a packet. */ (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, - from, &destination); + from, to); add_timeout(cur_time + ip->client->interval, send_request, ip); } @@ -1474,12 +1462,11 @@ send_decline(void *ipp) struct interface_info *ip = ipp; note("DHCPDECLINE on %s to %s port %d", ip->name, - inet_ntoa(sockaddr_broadcast.sin_addr), - ntohs(sockaddr_broadcast.sin_port)); + inet_ntoa(inaddr_broadcast), REMOTE_PORT); /* Send out a packet. */ (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, &sockaddr_broadcast); + inaddr_any, inaddr_broadcast); } void Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:49:10 2013 (r252615) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 21:53:54 2013 (r252616) @@ -301,7 +301,7 @@ int if_register_bpf(struct interface_inf void if_register_send(struct interface_info *); void if_register_receive(struct interface_info *); ssize_t send_packet(struct interface_info *, struct dhcp_packet *, size_t, - struct in_addr, struct sockaddr_in *); + struct in_addr, struct in_addr); ssize_t receive_packet(struct interface_info *, unsigned char *, size_t, struct sockaddr_in *, struct hardware *); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:56:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E28ECB98; Wed, 3 Jul 2013 21:56:26 +0000 (UTC) (envelope-from jilles@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 BB15D1AD5; Wed, 3 Jul 2013 21:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LuQgo031550; Wed, 3 Jul 2013 21:56:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LuQqi031547; Wed, 3 Jul 2013 21:56:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032156.r63LuQqi031547@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:56:26 +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: r252617 - in stable/9: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:56:27 -0000 Author: jilles Date: Wed Jul 3 21:56:25 2013 New Revision: 252617 URL: http://svnweb.freebsd.org/changeset/base/252617 Log: MFC r248349: sh: Recognize "--" and explicitly reject options in wait builtin. If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be. Added: stable/9/tools/regression/bin/sh/builtins/wait6.0 - copied unchanged from r248349, head/tools/regression/bin/sh/builtins/wait6.0 stable/9/tools/regression/bin/sh/builtins/wait7.0 - copied unchanged from r248349, head/tools/regression/bin/sh/builtins/wait7.0 Modified: stable/9/bin/sh/jobs.c Directory Properties: stable/9/bin/sh/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Modified: stable/9/bin/sh/jobs.c ============================================================================== --- stable/9/bin/sh/jobs.c Wed Jul 3 21:53:54 2013 (r252616) +++ stable/9/bin/sh/jobs.c Wed Jul 3 21:56:25 2013 (r252617) @@ -459,14 +459,15 @@ freejob(struct job *jp) int -waitcmd(int argc, char **argv) +waitcmd(int argc __unused, char **argv __unused) { struct job *job; int status, retval; struct job *jp; - if (argc > 1) { - job = getjob(argv[1]); + nextopt(""); + if (*argptr != NULL) { + job = getjob(*argptr); } else { job = NULL; } Copied: stable/9/tools/regression/bin/sh/builtins/wait6.0 (from r248349, head/tools/regression/bin/sh/builtins/wait6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/wait6.0 Wed Jul 3 21:56:25 2013 (r252617, copy of r248349, head/tools/regression/bin/sh/builtins/wait6.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +wait -- Copied: stable/9/tools/regression/bin/sh/builtins/wait7.0 (from r248349, head/tools/regression/bin/sh/builtins/wait7.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/wait7.0 Wed Jul 3 21:56:25 2013 (r252617, copy of r248349, head/tools/regression/bin/sh/builtins/wait7.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +: & +wait -- $! From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:57:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E81CCE1; Wed, 3 Jul 2013 21:57:25 +0000 (UTC) (envelope-from pjd@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 EB5B51AE9; Wed, 3 Jul 2013 21:57:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LvO1s031699; Wed, 3 Jul 2013 21:57:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LvOr9031696; Wed, 3 Jul 2013 21:57:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032157.r63LvOr9031696@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252618 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:57:25 -0000 Author: pjd Date: Wed Jul 3 21:57:24 2013 New Revision: 252618 URL: http://svnweb.freebsd.org/changeset/base/252618 Log: MFp4 @229473: No caller checks send_packet() return value, so make it void. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:56:25 2013 (r252617) +++ head/sbin/dhclient/bpf.c Wed Jul 3 21:57:24 2013 (r252618) @@ -249,7 +249,7 @@ if_register_receive(struct interface_inf error("Cannot lock bpf"); } -ssize_t +void send_packet(struct interface_info *interface, struct dhcp_packet *raw, size_t len, struct in_addr from, struct in_addr to) { @@ -290,7 +290,6 @@ send_packet(struct interface_info *inter if (result < 0) warning("send_packet: %m"); - return (result); } ssize_t Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 21:56:25 2013 (r252617) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 21:57:24 2013 (r252618) @@ -1225,7 +1225,7 @@ again: (int)ip->client->interval); /* Send out a packet. */ - (void)send_packet(ip, &ip->client->packet, ip->client->packet_length, + send_packet(ip, &ip->client->packet, ip->client->packet_length, inaddr_any, inaddr_broadcast); add_timeout(cur_time + ip->client->interval, send_discover, ip); @@ -1450,7 +1450,7 @@ cancel: REMOTE_PORT); /* Send out a packet. */ - (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, + send_packet(ip, &ip->client->packet, ip->client->packet_length, from, to); add_timeout(cur_time + ip->client->interval, send_request, ip); @@ -1465,7 +1465,7 @@ send_decline(void *ipp) inet_ntoa(inaddr_broadcast), REMOTE_PORT); /* Send out a packet. */ - (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, + send_packet(ip, &ip->client->packet, ip->client->packet_length, inaddr_any, inaddr_broadcast); } Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:56:25 2013 (r252617) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 21:57:24 2013 (r252618) @@ -300,7 +300,7 @@ struct hash_bucket *new_hash_bucket(void int if_register_bpf(struct interface_info *); void if_register_send(struct interface_info *); void if_register_receive(struct interface_info *); -ssize_t send_packet(struct interface_info *, struct dhcp_packet *, size_t, +void send_packet(struct interface_info *, struct dhcp_packet *, size_t, struct in_addr, struct in_addr); ssize_t receive_packet(struct interface_info *, unsigned char *, size_t, struct sockaddr_in *, struct hardware *); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 21:58:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B403E50; Wed, 3 Jul 2013 21:58:27 +0000 (UTC) (envelope-from pjd@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 381A71AF8; Wed, 3 Jul 2013 21:58:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LwR1Y031861; Wed, 3 Jul 2013 21:58:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LwRDf031860; Wed, 3 Jul 2013 21:58:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032158.r63LwRDf031860@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 21:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252619 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:58:27 -0000 Author: pjd Date: Wed Jul 3 21:58:26 2013 New Revision: 252619 URL: http://svnweb.freebsd.org/changeset/base/252619 Log: MFp4 @229474: iov_base field is 'void *' in FreeBSD, no need to cast. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:57:24 2013 (r252618) +++ head/sbin/dhclient/bpf.c Wed Jul 3 21:58:26 2013 (r252619) @@ -264,9 +264,9 @@ send_packet(struct interface_info *inter assemble_udp_ip_header(buf, &bufp, from.s_addr, to.s_addr, htons(REMOTE_PORT), (unsigned char *)raw, len); - iov[0].iov_base = (char *)buf; + iov[0].iov_base = buf; iov[0].iov_len = bufp; - iov[1].iov_base = (char *)raw; + iov[1].iov_base = raw; iov[1].iov_len = len; /* Fire it off */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:01:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9B471B5; Wed, 3 Jul 2013 22:01:52 +0000 (UTC) (envelope-from pjd@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 DACB11B14; Wed, 3 Jul 2013 22:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M1qkg034150; Wed, 3 Jul 2013 22:01:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M1qNY034147; Wed, 3 Jul 2013 22:01:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032201.r63M1qNY034147@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252620 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:01:53 -0000 Author: pjd Date: Wed Jul 3 22:01:52 2013 New Revision: 252620 URL: http://svnweb.freebsd.org/changeset/base/252620 Log: MFp4 @229476,229478: Make use of two fields: rfdesc and wfdesc to keep bpf descriptor open for reading only in rfdesc and bpf descriptor open for writing only in wfdesc. In the end they will be used by two different processes. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 21:58:26 2013 (r252619) +++ head/sbin/dhclient/bpf.c Wed Jul 3 22:01:52 2013 (r252620) @@ -61,15 +61,15 @@ __FBSDID("$FreeBSD$"); * mask. */ int -if_register_bpf(struct interface_info *info) +if_register_bpf(struct interface_info *info, int flags) { char filename[50]; int sock, b; /* Open a BPF device */ - for (b = 0; 1; b++) { + for (b = 0;; b++) { snprintf(filename, sizeof(filename), BPF_FORMAT, b); - sock = open(filename, O_RDWR, 0); + sock = open(filename, flags); if (sock < 0) { if (errno == EBUSY) continue; @@ -87,16 +87,76 @@ if_register_bpf(struct interface_info *i return (sock); } +/* + * Packet write filter program: + * 'ip and udp and src port bootps and dst port (bootps or bootpc)' + */ +struct bpf_insn dhcp_bpf_wfilter[] = { + BPF_STMT(BPF_LD + BPF_B + BPF_IND, 14), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, (IPVERSION << 4) + 5, 0, 12), + + /* Make sure this is an IP packet... */ + BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_IP, 0, 10), + + /* Make sure it's a UDP packet... */ + BPF_STMT(BPF_LD + BPF_B + BPF_ABS, 23), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 8), + + /* Make sure this isn't a fragment... */ + BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 20), + BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 6, 0), /* patched */ + + /* Get the IP header length... */ + BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14), + + /* Make sure it's from the right port... */ + BPF_STMT(BPF_LD + BPF_H + BPF_IND, 14), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 68, 0, 3), + + /* Make sure it is to the right ports ... */ + BPF_STMT(BPF_LD + BPF_H + BPF_IND, 16), + BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), + + /* If we passed all the tests, ask for the whole packet. */ + BPF_STMT(BPF_RET+BPF_K, (u_int)-1), + + /* Otherwise, drop it. */ + BPF_STMT(BPF_RET+BPF_K, 0), +}; + +int dhcp_bpf_wfilter_len = sizeof(dhcp_bpf_wfilter) / sizeof(struct bpf_insn); + void if_register_send(struct interface_info *info) { + struct bpf_version v; + struct bpf_program p; int sock, on = 1; - /* - * If we're using the bpf API for sending and receiving, we - * don't need to register this interface twice. - */ - info->wfdesc = info->rfdesc; + /* Open a BPF device and hang it on this interface... */ + info->wfdesc = if_register_bpf(info, O_WRONLY); + + /* Make sure the BPF version is in range... */ + if (ioctl(info->wfdesc, BIOCVERSION, &v) < 0) + error("Can't get BPF version: %m"); + + if (v.bv_major != BPF_MAJOR_VERSION || + v.bv_minor < BPF_MINOR_VERSION) + error("Kernel BPF version out of range - recompile dhcpd!"); + + /* Set up the bpf write filter program structure. */ + p.bf_len = dhcp_bpf_wfilter_len; + p.bf_insns = dhcp_bpf_wfilter; + + if (dhcp_bpf_wfilter[7].k == 0x1fff) + dhcp_bpf_wfilter[7].k = htons(IP_MF|IP_OFFMASK); + + if (ioctl(info->wfdesc, BIOCSETWF, &p) < 0) + error("Can't install write filter program: %m"); + + if (ioctl(info->wfdesc, BIOCLOCK, NULL) < 0) + error("Cannot lock bpf"); /* * Use raw socket for unicast send. @@ -144,46 +204,6 @@ struct bpf_insn dhcp_bpf_filter[] = { int dhcp_bpf_filter_len = sizeof(dhcp_bpf_filter) / sizeof(struct bpf_insn); -/* - * Packet write filter program: - * 'ip and udp and src port bootps and dst port (bootps or bootpc)' - */ -struct bpf_insn dhcp_bpf_wfilter[] = { - BPF_STMT(BPF_LD + BPF_B + BPF_IND, 14), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, (IPVERSION << 4) + 5, 0, 12), - - /* Make sure this is an IP packet... */ - BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 12), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_IP, 0, 10), - - /* Make sure it's a UDP packet... */ - BPF_STMT(BPF_LD + BPF_B + BPF_ABS, 23), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 8), - - /* Make sure this isn't a fragment... */ - BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 20), - BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 6, 0), /* patched */ - - /* Get the IP header length... */ - BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 14), - - /* Make sure it's from the right port... */ - BPF_STMT(BPF_LD + BPF_H + BPF_IND, 14), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 68, 0, 3), - - /* Make sure it is to the right ports ... */ - BPF_STMT(BPF_LD + BPF_H + BPF_IND, 16), - BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), - - /* If we passed all the tests, ask for the whole packet. */ - BPF_STMT(BPF_RET+BPF_K, (u_int)-1), - - /* Otherwise, drop it. */ - BPF_STMT(BPF_RET+BPF_K, 0), -}; - -int dhcp_bpf_wfilter_len = sizeof(dhcp_bpf_wfilter) / sizeof(struct bpf_insn); - void if_register_receive(struct interface_info *info) { @@ -192,7 +212,7 @@ if_register_receive(struct interface_inf int flag = 1, sz; /* Open a BPF device and hang it on this interface... */ - info->rfdesc = if_register_bpf(info); + info->rfdesc = if_register_bpf(info, O_RDONLY); /* Make sure the BPF version is in range... */ if (ioctl(info->rfdesc, BIOCVERSION, &v) < 0) @@ -235,16 +255,6 @@ if_register_receive(struct interface_inf if (ioctl(info->rfdesc, BIOCSETF, &p) < 0) error("Can't install packet filter program: %m"); - /* Set up the bpf write filter program structure. */ - p.bf_len = dhcp_bpf_wfilter_len; - p.bf_insns = dhcp_bpf_wfilter; - - if (dhcp_bpf_wfilter[7].k == 0x1fff) - dhcp_bpf_wfilter[7].k = htons(IP_MF|IP_OFFMASK); - - if (ioctl(info->rfdesc, BIOCSETWF, &p) < 0) - error("Can't install write filter program: %m"); - if (ioctl(info->rfdesc, BIOCLOCK, NULL) < 0) error("Cannot lock bpf"); } Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 21:58:26 2013 (r252619) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 22:01:52 2013 (r252620) @@ -297,7 +297,7 @@ struct hash_table *new_hash_table(int); struct hash_bucket *new_hash_bucket(void); /* bpf.c */ -int if_register_bpf(struct interface_info *); +int if_register_bpf(struct interface_info *, int); void if_register_send(struct interface_info *); void if_register_receive(struct interface_info *); void send_packet(struct interface_info *, struct dhcp_packet *, size_t, From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:03:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A627B2FD; Wed, 3 Jul 2013 22:03:19 +0000 (UTC) (envelope-from pjd@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 886811B30; Wed, 3 Jul 2013 22:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M3Jp4034419; Wed, 3 Jul 2013 22:03:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M3J5a034418; Wed, 3 Jul 2013 22:03:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032203.r63M3J5a034418@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252621 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:03:19 -0000 Author: pjd Date: Wed Jul 3 22:03:19 2013 New Revision: 252621 URL: http://svnweb.freebsd.org/changeset/base/252621 Log: Remove redundant white-spaces. Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:01:52 2013 (r252620) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:03:19 2013 (r252621) @@ -1523,7 +1523,7 @@ make_discover(struct interface_info *ip, ip->client->config->send_options[i].len; options[i]->timeout = 0xFFFFFFFF; } - + /* send host name if not set via config file. */ char hostname[_POSIX_HOST_NAME_MAX+1]; if (!options[DHO_HOST_NAME]) { @@ -1548,7 +1548,7 @@ make_discover(struct interface_info *ip, int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? ip->hw_address.hlen : sizeof(client_ident)-1; client_ident[0] = ip->hw_address.htype; - memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); + memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); options[DHO_DHCP_CLIENT_IDENTIFIER] = &option_elements[DHO_DHCP_CLIENT_IDENTIFIER]; options[DHO_DHCP_CLIENT_IDENTIFIER]->value = client_ident; options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen+1; @@ -1647,7 +1647,7 @@ make_request(struct interface_info *ip, ip->client->config->send_options[i].len; options[i]->timeout = 0xFFFFFFFF; } - + /* send host name if not set via config file. */ char hostname[_POSIX_HOST_NAME_MAX+1]; if (!options[DHO_HOST_NAME]) { @@ -1672,7 +1672,7 @@ make_request(struct interface_info *ip, int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? ip->hw_address.hlen : sizeof(client_ident)-1; client_ident[0] = ip->hw_address.htype; - memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); + memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); options[DHO_DHCP_CLIENT_IDENTIFIER] = &option_elements[DHO_DHCP_CLIENT_IDENTIFIER]; options[DHO_DHCP_CLIENT_IDENTIFIER]->value = client_ident; options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen+1; @@ -2489,19 +2489,19 @@ check_classless_option(unsigned char *da i += 4; continue; } else if (width < 9) { - addr = (in_addr_t)(data[i] << 24); + addr = (in_addr_t)(data[i] << 24); i += 1; } else if (width < 17) { - addr = (in_addr_t)(data[i] << 24) + + addr = (in_addr_t)(data[i] << 24) + (in_addr_t)(data[i + 1] << 16); i += 2; } else if (width < 25) { - addr = (in_addr_t)(data[i] << 24) + + addr = (in_addr_t)(data[i] << 24) + (in_addr_t)(data[i + 1] << 16) + (in_addr_t)(data[i + 2] << 8); i += 3; } else if (width < 33) { - addr = (in_addr_t)(data[i] << 24) + + addr = (in_addr_t)(data[i] << 24) + (in_addr_t)(data[i + 1] << 16) + (in_addr_t)(data[i + 2] << 8) + data[i + 3]; @@ -2525,7 +2525,7 @@ check_classless_option(unsigned char *da addr &= mask; data[i - 1] = (unsigned char)( (addr >> (((32 - width)/8)*8)) & 0xFF); - } + } i += 4; } if (i > len) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:04:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C119A45C; Wed, 3 Jul 2013 22:04:35 +0000 (UTC) (envelope-from jilles@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 B27251B3A; Wed, 3 Jul 2013 22:04:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M4ZAw034657; Wed, 3 Jul 2013 22:04:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M4ZNk034656; Wed, 3 Jul 2013 22:04:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032204.r63M4ZNk034656@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 22:04: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: r252622 - stable/9/lib/libc/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:04:35 -0000 Author: jilles Date: Wed Jul 3 22:04:35 2013 New Revision: 252622 URL: http://svnweb.freebsd.org/changeset/base/252622 Log: MFC r248774: accept(2): Mention inheritance of O_ASYNC and signal destination. While almost nobody uses O_ASYNC, and rightly so, the inheritance of the related properties across accept() is a portability issue like the inheritance of O_NONBLOCK. Modified: stable/9/lib/libc/sys/accept.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/accept.2 ============================================================================== --- stable/9/lib/libc/sys/accept.2 Wed Jul 3 22:03:19 2013 (r252621) +++ stable/9/lib/libc/sys/accept.2 Wed Jul 3 22:04:35 2013 (r252622) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd March 26, 2013 .Dt ACCEPT 2 .Os .Sh NAME @@ -57,7 +57,13 @@ queue of pending connections, creates a and allocates a new file descriptor for the socket which inherits the state of the .Dv O_NONBLOCK -property from the original socket +and +.Dv O_ASYNC +properties and the destination of +.Dv SIGIO +and +.Dv SIGURG +signals from the original socket .Fa s . .Pp If no pending connections are @@ -129,7 +135,11 @@ to pre-process incoming connections. .Pp Portable programs should not rely on the .Dv O_NONBLOCK -property being inherited. +and +.Dv O_ASYNC +properties and the signal destination being inherited, +but should set them explicitly using +.Xr fcntl 2 . .Sh RETURN VALUES The call returns \-1 on error. If it succeeds, it returns a non-negative From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:05:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8143A5B6; Wed, 3 Jul 2013 22:05:37 +0000 (UTC) (envelope-from pjd@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 738A31B4D; Wed, 3 Jul 2013 22:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M5bsE034892; Wed, 3 Jul 2013 22:05:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M5biV034891; Wed, 3 Jul 2013 22:05:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032205.r63M5biV034891@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252623 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:05:37 -0000 Author: pjd Date: Wed Jul 3 22:05:36 2013 New Revision: 252623 URL: http://svnweb.freebsd.org/changeset/base/252623 Log: MFp4 @229477: The gethostname(3) function won't work in capability mode, because reading kern.hostname sysctl is not permitted there. Cache hostname early and use cached value later. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:04:35 2013 (r252622) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:05:36 2013 (r252623) @@ -91,6 +91,8 @@ int log_perror = 1; int privfd; int nullfd = -1; +char hostname[_POSIX_HOST_NAME_MAX + 1]; + struct iaddr iaddr_broadcast = { 4, { 255, 255, 255, 255 } }; struct in_addr inaddr_any, inaddr_broadcast; @@ -446,6 +448,13 @@ main(int argc, char *argv[]) error("no such user: nobody"); } + /* + * Obtain hostname before entering capability mode - it won't be + * possible then, as reading kern.hostname is not permitted. + */ + if (gethostname(hostname, sizeof(hostname)) < 0) + hostname[0] = '\0'; + if (pipe(pipe_fd) == -1) error("pipe"); @@ -1525,9 +1534,8 @@ make_discover(struct interface_info *ip, } /* send host name if not set via config file. */ - char hostname[_POSIX_HOST_NAME_MAX+1]; if (!options[DHO_HOST_NAME]) { - if (gethostname(hostname, sizeof(hostname)) == 0) { + if (hostname[0] != '\0') { size_t len; char* posDot = strchr(hostname, '.'); if (posDot != NULL) @@ -1649,9 +1657,8 @@ make_request(struct interface_info *ip, } /* send host name if not set via config file. */ - char hostname[_POSIX_HOST_NAME_MAX+1]; if (!options[DHO_HOST_NAME]) { - if (gethostname(hostname, sizeof(hostname)) == 0) { + if (hostname[0] != '\0') { size_t len; char* posDot = strchr(hostname, '.'); if (posDot != NULL) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:07:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE985707; Wed, 3 Jul 2013 22:07:55 +0000 (UTC) (envelope-from pjd@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 B162B1B6A; Wed, 3 Jul 2013 22:07:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M7tmB035313; Wed, 3 Jul 2013 22:07:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M7tvh035312; Wed, 3 Jul 2013 22:07:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032207.r63M7tvh035312@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252624 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:07:55 -0000 Author: pjd Date: Wed Jul 3 22:07:55 2013 New Revision: 252624 URL: http://svnweb.freebsd.org/changeset/base/252624 Log: MFp4 @229479: - Add new request (IMSG_SEND_PACKET) that will be handled by privileged process. - Add $FreeBSD$. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/privsep.h Modified: head/sbin/dhclient/privsep.h ============================================================================== --- head/sbin/dhclient/privsep.h Wed Jul 3 22:05:36 2013 (r252623) +++ head/sbin/dhclient/privsep.h Wed Jul 3 22:07:55 2013 (r252624) @@ -14,6 +14,8 @@ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE, ABUSE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ */ #include @@ -33,7 +35,8 @@ enum imsg_code { IMSG_SCRIPT_INIT, IMSG_SCRIPT_WRITE_PARAMS, IMSG_SCRIPT_GO, - IMSG_SCRIPT_GO_RET + IMSG_SCRIPT_GO_RET, + IMSG_SEND_PACKET }; struct imsg_hdr { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:09:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97075847; Wed, 3 Jul 2013 22:09:02 +0000 (UTC) (envelope-from pjd@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 89F751B7B; Wed, 3 Jul 2013 22:09:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M92t3035527; Wed, 3 Jul 2013 22:09:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M924w035526; Wed, 3 Jul 2013 22:09:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032209.r63M924w035526@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252625 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:09:02 -0000 Author: pjd Date: Wed Jul 3 22:09:02 2013 New Revision: 252625 URL: http://svnweb.freebsd.org/changeset/base/252625 Log: MFp4 @229480: Shutdown write direction of the routing socket. We only need to read from it. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:07:55 2013 (r252624) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:09:02 2013 (r252625) @@ -476,6 +476,8 @@ main(int argc, char *argv[]) if ((routefd = socket(PF_ROUTE, SOCK_RAW, 0)) != -1) add_protocol("AF_ROUTE", routefd, routehandler, ifi); + if (shutdown(routefd, SHUT_WR) < 0) + error("can't shutdown route socket: %m"); /* set up the interface */ discover_interfaces(ifi); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:12:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B49D19A0; Wed, 3 Jul 2013 22:12:55 +0000 (UTC) (envelope-from pjd@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 A6BCE1B99; Wed, 3 Jul 2013 22:12:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MCtxj037879; Wed, 3 Jul 2013 22:12:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MCsdV037875; Wed, 3 Jul 2013 22:12:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032212.r63MCsdV037875@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252626 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:12:55 -0000 Author: pjd Date: Wed Jul 3 22:12:54 2013 New Revision: 252626 URL: http://svnweb.freebsd.org/changeset/base/252626 Log: MFp4 @229481: Currently it was allowed to send any UDP packets from unprivileged process and possibly any packets because /dev/bpf was open for writing. Move sending packets to privileged process. Unprivileged process has no longer access to not connected UDP socket and has only access to /dev/bpf in read-only mode. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h head/sbin/dhclient/privsep.c Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 22:09:02 2013 (r252625) +++ head/sbin/dhclient/bpf.c Wed Jul 3 22:12:54 2013 (r252626) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "dhcpd.h" +#include "privsep.h" #include #include @@ -260,23 +261,67 @@ if_register_receive(struct interface_inf } void -send_packet(struct interface_info *interface, struct dhcp_packet *raw, - size_t len, struct in_addr from, struct in_addr to) +send_packet_unpriv(int privfd, struct dhcp_packet *raw, size_t len, + struct in_addr from, struct in_addr to) +{ + struct imsg_hdr hdr; + struct buf *buf; + int errs; + + hdr.code = IMSG_SEND_PACKET; + hdr.len = sizeof(hdr) + + sizeof(size_t) + len + + sizeof(from) + sizeof(to); + + if ((buf = buf_open(hdr.len)) == NULL) + error("buf_open: %m"); + + errs = 0; + errs += buf_add(buf, &hdr, sizeof(hdr)); + errs += buf_add(buf, &len, sizeof(len)); + errs += buf_add(buf, raw, len); + errs += buf_add(buf, &from, sizeof(from)); + errs += buf_add(buf, &to, sizeof(to)); + if (errs) + error("buf_add: %m"); + + if (buf_close(privfd, buf) == -1) + error("buf_close: %m"); +} + +void +send_packet_priv(struct interface_info *interface, struct imsg_hdr *hdr, int fd) { unsigned char buf[256]; struct iovec iov[2]; struct msghdr msg; + struct dhcp_packet raw; + size_t len; + struct in_addr from, to; int result, bufp = 0; + if (hdr->len < sizeof(*hdr) + sizeof(size_t)) + error("corrupted message received"); + buf_read(fd, &len, sizeof(len)); + if (hdr->len != sizeof(*hdr) + sizeof(size_t) + len + + sizeof(from) + sizeof(to)) { + error("corrupted message received"); + } + if (len > sizeof(raw)) + error("corrupted message received"); + buf_read(fd, &raw, len); + buf_read(fd, &from, sizeof(from)); + buf_read(fd, &to, sizeof(to)); + /* Assemble the headers... */ if (to.s_addr == INADDR_BROADCAST) assemble_hw_header(interface, buf, &bufp); assemble_udp_ip_header(buf, &bufp, from.s_addr, to.s_addr, - htons(REMOTE_PORT), (unsigned char *)raw, len); + htons(REMOTE_PORT), (unsigned char *)&raw, len); iov[0].iov_base = buf; iov[0].iov_len = bufp; - iov[1].iov_base = raw; + iov[1].iov_base = &raw; iov[1].iov_len = len; /* Fire it off */ Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:09:02 2013 (r252625) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:12:54 2013 (r252626) @@ -455,11 +455,19 @@ main(int argc, char *argv[]) if (gethostname(hostname, sizeof(hostname)) < 0) hostname[0] = '\0'; + /* set up the interface */ + discover_interfaces(ifi); + if (pipe(pipe_fd) == -1) error("pipe"); fork_privchld(pipe_fd[0], pipe_fd[1]); + close(ifi->ufdesc); + ifi->ufdesc = -1; + close(ifi->wfdesc); + ifi->wfdesc = -1; + close(pipe_fd[0]); privfd = pipe_fd[1]; @@ -479,9 +487,6 @@ main(int argc, char *argv[]) if (shutdown(routefd, SHUT_WR) < 0) error("can't shutdown route socket: %m"); - /* set up the interface */ - discover_interfaces(ifi); - if (chroot(_PATH_VAREMPTY) == -1) error("chroot"); if (chdir("/") == -1) @@ -1236,8 +1241,8 @@ again: (int)ip->client->interval); /* Send out a packet. */ - send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, inaddr_broadcast); + send_packet_unpriv(privfd, &ip->client->packet, + ip->client->packet_length, inaddr_any, inaddr_broadcast); add_timeout(cur_time + ip->client->interval, send_discover, ip); } @@ -1461,8 +1466,8 @@ cancel: REMOTE_PORT); /* Send out a packet. */ - send_packet(ip, &ip->client->packet, ip->client->packet_length, - from, to); + send_packet_unpriv(privfd, &ip->client->packet, + ip->client->packet_length, from, to); add_timeout(cur_time + ip->client->interval, send_request, ip); } @@ -1476,8 +1481,8 @@ send_decline(void *ipp) inet_ntoa(inaddr_broadcast), REMOTE_PORT); /* Send out a packet. */ - send_packet(ip, &ip->client->packet, ip->client->packet_length, - inaddr_any, inaddr_broadcast); + send_packet_unpriv(privfd, &ip->client->packet, + ip->client->packet_length, inaddr_any, inaddr_broadcast); } void @@ -2698,6 +2703,8 @@ fork_privchld(int fd, int fd2) dup2(nullfd, STDERR_FILENO); close(nullfd); close(fd2); + close(ifi->rfdesc); + ifi->rfdesc = -1; for (;;) { pfd[0].fd = fd; @@ -2709,6 +2716,6 @@ fork_privchld(int fd, int fd2) if (nfds == 0 || !(pfd[0].revents & POLLIN)) continue; - dispatch_imsg(fd); + dispatch_imsg(ifi, fd); } } Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Jul 3 22:09:02 2013 (r252625) +++ head/sbin/dhclient/dhcpd.h Wed Jul 3 22:12:54 2013 (r252626) @@ -300,8 +300,10 @@ struct hash_bucket *new_hash_bucket(void int if_register_bpf(struct interface_info *, int); void if_register_send(struct interface_info *); void if_register_receive(struct interface_info *); -void send_packet(struct interface_info *, struct dhcp_packet *, size_t, - struct in_addr, struct in_addr); +void send_packet_unpriv(int, struct dhcp_packet *, size_t, struct in_addr, + struct in_addr); +struct imsg_hdr; +void send_packet_priv(struct interface_info *, struct imsg_hdr *, int); ssize_t receive_packet(struct interface_info *, unsigned char *, size_t, struct sockaddr_in *, struct hardware *); @@ -435,4 +437,4 @@ struct buf *buf_open(size_t); int buf_add(struct buf *, void *, size_t); int buf_close(int, struct buf *); ssize_t buf_read(int, void *, size_t); -void dispatch_imsg(int); +void dispatch_imsg(struct interface_info *, int); Modified: head/sbin/dhclient/privsep.c ============================================================================== --- head/sbin/dhclient/privsep.c Wed Jul 3 22:09:02 2013 (r252625) +++ head/sbin/dhclient/privsep.c Wed Jul 3 22:12:54 2013 (r252626) @@ -101,7 +101,7 @@ buf_read(int sock, void *buf, size_t nby } void -dispatch_imsg(int fd) +dispatch_imsg(struct interface_info *ifi, int fd) { struct imsg_hdr hdr; char *medium, *reason, *filename, @@ -232,6 +232,9 @@ dispatch_imsg(int fd) if (buf_close(fd, buf) == -1) error("buf_close: %m"); break; + case IMSG_SEND_PACKET: + send_packet_priv(ifi, &hdr, fd); + break; default: error("received unknown message, code %d", hdr.code); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:14:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79E9EAEA; Wed, 3 Jul 2013 22:14:13 +0000 (UTC) (envelope-from jilles@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 6BDF91BA5; Wed, 3 Jul 2013 22:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MEDQ3038133; Wed, 3 Jul 2013 22:14:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MEDtA038132; Wed, 3 Jul 2013 22:14:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032214.r63MEDtA038132@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 22:14:13 +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: r252627 - stable/9/lib/libc/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:14:13 -0000 Author: jilles Date: Wed Jul 3 22:14:12 2013 New Revision: 252627 URL: http://svnweb.freebsd.org/changeset/base/252627 Log: MFC r251181: fork(2): #include is not needed. Modified: stable/9/lib/libc/sys/fork.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/fork.2 ============================================================================== --- stable/9/lib/libc/sys/fork.2 Wed Jul 3 22:12:54 2013 (r252626) +++ stable/9/lib/libc/sys/fork.2 Wed Jul 3 22:14:12 2013 (r252627) @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 31, 2013 .Dt FORK 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft pid_t .Fn fork void From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:16:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B5E0C2E; Wed, 3 Jul 2013 22:16:03 +0000 (UTC) (envelope-from pjd@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 0DDEB1BB6; Wed, 3 Jul 2013 22:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MG2ii038435; Wed, 3 Jul 2013 22:16:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MG24I038434; Wed, 3 Jul 2013 22:16:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032216.r63MG24I038434@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252628 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:16:03 -0000 Author: pjd Date: Wed Jul 3 22:16:02 2013 New Revision: 252628 URL: http://svnweb.freebsd.org/changeset/base/252628 Log: MFp4 @229482: - Limit bpf descriptor in unprivileged process to CAP_POLL_EVENT, CAP_READ and allow for SIOCGIFFLAGS, SIOCGIFMEDIA ioctls. - While here limit bpf descriptor in privileged process to only CAP_WRITE. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/bpf.c Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Wed Jul 3 22:14:12 2013 (r252627) +++ head/sbin/dhclient/bpf.c Wed Jul 3 22:16:02 2013 (r252628) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "dhcpd.h" #include "privsep.h" +#include #include #include @@ -159,6 +160,9 @@ if_register_send(struct interface_info * if (ioctl(info->wfdesc, BIOCLOCK, NULL) < 0) error("Cannot lock bpf"); + if (cap_rights_limit(info->wfdesc, CAP_WRITE) < 0 && errno != ENOSYS) + error("Can't limit bpf descriptor: %m"); + /* * Use raw socket for unicast send. */ @@ -208,6 +212,7 @@ int dhcp_bpf_filter_len = sizeof(dhcp_bp void if_register_receive(struct interface_info *info) { + static const unsigned long cmds[2] = { SIOCGIFFLAGS, SIOCGIFMEDIA }; struct bpf_version v; struct bpf_program p; int flag = 1, sz; @@ -258,6 +263,13 @@ if_register_receive(struct interface_inf if (ioctl(info->rfdesc, BIOCLOCK, NULL) < 0) error("Cannot lock bpf"); + + if (cap_rights_limit(info->rfdesc, + CAP_IOCTL | CAP_POLL_EVENT | CAP_READ) < 0 && errno != ENOSYS) { + error("Can't limit bpf descriptor: %m"); + } + if (cap_ioctls_limit(info->rfdesc, cmds, 2) < 0 && errno != ENOSYS) + error("Can't limit ioctls for bpf descriptor: %m"); } void From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:17:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63B85D66; Wed, 3 Jul 2013 22:17:30 +0000 (UTC) (envelope-from pjd@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 5643C1BBC; Wed, 3 Jul 2013 22:17:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MHU5r038694; Wed, 3 Jul 2013 22:17:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MHU6O038693; Wed, 3 Jul 2013 22:17:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032217.r63MHU6O038693@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252629 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:17:30 -0000 Author: pjd Date: Wed Jul 3 22:17:29 2013 New Revision: 252629 URL: http://svnweb.freebsd.org/changeset/base/252629 Log: MFp4 @229483: Limit communication pipe with privileged process to CAP_READ and CAP_WRITE. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:16:02 2013 (r252628) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:17:29 2013 (r252629) @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); #include "dhcpd.h" #include "privsep.h" +#include + #include #ifndef _PATH_VAREMPTY @@ -470,6 +472,10 @@ main(int argc, char *argv[]) close(pipe_fd[0]); privfd = pipe_fd[1]; + if (cap_rights_limit(privfd, CAP_READ | CAP_WRITE) < 0 && + errno != ENOSYS) { + error("can't limit private descriptor: %m"); + } if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1) error("can't open and lock %s: %m", path_dhclient_db); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:18:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A692DEA8; Wed, 3 Jul 2013 22:18:40 +0000 (UTC) (envelope-from pjd@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 9880E1BC8; Wed, 3 Jul 2013 22:18:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MIee8038883; Wed, 3 Jul 2013 22:18:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MIe2q038882; Wed, 3 Jul 2013 22:18:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032218.r63MIe2q038882@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252630 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:18:40 -0000 Author: pjd Date: Wed Jul 3 22:18:40 2013 New Revision: 252630 URL: http://svnweb.freebsd.org/changeset/base/252630 Log: MFp4 @229484: Limit routing socket so only poll(2) and read(2) are allowed (CAP_POLL_EVENT and CAP_READ). This prevents unprivileged process from adding, removing or modifying system routes. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:17:29 2013 (r252629) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:18:40 2013 (r252630) @@ -492,6 +492,10 @@ main(int argc, char *argv[]) add_protocol("AF_ROUTE", routefd, routehandler, ifi); if (shutdown(routefd, SHUT_WR) < 0) error("can't shutdown route socket: %m"); + if (cap_rights_limit(routefd, CAP_POLL_EVENT | CAP_READ) < 0 && + errno != ENOSYS) { + error("can't limit route socket: %m"); + } if (chroot(_PATH_VAREMPTY) == -1) error("chroot"); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:19:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB0E5FEE; Wed, 3 Jul 2013 22:19:43 +0000 (UTC) (envelope-from pjd@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 CC5491BD4; Wed, 3 Jul 2013 22:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MJhef039034; Wed, 3 Jul 2013 22:19:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MJhQh039033; Wed, 3 Jul 2013 22:19:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032219.r63MJhQh039033@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252631 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:19:43 -0000 Author: pjd Date: Wed Jul 3 22:19:43 2013 New Revision: 252631 URL: http://svnweb.freebsd.org/changeset/base/252631 Log: MFp4 @229485: Only allow to overwrite lease file. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:18:40 2013 (r252630) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:19:43 2013 (r252631) @@ -1842,6 +1842,11 @@ rewrite_client_leases(void) leaseFile = fopen(path_dhclient_db, "w"); if (!leaseFile) error("can't create %s: %m", path_dhclient_db); + if (cap_rights_limit(fileno(leaseFile), CAP_FSTAT | CAP_FSYNC | + CAP_FTRUNCATE | CAP_SEEK | CAP_WRITE) < 0 && + errno != ENOSYS) { + error("can't limit lease descriptor: %m"); + } } else { fflush(leaseFile); rewind(leaseFile); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:21:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C44021F; Wed, 3 Jul 2013 22:21:12 +0000 (UTC) (envelope-from pjd@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 2EB1D1BE2; Wed, 3 Jul 2013 22:21:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MLCaI040869; Wed, 3 Jul 2013 22:21:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MLCFX040868; Wed, 3 Jul 2013 22:21:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032221.r63MLCFX040868@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252632 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:21:12 -0000 Author: pjd Date: Wed Jul 3 22:21:11 2013 New Revision: 252632 URL: http://svnweb.freebsd.org/changeset/base/252632 Log: MFp4 @229486: Once PID is written to the pidfile, revoke all capability rights. We just want to keep the pidfile open. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:19:43 2013 (r252631) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:21:11 2013 (r252632) @@ -2363,8 +2363,13 @@ go_daemon(void) if (daemon(1, 0) == -1) error("daemon"); - if (pidfile != NULL) + if (pidfile != NULL) { pidfile_write(pidfile); + if (cap_rights_limit(pidfile_fileno(pidfile), CAP_NONE) < 0 && + errno != ENOSYS) { + error("can't limit pidfile descriptor: %m"); + } + } /* we are chrooted, daemon(3) fails to open /dev/null */ if (nullfd != -1) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:22:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15C00370; Wed, 3 Jul 2013 22:22:30 +0000 (UTC) (envelope-from pjd@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 08C4D1BF3; Wed, 3 Jul 2013 22:22:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MMT27041094; Wed, 3 Jul 2013 22:22:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MMT8p041093; Wed, 3 Jul 2013 22:22:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032222.r63MMT8p041093@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252633 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:22:30 -0000 Author: pjd Date: Wed Jul 3 22:22:29 2013 New Revision: 252633 URL: http://svnweb.freebsd.org/changeset/base/252633 Log: MFp4 @229487: Revoke all capability rights from STDIN and allow only for write to STDOUT and STDERR. All those descriptors are redirected to /dev/null. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:21:11 2013 (r252632) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:22:29 2013 (r252633) @@ -2379,6 +2379,13 @@ go_daemon(void) close(nullfd); nullfd = -1; } + + if (cap_rights_limit(STDIN_FILENO, CAP_NONE) < 0 && errno != ENOSYS) + error("can't limit stdin: %m"); + if (cap_rights_limit(STDOUT_FILENO, CAP_WRITE) < 0 && errno != ENOSYS) + error("can't limit stdout: %m"); + if (cap_rights_limit(STDERR_FILENO, CAP_WRITE) < 0 && errno != ENOSYS) + error("can't limit stderr: %m"); } int From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:23:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9815F4A9; Wed, 3 Jul 2013 22:23:25 +0000 (UTC) (envelope-from pjd@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 8B26D1BFD; Wed, 3 Jul 2013 22:23:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MNPKa041243; Wed, 3 Jul 2013 22:23:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MNP5G041242; Wed, 3 Jul 2013 22:23:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307032223.r63MNP5G041242@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 3 Jul 2013 22:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252634 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:23:25 -0000 Author: pjd Date: Wed Jul 3 22:23:25 2013 New Revision: 252634 URL: http://svnweb.freebsd.org/changeset/base/252634 Log: MFp4 @229488: Sandbox unprivileged process using capability mode. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 3 22:22:29 2013 (r252633) +++ head/sbin/dhclient/dhclient.c Wed Jul 3 22:23:25 2013 (r252634) @@ -511,6 +511,9 @@ main(int argc, char *argv[]) setproctitle("%s", ifi->name); + if (cap_enter() < 0 && errno != ENOSYS) + error("can't enter capability mode: %m"); + if (immediate_daemon) go_daemon(); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:25:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF65860E; Wed, 3 Jul 2013 22:25:00 +0000 (UTC) (envelope-from obrien@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 C1E8D1C0A; Wed, 3 Jul 2013 22:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MP0xO041479; Wed, 3 Jul 2013 22:25:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MP07w041478; Wed, 3 Jul 2013 22:25:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032225.r63MP07w041478@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:25: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: r252635 - stable/9/usr.sbin/pkg_install/lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:25:00 -0000 Author: obrien Date: Wed Jul 3 22:25:00 2013 New Revision: 252635 URL: http://svnweb.freebsd.org/changeset/base/252635 Log: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/9/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/pkg_install/ (props changed) Modified: stable/9/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:23:25 2013 (r252634) +++ stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:25:00 2013 (r252635) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:44:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C10FB99; Wed, 3 Jul 2013 22:44:26 +0000 (UTC) (envelope-from obrien@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 8E86D1C9E; Wed, 3 Jul 2013 22:44:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MiQiq047110; Wed, 3 Jul 2013 22:44:26 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MiQS9047109; Wed, 3 Jul 2013 22:44:26 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032244.r63MiQS9047109@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252636 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:44:26 -0000 Author: obrien Date: Wed Jul 3 22:44:26 2013 New Revision: 252636 URL: http://svnweb.freebsd.org/changeset/base/252636 Log: Merge r252512 from src/gnu/usr.bin/patch into src/usr.bin/patch: Make it so that 'patch < FUBAR' and 'patch -i FUBAR' operate the same. The former makes a copy of stdin, but was not accurately putting the content of stdin into a temp file. This lead to the undercounting the number of lines in hunks containing NUL characters when reading from stdin. Thus resulting in "unexpected end of file in patch" errors. Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Wed Jul 3 22:25:00 2013 (r252635) +++ head/usr.bin/patch/pch.c Wed Jul 3 22:44:26 2013 (r252636) @@ -101,13 +101,17 @@ void open_patch_file(const char *filename) { struct stat filestat; + int nr, nw; if (filename == NULL || *filename == '\0' || strEQ(filename, "-")) { pfp = fopen(TMPPATNAME, "w"); if (pfp == NULL) pfatal("can't create %s", TMPPATNAME); - while (fgets(buf, buf_size, stdin) != NULL) - fputs(buf, pfp); + while ((nr = fread(buf, 1, buf_size, stdin)) > 0) { + nw = fwrite(buf, 1, nr, pfp); + if (nr != nw) + pfatal("write error to %s", TMPPATNAME); + } if (ferror(pfp) || fclose(pfp)) pfatal("can't write %s", TMPPATNAME); filename = TMPPATNAME; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:46:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D460DCF2; Wed, 3 Jul 2013 22:46:30 +0000 (UTC) (envelope-from obrien@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 C7A871CAD; Wed, 3 Jul 2013 22:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MkULm047456; Wed, 3 Jul 2013 22:46:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MkULI047455; Wed, 3 Jul 2013 22:46:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032246.r63MkULI047455@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252637 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:46:30 -0000 Author: obrien Date: Wed Jul 3 22:46:30 2013 New Revision: 252637 URL: http://svnweb.freebsd.org/changeset/base/252637 Log: Merge r252513 from src/gnu/usr.bin/patch into src/usr.bin/patch: Properly handle input lines containing NUL characters such that pgets() accurately fills the read buffer. Callers of pgets() still mis-process the buffer contents if the read line contains NUL characters, but this at least makes pgets() accurate. Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Wed Jul 3 22:44:26 2013 (r252636) +++ head/usr.bin/patch/pch.c Wed Jul 3 22:46:30 2013 (r252637) @@ -1204,7 +1204,7 @@ pgets(bool do_indent) indent++; } } - strncpy(buf, line, len - skipped); + memcpy(buf, line, len - skipped); buf[len - skipped] = '\0'; } return len; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:57:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 782BFD0; Wed, 3 Jul 2013 22:57:21 +0000 (UTC) (envelope-from obrien@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 500081CFE; Wed, 3 Jul 2013 22:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MvLZX050453; Wed, 3 Jul 2013 22:57:21 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MvKhd050450; Wed, 3 Jul 2013 22:57:20 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032257.r63MvKhd050450@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:57: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: r252638 - in stable/9/usr.sbin/pkg_install: add create lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:57:21 -0000 Author: obrien Date: Wed Jul 3 22:57:20 2013 New Revision: 252638 URL: http://svnweb.freebsd.org/changeset/base/252638 Log: Really MFC r252363 (sysconf(3) returns a long, not an int). Modified: stable/9/usr.sbin/pkg_install/add/extract.c stable/9/usr.sbin/pkg_install/create/pl.c stable/9/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/pkg_install/ (props changed) stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:57:20 2013 (r252638) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/9/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/9/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:57:20 2013 (r252638) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/9/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:57:20 2013 (r252638) @@ -64,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 22:59:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87833225; Wed, 3 Jul 2013 22:59:47 +0000 (UTC) (envelope-from obrien@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 5F2991D11; Wed, 3 Jul 2013 22:59:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Mxlsi050781; Wed, 3 Jul 2013 22:59:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MxkdY050778; Wed, 3 Jul 2013 22:59:46 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032259.r63MxkdY050778@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252639 - in stable/8/usr.sbin/pkg_install: add create lib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 22:59:47 -0000 Author: obrien Date: Wed Jul 3 22:59:46 2013 New Revision: 252639 URL: http://svnweb.freebsd.org/changeset/base/252639 Log: MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/8/usr.sbin/pkg_install/add/extract.c stable/8/usr.sbin/pkg_install/create/pl.c stable/8/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/8/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/add/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:59:46 2013 (r252639) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/8/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/8/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:59:46 2013 (r252639) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/8/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:59:46 2013 (r252639) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -64,7 +65,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:03:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 979CC381; Wed, 3 Jul 2013 23:03:29 +0000 (UTC) (envelope-from obrien@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 6EE5A1D21; Wed, 3 Jul 2013 23:03:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63N3TdW053241; Wed, 3 Jul 2013 23:03:29 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63N3SQx053236; Wed, 3 Jul 2013 23:03:28 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032303.r63N3SQx053236@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 23:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r252640 - in stable/7/usr.sbin/pkg_install: add create lib X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:03:29 -0000 Author: obrien Date: Wed Jul 3 23:03:28 2013 New Revision: 252640 URL: http://svnweb.freebsd.org/changeset/base/252640 Log: MF8: r252639 MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/7/usr.sbin/pkg_install/add/extract.c stable/7/usr.sbin/pkg_install/create/pl.c stable/7/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/7/ (props changed) stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) Modified: stable/7/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:03:28 2013 (r252640) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/7/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/7/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:03:28 2013 (r252640) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/7/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:03:28 2013 (r252640) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -63,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:05:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA9974F7; Wed, 3 Jul 2013 23:05:17 +0000 (UTC) (envelope-from neel@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 BD3AC1D3A; Wed, 3 Jul 2013 23:05:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63N5HGQ053605; Wed, 3 Jul 2013 23:05:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63N5Hc0053604; Wed, 3 Jul 2013 23:05:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307032305.r63N5Hc0053604@svn.freebsd.org> From: Neel Natu Date: Wed, 3 Jul 2013 23:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252641 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:05:17 -0000 Author: neel Date: Wed Jul 3 23:05:17 2013 New Revision: 252641 URL: http://svnweb.freebsd.org/changeset/base/252641 Log: Verify that all bytes in the instruction buffer are consumed during decoding. Suggested by: grehan Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jul 3 23:03:28 2013 (r252640) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jul 3 23:05:17 2013 (r252641) @@ -780,6 +780,19 @@ decode_immediate(struct vie *vie) } /* + * Verify that all the bytes in the instruction buffer were consumed. + */ +static int +verify_inst_length(struct vie *vie) +{ + + if (vie->num_processed == vie->num_valid) + return (0); + else + return (-1); +} + +/* * Verify that the 'guest linear address' provided as collateral of the nested * page table fault matches with our instruction decoding. */ @@ -853,6 +866,9 @@ vmm_decode_instruction(struct vm *vm, in if (decode_immediate(vie)) return (-1); + if (verify_inst_length(vie)) + return (-1); + if (verify_gla(vm, cpuid, gla, vie)) return (-1); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:06:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC7A76D4; Wed, 3 Jul 2013 23:06:59 +0000 (UTC) (envelope-from obrien@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 A43F21D4D; Wed, 3 Jul 2013 23:06:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63N6xYw053925; Wed, 3 Jul 2013 23:06:59 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63N6xRZ053920; Wed, 3 Jul 2013 23:06:59 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032306.r63N6xRZ053920@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 23:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r252642 - in stable/6/usr.sbin/pkg_install: add create lib X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:06:59 -0000 Author: obrien Date: Wed Jul 3 23:06:58 2013 New Revision: 252642 URL: http://svnweb.freebsd.org/changeset/base/252642 Log: MF7: r252640 MF8: r252639 MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/6/usr.sbin/pkg_install/add/extract.c stable/6/usr.sbin/pkg_install/create/pl.c stable/6/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/6/ (props changed) stable/6/usr.sbin/pkg_install/ (props changed) Modified: stable/6/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/6/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:06:58 2013 (r252642) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/6/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/6/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:06:58 2013 (r252642) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/6/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/6/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:06:58 2013 (r252642) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -63,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:15:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4047F9C3; Wed, 3 Jul 2013 23:15:31 +0000 (UTC) (envelope-from markj@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 224D61DBB; Wed, 3 Jul 2013 23:15:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NFVik056839; Wed, 3 Jul 2013 23:15:31 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NFU3j056833; Wed, 3 Jul 2013 23:15:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307032315.r63NFU3j056833@svn.freebsd.org> From: Mark Johnston Date: Wed, 3 Jul 2013 23:15: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: r252643 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:15:31 -0000 Author: markj Date: Wed Jul 3 23:15:30 2013 New Revision: 252643 URL: http://svnweb.freebsd.org/changeset/base/252643 Log: MFC r242726 (ambrisko): Add support for SCSI pass through devices to be attached and detached. MFC r251172 (sbruno): xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. Modified: stable/9/sys/dev/mfi/mfi.c stable/9/sys/dev/mfi/mfi_cam.c stable/9/sys/dev/mfi/mfivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfi.c Wed Jul 3 23:15:30 2013 (r252643) @@ -1628,6 +1628,11 @@ mfi_decode_evt(struct mfi_softc *sc, str sx_xunlock(&sc->mfi_config_lock); } } + if (sc->mfi_cam_rescan_cb != NULL && + (detail->code == MR_EVT_PD_INSERTED || + detail->code == MR_EVT_PD_REMOVED)) { + sc->mfi_cam_rescan_cb(sc, detail->args.pd.device_id); + } break; } } Modified: stable/9/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:15:30 2013 (r252643) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -63,12 +65,19 @@ __FBSDID("$FreeBSD$"); #include #include +enum mfip_state { + MFIP_STATE_NONE, + MFIP_STATE_DETACH, + MFIP_STATE_RESCAN +}; + struct mfip_softc { device_t dev; struct mfi_softc *mfi_sc; struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + enum mfip_state state; }; static int mfip_probe(device_t); @@ -76,6 +85,7 @@ static int mfip_attach(device_t); static int mfip_detach(device_t); static void mfip_cam_action(struct cam_sim *, union ccb *); static void mfip_cam_poll(struct cam_sim *); +static void mfip_cam_rescan(struct mfi_softc *, uint32_t tid); static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); @@ -122,6 +132,7 @@ mfip_attach(device_t dev) mfisc = device_get_softc(device_get_parent(dev)); sc->dev = dev; + sc->state = MFIP_STATE_NONE; sc->mfi_sc = mfisc; mfisc->mfi_cam_start = mfip_start; @@ -138,6 +149,8 @@ mfip_attach(device_t dev) return (EINVAL); } + mfisc->mfi_cam_rescan_cb = mfip_cam_rescan; + mtx_lock(&mfisc->mfi_io_lock); if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); @@ -162,6 +175,16 @@ mfip_detach(device_t dev) if (sc == NULL) return (EINVAL); + mtx_lock(&sc->mfi_sc->mfi_io_lock); + if (sc->state == MFIP_STATE_RESCAN) { + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + return (EBUSY); + } + sc->state = MFIP_STATE_DETACH; + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + + sc->mfi_sc->mfi_cam_rescan_cb = NULL; + if (sc->sim != NULL) { mtx_lock(&sc->mfi_sc->mfi_io_lock); xpt_bus_deregister(cam_sim_path(sc->sim)); @@ -261,6 +284,57 @@ mfip_cam_action(struct cam_sim *sim, uni return; } +static void +mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) +{ + union ccb *ccb; + struct mfip_softc *camsc; + struct cam_sim *sim; + device_t mfip_dev; + + mtx_lock(&Giant); + mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1); + mtx_unlock(&Giant); + if (mfip_dev == NULL) { + device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n"); + return; + } + + mtx_lock(&sc->mfi_io_lock); + camsc = device_get_softc(mfip_dev); + if (camsc->state == MFIP_STATE_DETACH) { + mtx_unlock(&sc->mfi_io_lock); + return; + } + camsc->state = MFIP_STATE_RESCAN; + mtx_unlock(&sc->mfi_io_lock); + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->mfi_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); + device_printf(sc->mfi_dev, + "Cannot create path for bus rescan.\n"); + return; + } + mtx_unlock(&sc->mfi_io_lock); + + xpt_rescan(ccb); + + mtx_lock(&sc->mfi_io_lock); + camsc->state = MFIP_STATE_NONE; + mtx_unlock(&sc->mfi_io_lock); +} + static struct mfi_command * mfip_start(void *data) { Modified: stable/9/sys/dev/mfi/mfivar.h ============================================================================== --- stable/9/sys/dev/mfi/mfivar.h Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfivar.h Wed Jul 3 23:15:30 2013 (r252643) @@ -313,6 +313,8 @@ struct mfi_softc { TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; struct mfi_command * (* mfi_cam_start)(void *); + void (*mfi_cam_rescan_cb)(struct mfi_softc *, + uint32_t); struct callout mfi_watchdog_callout; struct mtx mfi_io_lock; struct sx mfi_config_lock; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:16:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A334AFF; Wed, 3 Jul 2013 23:16:34 +0000 (UTC) (envelope-from markj@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 5C7131DC5; Wed, 3 Jul 2013 23:16:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NGYeA057003; Wed, 3 Jul 2013 23:16:34 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NGXux057000; Wed, 3 Jul 2013 23:16:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307032316.r63NGXux057000@svn.freebsd.org> From: Mark Johnston Date: Wed, 3 Jul 2013 23:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252644 - stable/8/sys/dev/mfi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:16:34 -0000 Author: markj Date: Wed Jul 3 23:16:33 2013 New Revision: 252644 URL: http://svnweb.freebsd.org/changeset/base/252644 Log: MFC r242726 (ambrisko): Add support for SCSI pass through devices to be attached and detached. MFC r251172 (sbruno): xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. Modified: stable/8/sys/dev/mfi/mfi.c stable/8/sys/dev/mfi/mfi_cam.c stable/8/sys/dev/mfi/mfivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfi.c Wed Jul 3 23:16:33 2013 (r252644) @@ -1628,6 +1628,11 @@ mfi_decode_evt(struct mfi_softc *sc, str sx_xunlock(&sc->mfi_config_lock); } } + if (sc->mfi_cam_rescan_cb != NULL && + (detail->code == MR_EVT_PD_INSERTED || + detail->code == MR_EVT_PD_REMOVED)) { + sc->mfi_cam_rescan_cb(sc, detail->args.pd.device_id); + } break; } } Modified: stable/8/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:16:33 2013 (r252644) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -66,12 +68,19 @@ __FBSDID("$FreeBSD$"); #include #include +enum mfip_state { + MFIP_STATE_NONE, + MFIP_STATE_DETACH, + MFIP_STATE_RESCAN +}; + struct mfip_softc { device_t dev; struct mfi_softc *mfi_sc; struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + enum mfip_state state; }; static int mfip_probe(device_t); @@ -79,6 +88,7 @@ static int mfip_attach(device_t); static int mfip_detach(device_t); static void mfip_cam_action(struct cam_sim *, union ccb *); static void mfip_cam_poll(struct cam_sim *); +static void mfip_cam_rescan(struct mfi_softc *, uint32_t tid); static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); @@ -125,6 +135,7 @@ mfip_attach(device_t dev) mfisc = device_get_softc(device_get_parent(dev)); sc->dev = dev; + sc->state = MFIP_STATE_NONE; sc->mfi_sc = mfisc; mfisc->mfi_cam_start = mfip_start; @@ -141,6 +152,8 @@ mfip_attach(device_t dev) return (EINVAL); } + mfisc->mfi_cam_rescan_cb = mfip_cam_rescan; + mtx_lock(&mfisc->mfi_io_lock); if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); @@ -165,6 +178,16 @@ mfip_detach(device_t dev) if (sc == NULL) return (EINVAL); + mtx_lock(&sc->mfi_sc->mfi_io_lock); + if (sc->state == MFIP_STATE_RESCAN) { + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + return (EBUSY); + } + sc->state = MFIP_STATE_DETACH; + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + + sc->mfi_sc->mfi_cam_rescan_cb = NULL; + if (sc->sim != NULL) { mtx_lock(&sc->mfi_sc->mfi_io_lock); xpt_bus_deregister(cam_sim_path(sc->sim)); @@ -275,6 +298,57 @@ mfip_cam_action(struct cam_sim *sim, uni return; } +static void +mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) +{ + union ccb *ccb; + struct mfip_softc *camsc; + struct cam_sim *sim; + device_t mfip_dev; + + mtx_lock(&Giant); + mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1); + mtx_unlock(&Giant); + if (mfip_dev == NULL) { + device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n"); + return; + } + + mtx_lock(&sc->mfi_io_lock); + camsc = device_get_softc(mfip_dev); + if (camsc->state == MFIP_STATE_DETACH) { + mtx_unlock(&sc->mfi_io_lock); + return; + } + camsc->state = MFIP_STATE_RESCAN; + mtx_unlock(&sc->mfi_io_lock); + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->mfi_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); + device_printf(sc->mfi_dev, + "Cannot create path for bus rescan.\n"); + return; + } + mtx_unlock(&sc->mfi_io_lock); + + xpt_rescan(ccb); + + mtx_lock(&sc->mfi_io_lock); + camsc->state = MFIP_STATE_NONE; + mtx_unlock(&sc->mfi_io_lock); +} + static struct mfi_command * mfip_start(void *data) { Modified: stable/8/sys/dev/mfi/mfivar.h ============================================================================== --- stable/8/sys/dev/mfi/mfivar.h Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfivar.h Wed Jul 3 23:16:33 2013 (r252644) @@ -313,6 +313,8 @@ struct mfi_softc { TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; struct mfi_command * (* mfi_cam_start)(void *); + void (*mfi_cam_rescan_cb)(struct mfi_softc *, + uint32_t); struct callout mfi_watchdog_callout; struct mtx mfi_io_lock; struct sx mfi_config_lock; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:21:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D7A33EBC; Wed, 3 Jul 2013 23:21:25 +0000 (UTC) (envelope-from neel@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 B11431E08; Wed, 3 Jul 2013 23:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NLP8q059510; Wed, 3 Jul 2013 23:21:25 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NLP3w059509; Wed, 3 Jul 2013 23:21:25 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307032321.r63NLP3w059509@svn.freebsd.org> From: Neel Natu Date: Wed, 3 Jul 2013 23:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252646 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:21:25 -0000 Author: neel Date: Wed Jul 3 23:21:25 2013 New Revision: 252646 URL: http://svnweb.freebsd.org/changeset/base/252646 Log: If a superpage mapping is being removed then we need to ignore the PG_PDE_PAT bit when looking up the vm_page associated with the superpage's physical address. If the caching attribute for the mapping is write combining or write protected then the PG_PDE_PAT bit will be set and thus cause an 'off-by-one' error when looking up the vm_page. Fix this by using the PG_PS_FRAME mask to compute the physical address for a superpage mapping instead of PG_FRAME. This is a theoretical issue at this point since non-writeback attributes are currently used only for fictitious mappings and fictitious mappings are not subject to promotion. Discussed with: alc, kib MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 3 23:19:57 2013 (r252645) +++ head/sys/amd64/amd64/pmap.c Wed Jul 3 23:21:25 2013 (r252646) @@ -4400,6 +4400,7 @@ pmap_remove_pages(pmap_t pmap) int64_t bit; uint64_t inuse, bitmask; int allfree, field, freed, idx; + vm_paddr_t pa; if (pmap != PCPU_GET(curpmap)) { printf("warning: pmap_remove_pages called with non-current pmap\n"); @@ -4429,7 +4430,7 @@ pmap_remove_pages(pmap_t pmap) pte = (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte = &pte[pmap_pte_index(pv->pv_va)]; - tpte = *pte & ~PG_PTE_PAT; + tpte = *pte; } if ((tpte & PG_V) == 0) { panic("bad pte va %lx pte %lx", @@ -4444,8 +4445,13 @@ pmap_remove_pages(pmap_t pmap) continue; } - m = PHYS_TO_VM_PAGE(tpte & PG_FRAME); - KASSERT(m->phys_addr == (tpte & PG_FRAME), + if (tpte & PG_PS) + pa = tpte & PG_PS_FRAME; + else + pa = tpte & PG_FRAME; + + m = PHYS_TO_VM_PAGE(pa); + KASSERT(m->phys_addr == pa, ("vm_page_t %p phys_addr mismatch %016jx %016jx", m, (uintmax_t)m->phys_addr, (uintmax_t)tpte)); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:24:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90D2D170; Wed, 3 Jul 2013 23:24:53 +0000 (UTC) (envelope-from jimharris@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 82D8C1E47; Wed, 3 Jul 2013 23:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NOrpi059989; Wed, 3 Jul 2013 23:24:53 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NOreC059988; Wed, 3 Jul 2013 23:24:53 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032324.r63NOreC059988@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r252647 - stable/7/sys/dev/isci/scil X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:24:53 -0000 Author: jimharris Date: Wed Jul 3 23:24:53 2013 New Revision: 252647 URL: http://svnweb.freebsd.org/changeset/base/252647 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Note: The reasons behind this change do not apply to stable/7. This MFC is to keep the driver consistent across stable branches and current. Sponsored by: Intel Modified: stable/7/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/7/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:21:25 2013 (r252646) +++ stable/7/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:24:53 2013 (r252647) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:27:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02A762B3; Wed, 3 Jul 2013 23:27:04 +0000 (UTC) (envelope-from ache@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 E81F01E5A; Wed, 3 Jul 2013 23:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NR4uT060300; Wed, 3 Jul 2013 23:27:04 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NR4OI060299; Wed, 3 Jul 2013 23:27:04 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201307032327.r63NR4OI060299@svn.freebsd.org> From: "Andrey A. Chernov" Date: Wed, 3 Jul 2013 23:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252648 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:27:05 -0000 Author: ache Date: Wed Jul 3 23:27:04 2013 New Revision: 252648 URL: http://svnweb.freebsd.org/changeset/base/252648 Log: In addition to prev. commit, for repeated rand_r(3) calls don't forget to compensate back at the end incremented at the start internal state. MFC after: 2 weeks Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Wed Jul 3 23:24:53 2013 (r252647) +++ head/lib/libc/stdlib/rand.c Wed Jul 3 23:27:04 2013 (r252648) @@ -90,7 +90,11 @@ rand_r(unsigned int *ctx) #endif int r = do_rand(&val); - *ctx = (unsigned int) val; +#ifdef USE_WEAK_SEEDING + *ctx = (unsigned int)val; +#else + *ctx = (unsigned int)(val - 1); +#endif return (r); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:28:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2E384C5; Wed, 3 Jul 2013 23:28:07 +0000 (UTC) (envelope-from jimharris@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 A4C671E65; Wed, 3 Jul 2013 23:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NS7gm060496; Wed, 3 Jul 2013 23:28:07 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NS7Yu060495; Wed, 3 Jul 2013 23:28:07 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032328.r63NS7Yu060495@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252650 - stable/8/sys/dev/isci/scil X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:28:07 -0000 Author: jimharris Date: Wed Jul 3 23:28:07 2013 New Revision: 252650 URL: http://svnweb.freebsd.org/changeset/base/252650 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Sponsored by: Intel Modified: stable/8/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/isci/ (props changed) Modified: stable/8/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/8/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:27:59 2013 (r252649) +++ stable/8/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:28:07 2013 (r252650) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:29:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60A5960D; Wed, 3 Jul 2013 23:29:41 +0000 (UTC) (envelope-from jimharris@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 517271E75; Wed, 3 Jul 2013 23:29:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NTfrJ060710; Wed, 3 Jul 2013 23:29:41 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NTfZ0060709; Wed, 3 Jul 2013 23:29:41 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032329.r63NTfZ0060709@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:29: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: r252651 - stable/9/sys/dev/isci/scil X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:29:41 -0000 Author: jimharris Date: Wed Jul 3 23:29:40 2013 New Revision: 252651 URL: http://svnweb.freebsd.org/changeset/base/252651 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Sponsored by: Intel Modified: stable/9/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:28:07 2013 (r252650) +++ stable/9/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:29:40 2013 (r252651) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:38:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F40C9830; Wed, 3 Jul 2013 23:38:02 +0000 (UTC) (envelope-from gonzo@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 E6B8F1EBB; Wed, 3 Jul 2013 23:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nc2Ze063407; Wed, 3 Jul 2013 23:38:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nc24U063406; Wed, 3 Jul 2013 23:38:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307032338.r63Nc24U063406@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 3 Jul 2013 23:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252652 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:38:03 -0000 Author: gonzo Date: Wed Jul 3 23:38:02 2013 New Revision: 252652 URL: http://svnweb.freebsd.org/changeset/base/252652 Log: Fix one of INVARIANTS-related UMA panics on ARM Force UMA zone to allocate service structures like slabs using own allocator. uma_debug code performs atomic ops on uma_slab_t fields and safety of this operation is not guaranteed for write-back caches Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Wed Jul 3 23:29:40 2013 (r252651) +++ head/sys/arm/arm/busdma_machdep-v6.c Wed Jul 3 23:38:02 2013 (r252652) @@ -192,14 +192,26 @@ static busdma_bufalloc_t standard_alloca static void busdma_init(void *dummy) { + int uma_flags; + + uma_flags = 0; /* Create a cache of buffers in standard (cacheable) memory. */ standard_allocator = busdma_bufalloc_create("buffer", arm_dcache_align, /* minimum_alignment */ NULL, /* uma_alloc func */ NULL, /* uma_free func */ - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ +#ifdef INVARIANTS + /* + * Force UMA zone to allocate service structures like + * slabs using own allocator. uma_debug code performs + * atomic ops on uma_slab_t fields and safety of this + * operation is not guaranteed for write-back caches + */ + uma_flags = UMA_ZONE_OFFPAGE; +#endif /* * Create a cache of buffers in uncacheable memory, to implement the * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. @@ -208,7 +220,7 @@ busdma_init(void *dummy) arm_dcache_align, /* minimum_alignment */ busdma_bufalloc_alloc_uncacheable, busdma_bufalloc_free_uncacheable, - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ } /* From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:38:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B1CFA00; Wed, 3 Jul 2013 23:38:38 +0000 (UTC) (envelope-from neel@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 8DEEF1ECD; Wed, 3 Jul 2013 23:38:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NccGp063512; Wed, 3 Jul 2013 23:38:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nccgu063509; Wed, 3 Jul 2013 23:38:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201307032338.r63Nccgu063509@svn.freebsd.org> From: Neel Natu Date: Wed, 3 Jul 2013 23:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252653 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:38:38 -0000 Author: neel Date: Wed Jul 3 23:38:37 2013 New Revision: 252653 URL: http://svnweb.freebsd.org/changeset/base/252653 Log: vm_phys_fictitious_reg_range() was losing the 'memattr' because it would be reset by pmap_page_init() right after being initialized in vm_page_initfake(). The statement above is with reference to the amd64 implementation of pmap_page_init(). Fix this by calling 'pmap_page_init()' in 'vm_page_initfake()' before changing the 'memattr'. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jul 3 23:38:02 2013 (r252652) +++ head/sys/vm/vm_page.c Wed Jul 3 23:38:37 2013 (r252653) @@ -645,6 +645,7 @@ vm_page_initfake(vm_page_t m, vm_paddr_t /* Fictitious pages don't use "order" or "pool". */ m->oflags = VPO_BUSY | VPO_UNMANAGED; m->wire_count = 1; + pmap_page_init(m); memattr: pmap_page_set_memattr(m, memattr); } Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Jul 3 23:38:02 2013 (r252652) +++ head/sys/vm/vm_phys.c Wed Jul 3 23:38:37 2013 (r252653) @@ -559,7 +559,6 @@ vm_phys_fictitious_reg_range(vm_paddr_t } for (i = 0; i < page_count; i++) { vm_page_initfake(&fp[i], start + PAGE_SIZE * i, memattr); - pmap_page_init(&fp[i]); fp[i].oflags &= ~(VPO_BUSY | VPO_UNMANAGED); } mtx_lock(&vm_phys_fictitious_reg_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:40:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE626B4A; Wed, 3 Jul 2013 23:40:43 +0000 (UTC) (envelope-from jimharris@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 921AA1ED9; Wed, 3 Jul 2013 23:40:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NehmN063862; Wed, 3 Jul 2013 23:40:43 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nehjw063861; Wed, 3 Jul 2013 23:40:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032340.r63Nehjw063861@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:40:43 +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: r252654 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:40:43 -0000 Author: jimharris Date: Wed Jul 3 23:40:43 2013 New Revision: 252654 URL: http://svnweb.freebsd.org/changeset/base/252654 Log: MFC r252263: Add an open_dev() helper function to be used in the various places where nvmecontrol needs to open a handle to a controller or namespace device node. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:38:37 2013 (r252653) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:40:43 2013 (r252654) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Intel Corporation + * Copyright (C) 2012-2013 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -258,13 +258,42 @@ read_namespace_data(int fd, int nsid, st } } +static int +open_dev(const char *str, int *fd, int show_error, int exit_on_error) +{ + struct stat devstat; + char full_path[64]; + + snprintf(full_path, sizeof(full_path), "/dev/%s", str); + if (stat(full_path, &devstat) != 0) { + if (show_error) + fprintf(stderr, "error\n"); + if (exit_on_error) + exit(EX_NOINPUT); + else + return (EX_NOINPUT); + } + + *fd = open(full_path, O_RDWR); + if (*fd < 0) { + if (show_error) + printf("Could not open %s. errno=%d (%s)\n", full_path, + errno, strerror(errno)); + if (exit_on_error) + exit(EX_NOPERM); + else + return (EX_NOPERM); + } + + return (EX_OK); +} + static void devlist(int argc, char *argv[]) { struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; - struct stat devstat; - char name[64], path[64]; + char name[64]; uint32_t i; int ch, ctrlr, exit_code, fd, found; @@ -283,21 +312,18 @@ devlist(int argc, char *argv[]) while (1) { ctrlr++; sprintf(name, "nvme%d", ctrlr); - sprintf(path, "/dev/%s", name); - - if (stat(path, &devstat) != 0) - break; - found++; + exit_code = open_dev(name, &fd, 0, 0); - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, - errno, strerror(errno)); - exit_code = EX_NOPERM; + if (exit_code == EX_NOINPUT) + break; + else if (exit_code == EX_NOPERM) { + printf("Could not open /dev/%s, errno = %d (%s)\n", + name, errno, strerror(errno)); continue; } + found++; read_controller_data(fd, &cdata); printf("%6s: %s\n", name, cdata.mn); @@ -310,20 +336,20 @@ devlist(int argc, char *argv[]) (long long)ns_get_sector_size(&nsdata) / 1024 / 1024 / 1024); } + + close(fd); } if (found == 0) printf("No NVMe controllers found.\n"); - exit(exit_code); + exit(EX_OK); } static void identify_ctrlr(int argc, char *argv[]) { struct nvme_controller_data cdata; - struct stat devstat; - char path[64]; int ch, fd, hexflag = 0, hexlength; int verboseflag = 0; @@ -340,22 +366,9 @@ identify_ctrlr(int argc, char *argv[]) } } - sprintf(path, "/dev/%s", argv[optind]); - - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + open_dev(argv[optind], &fd, 1, 1); read_controller_data(fd, &cdata); + close(fd); if (hexflag == 1) { if (verboseflag == 1) @@ -380,7 +393,6 @@ static void identify_ns(int argc, char *argv[]) { struct nvme_namespace_data nsdata; - struct stat devstat; char path[64]; char *nsloc; int ch, fd, hexflag = 0, hexlength, nsid; @@ -404,25 +416,18 @@ identify_ns(int argc, char *argv[]) * This is a cleaner check for cases where the correct controller * is specified, but an invalid namespace on that controller. */ - sprintf(path, "/dev/%s", argv[optind]); - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - nsloc = strstr(argv[optind], "ns"); - if (nsloc == NULL) { - printf("Invalid namepsace %s.\n", argv[optind]); - exit(EX_IOERR); - } + open_dev(argv[optind], &fd, 1, 1); + close(fd); /* * Pull the namespace id from the string. +2 skips past the "ns" part - * of the string. + * of the string. Don't search past 10 characters into the string, + * otherwise we know it is malformed. */ - nsid = strtol(nsloc + 2, NULL, 10); - if (nsid == 0 && errno != 0) { + nsloc = strnstr(argv[optind], "ns", 10); + if (nsloc != NULL) + nsid = strtol(nsloc + 2, NULL, 10); + if (nsloc == NULL || (nsid == 0 && errno != 0)) { printf("Invalid namespace ID %s.\n", argv[optind]); exit(EX_IOERR); } @@ -432,22 +437,10 @@ identify_ns(int argc, char *argv[]) * since it is an admin cmd. So the path should only include the * nvmeX part of the nvmeXnsY string. */ - sprintf(path, "/dev/"); - strncat(path, argv[optind], nsloc - argv[optind]); - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); + open_dev(path, &fd, 1, 1); read_namespace_data(fd, nsid, &nsdata); + close(fd); if (hexflag == 1) { if (verboseflag == 1) @@ -480,12 +473,6 @@ identify(int argc, char *argv[]) target = argv[optind]; - /* Specified device node must have "nvme" in it. */ - if (strstr(argv[optind], "nvme") == NULL) { - printf("Invalid device node '%s'.\n", argv[optind]); - exit(EX_IOERR); - } - optreset = 1; optind = 1; @@ -538,14 +525,11 @@ perftest(int argc, char *argv[]) int fd; char ch; char *p; - const char *name; - char path[64]; u_long ioctl_cmd = NVME_IO_TEST; bool nflag, oflag, sflag, tflag; int perthread = 0; nflag = oflag = sflag = tflag = false; - name = NULL; memset(&io_test, 0, sizeof(io_test)); @@ -623,26 +607,18 @@ perftest(int argc, char *argv[]) } } - name = argv[optind]; - - if (!nflag || !oflag || !sflag || !tflag || name == NULL) + if (!nflag || !oflag || !sflag || !tflag || optind >= argc) perftest_usage(); - sprintf(path, "/dev/%s", name); - - fd = open(path, O_RDWR); - if (fd < 0) { - fprintf(stderr, "%s not valid device. errno=%d (%s)\n", path, - errno, strerror(errno)); - perftest_usage(); - } - + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) { fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, strerror(errno)); + close(fd); exit(EX_IOERR); } + close(fd); print_perftest(&io_test, perthread); exit(EX_OK); } @@ -650,9 +626,7 @@ perftest(int argc, char *argv[]) static void reset_ctrlr(int argc, char *argv[]) { - struct stat devstat; - char path[64]; - int ch, fd; + int ch, fd; while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { @@ -661,24 +635,10 @@ reset_ctrlr(int argc, char *argv[]) } } - sprintf(path, "/dev/%s", argv[optind]); - - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { - printf("Reset request to %s failed. errno=%d (%s)\n", path, - errno, strerror(errno)); + printf("Reset request to %s failed. errno=%d (%s)\n", + argv[optind], errno, strerror(errno)); exit(EX_IOERR); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:42:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25BC3C91; Wed, 3 Jul 2013 23:42:13 +0000 (UTC) (envelope-from jimharris@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 F27041EE5; Wed, 3 Jul 2013 23:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NgCLH065671; Wed, 3 Jul 2013 23:42:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NgCEb065669; Wed, 3 Jul 2013 23:42:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032342.r63NgCEb065669@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:42: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: r252655 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:42:13 -0000 Author: jimharris Date: Wed Jul 3 23:42:12 2013 New Revision: 252655 URL: http://svnweb.freebsd.org/changeset/base/252655 Log: MFC r252264: Add separate *_usage() functions for each nvmecontrol command. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:40:43 2013 (r252654) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:42:12 2013 (r252655) @@ -289,6 +289,14 @@ open_dev(const char *str, int *fd, int s } static void +devlist_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + exit(EX_USAGE); +} + +static void devlist(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -302,7 +310,7 @@ devlist(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + devlist_usage(); } } @@ -347,6 +355,14 @@ devlist(int argc, char *argv[]) } static void +identify_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, IDENTIFY_USAGE); + exit(EX_USAGE); +} + +static void identify_ctrlr(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -362,7 +378,7 @@ identify_ctrlr(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -382,7 +398,7 @@ identify_ctrlr(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_controller(&cdata); @@ -407,7 +423,7 @@ identify_ns(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -454,7 +470,7 @@ identify_ns(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_namespace(&nsdata); @@ -467,7 +483,7 @@ identify(int argc, char *argv[]) char *target; if (argc < 2) - usage(); + identify_usage(); while (getopt(argc, argv, "vx") != -1) ; @@ -624,6 +640,14 @@ perftest(int argc, char *argv[]) } static void +reset_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, RESET_USAGE); + exit(EX_USAGE); +} + +static void reset_ctrlr(int argc, char *argv[]) { int ch, fd; @@ -631,7 +655,7 @@ reset_ctrlr(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + reset_usage(); } } From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:45:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3211DE4; Wed, 3 Jul 2013 23:45:59 +0000 (UTC) (envelope-from jimharris@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 A4C801EFD; Wed, 3 Jul 2013 23:45:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Njxgs066231; Wed, 3 Jul 2013 23:45:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NjwiR066227; Wed, 3 Jul 2013 23:45:58 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032345.r63NjwiR066227@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:45: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: r252656 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:45:59 -0000 Author: jimharris Date: Wed Jul 3 23:45:58 2013 New Revision: 252656 URL: http://svnweb.freebsd.org/changeset/base/252656 Log: MFC r252265: Break out code related to the devlist command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/devlist.c - copied unchanged from r252265, head/sbin/nvmecontrol/devlist.c stable/9/sbin/nvmecontrol/nvmecontrol.h - copied unchanged from r252265, head/sbin/nvmecontrol/nvmecontrol.h Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:42:12 2013 (r252655) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:45:58 2013 (r252656) @@ -1,6 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol +SRCS= nvmecontrol.c devlist.c MAN= nvmecontrol.8 .include Copied: stable/9/sbin/nvmecontrol/devlist.c (from r252265, head/sbin/nvmecontrol/devlist.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:45:58 2013 (r252656, copy of r252265, head/sbin/nvmecontrol/devlist.c) @@ -0,0 +1,114 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +devlist_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + exit(EX_USAGE); +} + +static inline uint32_t +ns_get_sector_size(struct nvme_namespace_data *nsdata) +{ + + return (1 << nsdata->lbaf[0].lbads); +} + +void +devlist(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct nvme_namespace_data nsdata; + char name[64]; + uint32_t i; + int ch, ctrlr, exit_code, fd, found; + + exit_code = EX_OK; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + devlist_usage(); + } + } + + ctrlr = -1; + found = 0; + + while (1) { + ctrlr++; + sprintf(name, "nvme%d", ctrlr); + + exit_code = open_dev(name, &fd, 0, 0); + + if (exit_code == EX_NOINPUT) + break; + else if (exit_code == EX_NOPERM) { + printf("Could not open /dev/%s, errno = %d (%s)\n", + name, errno, strerror(errno)); + continue; + } + + found++; + read_controller_data(fd, &cdata); + printf("%6s: %s\n", name, cdata.mn); + + for (i = 0; i < cdata.nn; i++) { + sprintf(name, "nvme%dns%d", ctrlr, i+1); + read_namespace_data(fd, i+1, &nsdata); + printf(" %10s (%lldGB)\n", + name, + nsdata.nsze * + (long long)ns_get_sector_size(&nsdata) / + 1024 / 1024 / 1024); + } + + close(fd); + } + + if (found == 0) + printf("No NVMe controllers found.\n"); + + exit(EX_OK); +} Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:42:12 2013 (r252655) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:45:58 2013 (r252656) @@ -31,8 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -44,20 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEVLIST_USAGE \ -" nvmecontrol devlist\n" - -#define IDENTIFY_USAGE \ -" nvmecontrol identify \n" - -#define PERFTEST_USAGE \ -" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ -" <-s size_in_bytes> <-t time_in_seconds>\n" \ -" <-i intr|wait> [-f refthread] [-p]\n" \ -" \n" - -#define RESET_USAGE \ -" nvmecontrol reset \n" +#include "nvmecontrol.h" static void perftest_usage(void); @@ -203,14 +188,7 @@ print_namespace(struct nvme_namespace_da } } -static uint32_t -ns_get_sector_size(struct nvme_namespace_data *nsdata) -{ - - return (1 << nsdata->lbaf[0].lbads); -} - -static void +void read_controller_data(int fd, struct nvme_controller_data *cdata) { struct nvme_pt_command pt; @@ -234,7 +212,7 @@ read_controller_data(int fd, struct nvme } } -static void +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata) { struct nvme_pt_command pt; @@ -258,7 +236,7 @@ read_namespace_data(int fd, int nsid, st } } -static int +int open_dev(const char *str, int *fd, int show_error, int exit_on_error) { struct stat devstat; @@ -289,72 +267,6 @@ open_dev(const char *str, int *fd, int s } static void -devlist_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, DEVLIST_USAGE); - exit(EX_USAGE); -} - -static void -devlist(int argc, char *argv[]) -{ - struct nvme_controller_data cdata; - struct nvme_namespace_data nsdata; - char name[64]; - uint32_t i; - int ch, ctrlr, exit_code, fd, found; - - exit_code = EX_OK; - - while ((ch = getopt(argc, argv, "")) != -1) { - switch ((char)ch) { - default: - devlist_usage(); - } - } - - ctrlr = -1; - found = 0; - - while (1) { - ctrlr++; - sprintf(name, "nvme%d", ctrlr); - - exit_code = open_dev(name, &fd, 0, 0); - - if (exit_code == EX_NOINPUT) - break; - else if (exit_code == EX_NOPERM) { - printf("Could not open /dev/%s, errno = %d (%s)\n", - name, errno, strerror(errno)); - continue; - } - - found++; - read_controller_data(fd, &cdata); - printf("%6s: %s\n", name, cdata.mn); - - for (i = 0; i < cdata.nn; i++) { - sprintf(name, "nvme%dns%d", ctrlr, i+1); - read_namespace_data(fd, i+1, &nsdata); - printf(" %10s (%lldGB)\n", - name, - nsdata.nsze * - (long long)ns_get_sector_size(&nsdata) / - 1024 / 1024 / 1024); - } - - close(fd); - } - - if (found == 0) - printf("No NVMe controllers found.\n"); - - exit(EX_OK); -} - -static void identify_usage(void) { fprintf(stderr, "usage:\n"); Copied: stable/9/sbin/nvmecontrol/nvmecontrol.h (from r252265, head/sbin/nvmecontrol/nvmecontrol.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:45:58 2013 (r252656, copy of r252265, head/sbin/nvmecontrol/nvmecontrol.h) @@ -0,0 +1,56 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __NVMECONTROL_H__ +#define __NVMECONTROL_H__ + +#include + +#define DEVLIST_USAGE \ +" nvmecontrol devlist\n" + +#define IDENTIFY_USAGE \ +" nvmecontrol identify \n" + +#define PERFTEST_USAGE \ +" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ +" <-s size_in_bytes> <-t time_in_seconds>\n" \ +" <-i intr|wait> [-f refthread] [-p]\n" \ +" \n" + +#define RESET_USAGE \ +" nvmecontrol reset \n" + +int open_dev(const char *str, int *fd, int show_error, int exit_on_error); +void read_controller_data(int fd, struct nvme_controller_data *cdata); +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); + +void devlist(int argc, char *argv[]); + +#endif + From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:46:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6942AF88; Wed, 3 Jul 2013 23:46:31 +0000 (UTC) (envelope-from smh@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 420D61F0B; Wed, 3 Jul 2013 23:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NkVX7066375; Wed, 3 Jul 2013 23:46:31 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NkUnc066372; Wed, 3 Jul 2013 23:46:30 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307032346.r63NkUnc066372@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 23:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252657 - in head/sys: cam/scsi geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:46:31 -0000 Author: smh Date: Wed Jul 3 23:46:30 2013 New Revision: 252657 URL: http://svnweb.freebsd.org/changeset/base/252657 Log: Bump disk(9) ABI version to signify the addition of d_delmaxsize by r249940. Ensure that d_delmaxsize is always set, removing init to 0 which could cause future issues if use cases change. Allow kern.cam.da.X.delete_max (which maps to d_delmaxsize) to be increased up to the calculated max after being reduced. MFC after: 1 day X-MFC-With: r249940 Modified: head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/cam/scsi/scsi_da.c Wed Jul 3 23:46:30 2013 (r252657) @@ -1746,7 +1746,7 @@ dadeletemaxsysctl(SYSCTL_HANDLER_ARGS) return (error); /* only accept values smaller than the calculated value */ - if (value > softc->disk->d_delmaxsize) { + if (value > dadeletemaxsize(softc, softc->delete_method)) { return (EINVAL); } softc->disk->d_delmaxsize = value; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/geom/geom_disk.c Wed Jul 3 23:46:30 2013 (r252657) @@ -148,14 +148,12 @@ g_disk_access(struct g_provider *pp, int dp->d_name, dp->d_unit); dp->d_maxsize = DFLTPHYS; } - if (dp->d_flags & DISKFLAG_CANDELETE) { - if (bootverbose && dp->d_delmaxsize == 0) { - printf("WARNING: Disk drive %s%d has no d_delmaxsize\n", - dp->d_name, dp->d_unit); - dp->d_delmaxsize = dp->d_maxsize; + if (dp->d_delmaxsize == 0) { + if (bootverbose && dp->d_flags & DISKFLAG_CANDELETE) { + printf("WARNING: Disk drive %s%d has no " + "d_delmaxsize\n", dp->d_name, dp->d_unit); } - } else { - dp->d_delmaxsize = 0; + dp->d_delmaxsize = dp->d_maxsize; } pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; @@ -629,7 +627,7 @@ void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_02) { + if (version != DISK_VERSION) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Wed Jul 3 23:45:58 2013 (r252656) +++ head/sys/geom/geom_disk.h Wed Jul 3 23:46:30 2013 (r252657) @@ -120,7 +120,8 @@ int disk_resize(struct disk *dp, int fla #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a #define DISK_VERSION_02 0x5856105b -#define DISK_VERSION DISK_VERSION_02 +#define DISK_VERSION_03 0x5856105c +#define DISK_VERSION DISK_VERSION_03 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:47:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35AE61ED; Wed, 3 Jul 2013 23:47:24 +0000 (UTC) (envelope-from jimharris@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 270BD1F1D; Wed, 3 Jul 2013 23:47:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NlORA066527; Wed, 3 Jul 2013 23:47:24 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NlNbO066521; Wed, 3 Jul 2013 23:47:23 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032347.r63NlNbO066521@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:47: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: r252658 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:47:24 -0000 Author: jimharris Date: Wed Jul 3 23:47:23 2013 New Revision: 252658 URL: http://svnweb.freebsd.org/changeset/base/252658 Log: MFC r252266: Break out code related to the identify command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/identify.c - copied unchanged from r252266, head/sbin/nvmecontrol/identify.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:47:23 2013 (r252658) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c +SRCS= nvmecontrol.c devlist.c identify.c MAN= nvmecontrol.8 .include Copied: stable/9/sbin/nvmecontrol/identify.c (from r252266, head/sbin/nvmecontrol/identify.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:47:23 2013 (r252658, copy of r252266, head/sbin/nvmecontrol/identify.c) @@ -0,0 +1,321 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)cdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_controller(struct nvme_controller_data *cdata) +{ + printf("Controller Capabilities/Features\n"); + printf("================================\n"); + printf("Vendor ID: %04x\n", cdata->vid); + printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); + printf("Serial Number: %s\n", cdata->sn); + printf("Model Number: %s\n", cdata->mn); + printf("Firmware Version: %s\n", cdata->fr); + printf("Recommended Arb Burst: %d\n", cdata->rab); + printf("IEEE OUI Identifier: %02x %02x %02x\n", + cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); + printf("Multi-Interface Cap: %02x\n", cdata->mic); + /* TODO: Use CAP.MPSMIN to determine true memory page size. */ + printf("Max Data Transfer Size: "); + if (cdata->mdts == 0) + printf("Unlimited\n"); + else + printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); + printf("\n"); + + printf("Admin Command Set Attributes\n"); + printf("============================\n"); + printf("Security Send/Receive: %s\n", + cdata->oacs.security ? "Supported" : "Not Supported"); + printf("Format NVM: %s\n", + cdata->oacs.format ? "Supported" : "Not Supported"); + printf("Firmware Activate/Download: %s\n", + cdata->oacs.firmware ? "Supported" : "Not Supported"); + printf("Abort Command Limit: %d\n", cdata->acl+1); + printf("Async Event Request Limit: %d\n", cdata->aerl+1); + printf("Number of Firmware Slots: "); + if (cdata->oacs.firmware != 0) + printf("%d\n", cdata->frmw.num_slots); + else + printf("N/A\n"); + printf("Firmware Slot 1 Read-Only: "); + if (cdata->oacs.firmware != 0) + printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); + else + printf("N/A\n"); + printf("Per-Namespace SMART Log: %s\n", + cdata->lpa.ns_smart ? "Yes" : "No"); + printf("Error Log Page Entries: %d\n", cdata->elpe+1); + printf("Number of Power States: %d\n", cdata->npss+1); + printf("\n"); + + printf("NVM Command Set Attributes\n"); + printf("==========================\n"); + printf("Submission Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->sqes.max); + printf(" Min: %d\n", 1 << cdata->sqes.min); + printf("Completion Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->cqes.max); + printf(" Min: %d\n", 1 << cdata->cqes.min); + printf("Number of Namespaces: %d\n", cdata->nn); + printf("Compare Command: %s\n", + cdata->oncs.compare ? "Supported" : "Not Supported"); + printf("Write Uncorrectable Command: %s\n", + cdata->oncs.write_unc ? "Supported" : "Not Supported"); + printf("Dataset Management Command: %s\n", + cdata->oncs.dsm ? "Supported" : "Not Supported"); + printf("Volatile Write Cache: %s\n", + cdata->vwc.present ? "Present" : "Not Present"); +} + +static void +print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)nsdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_namespace(struct nvme_namespace_data *nsdata) +{ + uint32_t i; + + printf("Size (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nsze, + (long long)nsdata->nsze / 1024 / 1024); + printf("Capacity (in LBAs): %lld (%lldM)\n", + (long long)nsdata->ncap, + (long long)nsdata->ncap / 1024 / 1024); + printf("Utilization (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nuse, + (long long)nsdata->nuse / 1024 / 1024); + printf("Thin Provisioning: %s\n", + nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); + printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); + printf("Current LBA Format: LBA Format #%d\n", + nsdata->flbas.format); + for (i = 0; i <= nsdata->nlbaf; i++) { + printf("LBA Format #%d:\n", i); + printf(" LBA Data Size: %d\n", + 1 << nsdata->lbaf[i].lbads); + } +} + +static void +identify_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, IDENTIFY_USAGE); + exit(EX_USAGE); +} + +static void +identify_ctrlr(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + identify_usage(); + } + } + + open_dev(argv[optind], &fd, 1, 1); + read_controller_data(fd, &cdata); + close(fd); + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_controller_data); + else + hexlength = offsetof(struct nvme_controller_data, + reserved5); + print_controller_hex(&cdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + identify_usage(); + } + + print_controller(&cdata); + exit(EX_OK); +} + +static void +identify_ns(int argc, char *argv[]) +{ + struct nvme_namespace_data nsdata; + char path[64]; + char *nsloc; + int ch, fd, hexflag = 0, hexlength, nsid; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + identify_usage(); + } + } + + /* + * Check if the specified device node exists before continuing. + * This is a cleaner check for cases where the correct controller + * is specified, but an invalid namespace on that controller. + */ + open_dev(argv[optind], &fd, 1, 1); + close(fd); + + /* + * Pull the namespace id from the string. +2 skips past the "ns" part + * of the string. Don't search past 10 characters into the string, + * otherwise we know it is malformed. + */ + nsloc = strnstr(argv[optind], "ns", 10); + if (nsloc != NULL) + nsid = strtol(nsloc + 2, NULL, 10); + if (nsloc == NULL || (nsid == 0 && errno != 0)) { + printf("Invalid namespace ID %s.\n", argv[optind]); + exit(EX_IOERR); + } + + /* + * We send IDENTIFY commands to the controller, not the namespace, + * since it is an admin cmd. So the path should only include the + * nvmeX part of the nvmeXnsY string. + */ + snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); + open_dev(path, &fd, 1, 1); + read_namespace_data(fd, nsid, &nsdata); + close(fd); + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_namespace_data); + else + hexlength = offsetof(struct nvme_namespace_data, + reserved6); + print_namespace_hex(&nsdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + identify_usage(); + } + + print_namespace(&nsdata); + exit(EX_OK); +} + +void +identify(int argc, char *argv[]) +{ + char *target; + + if (argc < 2) + identify_usage(); + + while (getopt(argc, argv, "vx") != -1) ; + + target = argv[optind]; + + optreset = 1; + optind = 1; + + /* + * If device node contains "ns", we consider it a namespace, + * otherwise, consider it a controller. + */ + if (strstr(target, "ns") == NULL) + identify_ctrlr(argc, argv); + else + identify_ns(argc, argv); +} Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:47:23 2013 (r252658) @@ -57,137 +57,6 @@ usage(void) exit(EX_USAGE); } -static void -print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)cdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void -print_controller(struct nvme_controller_data *cdata) -{ - printf("Controller Capabilities/Features\n"); - printf("================================\n"); - printf("Vendor ID: %04x\n", cdata->vid); - printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %s\n", cdata->sn); - printf("Model Number: %s\n", cdata->mn); - printf("Firmware Version: %s\n", cdata->fr); - printf("Recommended Arb Burst: %d\n", cdata->rab); - printf("IEEE OUI Identifier: %02x %02x %02x\n", - cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); - printf("Multi-Interface Cap: %02x\n", cdata->mic); - /* TODO: Use CAP.MPSMIN to determine true memory page size. */ - printf("Max Data Transfer Size: "); - if (cdata->mdts == 0) - printf("Unlimited\n"); - else - printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); - printf("\n"); - - printf("Admin Command Set Attributes\n"); - printf("============================\n"); - printf("Security Send/Receive: %s\n", - cdata->oacs.security ? "Supported" : "Not Supported"); - printf("Format NVM: %s\n", - cdata->oacs.format ? "Supported" : "Not Supported"); - printf("Firmware Activate/Download: %s\n", - cdata->oacs.firmware ? "Supported" : "Not Supported"); - printf("Abort Command Limit: %d\n", cdata->acl+1); - printf("Async Event Request Limit: %d\n", cdata->aerl+1); - printf("Number of Firmware Slots: "); - if (cdata->oacs.firmware != 0) - printf("%d\n", cdata->frmw.num_slots); - else - printf("N/A\n"); - printf("Firmware Slot 1 Read-Only: "); - if (cdata->oacs.firmware != 0) - printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); - else - printf("N/A\n"); - printf("Per-Namespace SMART Log: %s\n", - cdata->lpa.ns_smart ? "Yes" : "No"); - printf("Error Log Page Entries: %d\n", cdata->elpe+1); - printf("Number of Power States: %d\n", cdata->npss+1); - printf("\n"); - - printf("NVM Command Set Attributes\n"); - printf("==========================\n"); - printf("Submission Queue Entry Size\n"); - printf(" Max: %d\n", 1 << cdata->sqes.max); - printf(" Min: %d\n", 1 << cdata->sqes.min); - printf("Completion Queue Entry Size\n"); - printf(" Max: %d\n", 1 << cdata->cqes.max); - printf(" Min: %d\n", 1 << cdata->cqes.min); - printf("Number of Namespaces: %d\n", cdata->nn); - printf("Compare Command: %s\n", - cdata->oncs.compare ? "Supported" : "Not Supported"); - printf("Write Uncorrectable Command: %s\n", - cdata->oncs.write_unc ? "Supported" : "Not Supported"); - printf("Dataset Management Command: %s\n", - cdata->oncs.dsm ? "Supported" : "Not Supported"); - printf("Volatile Write Cache: %s\n", - cdata->vwc.present ? "Present" : "Not Present"); -} - -static void -print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)nsdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void -print_namespace(struct nvme_namespace_data *nsdata) -{ - uint32_t i; - - printf("Size (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nsze, - (long long)nsdata->nsze / 1024 / 1024); - printf("Capacity (in LBAs): %lld (%lldM)\n", - (long long)nsdata->ncap, - (long long)nsdata->ncap / 1024 / 1024); - printf("Utilization (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nuse, - (long long)nsdata->nuse / 1024 / 1024); - printf("Thin Provisioning: %s\n", - nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); - printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); - printf("Current LBA Format: LBA Format #%d\n", - nsdata->flbas.format); - for (i = 0; i <= nsdata->nlbaf; i++) { - printf("LBA Format #%d:\n", i); - printf(" LBA Data Size: %d\n", - 1 << nsdata->lbaf[i].lbads); - } -} - void read_controller_data(int fd, struct nvme_controller_data *cdata) { @@ -267,154 +136,6 @@ open_dev(const char *str, int *fd, int s } static void -identify_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, IDENTIFY_USAGE); - exit(EX_USAGE); -} - -static void -identify_ctrlr(int argc, char *argv[]) -{ - struct nvme_controller_data cdata; - int ch, fd, hexflag = 0, hexlength; - int verboseflag = 0; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - open_dev(argv[optind], &fd, 1, 1); - read_controller_data(fd, &cdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_controller_data); - else - hexlength = offsetof(struct nvme_controller_data, - reserved5); - print_controller_hex(&cdata, hexlength); - exit(EX_OK); - } - - if (verboseflag == 1) { - printf("-v not currently supported without -x.\n"); - identify_usage(); - } - - print_controller(&cdata); - exit(EX_OK); -} - -static void -identify_ns(int argc, char *argv[]) -{ - struct nvme_namespace_data nsdata; - char path[64]; - char *nsloc; - int ch, fd, hexflag = 0, hexlength, nsid; - int verboseflag = 0; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - /* - * Check if the specified device node exists before continuing. - * This is a cleaner check for cases where the correct controller - * is specified, but an invalid namespace on that controller. - */ - open_dev(argv[optind], &fd, 1, 1); - close(fd); - - /* - * Pull the namespace id from the string. +2 skips past the "ns" part - * of the string. Don't search past 10 characters into the string, - * otherwise we know it is malformed. - */ - nsloc = strnstr(argv[optind], "ns", 10); - if (nsloc != NULL) - nsid = strtol(nsloc + 2, NULL, 10); - if (nsloc == NULL || (nsid == 0 && errno != 0)) { - printf("Invalid namespace ID %s.\n", argv[optind]); - exit(EX_IOERR); - } - - /* - * We send IDENTIFY commands to the controller, not the namespace, - * since it is an admin cmd. So the path should only include the - * nvmeX part of the nvmeXnsY string. - */ - snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); - open_dev(path, &fd, 1, 1); - read_namespace_data(fd, nsid, &nsdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_namespace_data); - else - hexlength = offsetof(struct nvme_namespace_data, - reserved6); - print_namespace_hex(&nsdata, hexlength); - exit(EX_OK); - } - - if (verboseflag == 1) { - printf("-v not currently supported without -x.\n"); - identify_usage(); - } - - print_namespace(&nsdata); - exit(EX_OK); -} - -static void -identify(int argc, char *argv[]) -{ - char *target; - - if (argc < 2) - identify_usage(); - - while (getopt(argc, argv, "vx") != -1) ; - - target = argv[optind]; - - optreset = 1; - optind = 1; - - /* - * If device node contains "ns", we consider it a namespace, - * otherwise, consider it a controller. - */ - if (strstr(target, "ns") == NULL) - identify_ctrlr(argc, argv); - else - identify_ns(argc, argv); -} - -static void print_perftest(struct nvme_io_test *io_test, bool perthread) { uint32_t i, io_completed = 0, iops, mbps; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:47:23 2013 (r252658) @@ -51,6 +51,7 @@ void read_controller_data(int fd, struct void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); void devlist(int argc, char *argv[]); +void identify(int argc, char *argv[]); #endif From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:48:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C5F74331; Wed, 3 Jul 2013 23:48:59 +0000 (UTC) (envelope-from jimharris@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 A6B531F2B; Wed, 3 Jul 2013 23:48:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nmx8t066756; Wed, 3 Jul 2013 23:48:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NmwJM066749; Wed, 3 Jul 2013 23:48:58 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032348.r63NmwJM066749@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:48: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: r252659 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:48:59 -0000 Author: jimharris Date: Wed Jul 3 23:48:58 2013 New Revision: 252659 URL: http://svnweb.freebsd.org/changeset/base/252659 Log: MFC r252267: Break out code related to the perftest command into a separate file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/perftest.c - copied unchanged from r252267, head/sbin/nvmecontrol/perftest.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:48:58 2013 (r252659) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c +SRCS= nvmecontrol.c devlist.c identify.c perftest.c MAN= nvmecontrol.8 .include Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:48:58 2013 (r252659) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" -static void perftest_usage(void); - static void usage(void) { @@ -136,143 +134,6 @@ open_dev(const char *str, int *fd, int s } static void -print_perftest(struct nvme_io_test *io_test, bool perthread) -{ - uint32_t i, io_completed = 0, iops, mbps; - - for (i = 0; i < io_test->num_threads; i++) - io_completed += io_test->io_completed[i]; - - iops = io_completed/io_test->time; - mbps = iops * io_test->size / (1024*1024); - - printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", - io_test->num_threads, io_test->size, - io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", - io_test->time, iops, mbps); - - if (perthread) - for (i = 0; i < io_test->num_threads; i++) - printf("\t%3d: %8d IO/s\n", i, - io_test->io_completed[i]/io_test->time); - - exit(1); -} - -static void -perftest_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, PERFTEST_USAGE); - exit(EX_USAGE); -} - -static void -perftest(int argc, char *argv[]) -{ - struct nvme_io_test io_test; - int fd; - char ch; - char *p; - u_long ioctl_cmd = NVME_IO_TEST; - bool nflag, oflag, sflag, tflag; - int perthread = 0; - - nflag = oflag = sflag = tflag = false; - - memset(&io_test, 0, sizeof(io_test)); - - while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { - switch (ch) { - case 'f': - if (!strcmp(optarg, "refthread")) - io_test.flags |= NVME_TEST_FLAG_REFTHREAD; - break; - case 'i': - if (!strcmp(optarg, "bio") || - !strcmp(optarg, "wait")) - ioctl_cmd = NVME_BIO_TEST; - else if (!strcmp(optarg, "io") || - !strcmp(optarg, "intr")) - ioctl_cmd = NVME_IO_TEST; - break; - case 'n': - nflag = true; - io_test.num_threads = strtoul(optarg, &p, 0); - if (p != NULL && *p != '\0') { - fprintf(stderr, - "\"%s\" not valid number of threads.\n", - optarg); - perftest_usage(); - } else if (io_test.num_threads == 0 || - io_test.num_threads > 128) { - fprintf(stderr, - "\"%s\" not valid number of threads.\n", - optarg); - perftest_usage(); - } - break; - case 'o': - oflag = true; - if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) - io_test.opc = NVME_OPC_READ; - else if (!strcmp(optarg, "write") || - !strcmp(optarg, "WRITE")) - io_test.opc = NVME_OPC_WRITE; - else { - fprintf(stderr, "\"%s\" not valid opcode.\n", - optarg); - perftest_usage(); - } - break; - case 'p': - perthread = 1; - break; - case 's': - sflag = true; - io_test.size = strtoul(optarg, &p, 0); - if (p == NULL || *p == '\0' || toupper(*p) == 'B') { - // do nothing - } else if (toupper(*p) == 'K') { - io_test.size *= 1024; - } else if (toupper(*p) == 'M') { - io_test.size *= 1024 * 1024; - } else { - fprintf(stderr, "\"%s\" not valid size.\n", - optarg); - perftest_usage(); - } - break; - case 't': - tflag = true; - io_test.time = strtoul(optarg, &p, 0); - if (p != NULL && *p != '\0') { - fprintf(stderr, - "\"%s\" not valid time duration.\n", - optarg); - perftest_usage(); - } - break; - } - } - - if (!nflag || !oflag || !sflag || !tflag || optind >= argc) - perftest_usage(); - - open_dev(argv[optind], &fd, 1, 1); - if (ioctl(fd, ioctl_cmd, &io_test) < 0) { - fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, - strerror(errno)); - close(fd); - exit(EX_IOERR); - } - - close(fd); - print_perftest(&io_test, perthread); - exit(EX_OK); -} - -static void reset_usage(void) { fprintf(stderr, "usage:\n"); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:48:58 2013 (r252659) @@ -52,6 +52,7 @@ void read_namespace_data(int fd, int nsi void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); +void perftest(int argc, char *argv[]); #endif Copied: stable/9/sbin/nvmecontrol/perftest.c (from r252267, head/sbin/nvmecontrol/perftest.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/perftest.c Wed Jul 3 23:48:58 2013 (r252659, copy of r252267, head/sbin/nvmecontrol/perftest.c) @@ -0,0 +1,181 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +print_perftest(struct nvme_io_test *io_test, bool perthread) +{ + uint32_t i, io_completed = 0, iops, mbps; + + for (i = 0; i < io_test->num_threads; i++) + io_completed += io_test->io_completed[i]; + + iops = io_completed/io_test->time; + mbps = iops * io_test->size / (1024*1024); + + printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", + io_test->num_threads, io_test->size, + io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", + io_test->time, iops, mbps); + + if (perthread) + for (i = 0; i < io_test->num_threads; i++) + printf("\t%3d: %8d IO/s\n", i, + io_test->io_completed[i]/io_test->time); + + exit(1); +} + +static void +perftest_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +void +perftest(int argc, char *argv[]) +{ + struct nvme_io_test io_test; + int fd; + char ch; + char *p; + u_long ioctl_cmd = NVME_IO_TEST; + bool nflag, oflag, sflag, tflag; + int perthread = 0; + + nflag = oflag = sflag = tflag = false; + + memset(&io_test, 0, sizeof(io_test)); + + while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { + switch (ch) { + case 'f': + if (!strcmp(optarg, "refthread")) + io_test.flags |= NVME_TEST_FLAG_REFTHREAD; + break; + case 'i': + if (!strcmp(optarg, "bio") || + !strcmp(optarg, "wait")) + ioctl_cmd = NVME_BIO_TEST; + else if (!strcmp(optarg, "io") || + !strcmp(optarg, "intr")) + ioctl_cmd = NVME_IO_TEST; + break; + case 'n': + nflag = true; + io_test.num_threads = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } else if (io_test.num_threads == 0 || + io_test.num_threads > 128) { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } + break; + case 'o': + oflag = true; + if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) + io_test.opc = NVME_OPC_READ; + else if (!strcmp(optarg, "write") || + !strcmp(optarg, "WRITE")) + io_test.opc = NVME_OPC_WRITE; + else { + fprintf(stderr, "\"%s\" not valid opcode.\n", + optarg); + perftest_usage(); + } + break; + case 'p': + perthread = 1; + break; + case 's': + sflag = true; + io_test.size = strtoul(optarg, &p, 0); + if (p == NULL || *p == '\0' || toupper(*p) == 'B') { + // do nothing + } else if (toupper(*p) == 'K') { + io_test.size *= 1024; + } else if (toupper(*p) == 'M') { + io_test.size *= 1024 * 1024; + } else { + fprintf(stderr, "\"%s\" not valid size.\n", + optarg); + perftest_usage(); + } + break; + case 't': + tflag = true; + io_test.time = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid time duration.\n", + optarg); + perftest_usage(); + } + break; + } + } + + if (!nflag || !oflag || !sflag || !tflag || optind >= argc) + perftest_usage(); + + open_dev(argv[optind], &fd, 1, 1); + if (ioctl(fd, ioctl_cmd, &io_test) < 0) { + fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, + strerror(errno)); + close(fd); + exit(EX_IOERR); + } + + close(fd); + print_perftest(&io_test, perthread); + exit(EX_OK); +} From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:51:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5A5E479; Wed, 3 Jul 2013 23:51:04 +0000 (UTC) (envelope-from jimharris@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 97EAE1F3B; Wed, 3 Jul 2013 23:51:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Np4xe068690; Wed, 3 Jul 2013 23:51:04 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Np3DZ068686; Wed, 3 Jul 2013 23:51:03 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032351.r63Np3DZ068686@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:51: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: r252660 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:51:04 -0000 Author: jimharris Date: Wed Jul 3 23:51:03 2013 New Revision: 252660 URL: http://svnweb.freebsd.org/changeset/base/252660 Log: MFC r252268: Break out code related to the reset command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/reset.c - copied unchanged from r252268, head/sbin/nvmecontrol/reset.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:51:03 2013 (r252660) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c perftest.c +SRCS= nvmecontrol.c devlist.c identify.c perftest.c reset.c MAN= nvmecontrol.8 .include Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:51:03 2013 (r252660) @@ -133,36 +133,6 @@ open_dev(const char *str, int *fd, int s return (EX_OK); } -static void -reset_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, RESET_USAGE); - exit(EX_USAGE); -} - -static void -reset_ctrlr(int argc, char *argv[]) -{ - int ch, fd; - - while ((ch = getopt(argc, argv, "")) != -1) { - switch ((char)ch) { - default: - reset_usage(); - } - } - - open_dev(argv[optind], &fd, 1, 1); - if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { - printf("Reset request to %s failed. errno=%d (%s)\n", - argv[optind], errno, strerror(errno)); - exit(EX_IOERR); - } - - exit(EX_OK); -} - int main(int argc, char *argv[]) { @@ -177,7 +147,7 @@ main(int argc, char *argv[]) else if (strcmp(argv[1], "perftest") == 0) perftest(argc-1, &argv[1]); else if (strcmp(argv[1], "reset") == 0) - reset_ctrlr(argc-1, &argv[1]); + reset(argc-1, &argv[1]); usage(); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:51:03 2013 (r252660) @@ -53,6 +53,7 @@ void read_namespace_data(int fd, int nsi void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); +void reset(int argc, char *argv[]); #endif Copied: stable/9/sbin/nvmecontrol/reset.c (from r252268, head/sbin/nvmecontrol/reset.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/reset.c Wed Jul 3 23:51:03 2013 (r252660, copy of r252268, head/sbin/nvmecontrol/reset.c) @@ -0,0 +1,71 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +reset_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, RESET_USAGE); + exit(EX_USAGE); +} + +void +reset(int argc, char *argv[]) +{ + int ch, fd; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + reset_usage(); + } + } + + open_dev(argv[optind], &fd, 1, 1); + if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { + printf("Reset request to %s failed. errno=%d (%s)\n", + argv[optind], errno, strerror(errno)); + exit(EX_IOERR); + } + + exit(EX_OK); +} From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:52:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4784C5A7; Wed, 3 Jul 2013 23:52:17 +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 380671F41; Wed, 3 Jul 2013 23:52:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NqHnL068883; Wed, 3 Jul 2013 23:52:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NqGIa068875; Wed, 3 Jul 2013 23:52:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307032352.r63NqGIa068875@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 3 Jul 2013 23:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252661 - in head/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:52:17 -0000 Author: np Date: Wed Jul 3 23:52:15 2013 New Revision: 252661 URL: http://svnweb.freebsd.org/changeset/base/252661 Log: - Include the T5 firmware with the driver. - Update the T4 firmware to the latest. - Minor reorganization and updates to the version macros, etc. Obtained from: Chelsio MFC after: 1 day Added: head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw_cfg.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt (contents, props changed) head/sys/modules/cxgbe/t5_firmware/ head/sys/modules/cxgbe/t5_firmware/Makefile (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/Makefile head/sys/modules/cxgbe/t4_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 3 23:51:03 2013 (r252660) +++ head/sys/conf/files Wed Jul 3 23:52:15 2013 (r252661) @@ -1185,10 +1185,34 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" +t5fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "t5fw_cfg.c" +t5fw_cfg.fwo optional cxgbe \ + dependency "t5fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw_cfg.fwo" +t5fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t5fw_cfg.fw" +t5fw.fwo optional cxgbe \ + dependency "t5fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw.fwo" +t5fw.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "t5fw.fw" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Jul 3 23:51:03 2013 (r252660) +++ head/sys/dev/cxgbe/common/common.h Wed Jul 3 23:52:15 2013 (r252661) @@ -67,16 +67,6 @@ enum { PAUSE_AUTONEG = 1 << 2 }; -#define FW_VERSION_MAJOR_T4 1 -#define FW_VERSION_MINOR_T4 8 -#define FW_VERSION_MICRO_T4 4 -#define FW_VERSION_BUILD_T4 0 - -#define FW_VERSION_MAJOR_T5 0 -#define FW_VERSION_MINOR_T5 5 -#define FW_VERSION_MICRO_T5 18 -#define FW_VERSION_BUILD_T5 0 - struct memwin { uint32_t base; uint32_t aperture; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Jul 3 23:51:03 2013 (r252660) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Jul 3 23:52:15 2013 (r252661) @@ -975,14 +975,14 @@ int t4_check_fw_version(struct adapter * switch (chip_id(adapter)) { case CHELSIO_T4: - exp_major = FW_VERSION_MAJOR_T4; - exp_minor = FW_VERSION_MINOR_T4; - exp_micro = FW_VERSION_MICRO_T4; + exp_major = T4FW_VERSION_MAJOR; + exp_minor = T4FW_VERSION_MINOR; + exp_micro = T4FW_VERSION_MICRO; break; case CHELSIO_T5: - exp_major = FW_VERSION_MAJOR_T5; - exp_minor = FW_VERSION_MINOR_T5; - exp_micro = FW_VERSION_MICRO_T5; + exp_major = T5FW_VERSION_MAJOR; + exp_minor = T5FW_VERSION_MINOR; + exp_micro = T5FW_VERSION_MICRO; break; default: CH_ERR(adapter, "Unsupported chip type, %x\n", @@ -1128,7 +1128,19 @@ int t4_load_fw(struct adapter *adap, con const u32 *p = (const u32 *)fw_data; const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - + unsigned int fw_start_sec; + unsigned int fw_start; + unsigned int fw_size; + + if (ntohl(hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP) { + fw_start_sec = FLASH_FWBOOTSTRAP_START_SEC; + fw_start = FLASH_FWBOOTSTRAP_START; + fw_size = FLASH_FWBOOTSTRAP_MAX_SIZE; + } else { + fw_start_sec = FLASH_FW_START_SEC; + fw_start = FLASH_FW_START; + fw_size = FLASH_FW_MAX_SIZE; + } if (!size) { CH_ERR(adap, "FW image has no data\n"); return -EINVAL; @@ -1141,9 +1153,8 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FLASH_FW_MAX_SIZE) { - CH_ERR(adap, "FW image too large, max is %u bytes\n", - FLASH_FW_MAX_SIZE); + if (size > fw_size) { + CH_ERR(adap, "FW image too large, max is %u bytes\n", fw_size); return -EFBIG; } if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || @@ -1164,8 +1175,7 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, - FLASH_FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, fw_start_sec, fw_start_sec + i - 1); if (ret) goto out; @@ -1176,11 +1186,11 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); + ret = t4_write_flash(adap, fw_start, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FLASH_FW_START; + addr = fw_start; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; @@ -1190,7 +1200,7 @@ int t4_load_fw(struct adapter *adap, con } ret = t4_write_flash(adap, - FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + fw_start + offsetof(struct fw_hdr, fw_ver), sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) @@ -4622,14 +4632,17 @@ int t4_fw_upgrade(struct adapter *adap, const u8 *fw_data, unsigned int size, int force) { const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; + unsigned int bootstrap = ntohl(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; int reset, ret; - ret = t4_fw_halt(adap, mbox, force); - if (ret < 0 && !force) - return ret; + if (!bootstrap) { + ret = t4_fw_halt(adap, mbox, force); + if (ret < 0 && !force) + return ret; + } ret = t4_load_fw(adap, fw_data, size); - if (ret < 0) + if (ret < 0 || bootstrap) return ret; /* Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Wed Jul 3 23:51:03 2013 (r252660) +++ head/sys/dev/cxgbe/common/t4_hw.h Wed Jul 3 23:52:15 2013 (r252661) @@ -230,7 +230,15 @@ enum { FLASH_FW_NSECS = 16, FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC), FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS), - + + /* + * Location of bootstrap firmware image in FLASH. + */ + FLASH_FWBOOTSTRAP_START_SEC = 27, + FLASH_FWBOOTSTRAP_NSECS = 1, + FLASH_FWBOOTSTRAP_START = FLASH_START(FLASH_FWBOOTSTRAP_START_SEC), + FLASH_FWBOOTSTRAP_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FWBOOTSTRAP_NSECS), + /* * iSCSI persistent/crash information. */ @@ -248,19 +256,13 @@ enum { FLASH_FCOE_CRASH_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FCOE_CRASH_NSECS), /* - * Location of Firmware Configuration File in FLASH. Since the FPGA - * "FLASH" is smaller we need to store the Configuration File in a - * different location -- which will overlap the end of the firmware - * image if firmware ever gets that large ... + * Location of Firmware Configuration File in FLASH. */ FLASH_CFG_START_SEC = 31, FLASH_CFG_NSECS = 1, FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC), FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS), - FLASH_FPGA_CFG_START_SEC = 15, - FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC), - /* * Sectors 32-63 are reserved for FLASH failover. */ Added: head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu Wed Jul 3 23:52:15 2013 (r252661) @@ -0,0 +1,8417 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +begin-base64 644 t4fw +AAADpgEICwAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA4sDmgOhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IEZyaSBNYXkgMjQgMTM6 +NDA6MTQgUERUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA4LjBiLjAwAAAAAAAAAPj2L99g +AMAA4QAwuHj///8f/OFAgAAAAeEAe3AAABAAH//8EOEBlHAgAAAA4QGcBOEAeQAAAgBA4QB5gAAG +AEAAAgAKAAYACuEAeQQACgAAgAABAuEAezzhAHtE4QB75OIAAAAAAQAA4QB7kCAAAAAAAIAA4QB7 +AAAAQAHhAHucAABAAERERELgAAAA4wAEY0REREDjAAgAIAACXAAAAAAf/5BQAAAAAB//kFQAAAAA +H/+QWAAAAAAf/5BcH//AAAAAAAAAAAAAwAAS/88T/8+EIAQzAZMgEf/OEv/OkhAR/84S/86SEBH/ +zgH0MRH/zSIK/5IQAOQxAAUxAQIAEv/KAucxAhYAEf/JgRABAV/AIQIRAckREf/GEv/GkhAR/8YS +/8aSEGAADxH/wRL/xZIQEf/BEv/EkhCBEBH/w8AgkhES/8KSEsAgkhMS/8GSEIIQAvJQZS/3Ef+/ +xy+SEBH/vpIQEv++E/++kyDAMpMhE/+9kyKCIhL/vBP/vJMgIyIhFP+7BDMByTgT/7qDMAODFAgz +ERT/uKQzkyET/6yTImAACMIwkyET/6mTIhL/s5AgkCGQIpAjkCSQJZAmkCeQKJApkCqQK5AskC2Q +LpAvICYQICYRgiIS/6bAMC03MC03NC03OC03PCM9AXIz7QACABL/o8AwLzcALzcQLzcgLzcwIz0B +cjPtAAIAEv+ZwDAoNzAoNzQoNzgoNzwjPQFyM+0DAgAS/5YjCgAnNwAnNxAnNyAnNzAjPQFyM+0D +AgAS/5AV/5EW/5HAMNcgBWYBYAASBDYFAAIA0w/TDwUzDG47FAdHFAcEQ3Yx5gQ2BQUzDG877QAC +ABL/hRX/gyMKAAInAgcEQwQ+BQUzDAdHFG878AMCABL/f8kugyCEIYUivCJ0Ow6GULRVljC0M3Qz +9GP/5gBlP+JlX98S/3PAMgMuBQMCABL/asAwKDdAKDdEKDdIKDdMIz0BcjPtAwIAAAIAEv9tLScA +wBEBSTEASDEBAgDAABT/aQTSMRX/aJRQFP9oBNMxFf9olFAU/2cE1DEV/2eUUBT/ZwTVMRX/ZpRQ +EP9mAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+I8OMACfgf/4jwH/+I8OMAEugf +/4jwH/+I8OMAEugf/4jwH/+KcOMAEugf/4pwH/+QUOMAFGgf/5BQH/+snOMAGkgf/6ycH/+snOMA +NpQf/8AAH//9DeMANpQgAAAAIAABauMAc6QgAAF4IAABfOMAdRAgAAF8IAABheMAdRQgAAGYIAAB +nOMAdSAgAAGcIAABpeMAdSQgAAG4IAABvOMAdTAgAAG8IAABxeMAdTQgAAHYIAAB2OMAdUAgAAHc +IAAB4uMAdUAgAAH4IAAB+OMAdUggAAH8IAAB/OMAdUggAAIYIAACGOMAdUggAAIcIAACHOMAdUgg +AAI4IAACOOMAdUggAAI8IAACPOMAdUggAAJYIAACWOMAdUggAAJcIAACYuMAdUggAAJ4IAACeOMA +dVAgAAJ8IAACguMAdVAgAAKYIAGsnuMAdVggAoAAIAKTNOMCH2AgApM0IAKTNOMCMpQgApM4IAYK +IOMCMpggBgogIAYO0OMFqYAgBoAAIAaNEOMFrjAgBo0QIAduWuMFu0AgB25gIAdvLOMGnJAgCMAA +IAjAAOMGnVwgCMAAIAjAAOMGnVwgCMAAIAk2z+MGnVwAAAAAAAAAAAAAAAAgAA/2IAAP6CAAFAEg +AA/oIAATbSAAD+ggABCdIAATBSAAEoogAA/oIAASOSAAEeogABF9IAAP1SAAEScgAA/oIAAP6CAA +D+ggABC9AAAAAP///////w/8///w////APwgAJtzIACcsyAAnOMgAJypIACcaSAAnF8gAJwkIACc +GiAAnBAgAJvAIACc4SAAm7YgAJucAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAAIAAAAEAAAAEAAAAEAAAAACAAAABAAAABAAAABAAAA +BAAAABAAAABAAAABAAAA/xgwYGAAAAD/AAECAgAAACAG8tUgBvGCIAbzwyAG85ogBvNxIAbzSCAG +8ycgBvL+ECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQAAggBw0rIAcNKyAHDLkgBwyAIAcL +vyAHC6UgBwulIAcNKyAHDSsgBwulIAcLiyAHC4sgBw0rIAcNKyAHC1IgBw0rIAcNKyAHDSsgBw0r +IAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcLZyACivgA +AAABIAKK/AAAAAIgAo2oAAAA/yACiTgAAAD/IAKJOAAAAAAgAo2oAAAAACACijAAAAABIAKKOAAA +AAQgAopAAAAACCACikwAAAAQIAKKVAAAACAgAopcAAAAQCACimQAAACAIAKKeAAAAQAgAoqMAAAC +ACACiqQAAAQAIAKKuAAACAAgAorIAAAQACACitQAACAAIAKK6AAAQAAgAoocAAAAECACiiQAAAAR +IAKJnAAAAQAgAomoAAAAgCACibgAAABAIAKJyAAAACAgAonYAAAAECACiegAAAAIIAKJ9AAAAAQg +AooAAAAAAiACigwAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA +AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRY +VQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpo +AABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsA +AosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgB1wIIAdb5iAHXAMgB1wDIAdb5iAH +W+YgB1wIIAdcCCAHW+YgB1wIIAdb5iAHXAggB1wDIAdb5iAHW+YgB1vmIAdb5iAHW+YgB1wIIAdb +5iAHW+YgB1vmIAdb5iAHW+YAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7 +OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIAREDCABeJAgAER4IAFPmCABdBAgAW1sIAEwMCADcNgf +/+tIH//nECAAnXQf/9rEIABsICAAXqAAAAAAAAAAACABURggAIq4AAAAAAAAAAAf/9TcH//GCB// +w+gf/8GYIABaGCAAUiwgAE9gIACUPB//34QgBeNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAACABfqggAV9oIACmKCAApVgf//B4H//QBB//y0AgAIgkIASacCABErQgAPMU +IADeSCAA2DQgAMngIAC8pCAAqOAgBEe8IAOP3CABBjwgA6/IIAGkJCAAa+AAAAAAIACmhCAFAwQg +AJroIAFXaCAAApgAAAAAAAAAAAAAAAAf//OwIACmSCADkowAAAAAAAAAACADD+AgACXsIAAcACAA +JSwAAAAAIAAyQCAALuwgACu4AAAAACAAQ4AgAQnwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAIABAiCAEQ6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQjggAxaE +IABBQAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgLAAAAIAKQiAgAAAAgApCUCAAAACACkKAK +AAAAIAKQrAwAAAAgApC4EgAAACACkMgNAAAAIAKQ3A4AAAAgApDsEwAAACACkPwKAAAAIAKREA4A +AAAgApEcGAAAACACkSwNAAAAIAKRSA4AAAAgApFYEAAAACACkWgSAAAAIAKRfA4AAAAgApGQEAAA +ACACkaARAAAAIAKRtAoAAAAgApHICwAAACACkdQNAAAAIAKR4BQAAAAgApHwCgAAACACkggPAAAA +IAKSFAYAAAAgApIkBgAAACACkiwGAAAAIAKSNAYAAAAgApI8BgAAACACkkQJAAAAIAKSTAYAAAAg +ApJYBAAAACACkmAGAAAAIAKSaAsAAAAgApJwCwAAACACknwEAAAAIAKSYAQAAAAgApKICQAAACAC +kpAJAAAAIAKSnAAAAAAAAAAADQAAACACkqgKAAAAIAKSuAYAAAAgApLEAgAAACACkswDAAAAIAKQ +hAEAAAAgApLQAAAAAAAAAADXaqR46Me3ViQgcNvBvc7u9XwPr0eHxiqoMEYT/UaVAWmAmNiLRPev +//9bsYlc175rkBEi/Zhxk6Z5Q45JtAgh9h4lYsBAs0AmXlpR6bbHqtYvEF0CRBRT2KHmgefT+8gh +4c3mwzcH1vTVDYdFWhTtqePpBfzvo/hnbwLZjSpMiv/6OUKHcfaBbZ1hIv3lOAykvupES97Pqfa7 +S2C+v7xwKJt+xuqhJ/rU7zCFBIgdBdnU0Dnm25nlH6J8+MSsVmX0KSJEQyr/l6uUI6f8k6A5ZVtZ +w48MzJL/7/R9hYRd0W+ofk/+LObgowFDFE4IEaH3U36CvTryNSrX0rvrhtORBwwRFgcMERYHDBEW +BwwRFgUJDhQFCQ4UBQkOFAUJDhQECxAXBAsQFwQLEBcECxAXBgoPFQYKDxUGCg8VBgoPFR//wAAA +BAAgIAYO0CAGEkAEQQAIBAEACB//qSCBAAAAMAAAAB//nQClAAAAwAAAAMAEAAAf/N4AIAYPEB// +nRADgAAAAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+EIAYAAAAqAAAAH//P +MCADybQCAAAAgBAAAEFAAABBQAEAgwAAAf//v/8f/5WMIAKLgAQAAAiBgAAADAAAAB//m4AgCN6Q +H/+QoP//AAD//wD/IAjewCAI3yAgCN8AH/+RQAAADnAf/5qgH/+fnB/84gAf/58QH/+flB/84ODg +//4AH/+V+A////8f/5Z8H/+cKB//mzQf/5ugAAAM4AAA/4AgCQPwH/+blAAAC4jhAC4A4QGSAB// +nGQf/5sk4AAAoOEAMLgAAIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+s +XB//rFQf/OAIH/+sWB//rHQf/6xsH/+scB//rIwf/6yEH/+siB//qSAgBg8QH/zeAAEAAAAf/5qg +H/+ZpCAGDtAEAAAIBQAAAIP/AACBAAAAABAAACoAAAAgAAYoIAKK2B//iDAf/4QgH/+dEGdFIwHv +zauJmLrc/hAyVHYf/4AAIAjEUAAAPyggCMOgIAjEQCAIxHAgCMKwIAKQhM////8gCMLgIAjDMCAI +w2AQAAAAIAjDwD////8CAAAAQAAAACAIxAD//3//H/+dACAAIRwgCMcACAAAAAD///8gCMdg9/// +/yAIzcAgAB0A//7//yAI1FAAIAAAAABAAAwAAAAgCNSAAAD//wAAgAANAAAAIAAj4P/7//8P9oAA +AAP//wAAJ/8gCNcAAAEAAAAEAAAfgAA/IAAyQCAAOnAgAC7sIAAruCAI16Af/5oYIAjYACAJELAg +CNgwIAjYsCAI2SAgCNmQIAjZwAQBAAjgAAAAH/+atCAI2fAgCNlQUwAAAFIAAAAwAAAAUQAAAB/8 +4gCBgAAAH/+VjIIAAAAABgAAAABIAB//n6Af/5+cH/+QoAAADIgAAA2MIAA0eB//mUwgCNowIAja +kCAI2mAgCNsQH/+axCADLejg//4AIAkF0B//mbAgCNxAFAAAAIAAAACAAAACeAAAAIAAAAaAALAA +AAAKAADjMJL///AAgACxAOEBmgAAAgAAIAjcAB//l7wAAH5AH/+RNCgAAAAmAAAAH/+RUAYAAAAF +gAAAH/+Y1CsAAAAgAFVQNQAAAAOAAAADAAAAH/+Y2Af///8AP///gEAAAAgP//8f////IAAAAB// +mpg9AAAAH/+WNAcAAACBBAEAgQQAAAAAOpjDAAAAGAAAAB//kZAAAA//AEMAAB//mmQAAAgABAAA +AB//q9Af/6lA4QB6AB//lfQf/5mAH/+bAB//mZwgCRYQAAMHgCAJFoAf/5iEAEAAAAAACQAAADAC +//z4f8AAAACj/7sAo/+6AOADAACD/7YAD////w//+AD/AAAAIAkWwCAI3iAgCN5QIAkXUAAPAAAA +CgAA//8ADx//mYgD/8AAg//AACAJF9AgCRhAH/+bGB//qbD/YPAAH/+pkB//kGAEgAAIH/+AUABE +AAD/H///AMAAAAAAgQAf/OIMDwAAAP//AAAf/5q4H/+fmB/84ggf/5YwH/+AYCAGDOAAADAAAAAn +EB//2dgf/5lw3q2+7zQAAAA/AAAAAACJBgCZAAAf/6j4EAAHAu4AAAABwIAAH/+nyJkAAAAf/6m0 +AIgACIKAAAEf/6lIH/+oVAMVAAADEQAAAA8D/yAI47AgCOPgIAjkICAJIFAgCSEgIAjkQCAA0OQg +CSCQIAkg0CAI5HAgCOSgKQAAACAA2dTw8PDw/wD/AKqqqqrMzMzMH/+rwAAAGyAf/6nIIADpGAAP +QkAgA7W4H/+bIAAJAAAAgAAAIAELzAAJAAgf/6i8H/+pBAAACAYAAIjMAACJFH8AAADwAAAAIAki +sCAJIeAgCSKAH/+XlB/84HQABAP/CgAAAB//p+Qf/6ikH/+ZoIP/twCD/7YgIAjqIDMAAADhAAAA +H/+oxB//mdAf/6kMA//gAAA/9pAAABpkA//wAAAQAAEAABpsGgAAAB//mQQgCOpgIAFHLB//qQgA +D///AADerR//qMAf/5qQH/+ZrCAGCiAf/5kMH/+bCCAAcEAgAAXoH/+XaB//lcAgCSPwH/+edCAJ +JEDABAAAIAKMECAAcOAf/5ecAIEAAOABAAAA4AEAAADgASAJJYAgCO0AAAANlCAAmIwgAJYUIAkl +ACAJJVAf/5e4IAjvoB//n6wgCPbQH/+arB//koAgCP3gIAj+cCAI/oAgCP6wSAAAACABhiAf/5pw +IAGIFB//lfgf/5os4QAuAB//mjThAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/5s0AAALiB//nHgf +/5x0AAANwAAA/4Af/5xsH/+c2CABi/AgAZWcA/8AAP+///88AAAAAAX//4MAAAAf/5vUIAkFcCAB +qNwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAACBgAAAAAAAAB//+eAf//ngH//5pB//+aQf//mkH//5pB//9Ngf//ds +H//2EB//9hAf//YQIAXlYAAAAAAAAAAAAAAAAAAAAAAgBejgIAXo4AAAAAAAAAAAAAAAAAAAAAAg +AY6YIAXlYB//+GQf//hkH//4ZB//+GQf//hkH//4ZAAAAAAf//TgAAAAAAAAAAAAAAAAAAAAAAIB +AAAAAAAAAAAAAAAAAAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAA +AAAAABgFAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAACgQAAAAAAAAgAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAACAKABHyOxPyO9MPA+YxAQIAFvI5F/I6d2sGkGC0Zndj+FQOnFWSVw8UAGP/+QAAAGwQ +BBjyNx3yMisgBxzyMiohCPoCAAdxuwEA7tw5DdwCgAALqgKcMOPyLBmwBIAACKoCHPIqIzCA+kAI +FeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7AgzPAoAA62YBJMvhAACZYwIEiZNnKGYG +BiCLGPIbJSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAAbTkCBQJh0Q8AAABsEAQc8gsmIAcb8gof +8hD+QQQVoNYRAA3LOZswhyD75A4FoAklAPpgRhWgGAUA6DYDK74CgAD45gAMcWYBAPhgJhWgDAUA +5SBXKzQCgAD3xgAOsCsFAP+mAA7wCjUA6PH6EoIBgACcNZw3mzMZ8fkKdQKVMZk2JSEJnTQvIAec +OZQ7+KYACTH/AQDiNgov/AKAAA/uAgjuAu42CC0QBIAA0Q8nIQgqIQmcNZQ3BncCCKoCmjYIdwLn +NgQskASAANEPAAAAAAAAAGwQCCggBScgBykxBfgghhXgGUUA+QAMxWF3AQCKIhbx2xjx2/FVDA3g +DZUADHsRprsssp79gAxD4AqlACuynesWBSWMOYAAjIj3gAxwkgCdAC1irmTROCtireSxNGZz/QAA +7oYIJYm5gAAoIBSkiAgIRygkFPUAC73QDwUAGfHFLiIWLCEpiBUa8cSuzJqA6iIeLmfCgAD9AGYV +oA0lAP0ARhXgC2UA7fGzHVYCgAALqgKLFJqB6QAVBEBBAACJFQgAiig8EP0gxhXgTAUA/SDmFaAM +RQDsuzYEyIEAAG25BQgAhgkCYe7xpRWgh4AAiBXuAAUNzwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEo +ISnqISgkQAUAAAgITyglKflACEQiAJ0A/+M6BeAMFQD6IKgV4B7lAOoiHixtQoAA/CAmFeAJBQD4 +IAYV4A0FAOkWAiXZgQAAWHWoDH4R98AARzANlQD906YV58UBAPmABilSAJ0AwCDRDwDqJAAJ2ASA +AOxEAAroBIAAWHdd0qDRDwDAsArPNO+GCC32jgAA2iD8QGgdoBvFAFh5N2P/ygAAAOokAArYBIAA +WHi80qDRDwD/+ewNoAsFAAAAK3wY6iQACWAEgABYeStj/5zAoFmM6BjxbIyI+Z/zQJAKpQBj/6wq +IQn8QrAVr/0FAA2NAQ2ODC4kFO20Ay5hAoAA77QALVYCgAD9RgANMAkVAAmqApqx+NWmFe/5YgAv +JSn/+9QNoAgFAIon60QACmgEgAD7RAAVoAwFAFhyFNKg0Q8AAABsEAYoIAUrIhDkIAcqUASAAPgD +Ah3gHsUA+94ADPAZRQD5AAxdYUQBAIwiH/FE6hYALgseAAAMSREPmQgtkp4PAgD3oAvjUgCdACeS +nQwGPmRxbospKiIKC6oM90AJC6IAnQAqIE4sIEyxrfuACyQgCxUALSROKjABKSIY80ALRpIAnQAr +IAcsIST8YCQV4AhVAPlABAQwqxEA4IgRDVKCgAAKiAIa8SoI3QIoIQcrIQkKzAL7pgAOuogBAOrx +JhxDAoAACLsCKCEinXCNIJtznHT7BgAMMAplAOh2Ai7uAoAACt0CnXEsIhCcdSsgOBjxGvwAIh3g +TBUA/OEmFeC7GQALzTkc8RWeePsNAA5wCAUAmHcNzAKcdu3xChTYBQAAKyYYG/EAmHuZeu0AFQPI +wQAACQCK63YOIchBAADudg8j8QEAAAkghg4CYwkAhg4CYQxMEa/M6sadIwCpgACOKS0gOKbuninz +oAVXkgCdAAUPR/ngBFFSAJ0AwCDRDwDqJAALWASAAFhRIcHs7/DrFXaRgADqJAAJ2ASAAOwSACro +BIAAWHbC0qDRDwAAAADqJAAK2ASAAFh4KNKg0Q8AAAArTBjqJAAJYASAAFh4mWP/wYgiwJQJiAL4 +QEYVr/7eAAAAAAAAAPxDqBWkiQEAAIEEAL0aDcwC/EOmFa/6HgCKJ40QwMDqrCAu2ASAAFhxjtKg +0Q/aIFh2bGP/UQAAbBAMLSAFJiIQLyAHKyE15RYDKcAEgAD7AIgVpzUBAPJ/wBXgDBUAA8M5+0EA +DXAVhQDrggIsYASAAPdeAAqx/wEA9wAwFaAVRQD1oB/VY7sBAIkiKBYA8z1cDeAOhQCYEPLAHgcS +AJ0AnxKfGpsWFvCrkxXqFgQvrwKAAOZVCAIwDQAA5hYJInAFAACIGi4WCCsSCfUABmISAJ0AKlKe ++0AJq+IAnQAvUp1k87sY8JyIiPcACViSAJ0AGfCYKZKuDAM+6vCWFIn5gAAqoq0W8JTqFgska/0A +AOsSCyUJaYAA7WYIJZuZgACIKYcqCHcM8uAJY+IAnQApGgDzIjIN4Pr1ACsgFpwR+2AJrSIAnQAY +8IyGFI3DKiA4/eDmFeAJBQD54SYV4EcFAPfhBhWgqhkACnk5F/CDKyIXm/orIhub+43ECng5/MAP +EuIAnQCYF54dhhWcEZkc5xIMKwgeAABgAX4Y8G+IiGqBJooZKVKeepNDK1KdmxuNG+nwaRQz/QAA +79QABoHZgACWmGX/HGAC1Z4d/CAmFaAKBQBZi9wY8GCIiIwR7hINJA8HAAD//2gNoA8FAADAkPgh +ZhXv/u4AG/BXwKoKijT7YQYVr/7+AAAAAAAAAP/7OA2gDwUAAJ4dnx78ICYVoAoFAFmLyBjwTIwR +iIiPHo4d+R/12JIAnQBgAlHAkJkbihsd8EXAuguLNOvWCC12jgAAYAI4AJ4dnx6cEeokAAnYBIAA +WFBwjBGPHu4SDSV1+YAAYAHvAJ4dnx76QPAVoAwFAFhQvIwRjx7uEg0tdcYAAGACxgCIEY4X9iDI +Fa+MBQAsJDuMFAZ2AgbuAqy5DNoMmoTpJhssWASAAO0iEClQBIAAWHdtjh2MEfqzphWhBwUAc3sI +KyAWKAr/eLleiikpIDijquomCST5poAALyIQLSE1+4CIFeAIFQD4IKYVoAY1AJYTDbs2+iCGFeAd +hQD/fgAO//a2AIonnx6LEOqsICpgBIAAWHRkjx6aESsiG/1AiBXv/YYAAAAAAADqIAcp4ASAAFhQ +dowR/iGoFa/+QgDaIFh1o4wR/iGoFa/+QgAALSIQihYrIDsW8AQKmQIJiQLmmAINifYAABrwAfhE +hBXjaQEAh8DrIAcrMgKAAAaZAiYhB/rgBAOwuxEA6u/xHdqCgAALdwIrISIKdwIqIQmX8IcgnfX5 +4MYVqmYBAOn2BCszAoAABqoCFu/n6vYDK74CgADn5wIHyMEAAOf2ASZAgQAA5rsCAlP5AADr9gIi +FDUAAG2pBQgAhgkCYSggFKSICAhHKCQU9QAGrdIAnQCKGPqzphWhCQUA8yHyDeD89QArIBb9YAkV +IgCdAC0iF7Hd7SYXIYCpgACPKS4gOKP/nynzwAe/kgCdAIYVZWDSwCDRDwAAAAAoIE5kjD0OmwKb +IusSAClQBIAA7RIDKmAEgABYdZPSoNEPAOsSAylQBIAAWHb60qDRDwDaIPxAaB2gG8UAWHdsY//H +AIsS2iDrvBgpYASAAFh3Z2P/tAAAAAAA6iQADlgEgAD8IIgVr44FAO4kOyxwBIAAWHbq+iEGFaAP +BQAvJhv+R2Yd7/yCAIsbKiEJ/EKwFa/9BQANjQENjgwuJBTkzBANVgKAAAyqAv1gZh3gDgUA/2AG +HaAGFQAGqgKasRnvjvc1phWv+8oAAIon60QACmgEgAD7RAAVoAwFAFhwSdKg0Q8AANogWHUnY/8E +AAAAAADqIAcp4ASAAFhP8mP+04sS2iDrvBIpYASAAFh3OGP+92wQCCggBe3veBnQBIAA897qBeAe +RQD/AAq1IAylACsgTinSCNMP6hYDJdv9AAArJE73IAiYkAcVAC8yrmTyMCoyreakAAURkYAAsJjo +1gglCIGAACkgFLOZCQlHKSQU9SARLdIAnQApIHMrIh37IAQA3//1AOB6GgTABQAA/1cAD/SIAQAo +JHP7QAQFcAgVAAqKOQ+7AesmHS0HPgAAiiJ8pwQrIE7KtH2nCC0gTCwgTn3DGcxsLiAU7yICL1gc +AABk8fzAINEPAAAAAAAAiCfHkwmpAekmAiRQwQAAWGfg4+9OFQE5gAAooADTD9MPA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6EqmRTKp4qZZK+XKKAAA4gKKIIQ7KAHLVgEgAD6QGgd +oA01AAuAAGWv4GP/dQAA//9UDaAKBQDAoFmKox3vJonYLAoK+T/3AJAeRQAmCgApIBSzmfhChh3v ++/oAAAAA6iQACtgEgABYdmLSoNEPAAAqIAUrIAcPAgD/QA8VIbsBAAUFR/igDylSAJ0AjhPu4gYv +eASAAJ4UC74C9WAKchIAnQAMuhEDqggoop73AA580gCdACqine4WASUK8YAA+kAIFeAMFQBYI+Ub +7wQvIQke7vooISItIAcc7wwpIST/BgAMMN0RAO4SBC7qgoAADZkCDJkCmaCMICimAv9AZhXgDSUA +7qYFLmYCgAANzAL9QCYVoAkFAOsAFQVQYQAAsZnqgx4Mj+gAAI8RDP8R8+AAR/AOpQAu9p30v/KB +EgCdACoiB+tEAApoBIAA+0QAFaAMBQBYb6Jj/jIAAAAAAP/3OA2gCgUADJs069YILW6uAABj/tkA +AC8hCfhCsBWgCwUA+sAGHe/6BQAKmgEqZAPqmgwMQQKAAOokFC/+AoAACP8CB/8Cn2H2daYV7/aq +AIonwLD7RAAVoAwVAFh2YB3u1J2gjCAb7tPrpgIuZgKAAAfMAv1AJhWgG8UA7CQACVAEgABYdnnA +INEPAACJ2PcgBKiSAJ0ADOoRo6ooop73AAV80gCdACqinWSgprCYmNjuFgEtdVYAAIki6xYAJIUZ +gACfEvi/6yFSAJ0AiifAsPtEABWgDBUAWHMAHu60nqCNIBvutewSAi7uAoAAB90CnaGMxpyj+0BG +Fe/0ygDrVAAJUASAAFh14mP9H48Tj/P+IIYV7/iOAAAAAAAAAP/40A2gCgUAAJ8SmxH6IAYV4AoF +AFmKDB3ukIsQidiPEo4R+T/6iJAMpQD//YwNoAoFAMCgDJg0+aEGFa/9WgAAAACLEO8WAilQBIAA +67wYKWAEgABYdj3+IEgV7/0iAGwQBCggFO+LHmoYBIAAiif6YGgd4AwFAOqsICnoBIAAWG830qDR +DwCLInO+fhTucolIapF6G+5v0w8ssq5kwFgqsq1koFSwne1GCCUC4YAAKSAU6SQULNrcAAAvIQn4 +QrAVoA0FAP1ABh3v/AUADJwBLKQD7JwMDEECgADsJBQv/gKAAPnmAA+wDhUADv8Cn6H/daYVr/3m +AMCgwOoOnjTuRggtfWYAAI8iyfXAINEPwKBZic2JSPk/+9CSAJ0AY//lANog/EBoHaAbxQBYdgfA +INEPbBAIiS/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDp +fR8MFIAAACggTw8CAO8gTSRABQAACAhHKCRP+eASu6IAnQAvIAWbEZoQ/eAQ3WIAnQCJIsej+UAN +gOIAnQAsIhmLMv1gEv0iAJ0AjTiPERjuJunuKBaRQYAA6RYCLycCgADoRAgH+A0AAPXADKISAJ0A +KUKe/yAZK+IAnQApQp3tlAAEkWGAAIspiioMBT4Lqgz1QAmr4gCdACwaAPWB8g3g+PUAKyAW+WAX +1SIAnQAa7iApISQrIQcKmQIqIQkLC0oMuxALqgIrIAcc7gwLK0Do7hkd2oKAAAy7AiwhIpvQiyCZ +1JrTCMwCnNL9YAAVsAxVAAy7ApvRG+4Qii+a1SkgOPvcHAWgDAUA/aDmFaBIJQD3oQYV4JkZAPlN +AA3wCiUACYo5iWSZ2YhlmNr8wMgVoAkFAOzWCyOH4YAA6e4BHMKCgAAJiAKY3Ixol9+c3owSiWkp +1hCIaijWEewAFQbJIQAACQCKjGf84AqjogCdABnt6Qq4AgmIApjWwPX+k6YV4Q4FAPXB8g3g+vUA +KyAW+2ASBSIAnQAuIhmMKS0gTysgOOXMCAdwBQAA7iYZJuv9AAAtJE+cKfNgDgeSAJ0AjRBl0b7A +INEPnxOeFJ4VnRbqJAAK2ASAAFhN+I0WjhTvEgMldaGAAI4QZe/XiifbMOwSASVQwQAAWHHwwCDR +Dxrtu4qo90AOyJIAnQArQp7/YA+z4gCdAClCnR3ttOSR6mVj/QAAnNjtlAAM8tYAAGAAegAoIDnx +H/gOEgCdAP/75A2gCRUAwaN6+RIpIDr+IKYVoAv1APsgECViAJ0A6iQACtgEgABYdOjSoNEPAAAA +AAAA8AAYDaAa1QDAoYw3KyEJjTiOMuuvEQ3dAoAAD7sC5LsCCVAEgABYdMrAINEPAAAA//9YDaAa +hQAAACvsGOokAAlgBIAAWHVJY/8oAAq5ApnWwIX4k6YVoQwFAHXLDSsgFioK//tgDUUiAJ0AixBk +sTaLaoxnimmrewfMDJxn92DSDeANBQCxqoxlm2qLZppprNqre3e7AbGqm2aaZYgpLSA4pYiYKfOg +CT+SAJ0AiScqmRTKpouZyrKfExnteyiwAJ4UnhUJiAooghAssAf6QGgdoA01AAuAAI4UjxOLIsej ++1/zYOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+AA5/88IA2iBYcv5j/juKJ+qsMCtYBIAA +WGAs0qDRDwAAAAAAAAD/83gNoAkFAJ8TnhSeFZ0W+kDwFaAMBQBYTdWNFo4U7xIDLWd+AAAr7BLq +JAAJYASAAFh1BGP+E+ogByrgBIAAWE22Y/21nxOeFP4gphWgCgUAWYi7Gu0+iqiOFI8T+V/weJIA +nQD/+IgNoAkFAMCQHO04wLoLqzT7gQYV7/hCAJ8TiieeFO4WBSnYBIAA7BIBJVDBAABYcWLuEgQt +MASAAP4gaBXv+pIAnxOeFO4WBSlQBIAAWHLJjhT+IGgV7/siAADBU/pAaB2gCwUA/AACHaANNQBY +bNkrIAWOFfV/3Z1iAJ0AY/1jnxOeFJ4V6iAHKuAEgABYTYmOFP4gaBXv+RYAAGwQDJUTJiAFLyAH +hy/qMgQpwASAAPxGhBXnNQEA8n/AFeAOFQAD4zn9QQANcBtFAOerHwxgBIAA+sAehWH/AQCJIpgQ +8zrMDeAOhQAmgAGYEPLAHKcSAJ0AnxKfGhns+5MXFuz56hYGIlgNAADrFgkvrwKAAOZVCAJwBQAA +iBqeGI0Z9QAFWhIAnQArUp79YAgT4gCdAC9SnWTzkIiY9wAH2JIAnQAW7OgmYq4MAz7q7OYTCHmA +ACqireoWCyRr/QAA6xILJQgBgADtlgglmnGAAIcphioHZgzywAfb4gCdACgaAPMCMg3g+vUAKyAW +nBH7YAgdIgCdABbs6CogOPvZzAXgDQUAnff3gIgV4KoZAAprOYYWxIAKjTn2wA9y4gCdAJ0UjRfr +FgUuh14AAGABjoiYaoEgjRkrUp59szwvUp2fG4YbsIrvZAADAdGAAJqYZf9GYALUnhz8ICYVoAoF +AFmINhnsuYiYjBHuEgwkDx8AAP//aA2gDwUAwLD6IWYV7/8KAMDaDY00/SEGFe//DgAA//wEDaAP +BQAAnhyfHfwgJhWgCgUAWYgkGeyojBGImI8djhz5H/dYkgCdAGACWcBglhuKG8C6C4s065YILXgO +AABgAkOeHJ8dnBHqJAAJ2ASAAFhMzYwRjx3uEgwld4GAAGAB+54cnx36QPAVoAwFAFhNGYwRjx3u +Egwtd1YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgewgQAABgJhhhaW+I3Hh8SIxq1tBncMl8R2 +2wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQBIAAWHPBGex4jhyMEfqzphWhBwUAc3sI +KyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV4AoVAPog5hWgCDUAmBMP3Tb8IMYV4B9F +APe+AA+/9wYAAJ4ciiefHYsQ6qwgKmAEgABYcLfvEg0tYASAAP4hiBWv/NoA6iAHKeAEgABYTMqM +EY4c+disBe/+QgAA2iBYcfaMEY4c+diiBe/+NgAmIDsX7FntuwIHyIEAAPmCABWjqwEA57cCCwjG +AACTH43AE+xSA90BIyAHAyNACjMQA90CE+xGJiEkA90CIyEH6yEJLVICgAD6xgALOjMBAOohIimb +AoAAA7sCgy+d8I0glvSX9pP1m/ODH+vsOh7uAoAADe0CnfELqgLq9gIiDD0AALBKbakFCACGCQJh +KCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHyDeD89QArIBb9YAilIgCdAMg/jiktIDij +7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxpDpsCmyLrEgApUASAAO0SAypgBIAAWHHt0qDRDwDq +JAAK2ASAAFhzVNKg0Q8A2iD8QGgdoBvFAFhzxmP/xwCLEtog67wYKWAEgABYc8Fj/7TbwPwgyBWv +jgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhzQ/ohBhWgDwUA/kdmHe/8qgCLGyohCfxCsBWv +/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9gBh2gBhUABqoCmrEZ6+f3NaYVr/vyAACK +J+tEAApoBIAA+0QAFaAMBQBYbKLSoNEP2iBYcYFj/wYAAAAA6iAHKeAEgABYTExj/uGLEtog67wS +KWAEgABYc5Jj/vdsEAYoIAUlIAckCgP3AAVkUVUBACggImSAoQIqAlhq+vlABMDQBhUAKSAh4+vI +GAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1ksGopICH6QAgVoPzlAAyZAfcmAAywDQUA ++EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBYb8wMXRGj3fWzphWgAgUA0Q8X662KeGqh +JgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q///igNoAsFAMCgWYcdinhroc7//4wNoAsF +AMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA+GBoHaelAQDoFgAlU/kAAOq6OQoYBIAA +6hYELCAEgAD9gcAEUZkBAMGz+4AbBWIAnQCMImXC5hvrhrQ+7hYDLMcCgACriOgWBizABIAA7BIG +KAQKgAD1AAQiEgCdAI0TLMKejxb9gAcr4gCdAC/yne8WBSeVoYAAJSEbikKGKpgYBaU29U8ADfEH +BQB7cwHVoIcpB2YM9MAF4+IAnQAqGgD1QjIN4Pz1ACsgFpgY/WAF/SIAnQCNKaXdnSmKQvqgClKi +AJ0AjBQb63mHQ5gYmRnrdwEGB+mAAGAArgAAGuteiqjoFgglDL+AAIsWjBMrsp6PFnyzQC/ynRvr +V+TwOWUz/QAAlrjvFgUv+24AAGACFQAAAAD4ISYV4AoFAFmGyRrrTYqoiRnoEgglDv8AAP//TA2g +DwUAwPAc60fAugurNPuBBhXv/wYAAAAAAP/8eA2gDwUAmRnqJAAK2ASAAFhLcYkZ6BIIJXmpgABg +Aa0AmRn6QPAVoAwFAFhLvokZ6BIILXmWAABgAozudAAKWASAAOWsDAroBIAA7xIFKVAEgADsRgIp +4ASAAFhvs4gYiRmOFvvTphWhDQUAddsIKyAWLwr/f7ktwGH2IIYVr/oCAIonixDqrCAp4ASAAFhv +dsCy66QCLSAEgAD7QEgVr/5yAAAAAOogByrgBIAAWEuIiRn4IQgVr/8GAACIQ4tAjBTpEgUsOASA +AP8AaB2n2wEA7RYBLgieAAAnIAcY6yEHB0HodwoEyIEAAPb0KBXgrnEA7qwQDVPCgADsqgICQEEA +AOp3AQHT/QAA5+cCAYxFAABtqQUIAIYJAmGOQ4tAwICYEhjrEhbrEokRjxUc6w4tIQf11hoFoa4x +AKyq+1AQFardAQDsIRou7wKAAATdAp3wHerlCloMhCCc9uf2ByTgQQAA6vYFJMg9AADs9gMh0AUA +APaGAAs0mR0A5vYEJMgFAADpOQwKJgKAAASkApTxCY05nfItIBTj3QgNIASAAO0kFCWp7oAAjxaI +EvXzphWhDgUA9cHyDeD29QArIBb3YATNIgCdANKA0Q8AiBRkgJvAINEPACucGOokAAlgBIAAWHKF +Y//kiif4IOYVp5tBAOqsICgECoAA9SAEedIAnQCMFcCx7MwgKegEgABYa3+aEo5D+oAIFe/8KgAA +AACLFexNEQlQBIAA/WAARfAMFQBYabT0gGAVr/3CAGWsoPmf5OjSAJ0ALyAg8f/kl5IAnQBj/3sA +AAAAAAAA6iAHKuAEgABYSxqIEtKA0Q+KJ9ww6xIAJVCBAABYbvvAsvtARh3gAgUA0Q8AAAAA+mBo +HeAMBQDtNAAMOASAAFhrW9tA7DQACugEgADqFgIr8ASAAO8SBSlQBIAAWG8b+oAIFe/7VgAAACuc +EuokAAlgBIAAWHJJY/70AGwQBBTqpiRAgAhEEfqAaB2gCxUAWYRlGOqPZKBC+EYADDAJJQCZoeim +ACEByYAAaCEcbyQZ7iIWZUghAAADQIgJCIoDIIgJBIoDAIgJAIraQPoAQh3gDBUAWYe9wCDRD8ck +0Q8P6DCfog7uMJ6jDcAwnaQMsTD9QKYVoAsFAJum+0DmFe//LgBsEBQjFhqUGYkwIhYb+iNoFedl +AQD838AVoA0VAAzcOSqwB4u3/CGmFaeZAQD4IoYV4aoBAOoWCiXYgQAAKxYe9MAvgRIAnQAuEhuO +4mXkJhLqVYIoE+pS9kAwAJAPpQAmMq5kZiMpMq1klh8a6k6wKJio7ZQABK/5gAAuEh4oEhr7wKQV +r8UFAAXuAS4WHO6uCARAgQAA7uxALCgEgAD/AC/KogCdACYSGiISFCUWFvbAaBWv+AUA5hYRIRA9 +AAAIKQGlluYWECsoBIAA/sAumqIAnQCdFpkVjBkkEhqOGhbqMpYX/iJmFaSiHQDqFhUi2BEAAOsW +CyLQIQAAmhwb6kIqEhvkQQwvdwKAAOPuCAZgQQAALBYSJBYZLBIcKqEHFOo9LhYY/YgAFaqqAQDs +FggtVwKAAAuqAvoh5hWgB7oAAAAAAAAnMADqIgwEyAUAAOoSHid4BQAA/+BoHaBvAQDzKzAN4A8V +ACsSHCzQACqhBQXMC6ur67xALiAEgAD7gBUC4gCdAAkMQPoAIh3gCgUADLo4BKsL5KoKBaAhAAD6 +I6gV4AwFAAb8OBbqHAt3C6bGJmCQ58sLDXgEgADnzAoF2GEAAOhoCAZgQQAAivAEAIkCqjaawAsA +i4zw7dwBIZgFAADzn/rrogCdAI0UAssMCsMMk/DygAgVoAcVAPKAKBXgBgUAC3Y4qWmjo5NBejsC +IiwBkkDzABnf0gCdABzqASMSGSISGhTp/hrp/O4SDycwBQAABNQB6toBDM4CgAAJRAIpEh0KZgIt +EhuWlJRQjycmEhUkEhcD/wz4IsgVoTgdAJ8no2MS6egvEhSTHp5AjdD+I8gVoAsFAO9GAyGYBQAA +4kYCLs4CgAD4ZgAM8ApVAOlGASIQQQAA5hYBKXgEgADoFgApoASAAFmHsi0SHioSFS4SHC3RBSgS +FisSEK7d7dxAKUgEgAD7oBWD4gCdAG2pBQgAhgkCYQM0Ai4SES8SGu/yBy8NLgAAZPGq9dOSBaDy +9QAc6cwuEhovEhgtEhsu4Q3z86YV4ApVAP2gCBXgCwUAWYeXJhIb0w8mYBbywAoFIgCdAC0SGy4S +GigSGf2gCBXgClUA/8DoFeALBQDoFgAqYASAAFmHii4SGy7gFiMK/3PhCioSG4sdWCwzZKKMLxIT +JhIYJxIS9eAFwhIAnQAmYp4pEhj2wBNT4gCdACmSnekWFySHeYAAKhIaIhIZiVCKpy4SF/gghhXg +CCUA+kEACTeZQQDiFhkkkRmAACoSHh3phisSHCqhBa2dLdAAF+mDq6sF3Qvk1AAF2QEAAPugEErg +yQEA+gAiHeAKBQAMujgEqwvkqgoFoCEAAIwV36DnnQgLmASAAP+AAEYwDgUA7BYdJlhhAAD9goAV +r/bqAIQc+iFoFa/2CgAA+48ACj/1ggAS6V6CKPZADpiSAJ0AJhIYJxISJmKeKRIY9sAOy+IAnQAp +kp0b6VXkkc1hU/0AAJq46RYXLPmGAABgABMrEhoqEhsrsQ1YK9hj/rTAINEPAIsaLBIb67wYLlAE +gABYcQPAINEPLOEAscz9wAQdr/laACUSGiYSGSVRDAZVDGVR/yYSGyZgBPTAENkSAJ0AIhIa4xIX +KbcCgACIIaYzIiIC5oI+adgEgADzABLgUAcFACkSG4oZKJAUhB6qiPaAAEJ3iAEA6JQUIiAFAAD1 +ABJeUgCdABzpTC4SGi8SGC0SGy7hDST2nf2gCBXgClUA9c8AD3ALBQBZhxUvEhsv8BYmCv928Q4r +EhorsQ0qEhsFuwxYK6UqEhuNGYqnwMDqrCAu2ASAAFhp1tKg0Q8iEh2LF/MAAgEwBwUA6wAVARBB +AACxd+KDHguP6AAA+QAgFa/ymgAAAC8SFtMP79oMCUAEgAD4IqgV5OodAPHBIA3gDQUADwCG6AwA +BugFAAB+2fEoEhePGA6eDPlAAEQwDQUA5O0hZEBBAAAPIIboLAAG6AUAAH7Z8WP9Cxfo/4Qc+iFo +Fa/4XgAAAPuvAAo/994A//ZkDaAJBQCLGiwSG+u8Ei5QBIAAWHClwCDRD8CgWYRiEujlgij4X/EY +kgCdAP/4/A2gCQUAwJAY6ODAagYmNPcBBhWv+LYALRIU3EDt3A8p2ASAAPojyBWk3R0AWPq4+iNG +FaAOFQD+IaYVr+fCAMCgWYRNEujQgij4X8+wkA+lAP/oBA2gCQUALBIb+4BoHaAbxQBYcIXAINEP +AADAkBjoxg8mNPcBBhWv53YAAAD7DwAKv+geAPrPAAq/6LYALBIaLxIWLsAVLcAUK8AR7MEJKVAE +gADu3QgLcASAAFj6jWP92igSGykSCSaAFC8SGglmCCaEFC/yAPH/8LKSAJ0AKxIX6hIbKe8CgAD9 +YABF8AwFAFhnqPRgYBWv9+IAAAAqEhvrNAAJYASAAFv2jCgSGoiBDKsR6zsIDTgEgADxH+1gUgCd +AOoSGylgBIAAW/Zb90AAQ//2ZgCMFvYjaBXv/wUAD48BD4YMJnQULXEJ/uKwFaALBQArxAAvxAPk +7hAO7gKAAP+mAA6wCRUACd0CncEa6Ij5VaYV7/XmAABsEAiIIi8gB5UU9CBmFaD99QDxGCwN4f8B +ACggFn2BLCsSBNMP0w/+IMYV57sBAPt/wBXgCRUA65s5CVAEgABYKxkvEgbzTpAN4P31ACwwDxXo +ahvocRbob+VQgC4LhgAAhxOwdyVcN/4gphXkVR0A5XUID88CgADmmQgCqA0AAPXgBuIQDKUAKJKe +9QAUy+IAnQAlkp3kVAACigGAAIq490AKOJIAnQAuYq5k4QEpYq3kkP1le/0AAO+2CCSIAYAAKCAW +fYEOmRDrMQYpUASAAFgq3YkQjBMqIBQrIAQMqgj1YAkZEgCdAAoKRyokFPVADK5SAJ0ALTAPKRIE +8bEcDeeZAQD5IA3pUgCdAOlUAAHAQQAAbXkFCACGCQJhwKCaEgx0EaRUKCAE9QAJ+RIAnQCJMeQW +ASpYBIAA5TICLI0iAADzIA4AUAQFAKR5ihXiEgItVwKAAKaqKaad0Q8Airj3QA8QkgCdAIkVDJkR +ppkukp71wA/D4gCdAC6SnZ4QiBDlhAAED5mAALCp+WEGFe/8FgAAAADsEgMpUASAAO0SBCnYBIAA +WG330qDRDwDAkAyuNO62CCz4RgAA2iD8QGgdoBvFAFhv0WP/yicwDvbgAIP/+kYAAAAr/BjqJAAJ +YASAAFhvyWP/rMCgWYOGG+gKirgtCv/5X/VgkAylAGP/uQAAAAAA+kKGHa/7rgAAACwhBx3oGfvQ +PAXqzAEA7jAOLmcCgAANzAIstiiKIBjoHv1AABUwDDUADKoCKrYp6AQFAfhBAAD5IAnBUgCdAG3p +DgQCYw9AhgQCZQ8AhgQCYcDQ/CBGFe/6+gCOMPPACuqSAJ0AjxXiEgIv/wKAAKb/J/ad0Q8rIQn8 +QrAVr/0FAA2tAQ2vDP5Chh3gDgUA7ZQDLmECgADulAAt3gKAAP1mAA2wCBUACLsCm5H41aYVr/jW +AIon/KBoHaALFQDtEgMlUIEAAFhokfogRhWv+Q4AANog60QACuAEgABb9bSLEYkxDKwR7LsIDSAE +gADxP/JAUgCdAOokAArgBIAAW/WDpKSkeYoV4hICLVcCgACmqimmndEP//WoDaAFBQAAACv8Euok +AAlgBIAAWG9zY/5UAAAAAAD+IMYV4AoFAFmDLRvnsYq4/iDIFeD99QD5X/AwkAylAP/0qA2gBQUA +wOD+IAYVr/guAAyoNPlhBhWv9FYAiicloRX7RAAVr8kFAAmpAalZKZxAbekTBAJjD4CGBAJpD2CG +BAJnefsY0w+NE9MP+6BoHeAMBQBYaFj6IEYVr/WOAPXvAA///44A2iD6gGgd4AwFAFhmj7N7jBXi +EgIuZwKAAKbMK8ad0Q9sEAQjIAAkCu10MQYiIQO8ItEPhiCFI4Qh9nAABDs2IQD4YABBs2YBAKYz +DjMR8q8ACX1EAQDjPBohE8kAAAQkLAQzKKMi0Q9sEAiKIicgB4kwlRT4QtAVoXcBAPFbDA3omQEA ++CAmFeD79QB7gSArEgQLC0f7f8AV4AkVAOubOQlQBIAAWCoL809gDeD79QAa52aIqBbnY/cADGCS +AJ0ALWKuZNGsJWKtZFGosIiYqOlUAAKMeYAAFedUJVCAJVw3+CAGFeRVHQDlRQgLzwKAAOaZCAKo +DQAA9OAIWhIAnQAokp71ABLD4gCdACWSnWRRbyogFvtDJg3g7NUAKzAQ/WASJCIAnQArMQu8u9og +WCnSKCAULCAEpIj1gArREgCdAAgIRygkFPUADG5SAJ0AihQe51eNESghBxznNBnnU/+h4BXqiAEA +/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxWAi3eAoAA60sCAshBAADrVgEhwEEA +APlAB+lSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgT6SAEIlv9AAAMuxGrW/UgB4ESAJ0AiDHlMgIl +2EEAAOsWAiwJsgAA8wAKsFADBQCjTIgTDH0Rpt3s1p0sEASAANEPAAAAAAAAAPcADTiSAJ0ADHkR +ppkukp71wA2T4gCdACWSnWRRqbCMnKhlXuRgAFHqJAAJ2ASAAO0SBCpgBIAAWGzd0qDRDwDAoFmC +exrm/oio+R/zUJD79QD/+cgNoAUFAADaIPxAaB2gG8UAWG6zY/+8wFDA2g2INPlBBhWv+UoAK3wY +6iQACWAEgABYbqtj/5wAAAAAAPhChh2v+tIAAAAAiif9IGgdoAsVAOqsICpoBIAAWGem+iBmFa/8 +DgCLMPNgCLqSAJ0A4hIDK+cCgACmzCTGndEPjxAuIQn4QrAV7/oFAAqKAQqMDCwkFOSZEA92AoAA +Ce4C++BmHaALBQD74AYd4A0VAA3uAp7x/NWmFe/49gAA6iQACuAEgABb9LOLEigyAeoWBS1nAoAA +7LsIDRgEgADxH/WQUgCdAOokAArgBIAAW/SBiBOjo6NMDH0Rpt3s1p0sEASAANEP//asDaAFBQCO +NIs3jTX+cAAHu84hAP+AAEZz7gEArswOzBH9bwANvd0BAOzMGiXbyQAADb0sDcwo/WAARb/2QgAA +K3wS6iQACWAEgABYbmNj/nzAoFmCIBrmpIio+R/yeJD79QD/+YQNoAUFAADAUMD6D480/0EGFe/5 +RgCwSwy7EetbCAlQBIAA+2IAFeAMBQBYZZWzTOISAyvvAoAApt0s1p3RDwAAbBAG2iBYKccX5rMl +MBb5zVQFoqYFAAamKIo3qGgFVQoIVQunVYhQ5KwIKQEKgAD6oCgV4AcVAOWBFXvICoAAiDKUsJWi +m6MJiAKUUZgy0Q/aIFgptBzmoCvCherCiC1IBIAAqbvvMBYt3kKAAKuqG+acGOaa7uaRHM8CgACr +mahomBCZEYaRK4J97IJ/L4EKgADuZgEL6AqAAA27AiuGfebGAgYAcYAAWALMixCJESuyfRjmbQaG +OAa/Ao5Rn5KMMpTg7kYBKQEKgADlRgAr6AqAAA3MApRRnDLRD2wQCNogWCmQ1KAX5n8b5oD5zP4F +4qYFAAZEKBXmcOlJCAlXAoAAq6qKoCmSf6VFp0QKmQH4IAYV4GMFAOEABQEzuQAA8ADcDaAHFQAA +AAM8CvWAAgZ/CEUA6MgICVAEgADogh8qWASAAP50ABWvfQUA7cwIC2gEgAALgAABAYcDN2DhAQcJ +9yAAANEPbBAEFuZhFeY+0w+mIgU1AiUmgCQigGdAC20IBSgigGeAAmP/89EPAGwQBCggBSUgB/pg +qBWv9NUA+kBIFeADJQD9ASAR0VUBAMAg0Q8AiCkZ5k+aK/sAB/wiAJ0ACVkJKZ0CKpEIKZEEDwIA ++yAEw6IAnQAqCh/7QARo4gCdAAIqAlhlNIsiDwIAA7oBZK+4iicEuwHrJgIlUMEAAFherOPmGhUB +OYAAKKAA0w/TDwOICiiCEOygBy1YBIAA+kBoHaANRQALgABlr9yJJ9MPZJ92KpkUyqeKmWSvbCig +AAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0oAAP//VA2gCgUA2iBYZSErICLquwwJUASA +AFhmctpQ+gAiHeAMBQBYZuSLIgO6AfN/+uZiAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAA +WG2ewCDRDwDrICIpUASAAFhmYCogBcHjfqEMaKgpiyLzYAQFf/xmAC8gOsCPePnq+kBoHaALBQD8 +AAIdoA0lAFhljGP/1wAA+kBoHaALBQD8AAIdoA0lAFhlCWP/vwAAbBAKiCsd5fYuICGLN/xgyBWg +/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAf4IQYV7/TVAPxASBXgAyUA +/RtAQdFVAQCKKZsr+0AH7GIAnQAb5d8LWwkrvQIssQgrsQT9YASzogCdAMHP/YAEYOIAnQDaIFhk +yIsiA7oBZK+biicEuwHrJgIlUMEAAFheQQqrAuPlrhUBKYAAKLAA0w8DiAooghAssAf6QGgdoA1F +AAuAAOukAA1/HgAAiSdkn1oqmRQrkgnKqGS/TyiwAAOICiiCECywB/pAaB2gDTUAC4AA66QADX8u +AABj/y0AAAAAAP//SA2gCwUA2iBYZLUrICLquwwJUASAAFhmBtpQ+gAiHeAMBQBYZniLIgO6AfN/ ++s5iAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAAWG0ywCDRDwDrICIpUASAAFhl9CogBcHj +fqEMaKgpiyLzYAQFf/xaAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFhlIGP/1wAA+kBoHaALBQD8 +AAIdoA0lAFhknWP/vwAAbBAEKTAWCVkU9SAG2JIAnQDxLrAN7/vlAOPlYxgECoAA9SAEGhIAnQBo +lQTAINEPACogBrCqCgpH6iQGLX9+AACMIoonC8sB6yYCJVDBAABYXefJrSigAAOICiiCEOygBy1Y +BIAA+kBoHaANRQALgABlr+CJJ2SfsiqZFGSgoIqZZK+nKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01 +AAuAAGWv4GP/hQAAKSAGsJkJCUfpJAYs+8YAAIknjCIqmRQLzAGLmewmAiUCgYAAKLAAA4gKKIIQ +2iD9YPAVoA01AAuAAMAg0Q8AAOokAAnYBIAA7EQACugEgABYZbnAINEPAOokAAnYBIAA7EQACugE +gABb/0/AINEPAP/+wA2gCwUA//10DaAKBQBsEATRDwAAAGwQCBXlQBTlHBflQJIS+CBIFaAKBQD6 +IGYVoAlFAJkUGuU6CIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA+CAmFa/59QD5FwAMcAYFAPgg +BhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYFMYAALVHC+sAEANALFQDguxoOo0wAAC5x +fmTvygIqAlhmhI8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKKEAqZAZkyijcqrDBYXYHKoSig +ANMP0w8EiAooghDsoActWASAAPpgaB2gDUUAC4AAZa/ciTfTD2SfbSqZFMuniplkr2MooAAEiAoo +ghDsoActWASAAPpgaB2gDTUAC4AAZa/gY/9BixP6IEgVoAkVAAubOVhncdEP//8UDaAKBQBsEAYd +5PcLKxGtsyoyfxnk9YigJd31+KAARPAEBQDpuQgEAbGAACwyeC8ye/mABYRiAJ0AZfDsLDZ8KzJ5 +KzZ73UAN5BYBAgCUoA3kFiwKCfxABfQiAJ0ALzJ7wcDt5OIXg3mAACIyfCohBI4g8+H+Daa6AQAk +Nnz0b2YVoAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFhl7WWg +mSohBP9BIAwWmgEAyJnRDwDaIFhnNtEPANogWGdq0Q8A+kBoHaALBQBYZzfRDwAAAOrSYCFj4QAA ++4AEANALFQD9YAEF3/z1AAy7AwuqASrWYFmEwSQ2fCQ2e/pv6BWv/MoAWXu9WGWgLVKwZN85WXuO +Y/8zHOSy/m+IFaAKVQD4b0gVoAtFAOgWACFr5QAAWYJr+m/oFa/70gApMnviNnws+2YAACI2e9EP +AABsEAQU5KQZ5KDo5IoZXsKAAKS0I0J/qYjouAgBgkGAAIoweKkCKkJ7HOSZKzEEKkZ/DLoB6jUE +KdAEgABYZbHOrikxBP8hAAwW2QEAyNfRD9owWGb70Q/aMFhnL9EPAAAAAAAA+kBoHaALBQBYZvvR +DyNGf9EPAABsEATwYOAN7/n1AIgiCTkDCYgBmCKKJyqsMFhc6OPkVRUBGYAAKKAAA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv4Ikny5IqmRTKpYqZya0ooAADiAooghDsoActWASAAPpAaB2gDTUA +C4AAZa/g0Q8AAP//XA2gCgUA0Q8AAGwQBPJdABXgGMUA+EAHnCczAQAU5Cv0YAYSEgCdAAw5EQSZ +CCiSnvcAB07SAJ0AKZKdZJDYHORBG+RaAioJDKoKq6pYZbf6QAQA0AkVAP0gAQTf+/UA4qQABIBx +gACKogubAwuqAZoiiifTD9MPKqwwWFyy4+QgFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgd +oA1FAAuAAGWv3IknZJBnKpkUyqmKmcmtKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4NEP +AAAAAAAA//9MDaAKBQAV4/qKWGqhNww5EaSZK5Kebr0+KZKd5JA6ZVv9AACbWGWfNWAAC9owWXs0 +Za8q0Q/RD9EPAAAAAP/8aA2gCQUAwKBZf2WKWGuhvf//SA2gCQUAwJDAygysNPyhBhWv/w4AAAAA +bBAEGOPfAgNHDDMRqDMrMoQZ4+gosAAqsgEJiAoKIYwCCj4oghADAj78QGgdoA0lAAuAACI2hAwC +ANEPbBAEFOPQAgNHDDMRBDMIJDKEKkIBJkAAKEAI+phoHaCpJQACBT4DAj55gSMY49MIaAooghDq +VAAKWASAAPxAaB2gDSUAC4AAIjaEDAIA0Q/rJAAKUASAAFhldvNAaB2v/zYAAAAAAABsEAQZ49XT +DymSRip60AqZKBTj6/8gABSwChUACpkCKUa3+JboFaAFBQAF5DEBAgAjQrdmMAttCAUqQrdmoAJj +//Mb4+Aitopj//wAbBAEWX6EEuOiE+PAKSKC0w8JGo4DqAqIgAuAAGP/7ABsEAQqIgcqrBBYZnHR +DwAAbBAEiCcijBDaIFhmUGihAdEP2iBYZkoS480LqBHoIggFAdmAAAzqMCsihSuyACKs/+y7CAlQ +BIAAWYORHOPFKsJ/+kAEANALFQAAuxoLqgIqxn9Zg8DRDwAAAAD6AOIdoAsVAFhmJywifywmg9EP +AGwQBCYiBw8CAOZsECnQBIAAWGaK7DQACmgEgADuVAANWASAAO8iACtQBIAAWGXO0Q8AAABsEAQa +44eWIvRAZhWhlzEAGOOHqpkpkIAIOAKYIAlZDJkh0Q8S46MD6DAE7jAFsTCTIJQhlSIS458T42uE +IAQzApMgEuOdwDAoN0AoN0QoN0goN0wjPQFyM+0DAgAS45fAMJMgxy8T45YDIwMS45aEIAQ0AZQg +EuOUhCAENAGUIBLjk4QgBDQBlCAS45GEIAQ0AZQgxy/AMQMjAxLjjoQgBDQBlCBj//wS44yDIAMT +FA8zEZMgEuOJwDAjJgBX/9kQ44iRAJIBkwKUAxHjhoIQAeowohEB8DHAQATkFgACABHjgoIQIxoA +AyICkhAR43/AIZIQBOQxhAODAoIBgQAA0jABIwAAAAAQ43qRAJIBkwKUAxHjeIIQAeowohEB8THA +QATkFgACABHjcIIQIyoAAyICkhAR43DAIZIQBOQxhAODAoIBgQAA0zABMwAAAAAQ42uRAJIBkwKU +AxHjaYIQAeowohEB8jHAQATkFgACABHjXoIQI0oAAyICkhAR42HAIZIQBOQxhAODAoIBgQAA1DAB +QwAAAABsEAQkIBSjRCQkFNEPAAAAAFyUAV2UAl6UA1+UAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABckAFdkAJekANfkABTAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJQAHZABnZQCnpQDn5QECJQFCZQG +CpQHC5QAQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyQAZ2QAp6QBx2QA5+Q +BHiQBXmQBnqQB3uQAFMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADclAAdkAHd +lALelAPflAQElAUFlAYGlAcHlAgIlAkJlAoKlAsLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +3JAB3ZAC3pALHZAD35AEtJAFtZAGtpAHt5AIuJAJuZAKupALu5AAUwAAAB///CgA0jEQ//4KAAAA +AAAf//xwANMxEP/+CgAAAAAAH//8uADUMRD//goAAAAAAAD0MAoAAAAAAPQwCgAAAAAA9DAKAAAA +AGwQCIgiJyAHKSIUmRPxEvwN4XcBABrh8GSRARbh8SqggAx4EeaICAVQ3QAA+RPIFeSqHQCqSuvh +6RVQCQAA+yAJ86AMpQAogp3oFgQkCdmAAI2496AKOJIAnQAuYq7xz3AN4AkFACpireSg7mb7/QAA +77YIJQeJgAArIBSkuwsLRyskFPVgCV5SAJ0AizmJFPhiABWnxQEA+YAKgVa7HQD8geAA0AUFALBK +bakFCACGCQJhiRMa4cuJkOgSBCJj/QAA6pkCDO4CgAANzQL9ACYV4AoFAG25B+mGBiRBAQAAiBTr +MgEuTwKAAKmImBXpMgItjDIAAJoQ82ANOFIAnQCLEOtLCAvnAoAA5swIBdv9AADrxp0qkASAANEP +AAUMR2jCGIon+oBoHeAMBQDqrCAqaASAAFhiGNKg0Q/AINEP6iQACdgEgADsRAAK6ASAAFhnK9Kg +0Q8AAMCgDN407rYILXi+AACPImX/1Nog/EBoHaAbxQBYaQNj/8QAAAAAAP/7FA2gCAUAiCJlj7Ir +fBjqJAAJYASAAFho+mP/ocCgWXy3G+GOjbj5v/V4kAylAGP/si0hCf5CsBWv/wUAD78BD7gMKCQU +76QDL3ECgADppAAu7gKAAP+mAA6wDBUADN0CnaH81aYVr/qSAI4nnhGF6fnCghWvyQUA7OEVJ2iB +AAAJ2QGZEunJCApXAoAA6ogMAqhBAACV6QiIMujlFCTJAQAA+KAIYuIAnQBoq0ClrCzM8P0gBNOi +AJ0A7xIEIgyBAACwTm3pBQUAhg8CYSzSAQ8CAAysCOjZBCZjwQAA+YAG7GIAnQDs1gEuKASAAGWO +P2AAoQAA6xIFLOAEgADsFgYpUASAAFvu64kWiBWLMeoWAC1vAoAArYjxf/MIUgCdANog7JQADFgE +gABb7rqOEO6uCAqQBIAA7k4IC/8CgADm/wgHc/0AAC72ndEPAAAABZkM/CCIFaT5HQBt+QUFIIYM +AmOMEg9FDI8ULMxA6f8IAow9AACwWG2JBQxAhg8CZYUSLNkECagMqFUlXDDl1gEubP4AAIkSwKDq +1QQkyQEAAPmgJhXgBQUA+aAGFe/2DgCOEQxVDPXBJhXv+74AhRIlXED1oCYV7/yaAAAAbBAEHeEl +GuElDwIALdJxLKLHKqFuo93qOgwO7kKAAP2AAEZwCwUAK8QEK8QFWPI1+kBoHaALBQBb/HDRDwAA +AGwQBBbhFyQgB4lgJwoD8TEgDeFEAQApIhMJ6FH1AAkAkgCdAPPCFgXhqeEA9UAJAJIAnQD0gAXi +EgCdAAxJEQOZCCuSnvdgCjnSAJ0AKpKdZKEhLyEHGOED/cIGBer/AQDp4QIf/wKAAAj/Ap+gH+EA +/EAIFaA7BQCbp/lAphXgGIUAmKOfou3MAg52AoAAnKT3xgAPcAwFAJymnqEuIhMOjkHspggvdwKA +AJ6p6+DxGm8CgACj3SfWnSoiE5xgC6oCKiYT6iIQKVgEgABYvlEFCEdoghmKJ/oAIh3gDAUA+0QA +FaANFQBYYUfSoNEPAMAg0Q8c4NaLyPdgBNiSAJ0ADEkRo5ktkp73oAUp0gCdACqSneSgnGXr/QAA +nchlrzFgAFCOIrGf72YAJwGxgAAFCEf1AARREgCdAMAg0Q8AKhoACpkC+EJmFe/7agAAACsqAAub +AvpCZhXv+2oAAAAAACtMGOokAAlgBIAAWGghY/+8AACMImXPtStMGOokAAlgBIAAWGgbY/+kAAAA +AAD/+vANoAoFAMCgWXvVHOCri8j5f/rYkgCdAP/9wA2gCgUAwKDA2g29NP2BBhXv/YYAjCcvyRSK +yf+EABWvyAUA6O4BB/hBAADvxRQlU8EAAOrGCSdxAQAAfqssKcEVHeCiqpqayZ2gjCD7wUAF4A0V +AOumAi5mAoAADcwC/UAmFaACBQDRDwAAHeCYnaCMIPvBLgXgDRUA66YCLmYCgAANzAL9QCYVoAIF +ANEPbBAYkhCOIBXgj4kjiyGKIioWIisWJPgkZhXgBBUA9CDmFaAIBQD4IKYVoAxFAPwhRhWgDTUA +nRn0IMYV4A8lAJ8Y9cECBeAPpQD+IgYV4A21APwiJhXgDMUA/CJGFaAIhQD4IcYVoASVAPQh5hWg +CXUA+CGmFeALVQD6IWYV4AplAPohhhWgC9UA+iJmFeAK5QAqFhT1wNoFoAn1APgiphXgCEUAmBSG +FisSJIkVJ2F+LBIiImF/B5koL1CAqSn4nIgVo5kBAAOZCu6SAC9QBIAAJmI+LRIjqO4LYACOFywS +JC0SIgfuKC9Qga4u+JyoFaPuAQAD7gqO4CoWFuoSIy1YBIAAqO4LYACOGCwSFi0SJAfuKC9Qgq4u ++JzIFaPuAQAD7gqO4CoWF+oSIi1YBIAACO4IC2AAjhksEhctEhYH7igvUIOuLvic6BWj7gEAA+4K +juAqFhjqEiQtWASAAKjuC2AAjhosEhgtEhcH7igvUISuLvidCBWj7gEAA+4KjuAqFhnqEhYtWASA +AKjuC2AAjhssEhktEhgH7igvUIWuLvidKBWj7gEAA+4KjuAqFhrqEhctWASAAAjuCAtgAI4cLBIa +LRIZB+4oL1CGri74nUgVo+4BAAPuCo7gKhYb6hIYLVgEgACo7gtgAI4dLBIbLRIaB+4oL1CHri74 +nWgVo+4BAAPuCo7gKhYc6hIZLVgEgACo7gtgAI4eLBIcLRIbB+4oL1CIri74nYgVo+4BAAPuCi7i +ACoWHeoSGi1YBIAAqO4LYACOHywSHS0SHAfuKC9Qia4u+J2oFaPuAQAD7gou4gAqFh7qEhstWASA +AKjuC2AALhIQLBIeLRIdB+4oL1CKri74ncgVo+4BAAPuCi7iACoWH+oSHC1YBIAACO4IC2AALhIR +LBIfLRIeB+4oL1CLri74negVo+4BAAPuCi7iACoWIOoSHS1YBIAACO4IC2AALhISLBIgLRIfB+4o +L1CMri74nggVo+4BAAPuCo7gKhYh6hIeLVgEgACo7gtgACwSIS4SEy0SIC9QjQfuKChC8a4u+iBm +FaPuAQAD7gqO4OoSHy1YBIAAmxGo7gtgAIwRLhIULRIhL1COB+4oKELyri76IEYVo+4BAAPuCo7g +6hIgLVgEgAArFiOo7gtgAC4SFSwSI40TB+4oL1CPri74nmgVo+4BAAPuCo7g6hIhLTgEgAAnFiLo +7ggL2ASAAAtgAI4RKhYkKRISLRIVjxUrEhMsEhToEhEn+EEAAO8WBSXYQQAA6xYTJmBBAADsFhQk +QEEAAOgWESboQQAA7RYVJMhBAAApFhKNH4kciBuMHosd7xIQJEBBAADoFgsmYEEAAOwWDiXYQQAA +6xYNJ/hBAADvFhAkyEEAAOkWDCboQQAAnR+JFo0ZjxrrEgciqEEAAOwSCCboQQAA7RYJJ/hBAADv +FgoiIQEAAO8SBCZgQQAA7BYIJdhBAADrFgckyCEAAOkWBif7/QAA7xYEL+ImAACJEI8TixKOkIiT +jJKNkauIp8yq3a/unpCdkZySmJPRDwBsEAQpIhX4oAAE8Dh1AOmMDAEgQQAA8yAART+LBQDrpBAl +UEUAAPkABdNiAJ0AKwoAWXfbLCIVKyIU7c0RCUAEgAD8QkYV7oA9AP1rAA2wCTUA+kJmFeAKJQBt +qgyOhA4Oju6GBCRAEQAADwIA0w/TD22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuC +nIPrRAAJUASAAFv+toogiCKJIY8jCAiOCQmODw+OCgqOmiCfIykmAegmAilABIAAGd9BAgCGAwJh ++AAKFeAJtQBtmgIIAIrRDwAAAAAAAAD9gQAVoAsFAFl3rPhAaB2gCUUA0w9tmiHpggQkQEEAAIqB +i4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD6iQAClgEgABb/pTaQP/7/A2gPIUAAGwQBikiFfhCiBWg +RgUA0w/4gABFdZkBAAlmDHSrAbGIKiYVBioM6CYUJVFBAAD2gAezogCdAOs0AAtgBIAAWXd/+EBo +HaAJRQDTD9MPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4KcgyUsEOokAArYBIAA +W/5xBkcM9uAFjtIAnQDmNAgK0ASAAPbgaB2gAwUA5BYAKkAEgAD4yGgdoAlFAAoCZwhAhgoCZQgg +hgoCYwgAhuoMAAlABIAAbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kcg+okAArY +BIAAW/5U6lQAAZgFAADmbMAiIQEAAO9tmmpABIAAixAKPBELywjsfAwK0ASAAFl3R9EPAAAAAAAA +6zQACmAEgABZd0LRDwAAAPZgAEYwAwUA/CAGFa//JgBsEAQY3tUZ3tMa3tET3tSTI5gimSH6QAYV +oAsFACsmFSsmFNEPAAAAbBAG3iDk4hAqYASAAOdCByvQBIAA+72EBeAYNQDjQhUpkASAAOdyDiL7 +6QAAePsnGN7CCPgKiICaE5wS7hYBLAAigAAAkxAqspXsVAAJWASAAFl5DmSmN/KCphXgAgUA0Q8A +AAAAK+ITC5tS7hYBJf9BgAAa3qvjFgApWASAAOqityrgBIAAWXkBZKXKGt6k2yDqorkq4ASAAFl4 +/GSnTBreoNsg6qK7KuAEgABZePf3T8AN43bFABremtsg6qK9KuAEgABZePFkp1ca3pXbIOqivyrg +BIAAWXjsIyqA43MICAQKgAD7QEkwEgCdACsw2cFY9WAvSGIAnQBptyElNNmLEPqCphXgAgUA0Q+T +ECqyjexUAAlYBIAAWXjcZKefixD6gqYV4AIFANEPAJMQKrKb7FQACVgEgABZeNRlrxf6IGgdoAu1 +AFi6o/oAIh3gAwUA6rM4BQGJgADqEgIrWASAAFl3SsOw7N51HSgEgAD8oGgd4ApVAFl7/MhZHN5w +jREMXDYs1hhlNLWNEPyCphXgAgUA0Q8uQG5k7rqTECqysexUAAlYBIAAWXi4Za6n+iBoHaAbZQBY +uof6ACId4AIFAOqyOAUAqYAA6hICK1gEgABZdy4sfQMqxShlJGGNEPyCphXgAgUA0Q8AAJMQKrKj +7FQACVgEgABZeKRkos8a3kjbINMP6qKPKuAEgABZeJ9lrkL6IGgdoAtVAFi6bvoAIh3gAgUA6rI4 +BSqpgADqEgIrWASAAFl3FCxAb/GAKf7SAJ0AZKU3ihP6AKId4AzVAFi6S9Kg0Q+TECqyqexUAAlY +BIAAWXiJZa6y+iBoHaAbJQBYulhko8UrQG77YEDYEgCdAOoSAitYBIAAWXb/LEIWixArRhUKzDb8 +gsYVoAIFANEPAAAAkxAqsqfsVAAJWASAAFl4dWSiQxreGdsg6qKhKuAEgABZeHBlrlD6IGgdoAvl +AFi6QGSjY+oSAitYBIAAWXbpK30CKrUUixD6gqYV4AIFANEPkxAqspnsVAAJWASAAFl4YWSiShre +BNsg6qKlKuAEgABZeFxko9ca3gDbINMP6qKTKuAEgABZeFdlrer6IGgdoAt1AFi6JmSi/StAbmS3 +hxrd9YsS6qLfK2AEgABZeE1lpukrQG/AyAy7AitEb4sQ+oKmFeACBQDRDwAAkxAqsq/sVAAJWASA +AFl4QmSiDxrd5tsg0w/qopEq4ASAAFl4PWWtgvogaB2gC2UAWLoMZKKVK0BuZLcOGt3bixLqot8r +YASAAFl4M2SnHitAbywK/Qy7AStEb4sQ+oKmFeACBQDRDwCTECqyl+xUAAlYBIAAWXgoZKHXGt3M +2yDTD+qiiyrgBIAAWXgjZKMqGt3G2yDqoqsq4ASAAFl4HmSsPxrdwtsg6qKzKuAEgABZeBllrCzA +pf27igWgOwUAWXtNGt26ixLqos0rYASAAFl4EWWk2IsRK7ITC5lSyJlokgf5IBFp0gCdAI0RjBAr +1hP8gqYVoAIFANEPkxAqsofsVAAJWASAAFl4A2Shixrdp9sg6qKJKuAEgABZd/5lrIj6IGgdoAsl +AFi5zmShmxrdnosS6qLfK2AEgABZd/ZlrGeKE/oAQh3gDNUAWLmv0qDRDwAAAAAAAAD6IGgdoAv1 +AFi5v2ShYuoSAitYBIAAWXZp6xIAI+ALAAAqxRX6gqYV4AIFANEPAAD6IGgdoBsVAFi5s2ShMi1A +bmTVmSlAb/E/4C+SAJ0A8T/f79IAnQDqEgIrWASAAFl2Vy1CFxzdhPuhAA6wOwUA/ILmFeAKVQBZ +ewiLEPqCphXgAgUA0Q8A+iBoHaALpQBYuZ1koNouQG7TD2Tk+uoSAitYBIAAWXZFL0E0++AQgqIA +nQCKE/oBQh3gDNUAWLl80qDRDwAAAPogaB2gG1UAWLmNZKCa6hIBKlgEgADsEgIraASAAFi5FIsQ ++oKmFeACBQDRDwAAAPogaB2gC5UAWLmBZKBqKEBuZISeGt1RixLqot8rYASAAFl3qGWiuCtAb40Q +/IKmFeAMFQAMuwL6jeYd4AIFANEPAAAAAAAAAPogaB2gCxUAWLlvyqIa3UCLEuqi3ytgBIAAWXeY +ZarvihP6ACId4AzVAFi5UdKg0Q/Apf26hAWgOwUAWXrIwCDRDwAAAAAAAOoSAitYBIAAWXYK/UBo +HeA7BQD9unIFoApVAFl6vuoSAitYBIAAWXYD9UAYOpIAnQDHL9EPAAAA+iBoHaALhQBYuU/6ACId +4AIFAOqyOAUBSYAALEBuDwIAZMPXGt0o6xICK2AEgABZd3NlorUtQG/A6A7dAi1Eb2UvbY8Q/oKm +FeACBQDRDwDqEgEqWASAAFi5RWWvmisw2WP6BgAAAAD6IGgdoBsFAFi5NWSvOihAbtMPZINJ6hIC +K1gEgABZdd0pQhiLECtGFQqZNviDBhXgAgUA0Q8AAPogaB2gCzUAWLknZK8CGtz4ixLTD+qixStg +BIAAWXdP490CHQiGAACLESuyEwvJUciZaJIH+T/5AdIAnQCOEYwQA70BLeYT/IKmFaACBQDRD2Uu +vI8Q/oKmFeACBQDRD+oSAitYBIAAWXW8KkU0ghDygqYVoAIFANEPAAAAAAAA9uAAQbALBQD6YGgd +oIwFAFl1TuoSAinYBIAAWLldIyqAo3MrMNnAxAy7Avp/Zh2nuwEA+nsmHe/kKgAAACMqgKNzKDDZ ++iBIFaAJJQAJiALoNNkrWASAAFl1oMOw+nsGHafaAQD9uaIFoApVAFl6U2P4yooSWWna/UBoHeA7 +BQD9uZgFoApVAFl6TCoSAllp1Nyg+iBIFaP71QCre1l3D2ShpMCi/bmGBaA7BQBZekPHL9EPGtyv +ixLqoscrYASAAFl3BmWuEYsRK7ITC8lRaJEKaJIH+T/wAdIAnQAe3LYDvQEO3QKOEYwQLeYT/IKm +FaACBQDRDwCKE/oBIh3gDNUAWLiz0qDRDwAAAAAAAAD6IGgdoAtFAFi4w2Stco0R/blOBaAKVQD9 +omgV4DsFAFl6Ihrcj4sS6qLFK2AEgABZdubj3J8dBW4AAIsRK7ITC+lRyJlokgf5P+vp0gCdAI4R +jBADvQEt5hP8gqYVoAIFANEPGtx/ixLqos8rYASAAFl21mWtUYsRK7ITC5lSaJEKaJIH+T/qAdIA +nQAS3In4ICgVoo4FAK5+ArICIoYTLeDZ/CAIFaAPFQAP3QIt5Nn8gqYVoAIFANEPihP6AQId4AzV +AFi4ftKg0Q8jKoCjcysw2cDBDLsCCwtH+nsmHe/dRgAa3F+LEuqixytgBIAAWXa2ZazRixErshML +6VFokQpokgf5P+YB0gCdAB7caowRA70BDt0C/YJmFeAKVQD9uM4FoDsFAFl54IsQ+oKmFeACBQDR +DwAjKoCjcysw2cDIDLsCCwtH+nsmHe/blgD24ABCsAsFAPqgaB2gjAUAWXS2wWDqEgIq2ASAAFi4 +xCsw2Qa7Avp/Zh2nuwEA+nsmHe/avgCKE/oA4h3gDNUAWLhL0qDRDwCKE/oCAh3gDMUAWLhH0qDR +D4oT+gFCHeAMxQBYuEPSoNEPAIoT+gEiHeAMxQBYuD7SoNEPihP6AQId4AzFAFi4OtKg0Q+KE/oC +Qh3gDMUAWLg20qDRD4oT+gIiHeAMxQBYuDHSoNEPAIoT+gDCHeAMxQBYuC3SoNEPihP6AOId4AzF +AFi4KdKg0Q8AihP6AMId4AzVAFi4JNKg0Q8AAAAAbBAEJCIQLCAHDwIA8IeADeHMAQAtMBguMBkr +IhfvMBou7gKAAA7dAu4wGy7uAoAAD90CCN0RDt0C69kHdfAFAAAuJhcvMBAoMBHpMBIv/gKAAAj/ +AugwEy/+AoAACf8CCP8RCP8CaPAiKSIT6NwHFMAogAAImAEoJhMpQAUqCpX7IAdEIgCdAMAg0Q8r +MBQtMBXuMBYt3gKAAA27Au0wFy3eAoAADrsCCLsRDbsCaLC3jScv2RSK2f+kABWvyAUA6O4BB/iB +AADv1RQlU4EAAOrWCSdxAQAAfqsIKdEVCpoIKtYJHdvq2aD8AAgd4AslAG26AgkCYR/byJ+gjiD9 +wAAXMA8lAA/uAp6hLTAULjAVH9vf6DAWLu4CgAAO3QLuMBcu7gKAAAjdAu+mAi7uAoAADt0C7aYE +IdghAADrBgAFSGEAAAkAii8iE44iKAqACP8C7yYTL3keAAArzBjqJAAJYASAAFhjC2P/DdpAWNXZ +wCDRDwAAAGwQBhzbxo0gjjYvMQv4Y/AVoApVAPggBhWgOwUAWXk3GtvAJCIZLDELiCyJSoVH/QAA +RDALBQD4QYYVoA0FAOVSDiSQSoAALUYUCp4C/oFGFaAAHgArQhTrWggB2IEAAFlz/i5CFC0xC9MP +rt0tRhQqUAQsUAUY26vrUAYtVgKAAAyqAulQBy1WAoAAC6oC7NumHS4CgAAJVQIIVQH0oGAV7/jF +APigBAKwOwUA/qBoHaAKVQBZeREpIhQoMQupiCgmFCtCFC9cMH+xCMAg0Q8AAAAAABzblYpKDKoB +6kYKKVAEgABY0Bj6QGgdoAsFAPwAAh2gDSUAWAG5wCDRDwBsEAYc24uNIC4yBfRA6BWnVQEA/r/A +FeAIFQAPjzn0goIVoApVAPQgBhWgOwUAWXjziSLk23gUhWmAAPigBQlSAJ0AiCeMiPsCpBWvzwUA +6YILJHCBAAAP7gGuquuJFCVRAQAA/SAIxCCtBQCtya27K4UU+UAIy+IAnQD7IAk0IgCdAJmI2cDk +AAUOQASAAPgAqB2gCqUACAJhCAJhCAJhCAJhCAJhCAJhCAJhCAJhCAJhGNs7baoFAwCGCQJhmMCP +IP+2uAWgAqUA7sYCL/4CgAAC/wL/gCYV4AIFANEPAMAg0Q8mIAcX2yQGBkHqMgUrRwKAAKeIKYKe +K6wfC0sU+yAFY+IAnQAogp3uhAAEBVmAACmsH/QACB2kSR0AbUkCCAJhiDQd2xmd4IkgHNsa6uYD +J1hBAADs5gIszgKAAOlJAgHggQAA6eYBKVAEgAALgAAMbhGn7uTmnSKUdQAAiif6AUId4AwFAPtE +ABWgDaUAWFtv0qDRD8Ag0Q8AAAD9IGgdoAsFAPsBZhXv++YADK0M/c8ADvDvBQCv3f0BBhXv+5IA +L+xA/wEGFe/7ZgD//VwNoAgFAAAAK2wY6iQACWAEgABYYlVj/m8AbBAEhycf2xAqeRQpcRX44QgV +oK0FAP1AAEV/zgUA6pN0c9iBAACMew67AeuZCAwwBIAA6MFldMkBAAAqdRStinqTaHmhepp47wAF +CzgEgAAHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEX2tmXYIUgk2WUZPO19gWgB6UA4mYC +Kq4CgAAHVQLlZgErEASAANEPwCDRDwAA94BoHaAIBQD44WYVr/6CAAiaDPtvAA0w7AUArKr64QYV +r/4uACy8QPzhBhWv/gIAbBAEx48IWAMIOAIISAOoaOgiCAuBCoAAAiIYojLRDwBsEAQEOAMIWAOo +aOgiCAuBCoAAAiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQFSAMI +OAEIWAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBCMiECsgB9MPKDAF/BFiHeCZJQDTD/kHfg3huwEA +LCBo0w8PAgD9hX4N4I4FACkiE3ifIHCXAnmXH+/auhS8yIAALvq/Dp4BD+4B/kJmFaACBQDRD8Ag +0Q8AwKX9tWQFoDsFAFl4INowWNT7wCDRD40nKNkUitn/pAAV78kFAOn/AQRAgQAA6NUUJVOBAADq +1gkn+QEAAH+rByzRFarKKtYJH9qX2aD+AAgd4A0lAG3aAgkCYRnadZmgjSAc2pH+AEId7/j1AOim +BC7uAoAAD90CnaEpIhOIIpyiDpkC6SYTLHueAADaIOu8GClgBIAAWGHFwCDRDwAAAGwQBBPaiwMi +AtEPAGwQBCcgB4giGdpV9kIIFaF3AQDlgn9r1wKAAAmqCCiinvcAE6rSAJ0AJKKd7NpaEhNRgAAl +IhMtIgn6QUgV4FVBAAxVCiVSgO27DAKowQAA9WAQA+IAnQArIBYoCv94sRL6QPAVoAwFAFg6cOza +ShUR4YAAJyEHH9psGNo9+7TWBap3AQDpIRorvwKAAAh3ApdAjSAe2jr+gEYVoAdVAOraAg7eAoAA +B7sCm0EoIhOZRppE+AgABzKIUQDs6woMRYKAAOuygC92goAACO4CD+4CnkcLWwzrRgUl2EEAAJtD +KiIWiymlqqW7myn6QsYVr+kFAPiADPxiAJ0ALzIEB3oC/bSWBaAIFQD54CAV4A4FAPkCAA9wOwUA +WXexG9o3KUwg+fACHaAMBQD6AAgd4E8FAAkCYQkCYQkCYS9EICxEJSxEJixEJyxEJChEIS1iEvyH +Zh3o3R0A/IdGHejdHQD8hyYd6N0dAC1EOCoiF/qH5h2oqh0A+ofGHaiqHQD6h6YdqKodACpEPIo0 ++GMAFaD+9QDt2igSeKEAAPVABlgf+fUAGtoZCACIDwCKKUQzLUQxLkQwKkQyKjIELEQj+obmHaj8 +HQD+hEYd6OodAP6Gxh2o7h0A/oamHajuHQAuRDTrAAUCaQEAAA0CYSsgBwsLQR3Z2gy7EQ27CCe2 +nSsgFikK/3mxCvpA8BWgPAUAWDnyiDRogCeKJ/oAQh3gDAUA+0QAFaANJQBYWjorIhMs+n8MuwH6 +QmYV4AIFANEPHtn+LSITDt0C/EJmFe//LgAAAAAA6iQACtgEgABYOZ/s2c0Vb6mAAGAAK4hvGdnu +sYiYbwmIAviGZh2o+B0A/oZGHej/HQD+hiYd6P8dAP6GBh3v/KYAwCDRD9og7CQAA9hhAABYYRbA +INEPANog63wSKWAEgABYYRLAINEPAAAAAAAAAGwQBCoiFSkiFP2zRgWnNQEA6pkMAZQdAABkkHgr +IAcLC0EMuhGsqi2inm7SbiqinRTZuh/Znu3ZoBUDEYAALiEHDg5K5JQCD3cCgAAP7gIf2cqeoP5A +CBWgGAUAmKOdopSlHdmc/8YAD/AEJQDvpgQvdgKAAATuAp6h7QAVBVBhAAAKAIoMuBGsiCSGnS8i +Fan/LyYVaTIPwCDRD4kiypBoMi/AINEPAIon+gAiHeAMBQD7RAAVoA0VAFhZ5dKg0Q8AK7wY6iQA +CWAEgABYYNtpMs+MJy3JFIrJ+4QAFe/OBQDuuwEG6EEAAO3FFCVTwQAA6sYJJdkBAAB7qyovwRUZ +2XCq+prJmaCIIPOzOAWgCRUA4qYCLEYCgAAJiAL5QCYVoAIFANEPGdlmmaCIIPOzJgWgCRUA4qYC +LEYCgAAJiAL5QCYVoAIFANEPbBAEGtmMKSITGNmLKzELCpkBKSYTjTksIhQqIhF9iGurzOwmFCUE +iYAAjax91zgoIhLAsPwAAh2gDSUAC4AAKyIVKiIUGdl9C6oM7Nl9FVkDAAB7kxX7glYNoAkFAOkm +ESyQBIAA0Q/AINEP+kBoHaALBQD8AAIdoA0lAFv/jcCQ6SYRLJAEgADRDwD9stwFoAolAP5ACBWg +OwUAWXbM+kBoHaALBQD8AAIdoA0lAFjOy8Ag0Q8A2iBYzdhj/38AbBAGLiAF/7LCBeB4RQD/ABlT +ogCdAB7ZXC0iEw7dAi0mE/OgGbtSAJ0AjCyINiswICoxCv0AFeUluwEA/k0QFa6qAQD7W2AVr/jF +APlABAUwiLUA+cAIpCA1FQD7gABGMC4lAPxBhhWgLRUA/WJGDeAsVQB8sQp1sQf/YBh1IgCdACow +MCgwMRTZQukwMi1WAoAACKoC6DAzLVYCgAAJqgIIqhEIqgL1QBbOKIq5AP0QABQ1qgEACKoCGNj2 +0w8kgnsogoiqSgmqEfsAAEUwBEUA7bF3dVIBAAB8sW+JrASZApmsfbEFfLECfrkmJjA4KDA56TA6 +KzYCgAAIZgLoMDsrNgKAAAlmAghmEQhmArFmJiYXKiYR/WAEjCIAnQD1YAgMYgCdAP1gDexiAJ0A +/2AOzCIAnQAoEABlgdQpIhMPmQL4QmYV4AIFANEPKTAjwIEJiTkppEEooEEoFAD9f/vdIgCdAGP/ +egAAAPgAYh3j7eEA/z/3JiIAnQApMCQtMCXuMCYszgKAAA2ZAu0wJyzOAoAADpkCCJkR7ZkCBUAR +AAD5DQANf/rWAAAsMCHxn/tn0gCdAC4wPywwPC0wPSsiEOgwPi5mAoAADcwC7bITLmYCgAAIzAII +zBEOzAJ80QIsthMtMEAoMEEushTpMEIu7gKAAAjdAugwQy7uAoAACd0CCN0RCN0CfeECLbYUiKwe +2OAEiAKYrP5CRhWv/GYAAAApMCHxIAZOEgCdACswJCwwJe0wJi3eAoAADLsC7DAnLd4CgAANuwII +uxEMuwJlsJ8rMEwsME3tME4t3gKAAAy7AuwwTy3eAoAADbsCCLsRDLsCZLB6LCIQLMIYe8NxK6YS +JDBIKDBJ6TBKKiYCgAAIRALoMEsqJgKAAAlEAu3YvRomAoAACEQCJKYULjA0LDA1KTA25DA3L3YC +gAD9xgAPMAgFAOimEy92AoAACe4C6KYVL3YCgAAE7gKerfxCRhXv+U4AGNit+EJGFa/5IgAA+kBo +HaALBQD8AAIdoA0lAFjOBcAg0Q8AGdilKSYSiqcpPCDTD/tByBWgCzUAbboFCQCGCgJhKSITD5kC ++EJmFeACBQDRDwAA/bE0BaAKVQD8QAgV4DsFAFl18CsgBSwKeHy5m2P/qwAAKSIRy5CJl4me+SYA +FeALZQAqPCBtuQUKIIYJAmPAINEPAAAAAAAA//TIDa/qpQAqIhlj/38AACkiGYmXKzELiZ6/uwtL +S+W/x2TIwQAAY/9YAABsEAgW2H0qCgX9sPgFoDsFAPTWCBWgDQUAWXXRKGJOwFDm2HcUD5GAAPYg +phWgBhUALEJZLcEEjsD7v+AV7/U5AO/FBS3PAoAA6ekID78CgAAHlwwHAIf3gGQV5qUBAAqmYP1D +YEdWdwEADPgRCJgMCCCHKgoACqZi9UAKf1IAnQB/uQpkcAf64Af0IgCdABjYFRfYWeiCey/OQoAA +qakncqqpiAmIEah3iXrzIAYtIgCdAPLgBexiAJ0A/bCkBaAKVQD+4LAVoDsFAPzgCBXgCQUA+CAG +FeAPBQBZdaEZ2Eb64QgVr5t1ACt0BSmSsPgghhXvm2UA63QFLQgOAACMfOkWBCZ8tIAAK3ISLpJr +C4pE+1oADTAMBQD/QAEFMA0VAPtACBWvu4EAWGAfwPAvdhKKFI53HNgw+uAIFeAIBQD44YYVr88F +AOzCnSdogQAAD90B6OUUJukBAACd6Qy7DP3BBhXgDAUA+0soFaANFQBYYA0d2CEt0k6xVfy/9Yvi +AJ0AYACPAAAJ+RHpqQgOxwKAAP+ApBXluR0A6OgIDd+CgAALiAz5H4AVpOkBAOmCAC8BCoAA/MAB +B1/79QAL6wMLmQEJ7gKegI7A7cEEJ/gFAAAPD08vxQV98Q6w2wy5EfnAAET/+hIAAAD+AAId4AoF +APuApB2v/5YA+gBCHaA7BQDsEgUr6ASAAFl1VPggiBXv+7IA0Q8AAABsEAYqIgcmIAcPAgAoqRQG +BkEPAgDjogkkEDmAAPVByBXnhQEA+QATOVIAnQD9r94FoDsFAO2iAilwBIAA/kAIFeAKVQBZdT/9 +r9QFoApVAPoGAh3gDUUAWXU6FNeZDGkR9MAOGhIAnQAEmQgqkp4PAgD3QBNSUgCdACeSnWRyHf2v +ugWgClUA/GAQFeA7BQBZdSwqMADDtPtADcxiAJ0A5RYAIdAbAAAloAErCjD9r6QFplUBAPygaB3g +ClUAWXUhiRD0oAzIkgCdAPSgCkkSAJ0A9KAKCpIAnQDAwCghByogBx7Xx/5BBBXqiAEA+gIABbGq +AQDquxANVAKAAOr/AgxHAoAAC4gCGte8G9d1Dv8CCogCmHCNIJ90+uBGFeA6BQDqdgMuZgKAAP7g +xhWgCgUA+uCmFaAORQDqdgcu7gKAAO7dAgPYgQAA/OAmFeANJQADIIYLAmMDAIYLAmENzAL84SYV +oAtFAOkTHgPhAQAADAJpCWCGDAJnCUCGDAJlDG4RpO4r5p30oAbakgCdABTXnP5BCBXvmXUAKSQF +8pEoFe+YZQDoJAUviK4AAIssf7coKyISLjJrC4pE+1oADTAMBQD/QAEFMA0VAPtACBWvu4EAWF9t +wKAqJhKLII4nmiz8jsgVr88FAOrlFCdogQAAD90B7LsMBukBAACd6f3BBhXgDAUA+msoFaANFQBY +X17AINEPAP0gUBWv+wYA//fkDaADBQAb1yWKuPdABbiSAJ0ADGkRpJkokp73AAYKUgCdACeSnWRw +uLCsnLhlfi1gAEgqPQT0IAYV7/kyAPwQQh2v+eYA/a7QBaAKVQD6BgId4A0FAFl0suoiCilYBIAA +W/7Y//wcDaAKBQAAAC0gQAjdEPxgBhXv9k4AjiJk4G38YAgV4ApVAP2usAWgOwUAWXSkwCDRDwAA +AAAAAPoAQh2gOwUA7NdHGWgEgABZdJz/+2ANoAoFAAAAAAAA//ZkDaAHBQDAoFlyHRvW84q4+V/5 ++JIAnQD//UQNoAcFAMBwwPoPrzT/YQYV7/0KAIkw2iD5rnwFp5nBAOkkQClgBIAA6DYAI1hhAABY +Xk1j/28AbBAGiickIAcoqRT4oGgd4UQBAOWiCSQLaYAACQhH+QAM0VIAnQApIEHj1tgaMASAAPYA +gh3gDAUA8TjcDeALBQD0gAo6EgCdAAxKEaOqLaKe96AV++IAnQAqop3tpAANSASAAO/W0hUM+YAA +LiBBGtcW8dtMDeAEBQAoIAcuIQf8QQQV4MgRAPggAAQ67gEA6swQD3cCgADs7gIMRAKAAAjdAhzX +CgruAp6QiiCUl/UgphWgOAUAmJOfkv0gxhWgDiUA/aYADrAMRQDtlgQt7gKAAO7dAg1WAoAADKoC +mpHlBx4E0IEAAAoCYwUAhgoCYRXW952Z7yIIK2cCgACjzPeTphXvmnUAKiQF8rEoFe+YZQDoJAUv +jy4AAI8sf/cmKyISLjJrC4pE+1oADTAMBQD/QAEFMA0VAPtACBWvu4EAWF7FJCYSiyCOJ5Qs/K7I +Fa/PBQDk5RQnaIEAAA/dAey7DAbpAQAAnen9wQYV4AwFAPprKBWgDRUAWF63wCDRDwAAAP/6TA2g +BQUAHtZ/jej3oAw4kgCdAAxqEaOqKKKe9wAM6+IAnQAqop3koZRm+/0AAP/BBhXv+pIAKCBACIgQ ++KAGFa/5ggCOrizgBCfgBR3Wme/gBi5mAoAAB8wC7uAHLmYCgAAPzAIIzBEOzAINzAEnzGf2jgAL +8IuVAPbggBXv+PoAjlDaIP2tagXn7sEA7iRAKWAEgADtVgAiWGEAAFhdw8Ag0Q+cEJ0R6NZ+Fnmd +AAD6IGYV5P8dAC8WAugABQ7IBIAAbfkGCQJhnBCbEy4gBykhB/lAAATwrhEA6qoQDM8CgAAKmQIa +1pcKmQKKEYwQLSEImaD4QAgVoe4BAO8SAi90AoAADt0C7tZHHEYCgAAI/wLvpgEmeSEAAJ+jH9aQ +nqKUpQ/dAp2kBQSJ/0DGFeC+BQCepwogi4snLiAM67IOJmDBAADspgcvdAKAAA7dAu2mBCVQoQAA +WW6kixOMEokRGtZ479YwHmcCgAD9IABEv/YOAAD6AEIdoDsFAOzWaxloBIAAWXPAY/4IAAD/9RAN +oAoFAJwQ+iBmFeAKBQBZcUEe1heN6IsTjBD5v/MYkgCdAP/0eA2gCgUAwKDA+g/fNP/BBhXv9D4A +AAAAbBAEiSckIAcomRQEBEHnkgkkC3GAABPWCPaAaB2nhQEA+QAMcVIAnQD0gAraEgCdAAxJEQOZ +CCqSnvdADlJSAJ0AKZKdZJF4GtYjH9YDG9ZJ6gAFDNAEgAAKAmEKAmEKAmEKAmEqIAcoIQf5QAAE +MMoRAOrMEAxHAoAADIgCC4gCmJCMIP8gRhXgPgUA/yBmFaANRQDu1jgeZgKAAA3MApyR+kgwFeAF +JQD8QQQVoAQFAP8gxhWh+gEA5JYFL/wCgADvzAIE0IEAAO7MAg2I1gAAwLCUl+yWBC3+AoAABf8C +FdYmByCGCgJjBwCGCgJhn5noIggrdwKAAKPu/dOmFe+cdQAsJAXysSgV75plAOokBSwG7gAAiCx/ +hyYrIhIuMmsLikT7WgANMAwFAP9AAQUwDRUA+0AIFa+7gQBYXfEkJhKLII4nlCz8rsgVr88FAOTl +FCdogQAAD90B7LsMBukBAACd6f3BBhXgDAUA+msoFaANFQBYXePAINEPAAAA//pIDaAHBQAV1auK +WGqhfwxpEaOZKJKe9wAEYlIAnQApkp3kkINlW/0AAJtYZZ6XYAANLCBACMwQ/OAGFa/5sgCOcNog +/avmBefuwQDuJEApYASAAO12ACJYYQAAWFz/wCDRDwAAAAD6ESId7/uiAPoAQh2gOwUA7NXZGWgE +gABZcy5j/xAAAP/45A2gCQUAwKBZcLGKWPlf+6iSAJ0A//4oDaAJBQAAwJDA+g+vNP6hBhXv/eoA +AGwQDogizowpIhMd1dX7qxQFoZlBAOfVehzegoAA6xYELM+CgAD7IABEsBvlAPggphXgBGoAwCDR +DwAALkIbLEIarq566wGxzC5GG/yDRhWgBAUAKCEHGdVv9IAAhTqIAQDs1cAcRwKAAAmIAikhGphQ ++EAIFaBOBQCeU5xSHtW6HNWUDqoR7v4KBVG9AAD9BgAONKodAOxWBCxGAoAACKgCHNWymFEu4qHp +VgYjQMEAAOhWBSJIBQAADJkCGNWtKVYUiRQc1awI7gEOmQIMmQKZV4kYjikoIhap7umICAdwwQAA +7iYJJEDBAAAoJhaMGe/Voh5nAoAAp8wqxp0uIBb6QPAVr5mFAPhgph3g+PUA+cUmDaKsBQAMrB2v +ySmSf8GPDogM+SAk+iIAnQAMqRHtmQgPQgKAAAi4ApiTKjITKTIS+yAfjCAb5QAvIAcPD0EM+hGn +qiyinp8Z+4Aio+IAnQAlop2LFeRUR2LRgQAAJjISiTcuMheaFiiZFCuygPpDCBWgBAUA7u4JBB1J +gACEmSgyE4kpBO4LCGYMiCoKZjamu+sWCCXYwQAA6xYAJ3HBAADpiAwLYASAAPsAF2viAJ0AKiAW +KAr/7wIABUhBAAD5QAQUIgCdABjVaJQfkx4kIAclFhD0IOYVoqUFAAVEHRXVYwqjCqhIpUQEMwsU +1WGkMySCfvsgBADQCRUAAJUaBUQBJYJ/BFUCJYZ/JDJ/kxPlEhAiIAUAACQ2fyiCgOMSDi0BCoAA +5BIPLNAKgAD7ABoYogCdAIgXDIgRrYiIgAiqAWSjSCZUJycWEfoiRhXgCAUAKFQj+KQmHai2HQD6 +pMYd4ApVAPqkBh2oux0A+qSmHeAKBQD6pEYdqLsdAOtUJCJI4QAA6QYAArihAAAHAIqLPvqmZh3o *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:53:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A71166EE; Wed, 3 Jul 2013 23:53:29 +0000 (UTC) (envelope-from jimharris@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 991C51F4A; Wed, 3 Jul 2013 23:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NrTB2069054; Wed, 3 Jul 2013 23:53:29 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NrTRm069050; Wed, 3 Jul 2013 23:53:29 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032353.r63NrTRm069050@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:53:29 +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: r252662 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:53:29 -0000 Author: jimharris Date: Wed Jul 3 23:53:28 2013 New Revision: 252662 URL: http://svnweb.freebsd.org/changeset/base/252662 Log: MFC r252269: Add an nvme_function structure array, defining the name, C function and usage message for each nvmecontrol command. This helps reduce some code clutter both now and for future commits which will add logpage and firmware support to nvmecontrol(8). Also move helper function prototypes to the end of the header file, after the per-command functions. Also add missing static keyword that glebius@ fixed as part of r252302. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:52:15 2013 (r252661) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:53:28 2013 (r252662) @@ -44,14 +44,31 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" +typedef void (*nvme_fn_t)(int argc, char *argv[]); + +static struct nvme_function { + const char *name; + nvme_fn_t fn; + const char *usage; +} funcs[] = { + {"devlist", devlist, DEVLIST_USAGE}, + {"identify", identify, IDENTIFY_USAGE}, + {"perftest", perftest, PERFTEST_USAGE}, + {"reset", reset, RESET_USAGE}, + {NULL, NULL, NULL}, +}; + static void usage(void) { + struct nvme_function *f; + + f = funcs; fprintf(stderr, "usage:\n"); - fprintf(stderr, DEVLIST_USAGE); - fprintf(stderr, IDENTIFY_USAGE); - fprintf(stderr, RESET_USAGE); - fprintf(stderr, PERFTEST_USAGE); + while (f->name != NULL) { + fprintf(stderr, "%s", f->usage); + f++; + } exit(EX_USAGE); } @@ -136,18 +153,17 @@ open_dev(const char *str, int *fd, int s int main(int argc, char *argv[]) { + struct nvme_function *f; if (argc < 2) usage(); - if (strcmp(argv[1], "devlist") == 0) - devlist(argc-1, &argv[1]); - else if (strcmp(argv[1], "identify") == 0) - identify(argc-1, &argv[1]); - else if (strcmp(argv[1], "perftest") == 0) - perftest(argc-1, &argv[1]); - else if (strcmp(argv[1], "reset") == 0) - reset(argc-1, &argv[1]); + f = funcs; + while (f->name != NULL) { + if (strcmp(argv[1], f->name) == 0) + f->fn(argc-1, &argv[1]); + f++; + } usage(); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:52:15 2013 (r252661) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:53:28 2013 (r252662) @@ -46,14 +46,14 @@ #define RESET_USAGE \ " nvmecontrol reset \n" -int open_dev(const char *str, int *fd, int show_error, int exit_on_error); -void read_controller_data(int fd, struct nvme_controller_data *cdata); -void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); - void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); +int open_dev(const char *str, int *fd, int show_error, int exit_on_error); +void read_controller_data(int fd, struct nvme_controller_data *cdata); +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); + #endif From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:54:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 159AF8C1; Wed, 3 Jul 2013 23:54:37 +0000 (UTC) (envelope-from jimharris@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 E36431F5B; Wed, 3 Jul 2013 23:54:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NsaKG069249; Wed, 3 Jul 2013 23:54:36 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nsa3D069246; Wed, 3 Jul 2013 23:54:36 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032354.r63Nsa3D069246@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:54: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: r252663 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:54:37 -0000 Author: jimharris Date: Wed Jul 3 23:54:36 2013 New Revision: 252663 URL: http://svnweb.freebsd.org/changeset/base/252663 Log: MFC r252270: Create #defines for NVME_CTRLR_PREFIX and NVME_NS_PREFIX for the "nvme" and "ns" strings, rather than hardcoding the string values throughout the nvmecontrol code base. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/devlist.c stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/devlist.c ============================================================================== --- stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:54:36 2013 (r252663) @@ -78,7 +78,7 @@ devlist(int argc, char *argv[]) while (1) { ctrlr++; - sprintf(name, "nvme%d", ctrlr); + sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr); exit_code = open_dev(name, &fd, 0, 0); @@ -95,7 +95,8 @@ devlist(int argc, char *argv[]) printf("%6s: %s\n", name, cdata.mn); for (i = 0; i < cdata.nn; i++) { - sprintf(name, "nvme%dns%d", ctrlr, i+1); + sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, + NVME_NS_PREFIX, i+1); read_namespace_data(fd, i+1, &nsdata); printf(" %10s (%lldGB)\n", name, Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:54:36 2013 (r252663) @@ -258,7 +258,7 @@ identify_ns(int argc, char *argv[]) * of the string. Don't search past 10 characters into the string, * otherwise we know it is malformed. */ - nsloc = strnstr(argv[optind], "ns", 10); + nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10); if (nsloc != NULL) nsid = strtol(nsloc + 2, NULL, 10); if (nsloc == NULL || (nsid == 0 && errno != 0)) { @@ -314,7 +314,7 @@ identify(int argc, char *argv[]) * If device node contains "ns", we consider it a namespace, * otherwise, consider it a controller. */ - if (strstr(target, "ns") == NULL) + if (strstr(target, NVME_NS_PREFIX) == NULL) identify_ctrlr(argc, argv); else identify_ns(argc, argv); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:54:36 2013 (r252663) @@ -31,6 +31,9 @@ #include +#define NVME_CTRLR_PREFIX "nvme" +#define NVME_NS_PREFIX "ns" + #define DEVLIST_USAGE \ " nvmecontrol devlist\n" From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:56:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F0829A08; Wed, 3 Jul 2013 23:56:42 +0000 (UTC) (envelope-from jimharris@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 D2BF71F6D; Wed, 3 Jul 2013 23:56:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NugYb069607; Wed, 3 Jul 2013 23:56:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nugc0069603; Wed, 3 Jul 2013 23:56:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032356.r63Nugc0069603@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:56:42 +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: r252664 - stable/9/sys/dev/nvme X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:56:43 -0000 Author: jimharris Date: Wed Jul 3 23:56:41 2013 New Revision: 252664 URL: http://svnweb.freebsd.org/changeset/base/252664 Log: MFC r252271: Use MAXPHYS to specify the maximum I/O size for nvme(4). Also allow admin commands to transfer up to this maximum I/O size, rather than the artificial limit previously imposed. The larger I/O size is very beneficial for upcoming firmware download support. This has the added benefit of simplifying the code since both admin and I/O commands now use the same maximum I/O size. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme.h stable/9/sys/dev/nvme/nvme_ctrlr.c stable/9/sys/dev/nvme/nvme_private.h stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme.h ============================================================================== --- stable/9/sys/dev/nvme/nvme.h Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme.h Wed Jul 3 23:56:41 2013 (r252664) @@ -33,6 +33,8 @@ #include #endif +#include + #define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command) #define NVME_RESET_CONTROLLER _IO('n', 1) @@ -45,6 +47,8 @@ */ #define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) +#define NVME_MAX_XFER_SIZE MAXPHYS + union cap_lo_register { uint32_t raw; struct { Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:56:41 2013 (r252664) @@ -222,7 +222,6 @@ nvme_ctrlr_construct_admin_qpair(struct 0, /* vector */ num_entries, NVME_ADMIN_TRACKERS, - 16*1024, /* max xfer size */ ctrlr); } @@ -256,16 +255,6 @@ nvme_ctrlr_construct_io_qpairs(struct nv */ num_trackers = min(num_trackers, (num_entries-1)); - ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - TUNABLE_INT_FETCH("hw.nvme.max_xfer_size", &ctrlr->max_xfer_size); - /* - * Check that tunable doesn't specify a size greater than what our - * driver supports, and is an even PAGE_SIZE multiple. - */ - if (ctrlr->max_xfer_size > NVME_MAX_XFER_SIZE || - ctrlr->max_xfer_size % PAGE_SIZE) - ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); @@ -284,7 +273,6 @@ nvme_ctrlr_construct_io_qpairs(struct nv ctrlr->msix_enabled ? i+1 : 0, /* vector */ num_entries, num_trackers, - ctrlr->max_xfer_size, ctrlr); if (ctrlr->per_cpu_io_queues) @@ -1089,8 +1077,8 @@ intx: if (!ctrlr->msix_enabled) nvme_ctrlr_configure_intx(ctrlr); + ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; nvme_ctrlr_construct_admin_qpair(ctrlr); - status = nvme_ctrlr_construct_io_qpairs(ctrlr); if (status != 0) Modified: stable/9/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:56:41 2013 (r252664) @@ -60,8 +60,6 @@ MALLOC_DECLARE(M_NVME); #define IDT32_PCI_ID 0x80d0111d /* 32 channel board */ #define IDT8_PCI_ID 0x80d2111d /* 8 channel board */ -#define NVME_MAX_PRP_LIST_ENTRIES (32) - /* * For commands requiring more than 2 PRP entries, one PRP will be * embedded in the command (prp1), and the rest of the PRP entries @@ -69,7 +67,7 @@ MALLOC_DECLARE(M_NVME); * that real max number of PRP entries we support is 32+1, which * results in a max xfer size of 32*PAGE_SIZE. */ -#define NVME_MAX_XFER_SIZE NVME_MAX_PRP_LIST_ENTRIES * PAGE_SIZE +#define NVME_MAX_PRP_LIST_ENTRIES (NVME_MAX_XFER_SIZE / PAGE_SIZE) #define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) @@ -194,7 +192,6 @@ struct nvme_qpair { struct resource *res; void *tag; - uint32_t max_xfer_size; uint32_t num_entries; uint32_t num_trackers; uint32_t sq_tdbl_off; @@ -446,7 +443,7 @@ void nvme_ctrlr_post_failed_request(stru void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, - uint32_t num_trackers, uint32_t max_xfer_size, + uint32_t num_trackers, struct nvme_controller *ctrlr); void nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr); Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:56:41 2013 (r252664) @@ -460,7 +460,7 @@ nvme_qpair_msix_handler(void *arg) void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, uint32_t num_trackers, - uint32_t max_xfer_size, struct nvme_controller *ctrlr) + struct nvme_controller *ctrlr) { struct nvme_tracker *tr; uint32_t i; @@ -478,7 +478,6 @@ nvme_qpair_construct(struct nvme_qpair * num_trackers = min(num_trackers, 64); #endif qpair->num_trackers = num_trackers; - qpair->max_xfer_size = max_xfer_size; qpair->ctrlr = ctrlr; if (ctrlr->msix_enabled) { @@ -501,8 +500,8 @@ nvme_qpair_construct(struct nvme_qpair * bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, NULL, NULL, qpair->max_xfer_size, - (qpair->max_xfer_size/PAGE_SIZE)+1, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR, NULL, NULL, NVME_MAX_XFER_SIZE, + (NVME_MAX_XFER_SIZE/PAGE_SIZE)+1, PAGE_SIZE, 0, NULL, NULL, &qpair->dma_tag); qpair->num_cmds = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:58:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD2ABBB3; Wed, 3 Jul 2013 23:58:09 +0000 (UTC) (envelope-from jimharris@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 B4E8C1F7D; Wed, 3 Jul 2013 23:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nw9Mk069824; Wed, 3 Jul 2013 23:58:09 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nw9Z7069822; Wed, 3 Jul 2013 23:58:09 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032358.r63Nw9Z7069822@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:58: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: r252665 - stable/9/sys/dev/nvme X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:58:10 -0000 Author: jimharris Date: Wed Jul 3 23:58:09 2013 New Revision: 252665 URL: http://svnweb.freebsd.org/changeset/base/252665 Log: MFC r252272: Fail any passthrough command whose transfer size exceeds the controller's max transfer size. This guards against rogue commands coming in from userspace. Also add KASSERTS for the virtual address and unmapped bio cases, if the transfer size exceeds the controller's max transfer size. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:56:41 2013 (r252664) +++ stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:58:09 2013 (r252665) @@ -895,7 +895,13 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c struct buf *buf = NULL; int ret = 0; - if (pt->len > 0) + if (pt->len > 0) { + if (pt->len > ctrlr->max_xfer_size) { + nvme_printf(ctrlr, "pt->len (%d) " + "exceeds max_xfer_size (%d)\n", pt->len, + ctrlr->max_xfer_size); + return EIO; + } if (is_user_buffer) { /* * Ensure the user buffer is wired for the duration of @@ -920,7 +926,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c } else req = nvme_allocate_request_vaddr(pt->buf, pt->len, nvme_pt_done, pt); - else + } else req = nvme_allocate_request_null(nvme_pt_done, pt); req->cmd.opc = pt->cmd.opc; Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:56:41 2013 (r252664) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:58:09 2013 (r252665) @@ -786,6 +786,9 @@ _nvme_qpair_submit_request(struct nvme_q switch (req->type) { case NVME_REQUEST_VADDR: + KASSERT(req->payload_size <= qpair->ctrlr->max_xfer_size, + ("payload_size (%d) exceeds max_xfer_size (%d)\n", + req->payload_size, qpair->ctrlr->max_xfer_size)); err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, req->u.payload, req->payload_size, nvme_payload_map, tr, 0); if (err != 0) @@ -805,6 +808,10 @@ _nvme_qpair_submit_request(struct nvme_q break; #ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: + KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, + ("bio->bio_bcount (%jd) exceeds max_xfer_size (%d)\n", + (intmax_t)req->u.bio->bio_bcount, + qpair->ctrlr->max_xfer_size)); err = bus_dmamap_load_bio(tr->qpair->dma_tag, tr->payload_dma_map, req->u.bio, nvme_payload_map, tr, 0); if (err != 0) From owner-svn-src-all@FreeBSD.ORG Wed Jul 3 23:59:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBA04CEE; Wed, 3 Jul 2013 23:59:09 +0000 (UTC) (envelope-from jimharris@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 82F5B1F85; Wed, 3 Jul 2013 23:59:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nx959069983; Wed, 3 Jul 2013 23:59:09 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nx8Pi069980; Wed, 3 Jul 2013 23:59:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032359.r63Nx8Pi069980@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:59:08 +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: r252666 - stable/9/sys/dev/nvme X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 23:59:09 -0000 Author: jimharris Date: Wed Jul 3 23:59:08 2013 New Revision: 252666 URL: http://svnweb.freebsd.org/changeset/base/252666 Log: MFC r252273: Remove remaining uio-related code. The nvme_physio() function was removed quite a while ago, which was the only user of this uio-related code. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme_private.h stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:58:09 2013 (r252665) +++ stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:59:08 2013 (r252666) @@ -145,7 +145,6 @@ struct nvme_request { struct nvme_qpair *qpair; union { void *payload; - struct uio *uio; struct bio *bio; } u; uint32_t type; @@ -469,8 +468,6 @@ int nvme_ns_construct(struct nvme_namesp struct nvme_controller *ctrlr); void nvme_ns_destruct(struct nvme_namespace *ns); -int nvme_ns_physio(struct cdev *dev, struct uio *uio, int ioflag); - void nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr); void nvme_dump_command(struct nvme_command *cmd); @@ -525,19 +522,6 @@ nvme_allocate_request_null(nvme_cb_fn_t } static __inline struct nvme_request * -nvme_allocate_request_uio(struct uio *uio, nvme_cb_fn_t cb_fn, void *cb_arg) -{ - struct nvme_request *req; - - req = _nvme_allocate_request(cb_fn, cb_arg); - if (req != NULL) { - req->type = NVME_REQUEST_UIO; - req->u.uio = uio; - } - return (req); -} - -static __inline struct nvme_request * nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:58:09 2013 (r252665) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:59:08 2013 (r252666) @@ -735,14 +735,6 @@ nvme_payload_map(void *arg, bus_dma_segm } static void -nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, - bus_size_t mapsize, int error) -{ - - nvme_payload_map(arg, seg, nseg, error); -} - -static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) { struct nvme_tracker *tr; @@ -798,14 +790,6 @@ _nvme_qpair_submit_request(struct nvme_q case NVME_REQUEST_NULL: nvme_qpair_submit_tracker(tr->qpair, tr); break; - case NVME_REQUEST_UIO: - err = bus_dmamap_load_uio(tr->qpair->dma_tag, - tr->payload_dma_map, req->u.uio, nvme_payload_map_uio, - tr, 0); - if (err != 0) - nvme_printf(qpair->ctrlr, - "bus_dmamap_load_uio returned 0x%x!\n", err); - break; #ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:01:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AFBFEC2; Thu, 4 Jul 2013 00:01:00 +0000 (UTC) (envelope-from jimharris@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 6DB551FA1; Thu, 4 Jul 2013 00:01:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64010uP072067; Thu, 4 Jul 2013 00:01:00 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6400xJQ072040; Thu, 4 Jul 2013 00:00:59 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040000.r6400xJQ072040@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252667 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:01:00 -0000 Author: jimharris Date: Thu Jul 4 00:00:59 2013 New Revision: 252667 URL: http://svnweb.freebsd.org/changeset/base/252667 Log: MFC r252274: Ensure that a device node is specified when invoking the identify or reset commands. Also improve the checking of device node names, so that better error messages are displayed when incorrect names are specified. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/reset.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:00:59 2013 (r252667) @@ -200,6 +200,10 @@ identify_ctrlr(int argc, char *argv[]) } } + /* Check that a controller was specified. */ + if (optind >= argc) + identify_usage(); + open_dev(argv[optind], &fd, 1, 1); read_controller_data(fd, &cdata); close(fd); @@ -245,6 +249,10 @@ identify_ns(int argc, char *argv[]) } } + /* Check that a namespace was specified. */ + if (optind >= argc) + identify_usage(); + /* * Check if the specified device node exists before continuing. * This is a cleaner check for cases where the correct controller Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:00:59 2013 (r252667) @@ -126,10 +126,22 @@ open_dev(const char *str, int *fd, int s struct stat devstat; char full_path[64]; + if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { + if (show_error) + fprintf(stderr, + "Controller/namespace IDs must begin with '%s'.\n", + NVME_CTRLR_PREFIX); + if (exit_on_error) + exit(EX_USAGE); + else + return (EX_USAGE); + } + snprintf(full_path, sizeof(full_path), "/dev/%s", str); if (stat(full_path, &devstat) != 0) { if (show_error) - fprintf(stderr, "error\n"); + fprintf(stderr, "Could not stat %s. errno=%d (%s)\n", + full_path, errno, strerror(errno)); if (exit_on_error) exit(EX_NOINPUT); else @@ -139,8 +151,8 @@ open_dev(const char *str, int *fd, int s *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error) - printf("Could not open %s. errno=%d (%s)\n", full_path, - errno, strerror(errno)); + fprintf(stderr, "Could not open %s. errno=%d (%s)\n", + full_path, errno, strerror(errno)); if (exit_on_error) exit(EX_NOPERM); else Modified: stable/9/sbin/nvmecontrol/reset.c ============================================================================== --- stable/9/sbin/nvmecontrol/reset.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/reset.c Thu Jul 4 00:00:59 2013 (r252667) @@ -60,6 +60,10 @@ reset(int argc, char *argv[]) } } + /* Check that a controller was specified. */ + if (optind >= argc) + reset_usage(); + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { printf("Reset request to %s failed. errno=%d (%s)\n", From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:02:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 477CE6C; Thu, 4 Jul 2013 00:02:11 +0000 (UTC) (envelope-from ache@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 3A39B1FAF; Thu, 4 Jul 2013 00:02:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6402BwJ072342; Thu, 4 Jul 2013 00:02:11 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6402Bla072341; Thu, 4 Jul 2013 00:02:11 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201307040002.r6402Bla072341@svn.freebsd.org> From: "Andrey A. Chernov" Date: Thu, 4 Jul 2013 00:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252668 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:02:11 -0000 Author: ache Date: Thu Jul 4 00:02:10 2013 New Revision: 252668 URL: http://svnweb.freebsd.org/changeset/base/252668 Log: After fixing ranges restore POSIX requirement: rand() call without srand() must be the same as srand(1); rand(); (yet one increment) Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Thu Jul 4 00:00:59 2013 (r252667) +++ head/lib/libc/stdlib/rand.c Thu Jul 4 00:02:10 2013 (r252668) @@ -99,7 +99,12 @@ rand_r(unsigned int *ctx) } -static u_long next = 1; +static u_long next = +#ifdef USE_WEAK_SEEDING + 1; +#else + 2; +#endif int rand() From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:03:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E3C51DC; Thu, 4 Jul 2013 00:03:31 +0000 (UTC) (envelope-from jimharris@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 8EEA71FBF; Thu, 4 Jul 2013 00:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6403Vjj072602; Thu, 4 Jul 2013 00:03:31 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6403V5T072599; Thu, 4 Jul 2013 00:03:31 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040003.r6403V5T072599@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:03: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: r252669 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:03:31 -0000 Author: jimharris Date: Thu Jul 4 00:03:30 2013 New Revision: 252669 URL: http://svnweb.freebsd.org/changeset/base/252669 Log: MFC r252275: Add generalized helper functions for printing hex data as part of nvmecontrol commands. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Modified: stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:03:30 2013 (r252669) @@ -42,25 +42,6 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" static void -print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)cdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void print_controller(struct nvme_controller_data *cdata) { printf("Controller Capabilities/Features\n"); @@ -128,25 +109,6 @@ print_controller(struct nvme_controller_ } static void -print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)nsdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void print_namespace(struct nvme_namespace_data *nsdata) { uint32_t i; @@ -214,7 +176,7 @@ identify_ctrlr(int argc, char *argv[]) else hexlength = offsetof(struct nvme_controller_data, reserved5); - print_controller_hex(&cdata, hexlength); + print_hex(&cdata, hexlength); exit(EX_OK); } @@ -290,7 +252,7 @@ identify_ns(int argc, char *argv[]) else hexlength = offsetof(struct nvme_namespace_data, reserved6); - print_namespace_hex(&nsdata, hexlength); + print_hex(&nsdata, hexlength); exit(EX_OK); } Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:03:30 2013 (r252669) @@ -72,6 +72,54 @@ usage(void) exit(EX_USAGE); } +static void +print_bytes(void *data, uint32_t length) +{ + uint32_t i, j; + uint8_t *p, *end; + + end = (uint8_t *)data + length; + + for (i = 0; i < length; i++) { + p = (uint8_t *)data + (i*16); + printf("%03x: ", i*16); + for (j = 0; j < 16 && p < end; j++) + printf("%02x ", *p++); + if (p >= end) + break; + printf("\n"); + } + printf("\n"); +} + +static void +print_dwords(void *data, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)data; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +void +print_hex(void *data, uint32_t length) +{ + if (length >= sizeof(uint32_t) || length % sizeof(uint32_t) == 0) + print_dwords(data, length); + else + print_bytes(data, length); +} + void read_controller_data(int fd, struct nvme_controller_data *cdata) { Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:03:30 2013 (r252669) @@ -57,6 +57,7 @@ void reset(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); +void print_hex(void *data, uint32_t length); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:06:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B296039D; Thu, 4 Jul 2013 00:06:12 +0000 (UTC) (envelope-from jimharris@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 A293C1FDA; Thu, 4 Jul 2013 00:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6406CZv073097; Thu, 4 Jul 2013 00:06:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6406Bva073090; Thu, 4 Jul 2013 00:06:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040006.r6406Bva073090@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:06: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: r252670 - stable/9/sbin/nvmecontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:06:12 -0000 Author: jimharris Date: Thu Jul 4 00:06:11 2013 New Revision: 252670 URL: http://svnweb.freebsd.org/changeset/base/252670 Log: MFC r252277: Add log page support to nvmecontrol(8) through a new logpage command. This includes pretty printers for all of the standard NVMe log pages (Error, SMART/Health, Firmware), as well as hex output for non-standard or vendor-specific log pages. Also add missing static keyword that glebius@ fixed as part of r252302. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Added: stable/9/sbin/nvmecontrol/logpage.c - copied, changed from r252277, head/sbin/nvmecontrol/logpage.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.8 stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:06:11 2013 (r252670) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c perftest.c reset.c +SRCS= nvmecontrol.c devlist.c identify.c logpage.c perftest.c reset.c MAN= nvmecontrol.8 .include Copied and modified: stable/9/sbin/nvmecontrol/logpage.c (from r252277, head/sbin/nvmecontrol/logpage.c) ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Jun 26 23:53:54 2013 (r252277, copy source) +++ stable/9/sbin/nvmecontrol/logpage.c Thu Jul 4 00:06:11 2013 (r252670) @@ -227,7 +227,7 @@ print_log_firmware(void *buf, uint32_t s } } -struct logpage_function { +static struct logpage_function { uint8_t log_page; print_fn_t fn; } logfuncs[] = { Modified: stable/9/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:06:11 2013 (r252670) @@ -58,6 +58,12 @@ .Nm .Ic reset .Aq controller id +.Nm +.Ic logpage +.Aq Fl p Ar page_id +.Op Fl x +.Aq device id +.Aq namespace id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -84,6 +90,16 @@ stdout when 30 seconds expires. .Dl nvmecontrol reset nvme0 .Pp Perform a controller-level reset of the nvme0 controller. +.Pp +.Dl nvmecontrol logpage -p 1 nvme0 +.Pp +Display a human-readable summary of the nvme0 controller's Error Information Log. +Log pages defined by the NVMe specification include Error Information Log (ID=1), +SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3). +.Pp +.Dl nvmecontrol logpage -p 1 -x nvme0 +.Pp +Display a hexidecimal dump of the nvme0 controller's Error Information Log. .Sh AUTHORS .An -nosplit .Nm Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:06:11 2013 (r252670) @@ -55,6 +55,7 @@ static struct nvme_function { {"identify", identify, IDENTIFY_USAGE}, {"perftest", perftest, PERFTEST_USAGE}, {"reset", reset, RESET_USAGE}, + {"logpage", logpage, LOGPAGE_USAGE}, {NULL, NULL, NULL}, }; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:06:11 2013 (r252670) @@ -49,15 +49,21 @@ #define RESET_USAGE \ " nvmecontrol reset \n" +#define LOGPAGE_USAGE \ +" nvmecontrol logpage <-p page_id> [-x] \n" \ + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); +void logpage(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); void print_hex(void *data, uint32_t length); +void read_logpage(int fd, uint8_t log_page, int nsid, void *payload, + uint32_t payload_size); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:16:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24FF2596; Thu, 4 Jul 2013 00:16:45 +0000 (UTC) (envelope-from jimharris@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 14BE1101E; Thu, 4 Jul 2013 00:16:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r640Gi0b076418; Thu, 4 Jul 2013 00:16:44 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r640GhvI076412; Thu, 4 Jul 2013 00:16:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040016.r640GhvI076412@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:16:43 +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: r252671 - in stable/9: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:16:45 -0000 Author: jimharris Date: Thu Jul 4 00:16:43 2013 New Revision: 252671 URL: http://svnweb.freebsd.org/changeset/base/252671 Log: MFC r252278: Add firmware replacement and activation support to nvmecontrol(8) through a new firmware command. NVMe controllers may support up to 7 firmware slots for storing of different firmware revisions. This new firmware command supports firmware replacement (i.e. firmware download) with or without immediate activation, or activation of a previously stored firmware image. It also supports selection of the firmware slot during replacement operations, using IDENTIFY information from the controller to check that the specified slot is valid. Newly activated firmware does not take effect until the new controller reset, either via a reboot or separate 'nvmecontrol reset' command to the same controller. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Added: stable/9/sbin/nvmecontrol/firmware.c - copied, changed from r252278, head/sbin/nvmecontrol/firmware.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.8 stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h stable/9/sys/dev/nvme/nvme.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:16:43 2013 (r252671) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c logpage.c perftest.c reset.c +SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ + perftest.c reset.c MAN= nvmecontrol.8 .include Copied and modified: stable/9/sbin/nvmecontrol/firmware.c (from r252278, head/sbin/nvmecontrol/firmware.c) ============================================================================== --- head/sbin/nvmecontrol/firmware.c Thu Jun 27 00:08:25 2013 (r252278, copy source) +++ stable/9/sbin/nvmecontrol/firmware.c Thu Jul 4 00:16:43 2013 (r252671) @@ -82,7 +82,7 @@ read_image_file(char *path, void **buf, exit(EX_IOERR); } if ((*buf = malloc(sb.st_size)) == NULL) { - fprintf(stderr, "Unable to malloc %zd bytes.\n", + fprintf(stderr, "Unable to malloc %jd bytes.\n", sb.st_size); close(fd); exit(EX_IOERR); @@ -95,7 +95,7 @@ read_image_file(char *path, void **buf, } if (*size != sb.st_size) { fprintf(stderr, "Error reading '%s', " - "read %zd bytes, requested %zd bytes\n", + "read %zd bytes, requested %jd bytes\n", path, *size, sb.st_size); close(fd); exit(EX_IOERR); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:16:43 2013 (r252671) @@ -64,6 +64,12 @@ .Op Fl x .Aq device id .Aq namespace id +.Nm +.Ic firmware +.Op Fl s Ar slot +.Op Fl f Ar path_to_firmware +.Op Fl a +.Aq device id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -100,6 +106,20 @@ SMART/Health Information Log (ID=2), and .Dl nvmecontrol logpage -p 1 -x nvme0 .Pp Display a hexidecimal dump of the nvme0 controller's Error Information Log. +.Pp +.Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0 +.Pp +Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the +nvme0 controller, but do not activate the image. +.Pp +.Dl nvmecontrol firmware -s 4 -a nvme0 +.Pp +Activate the firmware in slot 4 of the nvme0 controller on the next reset. +.Pp +.Dl nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0 +.Pp +Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the +nvme0 controller and activate it on the next reset. .Sh AUTHORS .An -nosplit .Nm Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:16:43 2013 (r252671) @@ -56,6 +56,7 @@ static struct nvme_function { {"perftest", perftest, PERFTEST_USAGE}, {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, + {"firmware", firmware, FIRMWARE_USAGE}, {NULL, NULL, NULL}, }; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:16:43 2013 (r252671) @@ -52,11 +52,15 @@ #define LOGPAGE_USAGE \ " nvmecontrol logpage <-p page_id> [-x] \n" \ +#define FIRMWARE_USAGE \ +" nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); +void firmware(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); Modified: stable/9/sys/dev/nvme/nvme.h ============================================================================== --- stable/9/sys/dev/nvme/nvme.h Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sys/dev/nvme/nvme.h Thu Jul 4 00:16:43 2013 (r252671) @@ -383,6 +383,12 @@ enum nvme_dsm_attribute { NVME_DSM_ATTR_DEALLOCATE = 0x4, }; +enum nvme_activate_action { + NVME_AA_REPLACE_NO_ACTIVATE = 0x0, + NVME_AA_REPLACE_ACTIVATE = 0x1, + NVME_AA_ACTIVATE = 0x2, +}; + struct nvme_controller_data { /* bytes 0-255: controller capabilities and features */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:26:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8CCA17D0; Thu, 4 Jul 2013 00:26:24 +0000 (UTC) (envelope-from jimharris@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 7F0F8106E; Thu, 4 Jul 2013 00:26:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r640QO6Z079204; Thu, 4 Jul 2013 00:26:24 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r640QOCd079203; Thu, 4 Jul 2013 00:26:24 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040026.r640QOCd079203@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252672 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:26:24 -0000 Author: jimharris Date: Thu Jul 4 00:26:24 2013 New Revision: 252672 URL: http://svnweb.freebsd.org/changeset/base/252672 Log: Fix printf argument mismatch reported by gcc on i386. Reported by: kargl Modified: head/sbin/nvmecontrol/firmware.c Modified: head/sbin/nvmecontrol/firmware.c ============================================================================== --- head/sbin/nvmecontrol/firmware.c Thu Jul 4 00:16:43 2013 (r252671) +++ head/sbin/nvmecontrol/firmware.c Thu Jul 4 00:26:24 2013 (r252672) @@ -82,7 +82,7 @@ read_image_file(char *path, void **buf, exit(EX_IOERR); } if ((*buf = malloc(sb.st_size)) == NULL) { - fprintf(stderr, "Unable to malloc %zd bytes.\n", + fprintf(stderr, "Unable to malloc %jd bytes.\n", sb.st_size); close(fd); exit(EX_IOERR); @@ -95,7 +95,7 @@ read_image_file(char *path, void **buf, } if (*size != sb.st_size) { fprintf(stderr, "Error reading '%s', " - "read %zd bytes, requested %zd bytes\n", + "read %zd bytes, requested %jd bytes\n", path, *size, sb.st_size); close(fd); exit(EX_IOERR); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:34:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8E51B9EC; Thu, 4 Jul 2013 00:34:02 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 59AF710B6; Thu, 4 Jul 2013 00:34:02 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r640Xuqv076503; Wed, 3 Jul 2013 17:33:56 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r640XutQ076502; Wed, 3 Jul 2013 17:33:56 -0700 (PDT) (envelope-from sgk) Date: Wed, 3 Jul 2013 17:33:56 -0700 From: Steve Kargl To: Jim Harris Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol Message-ID: <20130704003356.GA76484@troutmask.apl.washington.edu> References: <201307040026.r640QOCd079203@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307040026.r640QOCd079203@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:34:02 -0000 On Thu, Jul 04, 2013 at 12:26:24AM +0000, Jim Harris wrote: > Author: jimharris > Date: Thu Jul 4 00:26:24 2013 > New Revision: 252672 > URL: http://svnweb.freebsd.org/changeset/base/252672 > > Log: > Fix printf argument mismatch reported by gcc on i386. > > Reported by: kargl > Thanks. -- Steve From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 00:54:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB4F0C11; Thu, 4 Jul 2013 00:54:23 +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 939E91122; Thu, 4 Jul 2013 00:54:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r640sN6Z087567; Thu, 4 Jul 2013 00:54:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r640sNQ2087566; Thu, 4 Jul 2013 00:54:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040054.r640sNQ2087566@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 00:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252673 - head/sys/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:54:23 -0000 Author: rmacklem Date: Thu Jul 4 00:54:23 2013 New Revision: 252673 URL: http://svnweb.freebsd.org/changeset/base/252673 Log: A problem with the old NFS client where large writes to large files would sometimes result in a corrupted file was reported via email. This problem appears to have been caused by r251719 (reverting r251719 fixed the problem). Although I have not been able to reproduce this problem, I suspect it is caused by another thread increasing np->n_size after the mtx_unlock(&np->n_mtx) but before the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes updates to np->n_size, doing the vnode_pager_setsize() with the mutex locked appears to avoid the problem. Unfortunately, vnode_pager_setsize() where the new size is smaller, cannot be called with a mutex held. This patch returns the semantics to be close to pre-r251719 such that the call to the vnode_pager_setsize() is only delayed until after the mutex is unlocked when np->n_size is shrinking. Since the file is growing when being written, I believe this will fix the corruption. Reported by: David G. Lawrence (dg@dglawrence.com) Tested by: David G. Lawrence (pending, to happen soon) Reviewed by: kib MFC after: 1 week Modified: head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Thu Jul 4 00:26:24 2013 (r252672) +++ head/sys/nfsclient/nfs_subs.c Thu Jul 4 00:54:23 2013 (r252673) @@ -581,6 +581,7 @@ nfs_loadattrcache(struct vnode **vpp, st vap->va_size = np->n_size; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + vnode_pager_setsize(vp, np->n_size); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -592,12 +593,22 @@ nfs_loadattrcache(struct vnode **vpp, st np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } + vnode_pager_setsize(vp, np->n_size); + } else if (vap->va_size < np->n_size) { + /* + * When shrinking the size, the call to + * vnode_pager_setsize() cannot be done + * with the mutex held, so delay it until + * after the mtx_unlock call. + */ + nsize = np->n_size = vap->va_size; + np->n_flag |= NSIZECHANGED; + setnsize = 1; } else { np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; + vnode_pager_setsize(vp, np->n_size); } - setnsize = 1; - nsize = vap->va_size; } else { np->n_size = vap->va_size; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:15:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8761DF; Thu, 4 Jul 2013 01:15:44 +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 BA39A11F7; Thu, 4 Jul 2013 01:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641FiQd094350; Thu, 4 Jul 2013 01:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641FiGM094349; Thu, 4 Jul 2013 01:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040115.r641FiGM094349@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:15: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: r252674 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:15:44 -0000 Author: rmacklem Date: Thu Jul 4 01:15:44 2013 New Revision: 252674 URL: http://svnweb.freebsd.org/changeset/base/252674 Log: MFC: r252138 Add a new "-o" option to the gssd which forces gss_init_sec_context() to use DES and the associated old style GSS initialization token. This appears to be required for some non-FreeBSD servers to get a kerberized NFS mount to work. Also, ignore some signals when daemonized, which might fix the gssd from "disappearing" without leaving a core dump. Given the tight timeframe for the FreeBSD9.2 release, I have committed this while waiting for code review. I will commit changes recommended by the review in a separate commit. Modified: stable/9/usr.sbin/gssd/gssd.c Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.c ============================================================================== --- stable/9/usr.sbin/gssd/gssd.c Thu Jul 4 00:54:23 2013 (r252673) +++ stable/9/usr.sbin/gssd/gssd.c Thu Jul 4 01:15:44 2013 (r252674) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include #include @@ -73,11 +74,26 @@ int debug_level; static char ccfile_dirlist[PATH_MAX + 1], ccfile_substring[NAME_MAX + 1]; static char pref_realm[1024]; static int verbose; +static int use_old_des; +#ifndef WITHOUT_KERBEROS +/* 1.2.752.43.13.14 */ +static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc = +{6, (void *) "\x2a\x85\x70\x2b\x0d\x0e"}; +static gss_OID GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X = + &gss_krb5_set_allowable_enctypes_x_desc; +static gss_OID_desc gss_krb5_mech_oid_x_desc = +{9, (void *) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" }; +static gss_OID GSS_KRB5_MECH_OID_X = + &gss_krb5_mech_oid_x_desc; +#endif static void gssd_load_mech(void); static int find_ccache_file(const char *, uid_t, char *); static int is_a_valid_tgt_cache(const char *, uid_t, int *, time_t *); static void gssd_verbose_out(const char *, ...); +#ifndef WITHOUT_KERBEROS +static OM_uint32 gssd_get_user_cred(OM_uint32 *, uid_t, gss_cred_id_t *); +#endif extern void gssd_1(struct svc_req *rqstp, SVCXPRT *transp); extern int gssd_syscall(char *path); @@ -103,11 +119,22 @@ main(int argc, char **argv) pref_realm[0] = '\0'; debug = 0; verbose = 0; - while ((ch = getopt(argc, argv, "dvs:c:r:")) != -1) { + while ((ch = getopt(argc, argv, "dovs:c:r:")) != -1) { switch (ch) { case 'd': debug_level++; break; + case 'o': +#ifndef WITHOUT_KERBEROS + /* + * Force use of DES and the old type of GSSAPI token. + */ + use_old_des = 1; +#else + errx(1, "This option not available when built" + " without MK_KERBEROS\n"); +#endif + break; case 'v': verbose = 1; break; @@ -149,8 +176,12 @@ main(int argc, char **argv) gssd_load_mech(); - if (!debug_level) + if (!debug_level) { daemon(0, 0); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + } memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL; @@ -336,7 +367,14 @@ gssd_init_sec_context_1_svc(init_sec_con gss_ctx_id_t ctx = GSS_C_NO_CONTEXT; gss_name_t name = GSS_C_NO_NAME; char ccname[PATH_MAX + 5 + 1], *cp, *cp2; - int gotone; + int gotone, gotcred; + OM_uint32 min_stat; +#ifndef WITHOUT_KERBEROS + gss_buffer_desc principal_desc; + char enctype[sizeof(uint32_t)]; + int key_enctype; + OM_uint32 maj_stat; +#endif memset(result, 0, sizeof(*result)); if (ccfile_dirlist[0] != '\0' && argp->cred == 0) { @@ -411,7 +449,46 @@ gssd_init_sec_context_1_svc(init_sec_con return (TRUE); } } + gotcred = 0; +#ifndef WITHOUT_KERBEROS + if (use_old_des != 0) { + if (cred == GSS_C_NO_CREDENTIAL) { + /* Acquire a credential for the uid. */ + maj_stat = gssd_get_user_cred(&min_stat, argp->uid, + &cred); + if (maj_stat == GSS_S_COMPLETE) + gotcred = 1; + else + gssd_verbose_out("gssd_init_sec_context: " + "get user cred failed uid=%d major=0x%x " + "minor=%d\n", (int)argp->uid, + (unsigned int)maj_stat, (int)min_stat); + } + if (cred != GSS_C_NO_CREDENTIAL) { + key_enctype = ETYPE_DES_CBC_CRC; + enctype[0] = (key_enctype >> 24) & 0xff; + enctype[1] = (key_enctype >> 16) & 0xff; + enctype[2] = (key_enctype >> 8) & 0xff; + enctype[3] = key_enctype & 0xff; + principal_desc.length = sizeof(enctype); + principal_desc.value = enctype; + result->major_status = gss_set_cred_option( + &result->minor_status, &cred, + GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X, + &principal_desc); + gssd_verbose_out("gssd_init_sec_context: set allowable " + "enctype major=0x%x minor=%d\n", + (unsigned int)result->major_status, + (int)result->minor_status); + if (result->major_status != GSS_S_COMPLETE) { + if (gotcred != 0) + gss_release_cred(&min_stat, &cred); + return (TRUE); + } + } + } +#endif result->major_status = gss_init_sec_context(&result->minor_status, cred, &ctx, name, argp->mech_type, argp->req_flags, argp->time_req, argp->input_chan_bindings, @@ -420,6 +497,8 @@ gssd_init_sec_context_1_svc(init_sec_con gssd_verbose_out("gssd_init_sec_context: done major=0x%x minor=%d" " uid=%d\n", (unsigned int)result->major_status, (int)result->minor_status, (int)argp->uid); + if (gotcred != 0) + gss_release_cred(&min_stat, &cred); if (result->major_status == GSS_S_COMPLETE || result->major_status == GSS_S_CONTINUE_NEEDED) { @@ -687,6 +766,11 @@ gssd_acquire_cred_1_svc(acquire_cred_arg gss_cred_id_t cred; char ccname[PATH_MAX + 5 + 1], *cp, *cp2; int gotone; +#ifndef WITHOUT_KERBEROS + gss_buffer_desc namebuf; + uint32_t minstat; + krb5_error_code kret; +#endif memset(result, 0, sizeof(*result)); if (ccfile_dirlist[0] != '\0' && argp->desired_name == 0) { @@ -1026,3 +1110,52 @@ is_a_valid_tgt_cache(const char *filepat #endif /* !WITHOUT_KERBEROS */ } +#ifndef WITHOUT_KERBEROS +/* + * Acquire a gss credential for a uid. + */ +static OM_uint32 +gssd_get_user_cred(OM_uint32 *min_statp, uid_t uid, gss_cred_id_t *credp) +{ + gss_buffer_desc principal_desc; + gss_name_t name; + OM_uint32 maj_stat, min_stat; + gss_OID_set mechlist; + struct passwd *pw; + + pw = getpwuid(uid); + if (pw == NULL) { + *min_statp = 0; + return (GSS_S_FAILURE); + } + + /* + * The mechanism must be set to KerberosV for acquisition + * of credentials to work reliably. + */ + maj_stat = gss_create_empty_oid_set(min_statp, &mechlist); + if (maj_stat != GSS_S_COMPLETE) + return (maj_stat); + maj_stat = gss_add_oid_set_member(min_statp, GSS_KRB5_MECH_OID_X, + &mechlist); + if (maj_stat != GSS_S_COMPLETE) { + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); + } + + principal_desc.value = (void *)pw->pw_name; + principal_desc.length = strlen(pw->pw_name); + maj_stat = gss_import_name(min_statp, &principal_desc, + GSS_C_NT_USER_NAME, &name); + if (maj_stat != GSS_S_COMPLETE) { + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); + } + /* Acquire the credentials. */ + maj_stat = gss_acquire_cred(min_statp, name, 0, mechlist, + GSS_C_INITIATE, credp, NULL, NULL); + gss_release_name(&min_stat, &name); + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); +} +#endif /* !WITHOUT_KERBEROS */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:18:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5CBA522C; Thu, 4 Jul 2013 01:18:39 +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 4F3A1120D; Thu, 4 Jul 2013 01:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641IduP094758; Thu, 4 Jul 2013 01:18:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641IdlD094757; Thu, 4 Jul 2013 01:18:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040118.r641IdlD094757@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:18:39 +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: r252675 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:18:39 -0000 Author: rmacklem Date: Thu Jul 4 01:18:38 2013 New Revision: 252675 URL: http://svnweb.freebsd.org/changeset/base/252675 Log: MFC: r252139 Document the "-o" option added by r252138. This is a content change. Modified: stable/9/usr.sbin/gssd/gssd.8 Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.8 ============================================================================== --- stable/9/usr.sbin/gssd/gssd.8 Thu Jul 4 01:15:44 2013 (r252674) +++ stable/9/usr.sbin/gssd/gssd.8 Thu Jul 4 01:18:38 2013 (r252675) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2013 +.Dd June 23, 2013 .Dt GSSD 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl d +.Op Fl o .Op Fl v .Op Fl s Ar dir-list .Op Fl c Ar file-substring @@ -50,6 +51,10 @@ Run in debug mode. In this mode, .Nm will not fork when it starts. +.It Fl o +Force use of DES and the associated old style GSS-API initialization token. +This may be required to make kerberized NFS mounts work against some +non-FreeBSD NFS servers. .It Fl v Run in verbose mode. In this mode, From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:22:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67A8F388; Thu, 4 Jul 2013 01:22:53 +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 58845122A; Thu, 4 Jul 2013 01:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641Mr1U096983; Thu, 4 Jul 2013 01:22:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641MrfA096982; Thu, 4 Jul 2013 01:22:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040122.r641MrfA096982@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:22:53 +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: r252676 - stable/9/usr.sbin/nfsd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:22:53 -0000 Author: rmacklem Date: Thu Jul 4 01:22:52 2013 New Revision: 252676 URL: http://svnweb.freebsd.org/changeset/base/252676 Log: MFC: r252483 Document that NFSv4 mounts won't work if hostid_enable="NO" is set in /etc/rc.conf because the host uuid is used to uniquely identify the client to the server. This is a content change. Modified: stable/9/usr.sbin/nfsd/nfsv4.4 Directory Properties: stable/9/usr.sbin/nfsd/ (props changed) Modified: stable/9/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- stable/9/usr.sbin/nfsd/nfsv4.4 Thu Jul 4 01:18:38 2013 (r252675) +++ stable/9/usr.sbin/nfsd/nfsv4.4 Thu Jul 4 01:22:52 2013 (r252676) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd July 1, 2013 .Dt NFSV4 4 .Os .Sh NAME @@ -235,6 +235,20 @@ plus set ``tcp'' and The .Xr nfsuserd 8 must be running, as above. +Also, since an +.Nm +mount uses the host uuid to identify the client uniquely to the server, +you cannot safely do an +.Nm +mount when +.sp +.Bd -literal -offset indent -compact +hostid_enable="NO" +.Ed +.sp +is set in +.Xr rc.conf 5 . +.sp If the .Nm server that is being mounted on supports delegations, you can start the From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:40:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 12A8B683; Thu, 4 Jul 2013 01:40:33 +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 04D9D12A6; Thu, 4 Jul 2013 01:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641eWY1002555; Thu, 4 Jul 2013 01:40:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641eW1C002554; Thu, 4 Jul 2013 01:40:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307040140.r641eW1C002554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 4 Jul 2013 01:40: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: r252677 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:40:33 -0000 Author: pfg Date: Thu Jul 4 01:40:32 2013 New Revision: 252677 URL: http://svnweb.freebsd.org/changeset/base/252677 Log: MFC r252364: Bring some updates from ufs/ufs_lookup to ext2fs. Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended file systems. Only set i_offset in the parent directory's i-node during a lookup for non-LOOKUP operations. Relax a VOP assertion for a DELETE lookup. Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Thu Jul 4 01:22:52 2013 (r252676) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Thu Jul 4 01:40:32 2013 (r252677) @@ -289,9 +289,9 @@ ext2_lookup_ino(struct vnode *vdp, struc int entryoffsetinblock; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; doff_t slotoffset; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ doff_t i_diroff; /* cached i_diroff value */ doff_t i_offset; /* cached i_offset value */ + int slotsize; /* size of area at slotoffset */ int slotfreespace; /* amount of space free in slot */ int slotneeded; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ @@ -476,7 +476,6 @@ searchloop: endsearch = i_diroff; goto searchloop; } - dp->i_offset = i_offset; if (bp != NULL) brelse(bp); /* @@ -512,7 +511,6 @@ searchloop: enduseful = slotoffset + slotsize; } dp->i_endoff = roundup2(enduseful, DIRBLKSIZ); - dp->i_flag |= IN_CHANGE | IN_UPDATE; /* * We return with the directory locked, so that * the parameters we set up above will still be @@ -560,12 +558,13 @@ found: */ if ((flags & ISLASTCN) && nameiop == LOOKUP) dp->i_diroff = i_offset &~ (DIRBLKSIZ - 1); - dp->i_offset = i_offset; /* * If deleting, and at end of pathname, return * parameters which can be used to remove file. */ if (nameiop == DELETE && (flags & ISLASTCN)) { + if (flags & LOCKPARENT) + ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); /* * Write access to directory required to delete files. */ @@ -576,7 +575,13 @@ found: * and distance past previous entry (if there * is a previous entry in this block) in dp->i_count. * Save directory inode pointer in ndp->ni_dvp for dirremove(). + * + * Technically we shouldn't be setting these in the + * WANTPARENT case (first lookup in rename()), but any + * lookups that will result in directory changes will + * overwrite these. */ + dp->i_offset = i_offset; if ((dp->i_offset & (DIRBLKSIZ - 1)) == 0) dp->i_count = 0; else @@ -621,6 +626,7 @@ found: * Careful about locking second inode. * This can only occur if the target is ".". */ + dp->i_offset = i_offset; if (dp->i_number == ino) return (EISDIR); if (dd_ino != NULL) @@ -656,10 +662,7 @@ found: */ pdp = vdp; if (flags & ISDOTDOT) { - ltype = VOP_ISLOCKED(pdp); - VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(vdp->v_mount, ino, cnp->cn_lkflags, &tdp); - vn_lock(pdp, ltype | LK_RETRY); + error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp); if (pdp->v_iflag & VI_DOOMED) { if (error == 0) vput(tdp); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:44:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A56B187B; Thu, 4 Jul 2013 01:44:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 37A7D12CC; Thu, 4 Jul 2013 01:44:31 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 51C2D781AE8; Thu, 4 Jul 2013 11:44:29 +1000 (EST) Date: Thu, 4 Jul 2013 11:44:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jim Harris Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol In-Reply-To: <201307040026.r640QOCd079203@svn.freebsd.org> Message-ID: <20130704105843.B982@besplex.bde.org> References: <201307040026.r640QOCd079203@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=RvpeemXtX5oA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=X2rCv88ZkwkA:10 a=CvOtz2YbMd5_vQfjsdYA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:44:31 -0000 On Thu, 4 Jul 2013, Jim Harris wrote: > Log: > Fix printf argument mismatch reported by gcc on i386. This just substitutes one printf format with another. > Modified: head/sbin/nvmecontrol/firmware.c > ============================================================================== > --- head/sbin/nvmecontrol/firmware.c Thu Jul 4 00:16:43 2013 (r252671) > +++ head/sbin/nvmecontrol/firmware.c Thu Jul 4 00:26:24 2013 (r252672) > @@ -82,7 +82,7 @@ read_image_file(char *path, void **buf, > exit(EX_IOERR); > } > if ((*buf = malloc(sb.st_size)) == NULL) { > - fprintf(stderr, "Unable to malloc %zd bytes.\n", > + fprintf(stderr, "Unable to malloc %jd bytes.\n", > sb.st_size); > close(fd); > exit(EX_IOERR); > @@ -95,7 +95,7 @@ read_image_file(char *path, void **buf, > } > if (*size != sb.st_size) { > fprintf(stderr, "Error reading '%s', " > - "read %zd bytes, requested %zd bytes\n", > + "read %zd bytes, requested %jd bytes\n", > path, *size, sb.st_size); > close(fd); > exit(EX_IOERR); st_size has type off_t. The format is for intmax_t. off_t is only accidentally compatible with off_t (on more arches that with ssize_t, so compile-time testing takes longer to find the bug). There are many other type errors visible in this patch: - st_size has type off_t. It is blindly converted to size_t when it is passed to malloc(). The message for malloc() failure prints the non- converted size, but says that the non-converted size was requested. Careful code would convert to size_t and check that the result fits. The converted value has the correct type for printing with %zu. (The old printf format also has a sign error in the format.). - st_size has type off_t. It is blindly converted to size_t when it is passed to read(). And although read() takes a size_t arg, ones larger than SSIZE_MAX give implementation-defined behaviour. On FreeBSD, the behaviour is to fail. The message for read() failure prints the non-converted size, but says that the converted size was requested. Careful code would convert to size_t and check that the result fits in ssize_t. The converted value has the correct type and range for printing with %zd. Many style bugs are visible in this patch: - the err() family is not used. This gives secondary bugs: - the program name is not put in the the error messages in another way - the string for the read() error is not put in the message in another way. This leads back to a non-style bug: the condition for an error is not (*size != sb.st_size); that can be for a short read; but using err() would only be correct if there is actually an error - warn(); ...; exit(); would have to be used instead of err(), since close(fd) might clobber errno. But close() before exit() is bogus unless errors in close() are checked for and handled, and they are not. - sysexits.h is used - EX_IOERR for malloc() failure is just wrong - the error messages are capitalized - the first error message is terminated with a "." - the second error message is obfuscated at the source level using string concatenation and splitting it across multiple lines - the second error message has grammar errors (2 comma splices, with the error largest for the first). Many programs use similar sloppy error checking for read(). This is only broken if the file size exceeds SSIZE_MAX or short reads occur. Neither is likely to occur for image files. But neither is malloc() failure. Fixing most of these bugs gives: size_t filesize; ... if (sb.st_size > SSIZE_MAX) errx(1, "size of file '%s is too large (%jd bytes)", (intmax_t)sb.st_size); filesize = sb.st_size; if ((*buf = malloc(filesize)) == NULL) errx(1, "unable to malloc %zd bytes", filesize); ... /* Repeat above size check if necessary (better do it up-front). /* XXX still assume no short reads. */ if (*size != filesize) err(1, "error reading '%s' (read %zd bytes; requested %zd)", path, *size, filesize); Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 01:48:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8943AA39; Thu, 4 Jul 2013 01:48:55 +0000 (UTC) (envelope-from loos@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 7B88912E6; Thu, 4 Jul 2013 01:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641mtGw003701; Thu, 4 Jul 2013 01:48:55 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641mtX2003700; Thu, 4 Jul 2013 01:48:55 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201307040148.r641mtX2003700@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 4 Jul 2013 01:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252678 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 01:48:55 -0000 Author: loos Date: Thu Jul 4 01:48:55 2013 New Revision: 252678 URL: http://svnweb.freebsd.org/changeset/base/252678 Log: - add myself to the committers list and add adrian as my mentor Approved by: adrian (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Jul 4 01:40:32 2013 (r252677) +++ head/share/misc/committers-src.dot Thu Jul 4 01:48:55 2013 (r252678) @@ -202,6 +202,7 @@ kevlo [label="Kevin Lo\nkevlo@FreeBSD.or kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] +loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] @@ -305,6 +306,7 @@ day1 -> rgrimes day1 -> alm day1 -> dg +adrian -> loos adrian -> monthadar adrian -> ray adrian -> rmh From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 02:48:03 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25B62459; Thu, 4 Jul 2013 02:48:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id C373D1681; Thu, 4 Jul 2013 02:48:02 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 84DBB780EF9; Thu, 4 Jul 2013 12:47:55 +1000 (EST) Date: Thu, 4 Jul 2013 12:47:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Andrey A. Chernov" Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib In-Reply-To: <201307032121.r63LLtkk022011@svn.freebsd.org> Message-ID: <20130704120336.G1176@besplex.bde.org> References: <201307032121.r63LLtkk022011@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=P2o1fveGC7kA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=OpigHBH0zK0A:10 a=KbnMHzfTeyEWB8DpWz8A:9 a=CjuIK1q_8ugA:10 a=LKO2KcaOxHFlX3nK:21 a=dEAoypXjF4bOxJSi:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 02:48:03 -0000 On Wed, 3 Jul 2013, Andrey A. Chernov wrote: > Log: > 1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range, > but ACM formula we use have internal state (and return value) in the > [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached > because it is off by one, zero is not reached too. > > Correct both RAND_MAX and rand(3) return value, shifting last one > to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] > range. > > 2) Add a checks for not overflowing on too big seeds. It may happens on > the machines, where sizeof(unsigned int) > 32 bits. > > Reviewed by: bde [1] > MFC after: 2 weeks Er, I think it is too dangerous to change either RAND_MAX or the offset without more preparation: - increasing the range returned (and increasing RAND_MAX to match) would obviously be binary-incompatible. Old binaries may have the old RAND_MAX built in to them, but will call the new rand(). They would be broken if the new rand() returned a value larger than the old RAND_MAX. But this change only reduces RAND_MAX. RAND_MAX was already 1 higher than could be returned. This change expands the range at the low end, so that 0 is now returned, but returning it was always possible and should have occurred. - changing the offset is more of a problem. It changes the sequence generated by each fixed seed. Of course, the sequence is not guaranteed to be repeated after all system changes. The C90/C99 specification is actually unusably fuzzy about this. C99 (n869.txt) says: %%% [#2] The srand function uses the argument as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to rand. If srand is then called with the same seed value, the sequence of pseudo-random numbers shall be repeated. If rand is called before any calls to srand have been made, the same sequence shall be generated as when srand is first called with a seed value of 1. %%% Perahps this only says that the sequence shall be repeated within each "execution" of a C program, but that is not very useful. This is not fixed in POSIX, at least in old drafts. POSIX should at least say that the sequence shall be repeated across the lifetime of a single process (it can be more specific about "execution"). But to be useful, the repeatability must be much more than that (certainly across reboots, which is already more than POSIX can explicitly specify). > Modified: head/lib/libc/stdlib/rand.c > ============================================================================== > --- head/lib/libc/stdlib/rand.c Wed Jul 3 21:14:57 2013 (r252607) > +++ head/lib/libc/stdlib/rand.c Wed Jul 3 21:21:54 2013 (r252608) > @@ -84,6 +84,10 @@ int > rand_r(unsigned int *ctx) > { > u_long val = (u_long) *ctx; > +#ifndef USE_WEAK_SEEDING > + /* Transform to [1, 0x7ffffffe] range. */ > + val = (val % 0x7ffffffe) + 1; > +#endif > int r = do_rand(&val); > > *ctx = (unsigned int) val; Style bugs: - old: initializations in declarations. The one for 'r' is especially bad. Almost all of the work for the function is done in the initialization. - new: initialization not even in declarations. There is now a statement in the middle of the declarations. This wouldn't even compile in C90. This is collateral with the old style bugs -- when almost the whole function is written in initializers, it is difficult to insert statements into it without increasing the mess. - old: bogus mix of spellings of "unsigned". Here u_ is used in one place and "unsigned" in another place. rand.c uses "unsigned" with "long" in most places, but it is the "unsigned" form that is the style bug -- in rev.1.1, u_int and u_long were used consistently. > @@ -125,6 +133,10 @@ sranddev() > mib[0] = CTL_KERN; > mib[1] = KERN_ARND; > sysctl(mib, 2, (void *)&next, &len, NULL, 0); > +#ifndef USE_WEAK_SEEDING > + /* Transform to [1, 0x7ffffffe] range. */ > + next = (next % 0x7ffffffe) + 1; > +#endif > } Previous breakage of this is still not fixed. Old versions used /dev/random and had error handling involving use of the current time when _read() failed. They also spelled read() correctly, so that the Standard library function rand() is not broken is the application is a pure C90 one that supplies its own read(). The above has doesn't even have error checking, and is broken if the application supplies its own sysctl(). The old versions had all these bugs nested in their error handling, however -- they used gettimeofday() with an unsafe spelling and had no error checking for it. Stack garbage for the failing syscalls is not too bad for a random number. Style bug: the API name 'sranddev()' is bogus for a function that doesn't used /dev/random like it used to. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 03:24:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 221D0A55; Thu, 4 Jul 2013 03:24:59 +0000 (UTC) (envelope-from kevlo@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 140F21913; Thu, 4 Jul 2013 03:24:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r643OwcV033468; Thu, 4 Jul 2013 03:24:58 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r643OwWX033466; Thu, 4 Jul 2013 03:24:58 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201307040324.r643OwWX033466@svn.freebsd.org> From: Kevin Lo Date: Thu, 4 Jul 2013 03:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252679 - in head/usr.bin: mail make X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 03:24:59 -0000 Author: kevlo Date: Thu Jul 4 03:24:58 2013 New Revision: 252679 URL: http://svnweb.freebsd.org/changeset/base/252679 Log: Remove unnecessary cast to pid_t. Modified: head/usr.bin/mail/popen.c head/usr.bin/make/job.c Modified: head/usr.bin/mail/popen.c ============================================================================== --- head/usr.bin/mail/popen.c Thu Jul 4 01:48:55 2013 (r252678) +++ head/usr.bin/mail/popen.c Thu Jul 4 03:24:58 2013 (r252679) @@ -316,7 +316,7 @@ sigchild(int signo __unused) int status; struct child *cp; - while ((pid = waitpid((pid_t)-1, &status, WNOHANG)) > 0) { + while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { cp = findchild(pid); if (cp->free) delchild(cp); Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Thu Jul 4 01:48:55 2013 (r252678) +++ head/usr.bin/make/job.c Thu Jul 4 03:24:58 2013 (r252679) @@ -2128,7 +2128,7 @@ Job_CatchChildren(Boolean block) } for (;;) { - pid = waitpid((pid_t)-1, &status, + pid = waitpid(-1, &status, (block ? 0 : WNOHANG) | WUNTRACED); if (pid <= 0) break; @@ -2628,7 +2628,7 @@ Job_AbortAll(void) /* * Catch as many children as want to report in at first, then give up */ - while (waitpid((pid_t)-1, &foo, WNOHANG) > 0) + while (waitpid(-1, &foo, WNOHANG) > 0) ; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 03:35:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 68044C38 for ; Thu, 4 Jul 2013 03:35:31 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1.freebsd.org (Postfix) with ESMTP id E46BF196D for ; Thu, 4 Jul 2013 03:35:30 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id 13so805839lba.16 for ; Wed, 03 Jul 2013 20:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=CvRgcAGrvv2FG6l00/pqVPDAfdBfOd1BLkeG+s4tuaw=; b=FSfX9LYYMqdZpK+iuE4n89iI3zcPkvkQHWuygn8Z3mAD0Y+qm5/4GjctlLLkVxofp/ eey81RMMEcaaHFHtUJ6DfpV2VaIpfoxlUmRtDKXGHtiH0QNPWbbXV7ckyouEBCXXdeMH pZOmtc4h7e3Rs7JKuyEOi1QfWmeANTm8y+9lrACQUsL2n6W8lBfRaDEG+NB6EUg2/UZJ tsTSLM2w9TaUhWNwfpafv+ahSeSmqIErl2UlZfCqPXF+V0G2Ke2AVTL1bjAOAxSUQIby WnQlps3lYpPU2BZVeMWRq6cAtyAFZCg4k6D+P2v5R6/6RhHGPx8Oo2MjDPflYO5env0u AZlA== X-Received: by 10.152.25.135 with SMTP id c7mr1824095lag.39.1372908929384; Wed, 03 Jul 2013 20:35:29 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id i9sm298734lai.4.2013.07.03.20.35.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Jul 2013 20:35:28 -0700 (PDT) Message-ID: <51D4ED7F.5050800@freebsd.org> Date: Thu, 04 Jul 2013 07:35:27 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib References: <201307032121.r63LLtkk022011@svn.freebsd.org> <20130704120336.G1176@besplex.bde.org> In-Reply-To: <20130704120336.G1176@besplex.bde.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQktldPx4qzUA4huhDQimey3i8F8ydaC/HNdYYqurMUEVDLW6l7l+BM8Lwhi+Qzatno7Fack Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 03:35:31 -0000 On 04.07.2013 6:47, Bruce Evans wrote: > Er, I think it is too dangerous to change either RAND_MAX or the offset > without more preparation: > - increasing the range returned (and increasing RAND_MAX to match) would > obviously be binary-incompatible. Old binaries may have the old RAND_MAX > built in to them, but will call the new rand(). They would be broken if > the new rand() returned a value larger than the old RAND_MAX. But this > change only reduces RAND_MAX. RAND_MAX was already 1 higher than could > be returned. This change expands the range at the low end, so that 0 > is now returned, but returning it was always possible and should have > occurred. Currently the range is reduced, not increased. In details: Old binaries + old libc already have +1 bigger RAND_MAX and never returns 0. Old binaries + new libc will have +2 bigger RAND_MAX and returns 0 (0 is allowed by POSIX). The value bigger than old RAND_MAX will never returned and it even is impossible with the formula we use and 0 is allowed by POSIX, so I don't see any binary incompatibilities with that changes. > - changing the offset is more of a problem. It changes the sequence > generated by each fixed seed. Of course, the sequence is not guaranteed > to be repeated after all system changes. The C90/C99 specification is > actually unusably fuzzy about this. C99 (n869.txt) says: ... > Perahps this only says that the sequence shall be repeated within each > "execution" of a C program, but that is not very useful. This is not > fixed in POSIX, at least in old drafts. POSIX should at least say that > the sequence shall be repeated across the lifetime of a single process > (it can be more specific about "execution"). But to be useful, the > repeatability must be much more than that (certainly across reboots, > which is already more than POSIX can explicitly specify). We already pass that moment in the past, changing old&bad formula with new one which cause the same effect: non-repeating sequence in the very global scope. We already agree that repeating depends on something like OS release numbers. I can't find that discussion right now. > Style bugs: > - old: initializations in declarations. The one for 'r' is especially bad. > Almost all of the work for the function is done in the initialization. > - new: initialization not even in declarations. There is now a statement > in the middle of the declarations. This wouldn't even compile in C90. > This is collateral with the old style bugs -- when almost the whole > function is written in initializers, it is difficult to insert statements > into it without increasing the mess. > - old: bogus mix of spellings of "unsigned". Here u_ is used in one place > and "unsigned" in another place. rand.c uses "unsigned" with "long" in > most places, but it is the "unsigned" form that is the style bug -- > in rev.1.1, u_int and u_long were used consistently. I don't plan to touch all old style bugs right now, but I'll fix new one you notice. > Previous breakage of this is still not fixed. Old versions used > /dev/random and had error handling involving use of the current > time when _read() failed. This specific sysctl() can't fail. You'll better to discuss this matter with the original change author, not with me. > They also spelled read() correctly, > so that the Standard library function rand() is not broken is > the application is a pure C90 one that supplies its own read(). > The above has doesn't even have error checking, and is broken > if the application supplies its own sysctl(). libc have a lot of places where it uses sysctl() instead of _sysctl(). If you assume to change them all, it will be sweep change not for me, please ask someone else. > Style bug: the API name 'sranddev()' is bogus for a function that doesn't > used /dev/random like it used to. This is historical thing when all we have was /dev/random. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 05:35:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B22374F; Thu, 4 Jul 2013 05:35:58 +0000 (UTC) (envelope-from grehan@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 1D2951EFD; Thu, 4 Jul 2013 05:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r645Zvxm070830; Thu, 4 Jul 2013 05:35:57 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r645Zv9q070826; Thu, 4 Jul 2013 05:35:57 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201307040535.r645Zv9q070826@svn.freebsd.org> From: Peter Grehan Date: Thu, 4 Jul 2013 05:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252682 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 05:35:58 -0000 Author: grehan Date: Thu Jul 4 05:35:56 2013 New Revision: 252682 URL: http://svnweb.freebsd.org/changeset/base/252682 Log: Support an optional "mac=" parameter to virtio-net config, to allow users to set the MAC address for a device. Clean up some obsolete code in pci_virtio_net.c Allow an error return from a PCI device emulation's init routine to be propagated all the way back to the top-level and result in the process exiting. Submitted by: Dinakar Medavaram dinnu sun at gmail (original version) Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Jul 4 04:26:19 2013 (r252681) +++ head/usr.sbin/bhyve/bhyverun.c Thu Jul 4 05:35:56 2013 (r252682) @@ -734,7 +734,13 @@ main(int argc, char *argv[]) init_mem(); init_inout(); - init_pci(ctx); + + /* + * Exit if a device emulation finds an error in it's initilization + */ + if (init_pci(ctx) != 0) + exit(1); + if (ioapic) ioapic_init(0); Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu Jul 4 04:26:19 2013 (r252681) +++ head/usr.sbin/bhyve/pci_emul.c Thu Jul 4 05:35:56 2013 (r252682) @@ -662,11 +662,13 @@ pci_emul_finddev(char *name) return (NULL); } -static void +static int pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int slot, int func, char *params) { struct pci_devinst *pdi; + int err; + pdi = malloc(sizeof(struct pci_devinst)); bzero(pdi, sizeof(*pdi)); @@ -684,12 +686,15 @@ pci_emul_init(struct vmctx *ctx, struct pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); - if ((*pde->pe_init)(ctx, pdi, params) != 0) { + err = (*pde->pe_init)(ctx, pdi, params); + if (err != 0) { free(pdi); } else { pci_emul_devices++; pci_slotinfo[slot][func].si_devi = pdi; - } + } + + return (err); } void @@ -989,7 +994,7 @@ pci_emul_fallback_handler(struct vmctx * return (0); } -void +int init_pci(struct vmctx *ctx) { struct mem_range memp; @@ -1009,8 +1014,10 @@ init_pci(struct vmctx *ctx) if (si->si_name != NULL) { pde = pci_emul_finddev(si->si_name); assert(pde != NULL); - pci_emul_init(ctx, pde, slot, func, - si->si_param); + error = pci_emul_init(ctx, pde, slot, func, + si->si_param); + if (error) + return (error); } } } @@ -1047,6 +1054,8 @@ init_pci(struct vmctx *ctx) error = register_mem_fallback(&memp); assert(error == 0); + + return (0); } int Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Thu Jul 4 04:26:19 2013 (r252681) +++ head/usr.sbin/bhyve/pci_emul.h Thu Jul 4 05:35:56 2013 (r252682) @@ -183,7 +183,7 @@ struct pciecap { uint16_t slot_status2; } __packed; -void init_pci(struct vmctx *ctx); +int init_pci(struct vmctx *ctx); void msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, int bytes, uint32_t val); void msixcap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Thu Jul 4 04:26:19 2013 (r252681) +++ head/usr.sbin/bhyve/pci_virtio_net.c Thu Jul 4 05:35:56 2013 (r252682) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -638,6 +639,30 @@ pci_vtnet_ring_init(struct pci_vtnet_sof } static int +pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr) +{ + struct ether_addr *ea; + char *tmpstr; + char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; + + tmpstr = strsep(&mac_str,"="); + + if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { + ea = ether_aton(mac_str); + + if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || + memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { + fprintf(stderr, "Invalid MAC %s\n", mac_str); + return (EINVAL); + } else + memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); + } + + return (0); +} + + +static int pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { MD5_CTX mdctx; @@ -646,6 +671,9 @@ pci_vtnet_init(struct vmctx *ctx, struct char tname[MAXCOMLEN + 1]; struct pci_vtnet_softc *sc; const char *env_msi; + char *devname; + char *vtopts; + int mac_provided; sc = malloc(sizeof(struct pci_vtnet_softc)); memset(sc, 0, sizeof(struct pci_vtnet_softc)); @@ -664,14 +692,31 @@ pci_vtnet_init(struct vmctx *ctx, struct } /* - * Attempt to open the tap device + * Attempt to open the tap device and read the MAC address + * if specified */ + mac_provided = 0; sc->vsc_tapfd = -1; if (opts != NULL) { char tbuf[80]; + int err; + + devname = vtopts = strdup(opts); + (void) strsep(&vtopts, ","); + + if (vtopts != NULL) { + err = pci_vtnet_parsemac(vtopts, sc->vsc_macaddr); + if (err != 0) { + free(devname); + return (err); + } + mac_provided = 1; + } strcpy(tbuf, "/dev/"); - strlcat(tbuf, opts, sizeof(tbuf)); + strlcat(tbuf, devname, sizeof(tbuf)); + + free(devname); sc->vsc_tapfd = open(tbuf, O_RDWR); if (sc->vsc_tapfd == -1) { @@ -701,28 +746,24 @@ pci_vtnet_init(struct vmctx *ctx, struct } /* - * The MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the vm name. The slot/func number is - * prepended to this for slots other than 1:0, so that - * a bootloader can netboot from the equivalent of slot 1. + * The default MAC address is the standard NetApp OUI of 00-a0-98, + * followed by an MD5 of the PCI slot/func number and dev name */ - if (pi->pi_slot == 1 && pi->pi_func == 0) { - strncpy(nstr, vmname, sizeof(nstr)); - } else { + if (!mac_provided) { snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); - } + pi->pi_func, vmname); - MD5Init(&mdctx); - MD5Update(&mdctx, nstr, strlen(nstr)); - MD5Final(digest, &mdctx); - - sc->vsc_macaddr[0] = 0x00; - sc->vsc_macaddr[1] = 0xa0; - sc->vsc_macaddr[2] = 0x98; - sc->vsc_macaddr[3] = digest[0]; - sc->vsc_macaddr[4] = digest[1]; - sc->vsc_macaddr[5] = digest[2]; + MD5Init(&mdctx); + MD5Update(&mdctx, nstr, strlen(nstr)); + MD5Final(digest, &mdctx); + + sc->vsc_macaddr[0] = 0x00; + sc->vsc_macaddr[1] = 0xa0; + sc->vsc_macaddr[2] = 0x98; + sc->vsc_macaddr[3] = digest[0]; + sc->vsc_macaddr[4] = digest[1]; + sc->vsc_macaddr[5] = digest[2]; + } /* initialize config space */ pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_NET); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 05:53:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8A1BFAEF; Thu, 4 Jul 2013 05:53:06 +0000 (UTC) (envelope-from alfred@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 7C9061F92; Thu, 4 Jul 2013 05:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r645r5mJ076054; Thu, 4 Jul 2013 05:53:05 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r645r5w0076053; Thu, 4 Jul 2013 05:53:05 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307040553.r645r5w0076053@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 4 Jul 2013 05:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252683 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 05:53:06 -0000 Author: alfred Date: Thu Jul 4 05:53:05 2013 New Revision: 252683 URL: http://svnweb.freebsd.org/changeset/base/252683 Log: The change in r236456 (atomic_store_rel not locked) exposed a bug in the ithread code where we could lose ithread interrupts if intr_event_schedule_thread() is called while the ithread is already running. Effectively memory writes could be ordered incorrectly such that the unatomic write of 0 to ithd->it_need (in ithread_loop) could be delayed until after it was set to be triggered again by intr_event_schedule_thread(). This was particularly a big problem for CAM because CAM optimizes scheduling of ithreads such that it only signals camisr() when it queues to an empty queue. This means that additional completion events would not unstick CAM and quickly lead to a complete lockup of the CAM stack. To fix this use atomics in all places where ithd->it_need is accessed. Submitted by: delphij, mav Obtained from: TrueOS, iXsystems MFC After: 1 week Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Thu Jul 4 05:35:56 2013 (r252682) +++ head/sys/kern/kern_intr.c Thu Jul 4 05:53:05 2013 (r252683) @@ -841,7 +841,7 @@ ok: * again and remove this handler if it has already passed * it on the list. */ - ie->ie_thread->it_need = 1; + atomic_store_rel_int(&ie->ie_thread->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(ie->ie_thread->it_thread); @@ -912,7 +912,7 @@ intr_event_schedule_thread(struct intr_e * running. Then, lock the thread and see if we actually need to * put it on the runqueue. */ - it->it_need = 1; + atomic_store_rel_int(&it->it_need, 1); thread_lock(td); if (TD_AWAITING_INTR(td)) { CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, @@ -990,7 +990,7 @@ ok: * again and remove this handler if it has already passed * it on the list. */ - it->it_need = 1; + atomic_store_rel_int(&it->it_need, 1); } else TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); thread_unlock(it->it_thread); @@ -1066,7 +1066,7 @@ intr_event_schedule_thread(struct intr_e * running. Then, lock the thread and see if we actually need to * put it on the runqueue. */ - it->it_need = 1; + atomic_store_rel_int(&it->it_need, 1); thread_lock(td); if (TD_AWAITING_INTR(td)) { CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, @@ -1247,7 +1247,7 @@ intr_event_execute_handlers(struct proc * interrupt threads always invoke all of their handlers. */ if (ie->ie_flags & IE_SOFT) { - if (!ih->ih_need) + if (atomic_load_acq_int(&ih->ih_need) == 0) continue; else atomic_store_rel_int(&ih->ih_need, 0); @@ -1349,7 +1349,7 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (ithd->it_need) { + while (atomic_load_acq_int(&ithd->it_need) != 0) { /* * This might need a full read and write barrier * to make sure that this write posts before any @@ -1368,7 +1368,8 @@ ithread_loop(void *arg) * set again, so we have to check it again. */ thread_lock(td); - if (!ithd->it_need && !(ithd->it_flags & (IT_DEAD | IT_WAIT))) { + if ((atomic_load_acq_int(&ithd->it_need) == 0) && + !(ithd->it_flags & (IT_DEAD | IT_WAIT))) { TD_SET_IWAIT(td); ie->ie_count = 0; mi_switch(SW_VOL | SWT_IWAIT, NULL); @@ -1529,7 +1530,7 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (ithd->it_need) { + while (atomic_load_acq_int(&ithd->it_need) != 0) { /* * This might need a full read and write barrier * to make sure that this write posts before any @@ -1551,7 +1552,8 @@ ithread_loop(void *arg) * set again, so we have to check it again. */ thread_lock(td); - if (!ithd->it_need && !(ithd->it_flags & (IT_DEAD | IT_WAIT))) { + if ((atomic_load_acq_int(&ithd->it_need) == 0) && + !(ithd->it_flags & (IT_DEAD | IT_WAIT))) { TD_SET_IWAIT(td); ie->ie_count = 0; mi_switch(SW_VOL | SWT_IWAIT, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 05:58:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F027CCB; Thu, 4 Jul 2013 05:58:54 +0000 (UTC) (envelope-from jkim@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 70A041FC1; Thu, 4 Jul 2013 05:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r645wsiX076769; Thu, 4 Jul 2013 05:58:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r645wsAM076768; Thu, 4 Jul 2013 05:58:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201307040558.r645wsAM076768@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 4 Jul 2013 05:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252684 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 05:58:54 -0000 Author: jkim Date: Thu Jul 4 05:58:53 2013 New Revision: 252684 URL: http://svnweb.freebsd.org/changeset/base/252684 Log: Make it little bit more C++ friendly. This explicit casting fixes some ports, emulators/virtualbox-ose and sysutils/smartmontools for example. Modified: head/sys/cam/cam_ccb.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Jul 4 05:53:05 2013 (r252683) +++ head/sys/cam/cam_ccb.h Thu Jul 4 05:58:53 2013 (r252684) @@ -1306,7 +1306,7 @@ cam_set_ccbstatus(union ccb *ccb, cam_st static __inline cam_status cam_ccb_status(union ccb *ccb) { - return (ccb->ccb_h.status & CAM_STATUS_MASK); + return ((cam_status)(ccb->ccb_h.status & CAM_STATUS_MASK)); } void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 07:01:46 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B549BAC4; Thu, 4 Jul 2013 07:01:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5BC6611C2; Thu, 4 Jul 2013 07:01:46 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 24DCC421F0C; Thu, 4 Jul 2013 17:01:39 +1000 (EST) Date: Thu, 4 Jul 2013 17:01:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib In-Reply-To: <51D4ED7F.5050800@freebsd.org> Message-ID: <20130704142324.K1670@besplex.bde.org> References: <201307032121.r63LLtkk022011@svn.freebsd.org> <20130704120336.G1176@besplex.bde.org> <51D4ED7F.5050800@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=P2o1fveGC7kA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=OpigHBH0zK0A:10 a=3ryOxJ1WKTKIsbvnt2AA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 07:01:46 -0000 On Thu, 4 Jul 2013, Andrey Chernov wrote: > On 04.07.2013 6:47, Bruce Evans wrote: >> Er, I think it is too dangerous to change either RAND_MAX or the offset >> without more preparation: >> - increasing the range returned (and increasing RAND_MAX to match) would >> obviously be binary-incompatible. Old binaries may have the old RAND_MAX >> built in to them, but will call the new rand(). They would be broken if >> the new rand() returned a value larger than the old RAND_MAX. But this >> change only reduces RAND_MAX. RAND_MAX was already 1 higher than could >> be returned. This change expands the range at the low end, so that 0 >> is now returned, but returning it was always possible and should have >> occurred. > > Currently the range is reduced, not increased. In details: That's what I said. > Old binaries + old libc already have +1 bigger RAND_MAX and never returns 0. > Old binaries + new libc will have +2 bigger RAND_MAX and returns 0 (0 is > allowed by POSIX). > The value bigger than old RAND_MAX will never returned and it even is > impossible with the formula we use and 0 is allowed by POSIX, so I don't > see any binary incompatibilities with that changes. It is only because it is reduced that the change is not a complete breakage of compatibility. >> - changing the offset is more of a problem. It changes the sequence >> generated by each fixed seed. Of course, the sequence is not guaranteed >> to be repeated after all system changes. The C90/C99 specification is >> actually unusably fuzzy about this. C99 (n869.txt) says: > > ... > >> Perahps this only says that the sequence shall be repeated within each >> "execution" of a C program, but that is not very useful. This is not >> fixed in POSIX, at least in old drafts. POSIX should at least say that >> the sequence shall be repeated across the lifetime of a single process >> (it can be more specific about "execution"). But to be useful, the >> repeatability must be much more than that (certainly across reboots, >> which is already more than POSIX can explicitly specify). > > We already pass that moment in the past, changing old&bad formula with > new one which cause the same effect: non-repeating sequence in the very > global scope. We already agree that repeating depends on something like > OS release numbers. I can't find that discussion right now. But you are changing it in between releases. >> Previous breakage of this is still not fixed. Old versions used >> /dev/random and had error handling involving use of the current >> time when _read() failed. > > This specific sysctl() can't fail. You'll better to discuss this matter > with the original change author, not with me. Of course it can fail. It fails whenever the kernel doesn't support the sysctl. This is always for old kernels. Not good enough for a security- related function. >> They also spelled read() correctly, >> so that the Standard library function rand() is not broken is >> the application is a pure C90 one that supplies its own read(). >> The above has doesn't even have error checking, and is broken >> if the application supplies its own sysctl(). > > libc have a lot of places where it uses sysctl() instead of _sysctl(). > If you assume to change them all, it will be sweep change not for me, > please ask someone else. Not many in the C99 part of the library. I already discussed the bug when it was committed. Some POSIX parts have always been broken: - sysconf() was the primary client of sysctl(), and it always used raw sysctl() - the careful namespace handling in __xuname()'s name is defeated by __xuname() calling sysctl(). - in libc/gen, it is mainly arc4random() that uses __sysctl(), and since arc4random() is not in POSIX, it can just use sysctl(). arc4random() is also not missing the error check when it uses the same sysctl that is missing the error handling in sranddev() and sranddomdev(). arc4random() handles the error by first falling back to using /dev/random; if that fails, it falls back to using gettimeofday(), getpid(); if that fails it intentionally uses stack garbage. This is what srand() and srandomdev() used to do, except they started at the /dev/random level and did home made stirring of the time bits. srand() and srandomdev() should do the same as arc4random() (except for the stirring step). Howver, it is actually not so good to succeed and produce low-quality random data. Callers have no way of knowing that the call didn't really work, and of course the error handling is not documented. - the POSIX ctermid() used to be careful about namespaces (it just used _PATH_TTY), but it now uses raw sysctlbyname(). - the POSIX gethostname() was never careful about namespaces. >> Style bug: the API name 'sranddev()' is bogus for a function that doesn't >> used /dev/random like it used to. > > This is historical thing when all we have was /dev/random. Yes, it is a bad API name (too closely tied to the implementation) that became worse when the implementation changed. But it may be safer to change this than RAND_MAX :-). Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 07:32:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 973CC16E; Thu, 4 Jul 2013 07:32:40 +0000 (UTC) (envelope-from rpaulo@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 891D11315; Thu, 4 Jul 2013 07:32:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r647WeMf005732; Thu, 4 Jul 2013 07:32:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r647WehU005731; Thu, 4 Jul 2013 07:32:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307040732.r647WehU005731@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 07:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252686 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 07:32:40 -0000 Author: rpaulo Date: Thu Jul 4 07:32:40 2013 New Revision: 252686 URL: http://svnweb.freebsd.org/changeset/base/252686 Log: wpa_supplicant should be able to reassociate when resuming, so remove a comment saying it can't. Modified: head/etc/rc.resume Modified: head/etc/rc.resume ============================================================================== --- head/etc/rc.resume Thu Jul 4 06:11:51 2013 (r252685) +++ head/etc/rc.resume Thu Jul 4 07:32:40 2013 (r252686) @@ -52,10 +52,6 @@ fi # suspend and reloading it on resume. Example: # kldload usb -# wpa_supplicant(8) doesn't seem to reassociate during resume. Uncomment -# the following to signal it to reassociate. -# /usr/sbin/wpa_cli reassociate - /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 07:59:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2C526FF; Thu, 4 Jul 2013 07:59:12 +0000 (UTC) (envelope-from des@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 B5B34147D; Thu, 4 Jul 2013 07:59:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r647xCfN012157; Thu, 4 Jul 2013 07:59:12 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r647xCgU012156; Thu, 4 Jul 2013 07:59:12 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307040759.r647xCgU012156@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 4 Jul 2013 07:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252688 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 07:59:12 -0000 Author: des Date: Thu Jul 4 07:59:11 2013 New Revision: 252688 URL: http://svnweb.freebsd.org/changeset/base/252688 Log: Fall back to sha512 if passwd_format is not set. MFC after: 3 days Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Thu Jul 4 07:37:29 2013 (r252687) +++ head/usr.sbin/pw/pw_user.c Thu Jul 4 07:59:11 2013 (r252688) @@ -573,7 +573,7 @@ pw_user(struct userconf * cnf, int mode, lc = login_getpwclass(pwd); if (lc == NULL || - login_setcryptfmt(lc, "md5", NULL) == NULL) + login_setcryptfmt(lc, "sha512", NULL) == NULL) warn("setting crypt(3) format"); login_close(lc); pwd->pw_passwd = pw_password(cnf, args, pwd->pw_name); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 08:09:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E6299BF3; Thu, 4 Jul 2013 08:09:54 +0000 (UTC) (envelope-from adrian@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 D962F1623; Thu, 4 Jul 2013 08:09:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6489s15015764; Thu, 4 Jul 2013 08:09:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6489seB015763; Thu, 4 Jul 2013 08:09:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307040809.r6489seB015763@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 08:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252689 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 08:09:55 -0000 Author: adrian Date: Thu Jul 4 08:09:54 2013 New Revision: 252689 URL: http://svnweb.freebsd.org/changeset/base/252689 Log: Add the missing link back to the EEPROM firmware name. Modified: head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Thu Jul 4 07:59:11 2013 (r252688) +++ head/sys/mips/conf/AP93.hints Thu Jul 4 08:09:54 2013 (r252689) @@ -36,6 +36,9 @@ hint.arswitch.0.is_gmii=0 # No, not GMII hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 +# ath0 - eeprom comes from here +hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + # Signal leds hint.gpioled.0.at="gpiobus0" hint.gpioled.0.name="sig1" From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 08:13:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99431D69; Thu, 4 Jul 2013 08:13:15 +0000 (UTC) (envelope-from adrian@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 7C14B164D; Thu, 4 Jul 2013 08:13:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648DFR8017920; Thu, 4 Jul 2013 08:13:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648DFBR017918; Thu, 4 Jul 2013 08:13:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307040813.r648DFBR017918@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 08:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252690 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 08:13:15 -0000 Author: adrian Date: Thu Jul 4 08:13:14 2013 New Revision: 252690 URL: http://svnweb.freebsd.org/changeset/base/252690 Log: Add in a configuration file and hints for the Engenius ENH-200. This is an AR7240 based device with an AR9285 on-board. I've tested the initial boot and wifi support; however at the moment the ethernet switch driver doesn't seem to be picking up carrier on the active ethernet port. Basic flood pinging works however, so I think we're on the right track. Thank you to Adrian Woodley for purchasing me one of these devices to bootstrap FreeBSD-HEAD on. Added: head/sys/mips/conf/ENH200 (contents, props changed) head/sys/mips/conf/ENH200.hints (contents, props changed) Added: head/sys/mips/conf/ENH200 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/ENH200 Thu Jul 4 08:13:14 2013 (r252690) @@ -0,0 +1,44 @@ +# +# Specific board setup for the Engenius ENH-200 802.11bgn mesh node. +# +# The Engenius ENH-200 has the following hardware: +# +# + AR7240 CPU SoC +# + AR9285 Wifi +# + Integrated switch +# + 8MB flash +# + 32MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR724X_BASE" +ident "ENH200" +hints "ENH200.hints" + +options AR71XX_REALMEM=32*1024*1024 + +options AR71XX_ENV_UBOOT + +# For DOS - enable if required +options MSDOSFS + +# uncompress - to boot read-only lzma natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" + +# Used for the static uboot partition map +device geom_map + +# Options needed for the EEPROM based calibration/PCI configuration data. +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch Added: head/sys/mips/conf/ENH200.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/ENH200.hints Thu Jul 4 08:13:14 2013 (r252690) @@ -0,0 +1,124 @@ +# $FreeBSD$ + +# arge0 MDIO bus +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# arge1 MDIO bus doesn't exist on the AR7240 + +# arge0: MII; dedicated PHY 4 on switch, connected via internal switch +# MDIO bus. + +# hint.arge.0.eeprommac=0x83fe9ff0 +hint.arge.0.phymask=0x10 # PHY 4 +# hint.arge.0.miimode=2 # MII +hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus + +# arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. +hint.arge.1.phymask=0x0 +# hint.arge.1.miimode=1 # GMII +hint.arge.1.media=1000 # Force to 1000BaseTX/full +hint.arge.1.fduplex=1 + +# +# AR7240 switch config +# +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=1 # We need to be explicitly told this +hint.arswitch.0.numphys=4 # 4 active switch PHYs (PHY 0 -> 3) +hint.arswitch.0.phy4cpu=1 # Yes, PHY 4 == dedicated PHY +hint.arswitch.0.is_rgmii=0 # No, not RGMII +hint.arswitch.0.is_gmii=0 # No, not GMII + +# ath0 hint - pcie slot 0 +hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 + +# ath0 - eeprom comes from here +hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# Signal leds +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="sig1" +hint.gpioled.0.pins=0x0001 # pin 0 +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.name="sig2" +hint.gpioled.1.pins=0x0002 # pin 1 +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.name="sig3" +hint.gpioled.2.pins=0x0800 # pin 11 +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.name="sig4" +hint.gpioled.3.pins=0x0080 # pin 7 + +# nvram mapping - XXX ? +#hint.nvram.0.base=0x1f030000 +#hint.nvram.0.maxsize=0x2000 +#hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +#hint.nvram.1.base=0x1f032000 +#hint.nvram.1.maxsize=0x4000 +#hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic + +# GEOM_MAP +# +# The default bootargs: +# +# bootargs=console=ttyS0,115200 root=31:04 rootfstype=squashfs init=/etc/preinit mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),320k(custom),1024k(kernel),4928k(rootfs),1536k(failsafe),64k(ART) board=ENH200 +# +# However there's not a lot of space in this image layout. +# +# Thus, an alternate layout will be used, complete with reconfiguring +# uboot to use the new base address. +# +# 256k - uboot (0x000000 -> 0x040000) +# 64k - uboot-env (0x040000 -> 0x050000) +# 1728k - kernel (0x050000 -> 0x200000) +# 6016k - rootfs (0x200000 -> 0x7e0000) +# 64k - config (0x7e0000 -> 0x7f0000) +# 64k - ART (0x7f0000 -> 0x800000) +# +# For this, the 'bootcmd' environment variable needs to be +# changed to point to the new location: +# +# ar7240> setenv bootcmd 'bootm 0x9f050000' + +# uboot (256k) +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# uboot-env (64k) +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="uboot-env" +hint.map.1.readonly=1 + +# kernel (1728k) +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end=0x00200000 +hint.map.2.name="kernel" + +# rootfs (6016k) +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00200000 +hint.map.3.end=0x007e0000 +hint.map.3.name="rootfs" + +# config (64k) +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007e0000 +hint.map.4.end=0x007f0000 +hint.map.4.name="cfg" + +# ART (64k) +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="ART" +hint.map.4.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 08:42:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B2FD700; Thu, 4 Jul 2013 08:42:21 +0000 (UTC) (envelope-from adrian@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 2E67C179B; Thu, 4 Jul 2013 08:42:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648gLet026157; Thu, 4 Jul 2013 08:42:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648gLvm026156; Thu, 4 Jul 2013 08:42:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307040842.r648gLvm026156@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 08:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252691 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 08:42:21 -0000 Author: adrian Date: Thu Jul 4 08:42:20 2013 New Revision: 252691 URL: http://svnweb.freebsd.org/changeset/base/252691 Log: Oops - fix bad hint numbering for the ART section. Modified: head/sys/mips/conf/ENH200.hints Modified: head/sys/mips/conf/ENH200.hints ============================================================================== --- head/sys/mips/conf/ENH200.hints Thu Jul 4 08:13:14 2013 (r252690) +++ head/sys/mips/conf/ENH200.hints Thu Jul 4 08:42:20 2013 (r252691) @@ -117,8 +117,8 @@ hint.map.4.end=0x007f0000 hint.map.4.name="cfg" # ART (64k) -hint.map.4.at="flash/spi0" -hint.map.4.start=0x007f0000 -hint.map.4.end=0x00800000 -hint.map.4.name="ART" -hint.map.4.readonly=1 +hint.map.5.at="flash/spi0" +hint.map.5.start=0x007f0000 +hint.map.5.end=0x00800000 +hint.map.5.name="ART" +hint.map.5.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 08:57:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66DABB1C; Thu, 4 Jul 2013 08:57:16 +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 497AD184C; Thu, 4 Jul 2013 08:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648vGlY029570; Thu, 4 Jul 2013 08:57:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648vEAX029556; Thu, 4 Jul 2013 08:57:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307040857.r648vEAX029556@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 4 Jul 2013 08:57:14 +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: r252692 - in stable/9/sys: netinet netinet6 netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 08:57:16 -0000 Author: ae Date: Thu Jul 4 08:57:13 2013 New Revision: 252692 URL: http://svnweb.freebsd.org/changeset/base/252692 Log: MFC r252026: Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics accounting. Modified: 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/raw_ip6.c stable/9/sys/netinet6/udp6_usrreq.c stable/9/sys/netipsec/ipsec.c stable/9/sys/netipsec/ipsec.h stable/9/sys/netipsec/ipsec6.h stable/9/sys/netipsec/ipsec_mbuf.c stable/9/sys/netipsec/ipsec_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet/tcp_input.c Thu Jul 4 08:57:13 2013 (r252692) @@ -920,12 +920,12 @@ findpcb: #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); goto dropunlock; } else #endif /* INET6 */ if (ipsec4_in_reject(m, inp) != 0) { - V_ipsec4stat.in_polvio++; + IPSECSTAT_INC(in_polvio); goto dropunlock; } #endif /* IPSEC */ Modified: stable/9/sys/netinet/udp_usrreq.c ============================================================================== --- stable/9/sys/netinet/udp_usrreq.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet/udp_usrreq.c Thu Jul 4 08:57:13 2013 (r252692) @@ -278,7 +278,7 @@ udp_append(struct inpcb *inp, struct ip /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - V_ipsec4stat.in_polvio++; + IPSECSTAT_INC(in_polvio); return; } #ifdef IPSEC_NAT_T @@ -1291,7 +1291,7 @@ udp4_espdecap(struct inpcb *inp, struct if (minlen > m->m_pkthdr.len) minlen = m->m_pkthdr.len; if ((m = m_pullup(m, minlen)) == NULL) { - V_ipsec4stat.in_inval++; + IPSECSTAT_INC(in_inval); return (NULL); /* Bypass caller processing. */ } data = mtod(m, caddr_t); /* Points to ip header. */ @@ -1331,7 +1331,7 @@ udp4_espdecap(struct inpcb *inp, struct uint32_t spi; if (payload <= sizeof(struct esp)) { - V_ipsec4stat.in_inval++; + IPSECSTAT_INC(in_inval); m_freem(m); return (NULL); /* Discard. */ } @@ -1352,7 +1352,7 @@ udp4_espdecap(struct inpcb *inp, struct tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, 2 * sizeof(uint16_t), M_NOWAIT); if (tag == NULL) { - V_ipsec4stat.in_nomem++; + IPSECSTAT_INC(in_nomem); m_freem(m); return (NULL); /* Discard. */ } Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/ip6_forward.c Thu Jul 4 08:57:13 2013 (r252692) @@ -120,7 +120,7 @@ ip6_forward(struct mbuf *m, int srcrt) * before forwarding packet actually. */ if (ipsec6_in_reject(m, NULL)) { - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); m_freem(m); return; } @@ -182,7 +182,7 @@ ip6_forward(struct mbuf *m, int srcrt) sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &error); if (sp == NULL) { - V_ipsec6stat.out_inval++; + IPSEC6STAT_INC(out_inval); IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 @@ -203,7 +203,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* * This packet is just discarded. */ - V_ipsec6stat.out_polvio++; + IPSEC6STAT_INC(out_polvio); IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { Modified: stable/9/sys/netinet6/raw_ip6.c ============================================================================== --- stable/9/sys/netinet6/raw_ip6.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/raw_ip6.c Thu Jul 4 08:57:13 2013 (r252692) @@ -263,7 +263,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if (n && ipsec6_in_reject(n, last)) { m_freem(n); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); /* Do not inject data into pcb. */ } else #endif /* IPSEC */ @@ -295,7 +295,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/udp6_usrreq.c Thu Jul 4 08:57:13 2013 (r252692) @@ -141,7 +141,7 @@ udp6_append(struct inpcb *inp, struct mb /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); return; } #endif /* IPSEC */ Modified: stable/9/sys/netipsec/ipsec.c ============================================================================== --- stable/9/sys/netipsec/ipsec.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec.c Thu Jul 4 08:57:13 2013 (r252692) @@ -454,7 +454,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int sp = ipsec_getpolicybysock(m, dir, inp, error); if (sp == NULL) { IPSEC_ASSERT(*error != 0, ("getpolicy failed w/o error")); - V_ipsec4stat.ips_out_inval++; + IPSECSTAT_INC(ips_out_inval); return (NULL); } IPSEC_ASSERT(*error == 0, ("sp w/ error set to %u", *error)); @@ -464,7 +464,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int printf("%s: invalid policy %u\n", __func__, sp->policy); /* FALLTHROUGH */ case IPSEC_POLICY_DISCARD: - V_ipsec4stat.ips_out_polvio++; + IPSECSTAT_INC(ips_out_polvio); *error = -EINVAL; /* Packet is discarded by caller. */ break; case IPSEC_POLICY_BYPASS: @@ -1315,7 +1315,7 @@ ipsec4_in_reject(struct mbuf *m, struct result = ipsec46_in_reject(m, inp); if (result) - V_ipsec4stat.ips_in_polvio++; + IPSECSTAT_INC(ips_in_polvio); return (result); } @@ -1333,7 +1333,7 @@ ipsec6_in_reject(struct mbuf *m, struct result = ipsec46_in_reject(m, inp); if (result) - V_ipsec6stat.ips_in_polvio++; + IPSEC6STAT_INC(ips_in_polvio); return (result); } Modified: stable/9/sys/netipsec/ipsec.h ============================================================================== --- stable/9/sys/netipsec/ipsec.h Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec.h Thu Jul 4 08:57:13 2013 (r252692) @@ -359,6 +359,7 @@ VNET_DECLARE(int, ip4_ipsec_ecn); VNET_DECLARE(int, ip4_esp_randpad); VNET_DECLARE(int, crypto_support); +#define IPSECSTAT_INC(name) V_ipsec4stat.name += 1 #define V_ipsec4stat VNET(ipsec4stat) #define V_ip4_def_policy VNET(ip4_def_policy) #define V_ip4_esp_trans_deflev VNET(ip4_esp_trans_deflev) Modified: stable/9/sys/netipsec/ipsec6.h ============================================================================== --- stable/9/sys/netipsec/ipsec6.h Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec6.h Thu Jul 4 08:57:13 2013 (r252692) @@ -48,6 +48,7 @@ VNET_DECLARE(int, ip6_ah_trans_deflev); VNET_DECLARE(int, ip6_ah_net_deflev); VNET_DECLARE(int, ip6_ipsec_ecn); +#define IPSEC6STAT_INC(name) V_ipsec6stat.name += 1 #define V_ipsec6stat VNET(ipsec6stat) #define V_ip6_esp_trans_deflev VNET(ip6_esp_trans_deflev) #define V_ip6_esp_net_deflev VNET(ip6_esp_net_deflev) Modified: stable/9/sys/netipsec/ipsec_mbuf.c ============================================================================== --- stable/9/sys/netipsec/ipsec_mbuf.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec_mbuf.c Thu Jul 4 08:57:13 2013 (r252692) @@ -135,7 +135,7 @@ m_makespace(struct mbuf *m0, int skip, i m = n; /* header is at front ... */ *off = 0; /* ... of new mbuf */ } - V_ipsec4stat.ips_mbinserted++; + IPSECSTAT_INC(ips_mbinserted); } else { /* * Copy the remainder to the back of the mbuf @@ -241,7 +241,7 @@ m_striphdr(struct mbuf *m, int skip, int /* Remove the header and associated data from the mbuf. */ if (roff == 0) { /* The header was at the beginning of the mbuf */ - V_ipsec4stat.ips_input_front++; + IPSECSTAT_INC(ips_input_front); m_adj(m1, hlen); if ((m1->m_flags & M_PKTHDR) == 0) m->m_pkthdr.len -= hlen; @@ -253,7 +253,7 @@ m_striphdr(struct mbuf *m, int skip, int * so first let's remove the remainder of the header from * the beginning of the remainder of the mbuf chain, if any. */ - V_ipsec4stat.ips_input_end++; + IPSECSTAT_INC(ips_input_end); if (roff + hlen > m1->m_len) { /* Adjust the next mbuf by the remainder */ m_adj(m1->m_next, roff + hlen - m1->m_len); @@ -278,7 +278,7 @@ m_striphdr(struct mbuf *m, int skip, int * The header lies in the "middle" of the mbuf; copy * the remainder of the mbuf down over the header. */ - V_ipsec4stat.ips_input_middle++; + IPSECSTAT_INC(ips_input_middle); bcopy(mtod(m1, u_char *) + roff + hlen, mtod(m1, u_char *) + roff, m1->m_len - (roff + hlen)); Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:57:13 2013 (r252692) @@ -164,7 +164,7 @@ ipsec_process_done(struct mbuf *m, struc * doing further processing. */ if (isr->next) { - V_ipsec4stat.ips_out_bundlesa++; + IPSECSTAT_INC(ips_out_bundlesa); /* XXX-BZ currently only support same AF bundles. */ switch (saidx->dst.sa.sa_family) { #ifdef INET @@ -362,7 +362,7 @@ again: * this packet because it is responsibility for * upper layer to retransmit the packet. */ - V_ipsec4stat.ips_out_nosa++; + IPSECSTAT_INC(ips_out_nosa); goto bad; } sav = isr->sav; @@ -833,14 +833,14 @@ ipsec6_output_tunnel(struct ipsec_output ipseclog((LOG_ERR, "%s: family mismatched between " "inner and outer, spi=%u\n", __func__, ntohl(isr->sav->spi))); - V_ipsec6stat.ips_out_inval++; + IPSEC6STAT_INC(ips_out_inval); error = EAFNOSUPPORT; goto bad; } m = ipsec6_splithdr(m); if (!m) { - V_ipsec6stat.ips_out_nomem++; + IPSEC6STAT_INC(ips_out_nomem); error = ENOMEM; goto bad; } @@ -870,7 +870,7 @@ ipsec6_output_tunnel(struct ipsec_output } if (state->ro->ro_rt == NULL) { IP6STAT_INC(ip6s_noroute); - V_ipsec6stat.ips_out_noroute++; + IPSEC6STAT_INC(ips_out_noroute); error = EHOSTUNREACH; goto bad; } @@ -882,7 +882,7 @@ ipsec6_output_tunnel(struct ipsec_output m = ipsec6_splithdr(m); if (!m) { - V_ipsec6stat.ips_out_nomem++; + IPSEC6STAT_INC(ips_out_nomem); error = ENOMEM; goto bad; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 08:59:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 33CE8E05; Thu, 4 Jul 2013 08:59:37 +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 25839186B; Thu, 4 Jul 2013 08:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648xbXi029930; Thu, 4 Jul 2013 08:59:37 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648xYoG029912; Thu, 4 Jul 2013 08:59:34 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307040859.r648xYoG029912@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 4 Jul 2013 08:59:34 +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: r252693 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 08:59:37 -0000 Author: ae Date: Thu Jul 4 08:59:34 2013 New Revision: 252693 URL: http://svnweb.freebsd.org/changeset/base/252693 Log: MFC r252028: Use corresponding macros to update statistics for AH, ESP, IPIP, IPCOMP, PFKEY. Modified: stable/9/sys/netipsec/ah_var.h stable/9/sys/netipsec/esp_var.h stable/9/sys/netipsec/ipcomp_var.h stable/9/sys/netipsec/ipip_var.h stable/9/sys/netipsec/ipsec_input.c stable/9/sys/netipsec/ipsec_output.c stable/9/sys/netipsec/key.c stable/9/sys/netipsec/keysock.c stable/9/sys/netipsec/keysock.h stable/9/sys/netipsec/xform_ah.c stable/9/sys/netipsec/xform_esp.c stable/9/sys/netipsec/xform_ipcomp.c stable/9/sys/netipsec/xform_ipip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ah_var.h ============================================================================== --- stable/9/sys/netipsec/ah_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ah_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -75,6 +75,8 @@ VNET_DECLARE(int, ah_enable); VNET_DECLARE(int, ah_cleartos); VNET_DECLARE(struct ahstat, ahstat); +#define AHSTAT_ADD(name, val) V_ahstat.name += (val) +#define AHSTAT_INC(name) AHSTAT_ADD(name, 1) #define V_ah_enable VNET(ah_enable) #define V_ah_cleartos VNET(ah_cleartos) #define V_ahstat VNET(ahstat) Modified: stable/9/sys/netipsec/esp_var.h ============================================================================== --- stable/9/sys/netipsec/esp_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/esp_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -75,6 +75,8 @@ struct espstat { VNET_DECLARE(int, esp_enable); VNET_DECLARE(struct espstat, espstat); +#define ESPSTAT_ADD(name, val) V_espstat.name += (val) +#define ESPSTAT_INC(name) ESPSTAT_ADD(name, 1) #define V_esp_enable VNET(esp_enable) #define V_espstat VNET(espstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipcomp_var.h ============================================================================== --- stable/9/sys/netipsec/ipcomp_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipcomp_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -68,6 +68,8 @@ struct ipcompstat { VNET_DECLARE(int, ipcomp_enable); VNET_DECLARE(struct ipcompstat, ipcompstat); +#define IPCOMPSTAT_ADD(name, val) V_ipcompstat.name += (val) +#define IPCOMPSTAT_INC(name) IPCOMPSTAT_ADD(name, 1) #define V_ipcomp_enable VNET(ipcomp_enable) #define V_ipcompstat VNET(ipcompstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipip_var.h ============================================================================== --- stable/9/sys/netipsec/ipip_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipip_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -62,6 +62,8 @@ struct ipipstat VNET_DECLARE(int, ipip_allow); VNET_DECLARE(struct ipipstat, ipipstat); +#define IPIPSTAT_ADD(name, val) V_ipipstat.name += (val) +#define IPIPSTAT_INC(name) IPIPSTAT_ADD(name, 1) #define V_ipip_allow VNET(ipip_allow) #define V_ipipstat VNET(ipipstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipsec_input.c ============================================================================== --- stable/9/sys/netipsec/ipsec_input.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipsec_input.c Thu Jul 4 08:59:34 2013 (r252693) @@ -99,8 +99,14 @@ #endif -#define IPSEC_ISTAT(p,x,y,z) ((p) == IPPROTO_ESP ? (x)++ : \ - (p) == IPPROTO_AH ? (y)++ : (z)++) +#define IPSEC_ISTAT(proto, name) do { \ + if ((proto) == IPPROTO_ESP) \ + ESPSTAT_INC(esps_##name); \ + else if ((proto) == IPPROTO_AH) \ + AHSTAT_INC(ahs_##name); \ + else \ + IPCOMPSTAT_INC(ipcomps_##name); \ +} while (0) #ifdef INET static void ipsec4_common_ctlinput(int, struct sockaddr *, void *, int); @@ -125,8 +131,7 @@ ipsec_common_input(struct mbuf *m, int s #endif #endif - IPSEC_ISTAT(sproto, V_espstat.esps_input, V_ahstat.ahs_input, - V_ipcompstat.ipcomps_input); + IPSEC_ISTAT(sproto, input); IPSEC_ASSERT(m != NULL, ("null packet")); @@ -138,15 +143,13 @@ ipsec_common_input(struct mbuf *m, int s (sproto == IPPROTO_AH && !V_ah_enable) || (sproto == IPPROTO_IPCOMP && !V_ipcomp_enable)) { m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); return EOPNOTSUPP; } if (m->m_pkthdr.len - skip < 2 * sizeof (u_int32_t)) { m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); DPRINTF(("%s: packet too small\n", __func__)); return EINVAL; } @@ -197,8 +200,7 @@ ipsec_common_input(struct mbuf *m, int s default: DPRINTF(("%s: unsupported protocol family %u\n", __func__, af)); m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_nopf, V_ahstat.ahs_nopf, - V_ipcompstat.ipcomps_nopf); + IPSEC_ISTAT(sproto, nopf); return EPFNOSUPPORT; } @@ -208,8 +210,7 @@ ipsec_common_input(struct mbuf *m, int s DPRINTF(("%s: no key association found for SA %s/%08lx/%u\n", __func__, ipsec_address(&dst_address), (u_long) ntohl(spi), sproto)); - IPSEC_ISTAT(sproto, V_espstat.esps_notdb, V_ahstat.ahs_notdb, - V_ipcompstat.ipcomps_notdb); + IPSEC_ISTAT(sproto, notdb); m_freem(m); return ENOENT; } @@ -218,8 +219,7 @@ ipsec_common_input(struct mbuf *m, int s DPRINTF(("%s: attempted to use uninitialized SA %s/%08lx/%u\n", __func__, ipsec_address(&dst_address), (u_long) ntohl(spi), sproto)); - IPSEC_ISTAT(sproto, V_espstat.esps_noxform, V_ahstat.ahs_noxform, - V_ipcompstat.ipcomps_noxform); + IPSEC_ISTAT(sproto, noxform); KEY_FREESAV(&sav); m_freem(m); return ENXIO; @@ -321,8 +321,7 @@ ipsec4_common_input_cb(struct mbuf *m, s /* Sanity check */ if (m == NULL) { DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_badkcr, V_ahstat.ahs_badkcr, - V_ipcompstat.ipcomps_badkcr); + IPSEC_ISTAT(sproto, badkcr); KEY_FREESAV(&sav); return EINVAL; } @@ -333,8 +332,7 @@ ipsec4_common_input_cb(struct mbuf *m, s DPRINTF(("%s: processing failed for SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOBUFS; goto bad; } @@ -355,9 +353,7 @@ ipsec4_common_input_cb(struct mbuf *m, s struct ip ipn; if (m->m_pkthdr.len - skip < sizeof(struct ip)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -386,9 +382,7 @@ ipsec4_common_input_cb(struct mbuf *m, s ipsp_address(saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -399,9 +393,7 @@ ipsec4_common_input_cb(struct mbuf *m, s struct ip6_hdr ip6n; if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -428,9 +420,7 @@ ipsec4_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -451,8 +441,7 @@ ipsec4_common_input_cb(struct mbuf *m, s sizeof(struct tdb_ident), M_NOWAIT); if (mtag == NULL) { DPRINTF(("%s: failed to get tag\n", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOMEM; goto bad; } @@ -494,9 +483,7 @@ ipsec4_common_input_cb(struct mbuf *m, s * Re-dispatch via software interrupt. */ if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { - IPSEC_ISTAT(sproto, V_espstat.esps_qfull, V_ahstat.ahs_qfull, - V_ipcompstat.ipcomps_qfull); - + IPSEC_ISTAT(sproto, qfull); DPRINTF(("%s: queue full; proto %u packet dropped\n", __func__, sproto)); return error; @@ -548,9 +535,7 @@ ipsec6_common_input(struct mbuf **mp, in if (protoff + l != *offp) { DPRINTF(("%s: bad packet header chain, protoff %u, " "l %u, off %u\n", __func__, protoff, l, *offp)); - IPSEC_ISTAT(proto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(proto, hdrops); m_freem(*mp); *mp = NULL; return IPPROTO_DONE; @@ -595,8 +580,7 @@ ipsec6_common_input_cb(struct mbuf *m, s /* Sanity check */ if (m == NULL) { DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_badkcr, V_ahstat.ahs_badkcr, - V_ipcompstat.ipcomps_badkcr); + IPSEC_ISTAT(sproto, badkcr); error = EINVAL; goto bad; } @@ -609,8 +593,7 @@ ipsec6_common_input_cb(struct mbuf *m, s __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EACCES; goto bad; } @@ -628,9 +611,7 @@ ipsec6_common_input_cb(struct mbuf *m, s struct ip ipn; if (m->m_pkthdr.len - skip < sizeof(struct ip)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -655,8 +636,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTATsproto, (V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -668,9 +648,7 @@ ipsec6_common_input_cb(struct mbuf *m, s struct ip6_hdr ip6n; if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -697,8 +675,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -718,8 +695,7 @@ ipsec6_common_input_cb(struct mbuf *m, s sizeof(struct tdb_ident), M_NOWAIT); if (mtag == NULL) { DPRINTF(("%s: failed to get tag\n", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOMEM; goto bad; } Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:59:34 2013 (r252693) @@ -282,8 +282,14 @@ ipsec_nextisr( int *error ) { -#define IPSEC_OSTAT(x,y,z) (isr->saidx.proto == IPPROTO_ESP ? (x)++ : \ - isr->saidx.proto == IPPROTO_AH ? (y)++ : (z)++) +#define IPSEC_OSTAT(name) do { \ + if (isr->saidx.proto == IPPROTO_ESP) \ + ESPSTAT_INC(esps_##name); \ + else if (isr->saidx.proto == IPPROTO_AH)\ + AHSTAT_INC(ahs_##name); \ + else \ + IPCOMPSTAT_INC(ipcomps_##name); \ +} while (0) struct secasvar *sav; IPSECREQUEST_LOCK_ASSERT(isr); @@ -391,8 +397,7 @@ again: (isr->saidx.proto == IPPROTO_IPCOMP && !V_ipcomp_enable)) { DPRINTF(("%s: IPsec outbound packet dropped due" " to policy (check your sysctls)\n", __func__)); - IPSEC_OSTAT(V_espstat.esps_pdrops, V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_OSTAT(pdrops); *error = EHOSTUNREACH; goto bad; } @@ -403,8 +408,7 @@ again: */ if (sav->tdb_xform == NULL) { DPRINTF(("%s: no transform for SA\n", __func__)); - IPSEC_OSTAT(V_espstat.esps_noxform, V_ahstat.ahs_noxform, - V_ipcompstat.ipcomps_noxform); + IPSEC_OSTAT(noxform); *error = EHOSTUNREACH; goto bad; } Modified: stable/9/sys/netipsec/key.c ============================================================================== --- stable/9/sys/netipsec/key.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/key.c Thu Jul 4 08:59:34 2013 (r252693) @@ -7340,7 +7340,7 @@ key_parse(m, so) if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != m->m_pkthdr.len) { ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__)); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); error = EINVAL; goto senderror; } @@ -7348,7 +7348,7 @@ key_parse(m, so) if (msg->sadb_msg_version != PF_KEY_V2) { ipseclog((LOG_DEBUG, "%s: PF_KEY version %u is mismatched.\n", __func__, msg->sadb_msg_version)); - V_pfkeystat.out_invver++; + PFKEYSTAT_INC(out_invver); error = EINVAL; goto senderror; } @@ -7356,7 +7356,7 @@ key_parse(m, so) if (msg->sadb_msg_type > SADB_MAX) { ipseclog((LOG_DEBUG, "%s: invalid type %u is passed.\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invmsgtype++; + PFKEYSTAT_INC(out_invmsgtype); error = EINVAL; goto senderror; } @@ -7409,7 +7409,7 @@ key_parse(m, so) ipseclog((LOG_DEBUG, "%s: must specify satype " "when msg type=%u.\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7429,7 +7429,7 @@ key_parse(m, so) case SADB_X_SPDDELETE2: ipseclog((LOG_DEBUG, "%s: illegal satype=%u\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7440,7 +7440,7 @@ key_parse(m, so) case SADB_SATYPE_MIP: ipseclog((LOG_DEBUG, "%s: type %u isn't supported.\n", __func__, msg->sadb_msg_satype)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EOPNOTSUPP; goto senderror; case 1: /* XXX: What does it do? */ @@ -7450,7 +7450,7 @@ key_parse(m, so) default: ipseclog((LOG_DEBUG, "%s: invalid type %u is passed.\n", __func__, msg->sadb_msg_satype)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7468,7 +7468,7 @@ key_parse(m, so) if (src0->sadb_address_proto != dst0->sadb_address_proto) { ipseclog((LOG_DEBUG, "%s: upper layer protocol " "mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7478,7 +7478,7 @@ key_parse(m, so) PFKEY_ADDR_SADDR(dst0)->sa_family) { ipseclog((LOG_DEBUG, "%s: address family mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7486,7 +7486,7 @@ key_parse(m, so) PFKEY_ADDR_SADDR(dst0)->sa_len) { ipseclog((LOG_DEBUG, "%s: address struct size " "mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7495,7 +7495,7 @@ key_parse(m, so) case AF_INET: if (PFKEY_ADDR_SADDR(src0)->sa_len != sizeof(struct sockaddr_in)) { - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7503,7 +7503,7 @@ key_parse(m, so) case AF_INET6: if (PFKEY_ADDR_SADDR(src0)->sa_len != sizeof(struct sockaddr_in6)) { - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7511,7 +7511,7 @@ key_parse(m, so) default: ipseclog((LOG_DEBUG, "%s: unsupported address family\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EAFNOSUPPORT; goto senderror; } @@ -7533,7 +7533,7 @@ key_parse(m, so) dst0->sadb_address_prefixlen > plen) { ipseclog((LOG_DEBUG, "%s: illegal prefixlen.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7546,7 +7546,7 @@ key_parse(m, so) if (msg->sadb_msg_type >= sizeof(key_typesw)/sizeof(key_typesw[0]) || key_typesw[msg->sadb_msg_type] == NULL) { - V_pfkeystat.out_invmsgtype++; + PFKEYSTAT_INC(out_invmsgtype); error = EINVAL; goto senderror; } @@ -7648,7 +7648,7 @@ key_align(m, mhp) ipseclog((LOG_DEBUG, "%s: duplicate ext_type " "%u\n", __func__, ext->sadb_ext_type)); m_freem(m); - V_pfkeystat.out_dupext++; + PFKEYSTAT_INC(out_dupext); return EINVAL; } break; @@ -7656,7 +7656,7 @@ key_align(m, mhp) ipseclog((LOG_DEBUG, "%s: invalid ext_type %u\n", __func__, ext->sadb_ext_type)); m_freem(m); - V_pfkeystat.out_invexttype++; + PFKEYSTAT_INC(out_invexttype); return EINVAL; } @@ -7664,7 +7664,7 @@ key_align(m, mhp) if (key_validate_ext(ext, extlen)) { m_freem(m); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); return EINVAL; } @@ -7682,7 +7682,7 @@ key_align(m, mhp) if (off != end) { m_freem(m); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); return EINVAL; } Modified: stable/9/sys/netipsec/keysock.c ============================================================================== --- stable/9/sys/netipsec/keysock.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/keysock.c Thu Jul 4 08:59:34 2013 (r252693) @@ -91,19 +91,19 @@ key_output(struct mbuf *m, struct socket if (m == 0) panic("%s: NULL pointer was passed.\n", __func__); - V_pfkeystat.out_total++; - V_pfkeystat.out_bytes += m->m_pkthdr.len; + PFKEYSTAT_INC(out_total); + PFKEYSTAT_ADD(out_bytes, m->m_pkthdr.len); len = m->m_pkthdr.len; if (len < sizeof(struct sadb_msg)) { - V_pfkeystat.out_tooshort++; + PFKEYSTAT_INC(out_tooshort); error = EINVAL; goto end; } if (m->m_len < sizeof(struct sadb_msg)) { if ((m = m_pullup(m, sizeof(struct sadb_msg))) == 0) { - V_pfkeystat.out_nomem++; + PFKEYSTAT_INC(out_nomem); error = ENOBUFS; goto end; } @@ -114,9 +114,9 @@ key_output(struct mbuf *m, struct socket KEYDEBUG(KEYDEBUG_KEY_DUMP, kdebug_mbuf(m)); msg = mtod(m, struct sadb_msg *); - V_pfkeystat.out_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(out_msgtype[msg->sadb_msg_type]); if (len != PFKEY_UNUNIT64(msg->sadb_msg_len)) { - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); error = EINVAL; goto end; } @@ -147,7 +147,7 @@ key_sendup0(rp, m, promisc) if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); m_freem(m); return ENOBUFS; } @@ -160,12 +160,12 @@ key_sendup0(rp, m, promisc) pmsg->sadb_msg_len = PFKEY_UNIT64(m->m_pkthdr.len); /* pid and seq? */ - V_pfkeystat.in_msgtype[pmsg->sadb_msg_type]++; + PFKEYSTAT_INC(in_msgtype[pmsg->sadb_msg_type]); } if (!sbappendaddr(&rp->rcb_socket->so_rcv, (struct sockaddr *)&key_src, m, NULL)) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); m_freem(m); error = ENOBUFS; } else @@ -197,9 +197,9 @@ key_sendup(so, msg, len, target) * we increment statistics here, just in case we have ENOBUFS * in this function. */ - V_pfkeystat.in_total++; - V_pfkeystat.in_bytes += len; - V_pfkeystat.in_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(in_total); + PFKEYSTAT_ADD(in_bytes, len); + PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); /* * Get mbuf chain whenever possible (not clusters), @@ -216,14 +216,14 @@ key_sendup(so, msg, len, target) if (tlen == len) { MGETHDR(n, M_DONTWAIT, MT_DATA); if (n == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MHLEN; } else { MGET(n, M_DONTWAIT, MT_DATA); if (n == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MLEN; @@ -233,7 +233,7 @@ key_sendup(so, msg, len, target) if ((n->m_flags & M_EXT) == 0) { m_free(n); m_freem(m); - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MCLBYTES; @@ -256,9 +256,9 @@ key_sendup(so, msg, len, target) m_copyback(m, 0, len, (caddr_t)msg); /* avoid duplicated statistics */ - V_pfkeystat.in_total--; - V_pfkeystat.in_bytes -= len; - V_pfkeystat.in_msgtype[msg->sadb_msg_type]--; + PFKEYSTAT_ADD(in_total, -1); + PFKEYSTAT_ADD(in_bytes, -len); + PFKEYSTAT_ADD(in_msgtype[msg->sadb_msg_type], -1); return key_sendup_mbuf(so, m, target); } @@ -281,19 +281,19 @@ key_sendup_mbuf(so, m, target) if (so == NULL && target == KEY_SENDUP_ONE) panic("%s: NULL pointer was passed.\n", __func__); - V_pfkeystat.in_total++; - V_pfkeystat.in_bytes += m->m_pkthdr.len; + PFKEYSTAT_INC(in_total); + PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len); if (m->m_len < sizeof(struct sadb_msg)) { m = m_pullup(m, sizeof(struct sadb_msg)); if (m == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } } if (m->m_len >= sizeof(struct sadb_msg)) { struct sadb_msg *msg; msg = mtod(m, struct sadb_msg *); - V_pfkeystat.in_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); } mtx_lock(&rawcb_mtx); LIST_FOREACH(rp, &V_rawcb_list, list) @@ -338,14 +338,14 @@ key_sendup_mbuf(so, m, target) sendup++; break; } - V_pfkeystat.in_msgtarget[target]++; + PFKEYSTAT_INC(in_msgtarget[target]); if (!sendup) continue; if ((n = m_copy(m, 0, (int)M_COPYALL)) == NULL) { m_freem(m); - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); mtx_unlock(&rawcb_mtx); return ENOBUFS; } Modified: stable/9/sys/netipsec/keysock.h ============================================================================== --- stable/9/sys/netipsec/keysock.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/keysock.h Thu Jul 4 08:59:34 2013 (r252693) @@ -70,6 +70,8 @@ struct keycb { }; VNET_DECLARE(struct pfkeystat, pfkeystat); +#define PFKEYSTAT_ADD(name, val) V_pfkeystat.name += (val) +#define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1) #define V_pfkeystat VNET(pfkeystat) extern int key_output(struct mbuf *m, struct socket *so); Modified: stable/9/sys/netipsec/xform_ah.c ============================================================================== --- stable/9/sys/netipsec/xform_ah.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/xform_ah.c Thu Jul 4 08:59:34 2013 (r252693) @@ -596,14 +596,14 @@ ah_input(struct mbuf *m, struct secasvar IP6_EXTHDR_GET(ah, struct newah *, m, skip, rplen); if (ah == NULL) { DPRINTF(("ah_input: cannot pullup header\n")); - V_ahstat.ahs_hdrops++; /*XXX*/ + AHSTAT_INC(ahs_hdrops); /*XXX*/ m_freem(m); return ENOBUFS; } /* Check replay window, if applicable. */ if (sav->replay && !ipsec_chkreplay(ntohl(ah->ah_seq), sav)) { - V_ahstat.ahs_replay++; + AHSTAT_INC(ahs_replay); DPRINTF(("%s: packet replay failure: %s\n", __func__, ipsec_logsastr(sav))); m_freem(m); @@ -620,17 +620,17 @@ ah_input(struct mbuf *m, struct secasvar hl, (u_long) (authsize + rplen - sizeof (struct ah)), ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_badauthl++; + AHSTAT_INC(ahs_badauthl); m_freem(m); return EACCES; } - V_ahstat.ahs_ibytes += m->m_pkthdr.len - skip - hl; + AHSTAT_ADD(ahs_ibytes, m->m_pkthdr.len - skip - hl); /* Get crypto descriptors. */ crp = crypto_getreq(1); if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptor\n",__func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); m_freem(m); return ENOBUFS; } @@ -670,7 +670,7 @@ ah_input(struct mbuf *m, struct secasvar } if (tc == NULL) { DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); crypto_freereq(crp); m_freem(m); return ENOBUFS; @@ -694,7 +694,7 @@ ah_input(struct mbuf *m, struct secasvar skip, ahx->type, 0); if (error != 0) { /* NB: mbuf is free'd by ah_massage_headers */ - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); free(tc, M_XDATA); crypto_freereq(crp); return error; @@ -775,19 +775,19 @@ ah_input_cb(struct cryptop *crp) return error; } - V_ahstat.ahs_noxform++; + AHSTAT_INC(ahs_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; } else { - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); crypto_freereq(crp); /* No longer needed. */ crp = NULL; } /* Shouldn't happen... */ if (m == NULL) { - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; @@ -813,7 +813,7 @@ ah_input_cb(struct cryptop *crp) "in SA %s/%08lx\n", __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_badauth++; + AHSTAT_INC(ahs_badauth); error = EACCES; goto bad; } @@ -844,7 +844,7 @@ ah_input_cb(struct cryptop *crp) m_copydata(m, skip + offsetof(struct newah, ah_seq), sizeof (seq), (caddr_t) &seq); if (ipsec_updatereplay(ntohl(seq), sav)) { - V_ahstat.ahs_replay++; + AHSTAT_INC(ahs_replay); error = ENOBUFS; /*XXX as above*/ goto bad; } @@ -858,7 +858,7 @@ ah_input_cb(struct cryptop *crp) DPRINTF(("%s: mangled mbuf chain for SA %s/%08lx\n", __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); goto bad; } @@ -919,7 +919,7 @@ ah_output( ahx = sav->tdb_authalgxform; IPSEC_ASSERT(ahx != NULL, ("null authentication xform")); - V_ahstat.ahs_output++; + AHSTAT_INC(ahs_output); /* Figure out header size. */ rplen = HDRSIZE(sav); @@ -942,7 +942,7 @@ ah_output( sav->sah->saidx.dst.sa.sa_family, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_nopf++; + AHSTAT_INC(ahs_nopf); error = EPFNOSUPPORT; goto bad; } @@ -953,20 +953,20 @@ ah_output( ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi), rplen + authsize + m->m_pkthdr.len, maxpacketsize)); - V_ahstat.ahs_toobig++; + AHSTAT_INC(ahs_toobig); error = EMSGSIZE; goto bad; } /* Update the counters. */ - V_ahstat.ahs_obytes += m->m_pkthdr.len - skip; + AHSTAT_ADD(ahs_obytes, m->m_pkthdr.len - skip); m = m_unshare(m, M_NOWAIT); if (m == NULL) { DPRINTF(("%s: cannot clone mbuf chain, SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); error = ENOBUFS; goto bad; } @@ -979,7 +979,7 @@ ah_output( rplen + authsize, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; /*XXX differs from openbsd */ + AHSTAT_INC(ahs_hdrops); /*XXX differs from openbsd */ error = ENOBUFS; goto bad; } @@ -1007,7 +1007,7 @@ ah_output( __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_wrap++; + AHSTAT_INC(ahs_wrap); error = EINVAL; goto bad; } @@ -1024,7 +1024,7 @@ ah_output( if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); error = ENOBUFS; goto bad; } @@ -1046,7 +1046,7 @@ ah_output( if (tc == NULL) { crypto_freereq(crp); DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); error = ENOBUFS; goto bad; } @@ -1151,7 +1151,7 @@ ah_output_cb(struct cryptop *crp) sav = tc->tc_sav; /* With the isr lock released SA pointer can be updated. */ if (sav != isr->sav) { - V_ahstat.ahs_notdb++; + AHSTAT_INC(ahs_notdb); DPRINTF(("%s: SA expired while in crypto\n", __func__)); error = ENOBUFS; /*XXX*/ goto bad; @@ -1168,7 +1168,7 @@ ah_output_cb(struct cryptop *crp) return error; } - V_ahstat.ahs_noxform++; + AHSTAT_INC(ahs_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; @@ -1176,12 +1176,12 @@ ah_output_cb(struct cryptop *crp) /* Shouldn't happen... */ if (m == NULL) { - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; } - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); /* * Copy original headers (with the new protocol number) back Modified: stable/9/sys/netipsec/xform_esp.c ============================================================================== --- stable/9/sys/netipsec/xform_esp.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/xform_esp.c Thu Jul 4 08:59:34 2013 (r252693) @@ -286,7 +286,7 @@ esp_input(struct mbuf *m, struct secasva if ( (skip&3) || (m->m_pkthdr.len&3) ){ DPRINTF(("%s: misaligned packet, skip %u pkt len %u", __func__, skip, m->m_pkthdr.len)); - V_espstat.esps_badilen++; + ESPSTAT_INC(esps_badilen); m_freem(m); return EINVAL; } @@ -332,7 +332,7 @@ esp_input(struct mbuf *m, struct secasva plen, espx->blocksize, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_espstat.esps_badilen++; + ESPSTAT_INC(esps_badilen); m_freem(m); return EINVAL; } @@ -343,13 +343,13 @@ esp_input(struct mbuf *m, struct secasva if (esph && sav->replay && !ipsec_chkreplay(ntohl(esp->esp_seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, ipsec_logsastr(sav))); /*XXX*/ - V_espstat.esps_replay++; + ESPSTAT_INC(esps_replay); m_freem(m); return ENOBUFS; /*XXX*/ } /* Update the counters */ - V_espstat.esps_ibytes += m->m_pkthdr.len - (skip + hlen + alen); + ESPSTAT_ADD(esps_ibytes, m->m_pkthdr.len - (skip + hlen + alen)); /* Find out if we've already done crypto */ for (mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_CRYPTO_DONE, NULL); @@ -368,7 +368,7 @@ esp_input(struct mbuf *m, struct secasva if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); m_freem(m); return ENOBUFS; } @@ -383,7 +383,7 @@ esp_input(struct mbuf *m, struct secasva if (tc == NULL) { crypto_freereq(crp); DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); m_freem(m); return ENOBUFS; } @@ -501,7 +501,7 @@ esp_input_cb(struct cryptop *crp) return error; } - V_espstat.esps_noxform++; + ESPSTAT_INC(esps_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; @@ -509,12 +509,12 @@ esp_input_cb(struct cryptop *crp) /* Shouldn't happen... */ if (m == NULL) { - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; } - V_espstat.esps_hist[sav->alg_enc]++; + ESPSTAT_INC(esps_hist[sav->alg_enc]); /* If authentication was performed, check now. */ if (esph != NULL) { @@ -533,7 +533,7 @@ esp_input_cb(struct cryptop *crp) * the verification for us. Otherwise we need to * check the authentication calculation. */ - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); if (mtag == NULL) { /* Copy the authenticator from the packet */ m_copydata(m, m->m_pkthdr.len - alen, @@ -548,7 +548,7 @@ esp_input_cb(struct cryptop *crp) __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_espstat.esps_badauth++; + ESPSTAT_INC(esps_badauth); error = EACCES; goto bad; } @@ -578,7 +578,7 @@ esp_input_cb(struct cryptop *crp) if (ipsec_updatereplay(ntohl(seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, ipsec_logsastr(sav))); - V_espstat.esps_replay++; + ESPSTAT_INC(esps_replay); error = ENOBUFS; goto bad; } @@ -593,7 +593,7 @@ esp_input_cb(struct cryptop *crp) /* Remove the ESP header and IV from the mbuf. */ error = m_striphdr(m, skip, hlen); if (error) { - V_espstat.esps_hdrops++; + ESPSTAT_INC(esps_hdrops); DPRINTF(("%s: bad mbuf chain, SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 10:38:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1A11F4F7; Thu, 4 Jul 2013 10:38:15 +0000 (UTC) (envelope-from gber@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 0C1FC1DA4; Thu, 4 Jul 2013 10:38:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64AcEG1059227; Thu, 4 Jul 2013 10:38:14 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64AcEUa059226; Thu, 4 Jul 2013 10:38:14 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201307041038.r64AcEUa059226@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 4 Jul 2013 10:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252694 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 10:38:15 -0000 Author: gber Date: Thu Jul 4 10:38:14 2013 New Revision: 252694 URL: http://svnweb.freebsd.org/changeset/base/252694 Log: Fix modified bit emulation for ARMv6/v7 When doing pmap_enter_locked(), enable write permission only when access type indicates attempt to write. Otherwise, leave the page read only but mark it writable in pv_flags. This will result in: 1. Marking page writable during pmap_enter() but only when ensured that it will be written right away so that we will not get redundant permissions fault on write attempt. 2. Keeping page read only when it is permitted to be written but there was no actual write attempt. Hence, we will get permissions fault on write access and mark page writable in pmap_fault_fixup() what will indicate modification status. Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu Jul 4 08:59:34 2013 (r252693) +++ head/sys/arm/arm/pmap-v6.c Thu Jul 4 10:38:14 2013 (r252694) @@ -2801,8 +2801,13 @@ validate: } if (prot & VM_PROT_WRITE) { - /* Write enable */ - npte &= ~(L2_APX); + /* + * Enable write permission if the access type + * indicates write intention. Emulate modified + * bit otherwise. + */ + if ((access & VM_PROT_WRITE) != 0) + npte &= ~(L2_APX); if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 10:40:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1A5E9653; Thu, 4 Jul 2013 10:40:25 +0000 (UTC) (envelope-from gber@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 0DF6A1DBB; Thu, 4 Jul 2013 10:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64AeOYq059565; Thu, 4 Jul 2013 10:40:24 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64AeOIS059564; Thu, 4 Jul 2013 10:40:24 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201307041040.r64AeOIS059564@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 4 Jul 2013 10:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252695 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 10:40:25 -0000 Author: gber Date: Thu Jul 4 10:40:24 2013 New Revision: 252695 URL: http://svnweb.freebsd.org/changeset/base/252695 Log: Remove redundant clearing of the PGA_WRITEABLE flag in pmap_remove_all() This flag should already be cleared by pmap_nuke_pv() Submitted by: Zbigniew Bodek Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu Jul 4 10:38:14 2013 (r252694) +++ head/sys/arm/arm/pmap-v6.c Thu Jul 4 10:40:24 2013 (r252695) @@ -2470,7 +2470,6 @@ pmap_remove_all(vm_page_t m) else cpu_tlb_flushD(); } - vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 11:43:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EB6EF76 for ; Thu, 4 Jul 2013 11:43:05 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 70E761FED for ; Thu, 4 Jul 2013 11:43:05 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id r11so1112958lbv.41 for ; Thu, 04 Jul 2013 04:43:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=ZtSPXo3FIzAHNmZ2fdjzlN9do3rUqin1X6luJWH8Xt4=; b=g03A6YvrvBTslmvjK0YuBAFbJzbZJc3rSgTKLR56PM6SJtlw7M9wg/YRFtu9udBEMr tLNEUt/DaG2jL+mi/Fg8qjb1A0m57N/LHAr+kHittZy1SDetzu54AIjcjdKvLirzTtOO rmn8hJAFEn1tBpjJ7dA/6+GW9/SzN9LGWRgq4u6hfvTYiX1UHIs6Nd8iHRuvXVshLUA6 8chSkm8CQl5X81/yfXHLmkTjQj3vxygzN9tv4fZYhhfv6NWWDezB5967+6swb32cRxSI zObC64kP1gUTnpPAwR5sWZxCHhZOCI7+mvSUyZ3Kg4+XFuPPpEDwEk7uV8LT6EnRERQs +1TQ== X-Received: by 10.112.159.66 with SMTP id xa2mr3232569lbb.60.1372938183853; Thu, 04 Jul 2013 04:43:03 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id ea14sm1109339lbb.11.2013.07.04.04.43.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Jul 2013 04:43:03 -0700 (PDT) Message-ID: <51D55FC5.7040703@freebsd.org> Date: Thu, 04 Jul 2013 15:43:01 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib References: <201307032121.r63LLtkk022011@svn.freebsd.org> <20130704120336.G1176@besplex.bde.org> <51D4ED7F.5050800@freebsd.org> <20130704142324.K1670@besplex.bde.org> In-Reply-To: <20130704142324.K1670@besplex.bde.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkm2QoDsXE9qX8qNkZr6CY3jH8IvgfQeRC2WF6vqocw2aQmcft83Uh05vqAWCXa8XaLDY+f Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 11:43:06 -0000 On 04.07.2013 11:01, Bruce Evans wrote: >> We already pass that moment in the past, changing old&bad formula with >> new one which cause the same effect: non-repeating sequence in the very >> global scope. We already agree that repeating depends on something like >> OS release numbers. I can't find that discussion right now. > > But you are changing it in between releases. Development and stable branches are not official releases. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 12:24:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDE76A2F; Thu, 4 Jul 2013 12:24:40 +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 C649611DE; Thu, 4 Jul 2013 12:24:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64COeo2090638; Thu, 4 Jul 2013 12:24:40 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64COePZ090637; Thu, 4 Jul 2013 12:24:40 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307041224.r64COePZ090637@svn.freebsd.org> From: Warren Block Date: Thu, 4 Jul 2013 12:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252696 - head/usr.sbin/powerd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 12:24:41 -0000 Author: wblock (doc committer) Date: Thu Jul 4 12:24:39 2013 New Revision: 252696 URL: http://svnweb.freebsd.org/changeset/base/252696 Log: Put the power modes in a list to make them easier to find. Reviewed by: joel MFC after: 1 week Modified: head/usr.sbin/powerd/powerd.8 Modified: head/usr.sbin/powerd/powerd.8 ============================================================================== --- head/usr.sbin/powerd/powerd.8 Thu Jul 4 10:40:24 2013 (r252695) +++ head/usr.sbin/powerd/powerd.8 Thu Jul 4 12:24:39 2013 (r252696) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2009 +.Dd July 4, 2013 .Dt POWERD 8 .Os .Sh NAME @@ -47,27 +47,43 @@ The .Nm utility monitors the system state and sets various power control options accordingly. -It offers four modes (maximum, minimum, adaptive and hiadaptive) that can be -individually selected while on AC power or batteries. -The modes maximum, minimum, adaptive and hiadaptive may be abbreviated -max, min, adp, hadp. -.Pp -Maximum mode chooses the highest performance values. -Minimum mode selects the lowest performance values to get the most power -savings. -Adaptive mode attempts to strike a balance by degrading performance when -the system appears idle and increasing it when the system is busy. +It offers power-saving modes that can be +individually selected for operation on AC power or batteries. +.Bl -tag -width ".Ar hiadaptive" +.It Ar maximum +Choose the highest performance values. +May be abbreviated as +.Ar max . +.It Ar minimum +Choose the lowest performance values to get the most power savings. +May be abbreviated as +.Ar min . +.It Ar adaptive +Attempt to strike a balance by degrading performance when the system +appears idle and increasing it when the system is busy. It offers a good balance between a small performance loss for greatly increased power savings. -Hiadaptive mode is like adaptive mode, but tuned for systems where -performance and interactivity are more important than power consumption. -It increases frequency faster, reduces the frequency less aggressively and +May be abbreviated as +.Ar adp . +.It Ar hiadaptive +Like +.Ar adaptive +mode, but tuned for systems where performance and interactivity are +more important than power consumption. +It increases frequency faster, reduces frequency less aggressively, and will maintain full frequency for longer. -The default mode is adaptive for battery power and hiadaptive for the rest. +May be abbreviated as +.Ar hadp . +.El +.Pp +The default mode is +.Ar adaptive +for battery power and +.Ar hiadaptive +for the rest. .Pp -The .Nm -utility recognizes the following runtime options: +recognizes these runtime options: .Bl -tag -width ".Fl r Ar percent" .It Fl a Ar mode Selects the From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 12:27:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C42EC0D; Thu, 4 Jul 2013 12:27:11 +0000 (UTC) (envelope-from pjd@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 3EA6411F5; Thu, 4 Jul 2013 12:27:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64CRBIi090979; Thu, 4 Jul 2013 12:27:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64CRBmQ090978; Thu, 4 Jul 2013 12:27:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307041227.r64CRBmQ090978@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 4 Jul 2013 12:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252697 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 12:27:11 -0000 Author: pjd Date: Thu Jul 4 12:27:10 2013 New Revision: 252697 URL: http://svnweb.freebsd.org/changeset/base/252697 Log: Fix dhclient for interfaces that are down. The discover_interfaces() function that looks for interface skips interfaces that are not UP. We need to call dhclient-script PREINIT before we call discover_interfaces(), so the script has a chance to bring the interface UP. Reported by: alfred Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu Jul 4 12:24:39 2013 (r252696) +++ head/sbin/dhclient/dhclient.c Thu Jul 4 12:27:10 2013 (r252697) @@ -457,6 +457,11 @@ main(int argc, char *argv[]) if (gethostname(hostname, sizeof(hostname)) < 0) hostname[0] = '\0'; + priv_script_init("PREINIT", NULL); + if (ifi->client->alias) + priv_script_write_params("alias_", ifi->client->alias); + priv_script_go(); + /* set up the interface */ discover_interfaces(ifi); @@ -483,11 +488,6 @@ main(int argc, char *argv[]) rewrite_client_leases(); close(fd); - priv_script_init("PREINIT", NULL); - if (ifi->client->alias) - priv_script_write_params("alias_", ifi->client->alias); - priv_script_go(); - if ((routefd = socket(PF_ROUTE, SOCK_RAW, 0)) != -1) add_protocol("AF_ROUTE", routefd, routehandler, ifi); if (shutdown(routefd, SHUT_WR) < 0) From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 12:30:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 355D2D89; Thu, 4 Jul 2013 12:30:53 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id B74DB121E; Thu, 4 Jul 2013 12:30:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r64CUpL9046978; Thu, 4 Jul 2013 16:30:51 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 4 Jul 2013 16:30:51 +0400 (MSK) From: Dmitry Morozovsky To: Andrey Chernov Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib In-Reply-To: <51D55FC5.7040703@freebsd.org> Message-ID: References: <201307032121.r63LLtkk022011@svn.freebsd.org> <20130704120336.G1176@besplex.bde.org> <51D4ED7F.5050800@freebsd.org> <20130704142324.K1670@besplex.bde.org> <51D55FC5.7040703@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Thu, 04 Jul 2013 16:30:51 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 12:30:53 -0000 On Thu, 4 Jul 2013, Andrey Chernov wrote: > >> We already pass that moment in the past, changing old&bad formula with > >> new one which cause the same effect: non-repeating sequence in the very > >> global scope. We already agree that repeating depends on something like > >> OS release numbers. I can't find that discussion right now. > > > > But you are changing it in between releases. > > Development and stable branches are not official releases. sorry for nitpicking: ther is quite large difference between official/unofficial status and users/vendors expectations regarding interface/APIs stability. development (aka -current or head/) is not, while stable (aka stable/*/) are, ate least they are great subject to POLA. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 12:35:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B1611000; Thu, 4 Jul 2013 12:35:40 +0000 (UTC) (envelope-from ache@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 F1981124F; Thu, 4 Jul 2013 12:35:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64CZdtu093865; Thu, 4 Jul 2013 12:35:39 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64CZdKV093864; Thu, 4 Jul 2013 12:35:39 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201307041235.r64CZdKV093864@svn.freebsd.org> From: "Andrey A. Chernov" Date: Thu, 4 Jul 2013 12:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252698 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 12:35:40 -0000 Author: ache Date: Thu Jul 4 12:35:39 2013 New Revision: 252698 URL: http://svnweb.freebsd.org/changeset/base/252698 Log: Style fix noted by bde@ Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Thu Jul 4 12:27:10 2013 (r252697) +++ head/lib/libc/stdlib/rand.c Thu Jul 4 12:35:39 2013 (r252698) @@ -83,12 +83,16 @@ do_rand(unsigned long *ctx) int rand_r(unsigned int *ctx) { - u_long val = (u_long) *ctx; -#ifndef USE_WEAK_SEEDING + u_long val; + int r; + +#ifdef USE_WEAK_SEEDING + val = *ctx; +#else /* Transform to [1, 0x7ffffffe] range. */ - val = (val % 0x7ffffffe) + 1; + val = (*ctx % 0x7ffffffe) + 1; #endif - int r = do_rand(&val); + r = do_rand(&val); #ifdef USE_WEAK_SEEDING *ctx = (unsigned int)val; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 13:05:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F387B7B for ; Thu, 4 Jul 2013 13:05:09 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx1.freebsd.org (Postfix) with ESMTP id C95FB13CA for ; Thu, 4 Jul 2013 13:05:08 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id x10so1197514lbi.5 for ; Thu, 04 Jul 2013 06:05:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=kRXTm3KNfoBufaF5aMyTnvVqKim6SgFLGTzTNbK8tuU=; b=HRBUHNknYtmhkJqfxXjpr157BLK7/DEcm6+UFGZAS8lnyO3OeDrf2xsG2Cl9rJinwb 1Xr/wK+NCe/J5y9qgEzMl3RnEuG3KBltARxCKHOy73s6zcSS48U9vAdMEhCWlMBG4LsP OhhI96Jsl8/qLM5mGhuPZ07io/U/zZCg6G7GFA4jswhFbO/VzOle6mrGpMmAbFE+uv2T g055WR7kZdRtqZpTJ41K7grCBtWHR9gj9RuvcFqXH1JPko48HJBIfmT2porAbx3i4fHq 8eHr7xO924CJFF6eHU5XTPpkkHJEggTCFNW3y/TaIRdXAmTVtuzbg+iOU/ShgaENs+0p SaNw== X-Received: by 10.152.19.131 with SMTP id f3mr2973021lae.9.1372943101799; Thu, 04 Jul 2013 06:05:01 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id m1sm1113883lag.3.2013.07.04.06.05.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Jul 2013 06:05:01 -0700 (PDT) Message-ID: <51D572FC.7090004@freebsd.org> Date: Thu, 04 Jul 2013 17:05:00 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Dmitry Morozovsky Subject: Re: svn commit: r252608 - in head: include lib/libc/stdlib References: <201307032121.r63LLtkk022011@svn.freebsd.org> <20130704120336.G1176@besplex.bde.org> <51D4ED7F.5050800@freebsd.org> <20130704142324.K1670@besplex.bde.org> <51D55FC5.7040703@freebsd.org> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk0s7S6yxlYNBJ1x4cgPQxeN33bItemQTDXwgdGlqNrIb27pYhZpAbcigGUVTNvz14kfocg Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 13:05:09 -0000 On 04.07.2013 16:30, Dmitry Morozovsky wrote: > On Thu, 4 Jul 2013, Andrey Chernov wrote: > >>>> We already pass that moment in the past, changing old&bad formula with >>>> new one which cause the same effect: non-repeating sequence in the very >>>> global scope. We already agree that repeating depends on something like >>>> OS release numbers. I can't find that discussion right now. >>> >>> But you are changing it in between releases. >> >> Development and stable branches are not official releases. > > sorry for nitpicking: ther is quite large difference between > official/unofficial status and users/vendors expectations regarding > interface/APIs stability. > > development (aka -current or head/) is not, while stable > (aka stable/*/) are, ate least they are great subject to POLA. POSIX wording is unclear here. From common sense point of view: 1) all-time guaranteed results can come only from own formula and return values can change when the system libraries are changing (it is true for many other functions too) 2) nobody uses rand(3) nowadays. But in case you insist, I may just to not MFC this changes. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 14:26:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F0F417E; Thu, 4 Jul 2013 14:26:42 +0000 (UTC) (envelope-from des@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 8F3B518D3; Thu, 4 Jul 2013 14:26:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64EQgpu026433; Thu, 4 Jul 2013 14:26:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64EQgA0026432; Thu, 4 Jul 2013 14:26:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307041426.r64EQgA0026432@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 4 Jul 2013 14:26:42 +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: r252699 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 14:26:42 -0000 Author: des Date: Thu Jul 4 14:26:42 2013 New Revision: 252699 URL: http://svnweb.freebsd.org/changeset/base/252699 Log: Protect the #define MALLOC_PRODUCTION directive in case it was also defined on the command line (due to MALLOC_PRODUCTION=yes in src.conf). Modified: stable/9/lib/libc/stdlib/malloc.c Modified: stable/9/lib/libc/stdlib/malloc.c ============================================================================== --- stable/9/lib/libc/stdlib/malloc.c Thu Jul 4 12:35:39 2013 (r252698) +++ stable/9/lib/libc/stdlib/malloc.c Thu Jul 4 14:26:42 2013 (r252699) @@ -123,7 +123,9 @@ * defaults the A and J runtime options to off. These settings are appropriate * for production systems. */ +#ifndef MALLOC_PRODUCTION #define MALLOC_PRODUCTION +#endif #ifndef MALLOC_PRODUCTION /* From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 15:19:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6633B417; Thu, 4 Jul 2013 15:19:46 +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 45B291C08; Thu, 4 Jul 2013 15:19:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64FJkM1041650; Thu, 4 Jul 2013 15:19:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64FJktN041649; Thu, 4 Jul 2013 15:19:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307041519.r64FJktN041649@svn.freebsd.org> From: Alexander Motin Date: Thu, 4 Jul 2013 15:19:46 +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: r252700 - stable/9/lib/libstand X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 15:19:46 -0000 Author: mav Date: Thu Jul 4 15:19:45 2013 New Revision: 252700 URL: http://svnweb.freebsd.org/changeset/base/252700 Log: MFC r240774: Don't use global nfs_root_node variable as per-file storage. There are fields that should be file-specific. Modified: stable/9/lib/libstand/nfs.c Directory Properties: stable/9/lib/libstand/ (props changed) Modified: stable/9/lib/libstand/nfs.c ============================================================================== --- stable/9/lib/libstand/nfs.c Thu Jul 4 14:26:42 2013 (r252699) +++ stable/9/lib/libstand/nfs.c Thu Jul 4 15:19:45 2013 (r252700) @@ -486,6 +486,9 @@ nfs_open(const char *upath, struct open_ desc->destip = rootip; if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -498,14 +501,15 @@ nfs_open(const char *upath, struct open_ setenv("boot.nfsroot.path", rootpath, 1); setenv("boot.nfsroot.nfshandle", buf, 1); -#ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } - currfd = &nfs_root_node; +#ifndef NFS_NOSYMLINK + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -533,7 +537,6 @@ nfs_open(const char *upath, struct open_ /* allocate file system specific data structure */ newfd = malloc(sizeof(*newfd)); newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -585,11 +588,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -597,8 +597,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -611,14 +610,12 @@ out: if (path) free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); currfd->iodesc = desc; - currfd->off = 0; error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -628,10 +625,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -646,7 +640,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; @@ -1133,6 +1127,9 @@ nfs_open(const char *upath, struct open_ if ((error = nfs_getrootfh(desc, rootpath, &nfs_root_node.fhsize, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -1147,14 +1144,14 @@ nfs_open(const char *upath, struct open_ sprintf(buf, "%d", nfs_root_node.fhsize); setenv("boot.nfsroot.nfshandlelen", buf, 1); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } #ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); - - currfd = &nfs_root_node; + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -1186,7 +1183,6 @@ nfs_open(const char *upath, struct open_ goto out; } newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -1238,11 +1234,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -1250,8 +1243,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -1262,17 +1254,12 @@ out: free(newfd); free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); - if (currfd != NULL) { - currfd->iodesc = desc; - currfd->off = 0; + currfd->iodesc = desc; - error = nfs_lookupfh(&nfs_root_node, upath, currfd); - } else - error = ENOMEM; + error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1282,10 +1269,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -1300,7 +1284,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 15:21:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D340D65E; Thu, 4 Jul 2013 15:21:27 +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 B45F71C3F; Thu, 4 Jul 2013 15:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64FLR3Y043528; Thu, 4 Jul 2013 15:21:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64FLRhF043527; Thu, 4 Jul 2013 15:21:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307041521.r64FLRhF043527@svn.freebsd.org> From: Alexander Motin Date: Thu, 4 Jul 2013 15:21: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: r252701 - stable/9/lib/libstand X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 15:21:27 -0000 Author: mav Date: Thu Jul 4 15:21:27 2013 New Revision: 252701 URL: http://svnweb.freebsd.org/changeset/base/252701 Log: MFC r240780, r252468: Make nfs_readdir() more careful about using response data, cached in global buffer. For now it fixes bug when following `ls` command will return data from previous one aborted by pager. Also it should allow to read several directories same time, for example, for recursive tracerse. Modified: stable/9/lib/libstand/nfs.c Directory Properties: stable/9/lib/libstand/ (props changed) Modified: stable/9/lib/libstand/nfs.c ============================================================================== --- stable/9/lib/libstand/nfs.c Thu Jul 4 15:19:45 2013 (r252700) +++ stable/9/lib/libstand/nfs.c Thu Jul 4 15:21:27 2013 (r252701) @@ -181,6 +181,7 @@ struct nfs_iodesc { uint32_t fhsize; u_char fh[NFS_V3MAXFHSIZE]; struct nfsv3_fattrs fa; /* all in network order */ + uint64_t cookie; }; #endif /* OLD_NFSV2 */ @@ -755,6 +756,7 @@ nfs_readdir(struct open_file *f, struct struct nfs_readdir_data *rd; struct nfs_readdir_off *roff = NULL; static char *buf; + static struct nfs_iodesc *pfp = NULL; static n_long cookie = 0; size_t cc; n_long eof; @@ -768,13 +770,14 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(cookie); + args->cookie = htonl(fp->off); args->count = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, @@ -784,6 +787,8 @@ nfs_readdir(struct open_file *f, struct roff = (struct nfs_readdir_off *)buf; if (ntohl(roff->cookie) != 0) return EIO; + pfp = fp; + cookie = fp->off; } roff = (struct nfs_readdir_off *)buf; @@ -804,7 +809,7 @@ nfs_readdir(struct open_file *f, struct buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); roff = (struct nfs_readdir_off *)buf; - cookie = ntohl(roff->cookie); + fp->off = cookie = ntohl(roff->cookie); return 0; } #else /* !OLD_NFSV2 */ @@ -1260,6 +1265,7 @@ out: #endif if (!error) { currfd->off = 0; + currfd->cookie = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1398,11 +1404,9 @@ nfs_readdir(struct open_file *f, struct struct nfsv3_readdir_repl *repl; struct nfsv3_readdir_entry *rent; static char *buf; - static uint32_t cookie0 = 0; - static uint32_t cookie1 = 0; + static struct nfs_iodesc *pfp = NULL; + static uint64_t cookie = 0; size_t cc; - static uint32_t cookieverf0 = 0; - static uint32_t cookieverf1 = 0; int pos; struct args { @@ -1418,7 +1422,8 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie0 == 0 && cookie1 == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); @@ -1426,10 +1431,10 @@ nfs_readdir(struct open_file *f, struct args->fhsize = htonl(fp->fhsize); bcopy(fp->fh, args->fhpluscookie, fp->fhsize); pos = roundup(fp->fhsize, sizeof(uint32_t)) / sizeof(uint32_t); - args->fhpluscookie[pos++] = cookie0; - args->fhpluscookie[pos++] = cookie1; - args->fhpluscookie[pos++] = cookieverf0; - args->fhpluscookie[pos++] = cookieverf1; + args->fhpluscookie[pos++] = htonl(fp->off >> 32); + args->fhpluscookie[pos++] = htonl(fp->off); + args->fhpluscookie[pos++] = htonl(fp->cookie >> 32); + args->fhpluscookie[pos++] = htonl(fp->cookie); args->fhpluscookie[pos] = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER3, NFSPROCV3_READDIR, @@ -1440,8 +1445,10 @@ nfs_readdir(struct open_file *f, struct repl = (struct nfsv3_readdir_repl *)buf; if (repl->errno != 0) return (ntohl(repl->errno)); - cookieverf0 = repl->cookiev0; - cookieverf1 = repl->cookiev1; + pfp = fp; + cookie = fp->off; + fp->cookie = ((uint64_t)ntohl(repl->cookiev0) << 32) | + ntohl(repl->cookiev1); buf += sizeof (struct nfsv3_readdir_repl); } rent = (struct nfsv3_readdir_entry *)buf; @@ -1449,10 +1456,7 @@ nfs_readdir(struct open_file *f, struct if (rent->follows == 0) { /* fid0 is actually eof */ if (rent->fid0 != 0) { - cookie0 = 0; - cookie1 = 0; - cookieverf0 = 0; - cookieverf1 = 0; + cookie = 0; return (ENOENT); } goto refill; @@ -1463,8 +1467,9 @@ nfs_readdir(struct open_file *f, struct d->d_name[d->d_namlen] = '\0'; pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t); - cookie0 = rent->nameplus[pos++]; - cookie1 = rent->nameplus[pos++]; + fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos]) << 32) | + ntohl(rent->nameplus[pos + 1]); + pos += 2; buf = (u_char *)&rent->nameplus[pos]; return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:50:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEA4548E; Thu, 4 Jul 2013 17:50:13 +0000 (UTC) (envelope-from bryanv@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 B88C21471; Thu, 4 Jul 2013 17:50:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64HoDdc084854; Thu, 4 Jul 2013 17:50:13 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64HoBws084839; Thu, 4 Jul 2013 17:50:11 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041750.r64HoBws084839@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252702 - in head/sys/dev/virtio: . balloon block network pci scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:50:14 -0000 Author: bryanv Date: Thu Jul 4 17:50:11 2013 New Revision: 252702 URL: http://svnweb.freebsd.org/changeset/base/252702 Log: Convert VirtIO to use ithreads instead of taskqueues Contains projects/virtio commits: r245709: Each VirtIO device was scheduling its own taskqueue(9) to do the off-level interrupt handling. ithreads(9) is the more nature way to do this. The primary motivation for this work to better support network multiqueue. r245710: virtio: Change virtqueue intr handlers to return void r245711: virtio_blk: Remove interrupt taskqueue r245721: vtnet: Remove interrupt taskqueue r245722: virtio_scsi: Remove interrupt taskqueue r245747: vtnet: Remove taskqueue fields missed in r245721 MFC after: 1 month Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/scsi/virtio_scsivar.h head/sys/dev/virtio/virtio_if.m head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:50:11 2013 (r252702) @@ -90,7 +90,7 @@ static int vtballoon_config_change(devic static void vtballoon_negotiate_features(struct vtballoon_softc *); static int vtballoon_alloc_virtqueues(struct vtballoon_softc *); -static int vtballoon_vq_intr(void *); +static void vtballoon_vq_intr(void *); static void vtballoon_inflate(struct vtballoon_softc *, int); static void vtballoon_deflate(struct vtballoon_softc *, int); @@ -300,7 +300,7 @@ vtballoon_alloc_virtqueues(struct vtball return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); } -static int +static void vtballoon_vq_intr(void *xsc) { struct vtballoon_softc *sc; @@ -310,8 +310,6 @@ vtballoon_vq_intr(void *xsc) VTBALLOON_LOCK(sc); wakeup_one(sc); VTBALLOON_UNLOCK(sc); - - return (1); } static void Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:50:11 2013 (r252702) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -85,9 +84,6 @@ struct vtblk_softc { vtblk_req_ready; struct vtblk_request *vtblk_req_ordered; - struct taskqueue *vtblk_tq; - struct task vtblk_intr_task; - int vtblk_max_nsegs; int vtblk_request_count; @@ -138,8 +134,7 @@ static struct vtblk_request * vtblk_bio_ static int vtblk_execute_request(struct vtblk_softc *, struct vtblk_request *); -static int vtblk_vq_intr(void *); -static void vtblk_intr_task(void *, int); +static void vtblk_vq_intr(void *); static void vtblk_stop(struct vtblk_softc *); @@ -333,24 +328,12 @@ vtblk_attach(device_t dev) vtblk_alloc_disk(sc, &blkcfg); - TASK_INIT(&sc->vtblk_intr_task, 0, vtblk_intr_task, sc); - sc->vtblk_tq = taskqueue_create_fast("vtblk_taskq", M_NOWAIT, - taskqueue_thread_enqueue, &sc->vtblk_tq); - if (sc->vtblk_tq == NULL) { - error = ENOMEM; - device_printf(dev, "cannot allocate taskqueue\n"); - goto fail; - } - error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { device_printf(dev, "cannot setup virtqueue interrupt\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); - vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); @@ -375,12 +358,6 @@ vtblk_detach(device_t dev) vtblk_stop(sc); VTBLK_UNLOCK(sc); - if (sc->vtblk_tq != NULL) { - taskqueue_drain(sc->vtblk_tq, &sc->vtblk_intr_task); - taskqueue_free(sc->vtblk_tq); - sc->vtblk_tq = NULL; - } - vtblk_drain(sc); if (sc->vtblk_disk != NULL) { @@ -834,28 +811,16 @@ vtblk_execute_request(struct vtblk_softc return (error); } -static int -vtblk_vq_intr(void *xsc) -{ - struct vtblk_softc *sc; - - sc = xsc; - - virtqueue_disable_intr(sc->vtblk_vq); - taskqueue_enqueue_fast(sc->vtblk_tq, &sc->vtblk_intr_task); - - return (1); -} - static void -vtblk_intr_task(void *arg, int pending) +vtblk_vq_intr(void *xsc) { struct vtblk_softc *sc; struct virtqueue *vq; - sc = arg; + sc = xsc; vq = sc->vtblk_vq; +again: VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { VTBLK_UNLOCK(sc); @@ -872,9 +837,7 @@ vtblk_intr_task(void *arg, int pending) if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); VTBLK_UNLOCK(sc); - taskqueue_enqueue_fast(sc->vtblk_tq, - &sc->vtblk_intr_task); - return; + goto again; } VTBLK_UNLOCK(sc); Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:50:11 2013 (r252702) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -97,7 +96,6 @@ static void vtnet_set_hwaddr(struct vtne static int vtnet_is_link_up(struct vtnet_softc *); static void vtnet_update_link_status(struct vtnet_softc *); static void vtnet_watchdog(struct vtnet_softc *); -static void vtnet_config_change_task(void *, int); static int vtnet_change_mtu(struct vtnet_softc *, int); static int vtnet_ioctl(struct ifnet *, u_long, caddr_t); @@ -123,8 +121,7 @@ static int vtnet_rx_csum(struct vtnet_so struct virtio_net_hdr *); static int vtnet_rxeof_merged(struct vtnet_softc *, struct mbuf *, int); static int vtnet_rxeof(struct vtnet_softc *, int, int *); -static void vtnet_rx_intr_task(void *, int); -static int vtnet_rx_vq_intr(void *); +static void vtnet_rx_vq_intr(void *); static void vtnet_txeof(struct vtnet_softc *); static struct mbuf * vtnet_tx_offload(struct vtnet_softc *, struct mbuf *, @@ -135,8 +132,7 @@ static int vtnet_encap(struct vtnet_soft static void vtnet_start_locked(struct ifnet *); static void vtnet_start(struct ifnet *); static void vtnet_tick(void *); -static void vtnet_tx_intr_task(void *, int); -static int vtnet_tx_vq_intr(void *); +static void vtnet_tx_vq_intr(void *); static void vtnet_stop(struct vtnet_softc *); static int vtnet_reinit(struct vtnet_softc *); @@ -427,19 +423,6 @@ vtnet_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif - TASK_INIT(&sc->vtnet_rx_intr_task, 0, vtnet_rx_intr_task, sc); - TASK_INIT(&sc->vtnet_tx_intr_task, 0, vtnet_tx_intr_task, sc); - TASK_INIT(&sc->vtnet_cfgchg_task, 0, vtnet_config_change_task, sc); - - sc->vtnet_tq = taskqueue_create_fast("vtnet_taskq", M_NOWAIT, - taskqueue_thread_enqueue, &sc->vtnet_tq); - if (sc->vtnet_tq == NULL) { - error = ENOMEM; - device_printf(dev, "cannot allocate taskqueue\n"); - ether_ifdetach(ifp); - goto fail; - } - error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); @@ -447,9 +430,6 @@ vtnet_attach(device_t dev) goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); - /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. @@ -495,18 +475,10 @@ vtnet_detach(device_t dev) VTNET_UNLOCK(sc); callout_drain(&sc->vtnet_tick_ch); - taskqueue_drain(taskqueue_fast, &sc->vtnet_cfgchg_task); ether_ifdetach(ifp); } - if (sc->vtnet_tq != NULL) { - taskqueue_drain(sc->vtnet_tq, &sc->vtnet_rx_intr_task); - taskqueue_drain(sc->vtnet_tq, &sc->vtnet_tx_intr_task); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; - } - if (sc->vtnet_vlan_attach != NULL) { EVENTHANDLER_DEREGISTER(vlan_config, sc->vtnet_vlan_attach); sc->vtnet_vlan_attach = NULL; @@ -590,9 +562,11 @@ vtnet_config_change(device_t dev) sc = device_get_softc(dev); - taskqueue_enqueue_fast(taskqueue_fast, &sc->vtnet_cfgchg_task); + VTNET_LOCK(sc); + vtnet_update_link_status(sc); + VTNET_UNLOCK(sc); - return (1); + return (0); } static void @@ -788,18 +762,6 @@ vtnet_watchdog(struct vtnet_softc *sc) vtnet_init_locked(sc); } -static void -vtnet_config_change_task(void *arg, int pending) -{ - struct vtnet_softc *sc; - - sc = arg; - - VTNET_LOCK(sc); - vtnet_update_link_status(sc); - VTNET_UNLOCK(sc); -} - static int vtnet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -1705,15 +1667,16 @@ vtnet_rxeof(struct vtnet_softc *sc, int } static void -vtnet_rx_intr_task(void *arg, int pending) +vtnet_rx_vq_intr(void *xsc) { struct vtnet_softc *sc; struct ifnet *ifp; int more; - sc = arg; + sc = xsc; ifp = sc->vtnet_ifp; +again: VTNET_LOCK(sc); #ifdef DEVICE_POLLING @@ -1730,31 +1693,15 @@ vtnet_rx_intr_task(void *arg, int pendin } more = vtnet_rxeof(sc, sc->vtnet_rx_process_limit, NULL); - if (!more && vtnet_enable_rx_intr(sc) != 0) { - vtnet_disable_rx_intr(sc); - more = 1; - } - - VTNET_UNLOCK(sc); - - if (more) { + if (more || vtnet_enable_rx_intr(sc) != 0) { + if (!more) + vtnet_disable_rx_intr(sc); sc->vtnet_stats.rx_task_rescheduled++; - taskqueue_enqueue_fast(sc->vtnet_tq, - &sc->vtnet_rx_intr_task); + VTNET_UNLOCK(sc); + goto again; } -} - -static int -vtnet_rx_vq_intr(void *xsc) -{ - struct vtnet_softc *sc; - sc = xsc; - - vtnet_disable_rx_intr(sc); - taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_rx_intr_task); - - return (1); + VTNET_UNLOCK(sc); } static void @@ -2077,14 +2024,15 @@ vtnet_tick(void *xsc) } static void -vtnet_tx_intr_task(void *arg, int pending) +vtnet_tx_vq_intr(void *xsc) { struct vtnet_softc *sc; struct ifnet *ifp; - sc = arg; + sc = xsc; ifp = sc->vtnet_ifp; +again: VTNET_LOCK(sc); #ifdef DEVICE_POLLING @@ -2109,26 +2057,12 @@ vtnet_tx_intr_task(void *arg, int pendin vtnet_disable_tx_intr(sc); sc->vtnet_stats.tx_task_rescheduled++; VTNET_UNLOCK(sc); - taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_tx_intr_task); - return; + goto again; } VTNET_UNLOCK(sc); } -static int -vtnet_tx_vq_intr(void *xsc) -{ - struct vtnet_softc *sc; - - sc = xsc; - - vtnet_disable_tx_intr(sc); - taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_tx_intr_task); - - return (1); -} - static void vtnet_stop(struct vtnet_softc *sc) { Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 17:50:11 2013 (r252702) @@ -79,11 +79,6 @@ struct vtnet_softc { int vtnet_watchdog_timer; uint64_t vtnet_features; - struct taskqueue *vtnet_tq; - struct task vtnet_rx_intr_task; - struct task vtnet_tx_intr_task; - struct task vtnet_cfgchg_task; - struct vtnet_statistics vtnet_stats; struct callout vtnet_tick_ch; Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:50:11 2013 (r252702) @@ -160,10 +160,12 @@ static void vtpci_reset(struct vtpci_sof static void vtpci_select_virtqueue(struct vtpci_softc *, int); -static int vtpci_legacy_intr(void *); -static int vtpci_vq_shared_intr(void *); -static int vtpci_vq_intr(void *); -static int vtpci_config_intr(void *); +static void vtpci_legacy_intr(void *); +static int vtpci_vq_shared_intr_filter(void *); +static void vtpci_vq_shared_intr(void *); +static int vtpci_vq_intr_filter(void *); +static void vtpci_vq_intr(void *); +static void vtpci_config_intr(void *); #define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt @@ -932,7 +934,7 @@ vtpci_setup_legacy_interrupt(struct vtpc dev = sc->vtpci_dev; ires = &sc->vtpci_intr_res[0]; - error = bus_setup_intr(dev, ires->irq, type, vtpci_legacy_intr, NULL, + error = bus_setup_intr(dev, ires->irq, type, NULL, vtpci_legacy_intr, sc, &ires->intrhand); return (error); @@ -949,11 +951,11 @@ vtpci_setup_msix_interrupts(struct vtpci dev = sc->vtpci_dev; /* - * The first resource is used for configuration changed interrupts. + * The first MSIX vector is used for configuration changed interrupts. */ ires = &sc->vtpci_intr_res[0]; - error = bus_setup_intr(dev, ires->irq, type, vtpci_config_intr, - NULL, sc, &ires->intrhand); + error = bus_setup_intr(dev, ires->irq, type, NULL, vtpci_config_intr, + sc, &ires->intrhand); if (error) return (error); @@ -961,13 +963,9 @@ vtpci_setup_msix_interrupts(struct vtpci ires = &sc->vtpci_intr_res[1]; error = bus_setup_intr(dev, ires->irq, type, - vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); - if (error) - return (error); + vtpci_vq_shared_intr_filter, vtpci_vq_shared_intr, sc, + &ires->intrhand); } else { - /* - * Each remaining resource is assigned to a specific virtqueue. - */ for (i = 0; i < sc->vtpci_nvqs; i++) { vqx = &sc->vtpci_vqx[i]; if (vqx->ires_idx < 1) @@ -975,17 +973,17 @@ vtpci_setup_msix_interrupts(struct vtpci ires = &sc->vtpci_intr_res[vqx->ires_idx]; error = bus_setup_intr(dev, ires->irq, type, - vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); + vtpci_vq_intr_filter, vtpci_vq_intr, vqx->vq, + &ires->intrhand); if (error) - return (error); + break; } } - error = vtpci_set_host_msix_vectors(sc); - if (error) - return (error); + if (error == 0) + error = vtpci_set_host_msix_vectors(sc); - return (0); + return (error); } static int @@ -1191,7 +1189,7 @@ vtpci_select_virtqueue(struct vtpci_soft vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, idx); } -static int +static void vtpci_legacy_intr(void *xsc) { struct vtpci_softc *sc; @@ -1208,15 +1206,14 @@ vtpci_legacy_intr(void *xsc) if (isr & VIRTIO_PCI_ISR_CONFIG) vtpci_config_intr(sc); - if (isr & VIRTIO_PCI_ISR_INTR) + if (isr & VIRTIO_PCI_ISR_INTR) { for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) virtqueue_intr(vqx->vq); - - return (isr ? FILTER_HANDLED : FILTER_STRAY); + } } static int -vtpci_vq_shared_intr(void *xsc) +vtpci_vq_shared_intr_filter(void *xsc) { struct vtpci_softc *sc; struct vtpci_virtqueue *vqx; @@ -1227,36 +1224,55 @@ vtpci_vq_shared_intr(void *xsc) vqx = &sc->vtpci_vqx[0]; for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - rc |= virtqueue_intr(vqx->vq); + rc |= virtqueue_intr_filter(vqx->vq); + + return (rc ? FILTER_SCHEDULE_THREAD : FILTER_STRAY); +} + +static void +vtpci_vq_shared_intr(void *xsc) +{ + struct vtpci_softc *sc; + struct vtpci_virtqueue *vqx; + int i; + + sc = xsc; + vqx = &sc->vtpci_vqx[0]; - return (rc ? FILTER_HANDLED : FILTER_STRAY); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) + virtqueue_intr(vqx->vq); } static int -vtpci_vq_intr(void *xvq) +vtpci_vq_intr_filter(void *xvq) { struct virtqueue *vq; int rc; vq = xvq; - rc = virtqueue_intr(vq); + rc = virtqueue_intr_filter(vq); - return (rc ? FILTER_HANDLED : FILTER_STRAY); + return (rc ? FILTER_SCHEDULE_THREAD : FILTER_STRAY); } -static int +static void +vtpci_vq_intr(void *xvq) +{ + struct virtqueue *vq; + + vq = xvq; + virtqueue_intr(vq); +} + +static void vtpci_config_intr(void *xsc) { struct vtpci_softc *sc; device_t child; - int rc; - rc = 0; sc = xsc; child = sc->vtpci_child_dev; if (child != NULL) - rc = VIRTIO_CONFIG_CHANGE(child); - - return (rc ? FILTER_HANDLED : FILTER_STRAY); + VIRTIO_CONFIG_CHANGE(child); } Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:50:11 2013 (r252702) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -172,13 +171,10 @@ static struct vtscsi_request * vtscsi_de static void vtscsi_complete_request(struct vtscsi_request *); static void vtscsi_complete_vq(struct vtscsi_softc *, struct virtqueue *); -static void vtscsi_control_vq_task(void *, int); -static void vtscsi_event_vq_task(void *, int); -static void vtscsi_request_vq_task(void *, int); - -static int vtscsi_control_vq_intr(void *); -static int vtscsi_event_vq_intr(void *); -static int vtscsi_request_vq_intr(void *); + +static void vtscsi_control_vq_intr(void *); +static void vtscsi_event_vq_intr(void *); +static void vtscsi_request_vq_intr(void *); static void vtscsi_disable_vqs_intr(struct vtscsi_softc *); static void vtscsi_enable_vqs_intr(struct vtscsi_softc *); @@ -333,30 +329,12 @@ vtscsi_attach(device_t dev) goto fail; } - TASK_INIT(&sc->vtscsi_control_intr_task, 0, - vtscsi_control_vq_task, sc); - TASK_INIT(&sc->vtscsi_event_intr_task, 0, - vtscsi_event_vq_task, sc); - TASK_INIT(&sc->vtscsi_request_intr_task, 0, - vtscsi_request_vq_task, sc); - - sc->vtscsi_tq = taskqueue_create_fast("vtscsi_taskq", M_NOWAIT, - taskqueue_thread_enqueue, &sc->vtscsi_tq); - if (sc->vtscsi_tq == NULL) { - error = ENOMEM; - device_printf(dev, "cannot allocate taskqueue\n"); - goto fail; - } - error = virtio_setup_intr(dev, INTR_TYPE_CAM); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); goto fail; } - taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); - vtscsi_enable_vqs_intr(sc); /* @@ -389,14 +367,6 @@ vtscsi_detach(device_t dev) vtscsi_stop(sc); VTSCSI_UNLOCK(sc); - if (sc->vtscsi_tq != NULL) { - taskqueue_drain(sc->vtscsi_tq, &sc->vtscsi_control_intr_task); - taskqueue_drain(sc->vtscsi_tq, &sc->vtscsi_event_intr_task); - taskqueue_drain(sc->vtscsi_tq, &sc->vtscsi_request_intr_task); - taskqueue_free(sc->vtscsi_tq); - sc->vtscsi_tq = NULL; - } - vtscsi_complete_vqs(sc); vtscsi_drain_vqs(sc); @@ -2152,14 +2122,15 @@ vtscsi_complete_vq(struct vtscsi_softc * } static void -vtscsi_control_vq_task(void *arg, int pending) +vtscsi_control_vq_intr(void *xsc) { struct vtscsi_softc *sc; struct virtqueue *vq; - sc = arg; + sc = xsc; vq = sc->vtscsi_control_vq; +again: VTSCSI_LOCK(sc); vtscsi_complete_vq(sc, sc->vtscsi_control_vq); @@ -2167,24 +2138,23 @@ vtscsi_control_vq_task(void *arg, int pe if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); VTSCSI_UNLOCK(sc); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_control_intr_task); - return; + goto again; } VTSCSI_UNLOCK(sc); } static void -vtscsi_event_vq_task(void *arg, int pending) +vtscsi_event_vq_intr(void *xsc) { struct vtscsi_softc *sc; struct virtqueue *vq; struct virtio_scsi_event *event; - sc = arg; + sc = xsc; vq = sc->vtscsi_event_vq; +again: VTSCSI_LOCK(sc); while ((event = virtqueue_dequeue(vq, NULL)) != NULL) @@ -2193,23 +2163,22 @@ vtscsi_event_vq_task(void *arg, int pend if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); VTSCSI_UNLOCK(sc); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_control_intr_task); - return; + goto again; } VTSCSI_UNLOCK(sc); } static void -vtscsi_request_vq_task(void *arg, int pending) +vtscsi_request_vq_intr(void *xsc) { struct vtscsi_softc *sc; struct virtqueue *vq; - sc = arg; + sc = xsc; vq = sc->vtscsi_request_vq; +again: VTSCSI_LOCK(sc); vtscsi_complete_vq(sc, sc->vtscsi_request_vq); @@ -2217,56 +2186,12 @@ vtscsi_request_vq_task(void *arg, int pe if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); VTSCSI_UNLOCK(sc); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_request_intr_task); - return; + goto again; } VTSCSI_UNLOCK(sc); } -static int -vtscsi_control_vq_intr(void *xsc) -{ - struct vtscsi_softc *sc; - - sc = xsc; - - virtqueue_disable_intr(sc->vtscsi_control_vq); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_control_intr_task); - - return (1); -} - -static int -vtscsi_event_vq_intr(void *xsc) -{ - struct vtscsi_softc *sc; - - sc = xsc; - - virtqueue_disable_intr(sc->vtscsi_event_vq); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_event_intr_task); - - return (1); -} - -static int -vtscsi_request_vq_intr(void *xsc) -{ - struct vtscsi_softc *sc; - - sc = xsc; - - virtqueue_disable_intr(sc->vtscsi_request_vq); - taskqueue_enqueue_fast(sc->vtscsi_tq, - &sc->vtscsi_request_intr_task); - - return (1); -} - static void vtscsi_disable_vqs_intr(struct vtscsi_softc *sc) { Modified: head/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 17:50:11 2013 (r252702) @@ -62,11 +62,6 @@ struct vtscsi_softc { struct virtqueue *vtscsi_event_vq; struct virtqueue *vtscsi_request_vq; - struct taskqueue *vtscsi_tq; - struct task vtscsi_control_intr_task; - struct task vtscsi_event_intr_task; - struct task vtscsi_request_intr_task; - struct cam_sim *vtscsi_sim; struct cam_path *vtscsi_path; Modified: head/sys/dev/virtio/virtio_if.m ============================================================================== --- head/sys/dev/virtio/virtio_if.m Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/virtio_if.m Thu Jul 4 17:50:11 2013 (r252702) @@ -33,8 +33,7 @@ CODE { static int virtio_default_config_change(device_t dev) { - /* Return that we've handled the change. */ - return (1); + return (0); } }; Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:50:11 2013 (r252702) @@ -414,18 +414,27 @@ virtqueue_nused(struct virtqueue *vq) } int -virtqueue_intr(struct virtqueue *vq) +virtqueue_intr_filter(struct virtqueue *vq) { - if (vq->vq_intrhand == NULL || - vq->vq_used_cons_idx == vq->vq_ring.used->idx) + if (__predict_false(vq->vq_intrhand == NULL)) + return (0); + if (vq->vq_used_cons_idx == vq->vq_ring.used->idx) return (0); - vq->vq_intrhand(vq->vq_intrhand_arg); + virtqueue_disable_intr(vq); return (1); } +void +virtqueue_intr(struct virtqueue *vq) +{ + + if (__predict_true(vq->vq_intrhand != NULL)) + vq->vq_intrhand(vq->vq_intrhand_arg); +} + int virtqueue_enable_intr(struct virtqueue *vq) { Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Thu Jul 4 15:21:27 2013 (r252701) +++ head/sys/dev/virtio/virtqueue.h Thu Jul 4 17:50:11 2013 (r252702) @@ -39,7 +39,7 @@ struct sglist; #define VIRTIO_RING_F_EVENT_IDX (1 << 29) /* Device callback for a virtqueue interrupt. */ -typedef int virtqueue_intr_t(void *); +typedef void virtqueue_intr_t(void *); #define VIRTQUEUE_MAX_NAME_SZ 32 @@ -70,7 +70,8 @@ void *virtqueue_drain(struct virtqueue * void virtqueue_free(struct virtqueue *vq); int virtqueue_reinit(struct virtqueue *vq, uint16_t size); -int virtqueue_intr(struct virtqueue *vq); +int virtqueue_intr_filter(struct virtqueue *vq); +void virtqueue_intr(struct virtqueue *vq); int virtqueue_enable_intr(struct virtqueue *vq); int virtqueue_postpone_intr(struct virtqueue *vq); void virtqueue_disable_intr(struct virtqueue *vq); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:53:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4AAFC64C; Thu, 4 Jul 2013 17:53:03 +0000 (UTC) (envelope-from bryanv@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 2BFDB15D1; Thu, 4 Jul 2013 17:53:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Hr3H5086786; Thu, 4 Jul 2013 17:53:03 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Hr25J086782; Thu, 4 Jul 2013 17:53:02 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041753.r64Hr25J086782@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252703 - in head: share/man/man4 sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:53:03 -0000 Author: bryanv Date: Thu Jul 4 17:53:02 2013 New Revision: 252703 URL: http://svnweb.freebsd.org/changeset/base/252703 Log: Merge several virtio_blk changes from projects/virtio The notable changes of this commit are support for disk resizing and chases updates to the spec regarding write caching. Contains projects/virtio commits: r245713: virtio_blk: Replace __FUNCTION__ with __func__ r245714: virtio_blk: Use more consistent mutex name r245715: virtio_blk: Print device name too if failed to reinit during dump r245716: virtio_blk: Remove an unuseful ASSERT r245723: virtio_blk: Record the vendor and device information r245724: virtio_blk: Add resize support r245726: virtio_blk: More verbose ASSERT messages r245730: virtio_blk: Tweak resize announcement message r246061: virtio_blk: Do not always read entire config r246062: virtio_blk: Use topology to set the stripe size/offset r246307: virtio_blk: Correct stripe offset calculation r246063: virtio_blk: Add support for write cache enable feature r246303: virtio_blk: Expand a comment r252529: virtio_blk: Improve write cache handling r252681: virtio_blk: Remove unneeded curly braces MFC after: 1 month Modified: head/share/man/man4/virtio_blk.4 head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/block/virtio_blk.h Modified: head/share/man/man4/virtio_blk.4 ============================================================================== --- head/share/man/man4/virtio_blk.4 Thu Jul 4 17:50:11 2013 (r252702) +++ head/share/man/man4/virtio_blk.4 Thu Jul 4 17:53:02 2013 (r252703) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2012 +.Dd July 2, 2013 .Dt VIRTIO_BLK 4 .Os .Sh NAME @@ -53,11 +53,33 @@ Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . -.Bl -tag -width "xxxxxx" +.Bl -tag -width indent .It Va hw.vtblk.no_ident -This tunable disables retrieving the device identification string -from the hypervisor. +.It Va hw.vtblk. Ns Ar X Ns Va .no_ident +.Pp +These tunables disable retrieving the device identification string +from the hypervisor either globally or per-device. The default value is 0. +.It Va hw.vtblk.writecache_mode +.It Va hw.vtblk. Ns Ar X Ns Va .writecache_mode +.Pp +These tunables determine the write cache mode globally or per-device. +The mode can changed only if the ConfigWCE feature is negotiated. +Set to 0 for writethrough mode, 1 for writeback mode, and -1 to leave +it as-is. +The default value is to leave as-is. +.El +.Sh SYSCTL VARIABLES +The following variables are available as +.Xr sysctl 8 +variables. +.Bl -tag -width indent +.It Va dev.vtblk. Ns Ar X Ns Va .writecache_mode +.Pp +The write cache mode of the device can be either writethrough (0) or +writeback (1). +If the ConfigWCE feature is negotiated, the write cache mode can +be toggled between writethrough and writeback. .El .Sh SEE ALSO .Xr virtio 4 Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:50:11 2013 (r252702) +++ head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:53:02 2013 (r252703) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -61,6 +62,12 @@ struct vtblk_request { TAILQ_ENTRY(vtblk_request) vbr_link; }; +enum vtblk_cache_mode { + VTBLK_CACHE_WRITETHROUGH, + VTBLK_CACHE_WRITEBACK, + VTBLK_CACHE_MAX +}; + struct vtblk_softc { device_t vtblk_dev; struct mtx vtblk_mtx; @@ -72,6 +79,7 @@ struct vtblk_softc { #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 #define VTBLK_FLAG_BARRIER 0x0020 +#define VTBLK_FLAG_WC_CONFIG 0x0040 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -86,6 +94,7 @@ struct vtblk_softc { int vtblk_max_nsegs; int vtblk_request_count; + enum vtblk_cache_mode vtblk_write_cache; struct vtblk_request vtblk_dump_request; }; @@ -98,8 +107,9 @@ static struct virtio_feature_desc vtblk_ { VIRTIO_BLK_F_RO, "ReadOnly" }, { VIRTIO_BLK_F_BLK_SIZE, "BlockSize" }, { VIRTIO_BLK_F_SCSI, "SCSICmds" }, - { VIRTIO_BLK_F_FLUSH, "FlushCmd" }, + { VIRTIO_BLK_F_WCE, "WriteCache" }, { VIRTIO_BLK_F_TOPOLOGY, "Topology" }, + { VIRTIO_BLK_F_CONFIG_WCE, "ConfigWCE" }, { 0, NULL } }; @@ -112,6 +122,7 @@ static int vtblk_detach(device_t); static int vtblk_suspend(device_t); static int vtblk_resume(device_t); static int vtblk_shutdown(device_t); +static int vtblk_config_change(device_t); static int vtblk_open(struct disk *); static int vtblk_close(struct disk *); @@ -124,6 +135,11 @@ static void vtblk_negotiate_features(str static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); static int vtblk_alloc_virtqueue(struct vtblk_softc *); +static void vtblk_resize_disk(struct vtblk_softc *, uint64_t); +static void vtblk_set_write_cache(struct vtblk_softc *, int); +static int vtblk_write_cache_enabled(struct vtblk_softc *sc, + struct virtio_blk_config *); +static int vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS); static void vtblk_alloc_disk(struct vtblk_softc *, struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); @@ -138,6 +154,8 @@ static void vtblk_vq_intr(void *); static void vtblk_stop(struct vtblk_softc *); +static void vtblk_read_config(struct vtblk_softc *, + struct virtio_blk_config *); static void vtblk_get_ident(struct vtblk_softc *); static void vtblk_prepare_dump(struct vtblk_softc *); static int vtblk_write_dump(struct vtblk_softc *, void *, off_t, size_t); @@ -162,9 +180,14 @@ static void vtblk_enqueue_ready(struct v static int vtblk_request_error(struct vtblk_request *); static void vtblk_finish_bio(struct bio *, int); +static void vtblk_setup_sysctl(struct vtblk_softc *); +static int vtblk_tunable_int(struct vtblk_softc *, const char *, int); + /* Tunables. */ static int vtblk_no_ident = 0; TUNABLE_INT("hw.vtblk.no_ident", &vtblk_no_ident); +static int vtblk_writecache_mode = -1; +TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writecache_mode); /* Features desired/implemented by this driver. */ #define VTBLK_FEATURES \ @@ -174,13 +197,14 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ VIRTIO_BLK_F_GEOMETRY | \ VIRTIO_BLK_F_RO | \ VIRTIO_BLK_F_BLK_SIZE | \ - VIRTIO_BLK_F_FLUSH | \ + VIRTIO_BLK_F_WCE | \ + VIRTIO_BLK_F_CONFIG_WCE | \ VIRTIO_RING_F_INDIRECT_DESC) #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx #define VTBLK_LOCK_INIT(_sc, _name) \ mtx_init(VTBLK_MTX((_sc)), (_name), \ - "VTBLK Lock", MTX_DEF) + "VirtIO Block Lock", MTX_DEF) #define VTBLK_LOCK(_sc) mtx_lock(VTBLK_MTX((_sc))) #define VTBLK_UNLOCK(_sc) mtx_unlock(VTBLK_MTX((_sc))) #define VTBLK_LOCK_DESTROY(_sc) mtx_destroy(VTBLK_MTX((_sc))) @@ -206,6 +230,9 @@ static device_method_t vtblk_methods[] = DEVMETHOD(device_resume, vtblk_resume), DEVMETHOD(device_shutdown, vtblk_shutdown), + /* VirtIO methods. */ + DEVMETHOD(virtio_config_change, vtblk_config_change), + DEVMETHOD_END }; @@ -279,10 +306,13 @@ vtblk_attach(device_t dev) sc->vtblk_flags |= VTBLK_FLAG_READONLY; if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) sc->vtblk_flags |= VTBLK_FLAG_BARRIER; + if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) + sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; + + vtblk_setup_sysctl(sc); /* Get local copy of config. */ - virtio_read_device_config(dev, 0, &blkcfg, - sizeof(struct virtio_blk_config)); + vtblk_read_config(sc, &blkcfg); /* * With the current sglist(9) implementation, it is not easy @@ -418,6 +448,26 @@ vtblk_shutdown(device_t dev) } static int +vtblk_config_change(device_t dev) +{ + struct vtblk_softc *sc; + struct virtio_blk_config blkcfg; + uint64_t capacity; + + sc = device_get_softc(dev); + + vtblk_read_config(sc, &blkcfg); + + /* Capacity is always in 512-byte units. */ + capacity = blkcfg.capacity * 512; + + if (sc->vtblk_disk->d_mediasize != capacity) + vtblk_resize_disk(sc, capacity); + + return (0); +} + +static int vtblk_open(struct disk *dp) { struct vtblk_softc *sc; @@ -518,8 +568,8 @@ vtblk_strategy(struct bio *bp) max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; KASSERT(nsegs <= max_nsegs, - ("bio %p spanned too many segments: %d, max: %d", - bp, nsegs, max_nsegs)); + ("%s: bio %p spanned too many segments: %d, max: %d", + __func__, bp, nsegs, max_nsegs)); } #endif @@ -583,6 +633,84 @@ vtblk_alloc_virtqueue(struct vtblk_softc } static void +vtblk_resize_disk(struct vtblk_softc *sc, uint64_t new_capacity) +{ + device_t dev; + struct disk *dp; + int error; + + dev = sc->vtblk_dev; + dp = sc->vtblk_disk; + + dp->d_mediasize = new_capacity; + if (bootverbose) { + device_printf(dev, "resized to %juMB (%ju %u byte sectors)\n", + (uintmax_t) dp->d_mediasize >> 20, + (uintmax_t) dp->d_mediasize / dp->d_sectorsize, + dp->d_sectorsize); + } + + error = disk_resize(dp, M_NOWAIT); + if (error) { + device_printf(dev, + "disk_resize(9) failed, error: %d\n", error); + } +} + +static void +vtblk_set_write_cache(struct vtblk_softc *sc, int wc) +{ + + /* Set either writeback (1) or writethrough (0) mode. */ + virtio_write_dev_config_1(sc->vtblk_dev, + offsetof(struct virtio_blk_config, writeback), wc); +} + +static int +vtblk_write_cache_enabled(struct vtblk_softc *sc, + struct virtio_blk_config *blkcfg) +{ + int wc; + + if (sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) { + wc = vtblk_tunable_int(sc, "writecache_mode", + vtblk_writecache_mode); + if (wc >= 0 && wc < VTBLK_CACHE_MAX) + vtblk_set_write_cache(sc, wc); + else + wc = blkcfg->writeback; + } else + wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); + + return (wc); +} + +static int +vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct vtblk_softc *sc; + int wc, error; + + sc = oidp->oid_arg1; + wc = sc->vtblk_write_cache; + + error = sysctl_handle_int(oidp, &wc, 0, req); + if (error || req->newptr == NULL) + return (error); + if ((sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) == 0) + return (EPERM); + if (wc < 0 || wc >= VTBLK_CACHE_MAX) + return (EINVAL); + + VTBLK_LOCK(sc); + sc->vtblk_write_cache = wc; + vtblk_set_write_cache(sc, sc->vtblk_write_cache); + VTBLK_UNLOCK(sc); + + return (0); +} + +static void vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) { device_t dev; @@ -598,6 +726,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_name = VTBLK_DISK_NAME; dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; + dp->d_flags = DISKFLAG_CANFLUSHCACHE; + dp->d_hba_vendor = virtio_get_vendor(dev); + dp->d_hba_device = virtio_get_device(dev); + dp->d_hba_subvendor = virtio_get_subvendor(dev); + dp->d_hba_subdevice = virtio_get_subdevice(dev); if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0) dp->d_dump = vtblk_dump; @@ -633,8 +766,18 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_fwheads = blkcfg->geometry.heads; } - if (virtio_with_feature(dev, VIRTIO_BLK_F_FLUSH)) - dp->d_flags |= DISKFLAG_CANFLUSHCACHE; + if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) { + dp->d_stripesize = dp->d_sectorsize * + (1 << blkcfg->topology.physical_block_exp); + dp->d_stripeoffset = (dp->d_stripesize - + blkcfg->topology.alignment_offset * dp->d_sectorsize) % + dp->d_stripesize; + } + + if (vtblk_write_cache_enabled(sc, blkcfg) != 0) + sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK; + else + sc->vtblk_write_cache = VTBLK_CACHE_WRITETHROUGH; } static void @@ -742,8 +885,7 @@ vtblk_bio_request(struct vtblk_softc *sc req->vbr_hdr.sector = bp->bio_offset / 512; break; default: - panic("%s: bio with unhandled cmd: %d", __FUNCTION__, - bp->bio_cmd); + panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } return (req); @@ -786,14 +928,13 @@ vtblk_execute_request(struct vtblk_softc } sglist_reset(sg); - sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append(sg, bp->bio_data, bp->bio_bcount); if (error || sg->sg_nseg == sg->sg_maxseg) panic("%s: data buffer too big bio:%p error:%d", - __FUNCTION__, bp, error); + __func__, bp, error); /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) @@ -851,6 +992,37 @@ vtblk_stop(struct vtblk_softc *sc) virtio_stop(sc->vtblk_dev); } +#define VTBLK_GET_CONFIG(_dev, _feature, _field, _cfg) \ + if (virtio_with_feature(_dev, _feature)) { \ + virtio_read_device_config(_dev, \ + offsetof(struct virtio_blk_config, _field), \ + &(_cfg)->_field, sizeof((_cfg)->_field)); \ + } + +static void +vtblk_read_config(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) +{ + device_t dev; + + dev = sc->vtblk_dev; + + bzero(blkcfg, sizeof(struct virtio_blk_config)); + + /* The capacity is always available. */ + virtio_read_device_config(dev, offsetof(struct virtio_blk_config, + capacity), &blkcfg->capacity, sizeof(blkcfg->capacity)); + + /* Read the configuration if the feature was negotiated. */ + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_SIZE_MAX, size_max, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_SEG_MAX, seg_max, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_GEOMETRY, geometry, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_BLK_SIZE, blk_size, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_TOPOLOGY, topology, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, writeback, blkcfg); +} + +#undef VTBLK_GET_CONFIG + static void vtblk_get_ident(struct vtblk_softc *sc) { @@ -862,7 +1034,7 @@ vtblk_get_ident(struct vtblk_softc *sc) dp = sc->vtblk_disk; len = MIN(VIRTIO_BLK_ID_BYTES, DISK_IDENT_SIZE); - if (vtblk_no_ident != 0) + if (vtblk_tunable_int(sc, "no_ident", vtblk_no_ident) != 0) return; req = vtblk_dequeue_request(sc); @@ -912,8 +1084,10 @@ vtblk_prepare_dump(struct vtblk_softc *s */ vtblk_drain_vq(sc, 1); - if (virtio_reinit(dev, sc->vtblk_features) != 0) - panic("cannot reinit VirtIO block device during dump"); + if (virtio_reinit(dev, sc->vtblk_features) != 0) { + panic("%s: cannot reinit VirtIO block device during dump", + device_get_nameunit(dev)); + } virtqueue_disable_intr(vq); virtio_reinit_complete(dev); @@ -966,7 +1140,6 @@ static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { struct virtqueue *vq; - struct vtblk_request *r; int error; vq = sc->vtblk_vq; @@ -979,14 +1152,12 @@ vtblk_poll_request(struct vtblk_softc *s return (error); virtqueue_notify(vq); - - r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response: %p/%p", r, req)); + virtqueue_poll(vq, NULL); error = vtblk_request_error(req); if (error && bootverbose) { device_printf(sc->vtblk_dev, - "%s: IO error: %d\n", __FUNCTION__, error); + "%s: IO error: %d\n", __func__, error); } return (error); @@ -1117,7 +1288,7 @@ vtblk_free_requests(struct vtblk_softc * struct vtblk_request *req; KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready), - ("ready requests left on queue")); + ("%s: ready requests left on queue", __func__)); while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; @@ -1125,7 +1296,7 @@ vtblk_free_requests(struct vtblk_softc * } KASSERT(sc->vtblk_request_count == 0, - ("leaked requests: %d", sc->vtblk_request_count)); + ("%s: leaked %d requests", __func__, sc->vtblk_request_count)); } static struct vtblk_request * @@ -1199,3 +1370,33 @@ vtblk_finish_bio(struct bio *bp, int err biodone(bp); } + +static void +vtblk_setup_sysctl(struct vtblk_softc *sc) +{ + device_t dev; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + dev = sc->vtblk_dev; + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, vtblk_write_cache_sysctl, + "I", "Write cache mode (writethrough (0) or writeback (1))"); +} + +static int +vtblk_tunable_int(struct vtblk_softc *sc, const char *knob, int def) +{ + char path[64]; + + snprintf(path, sizeof(path), + "hw.vtblk.%d.%s", device_get_unit(sc->vtblk_dev), knob); + TUNABLE_INT_FETCH(path, &def); + + return (def); +} Modified: head/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Thu Jul 4 17:50:11 2013 (r252702) +++ head/sys/dev/virtio/block/virtio_blk.h Thu Jul 4 17:53:02 2013 (r252703) @@ -39,8 +39,9 @@ #define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ #define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ #define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_FLUSH 0x0200 /* Cache flush command support */ +#define VIRTIO_BLK_F_WCE 0x0200 /* Writeback mode enabled after reset */ #define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ +#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ #define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ @@ -51,15 +52,27 @@ struct virtio_blk_config { uint32_t size_max; /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ uint32_t seg_max; - /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */ + /* Geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */ struct virtio_blk_geometry { uint16_t cylinders; uint8_t heads; uint8_t sectors; } geometry; - /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ + /* Block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ uint32_t blk_size; + + /* Topology of the device (if VIRTIO_BLK_F_TOPOLOGY) */ + struct virtio_blk_topology { + uint8_t physical_block_exp; + uint8_t alignment_offset; + uint16_t min_io_size; + uint16_t opt_io_size; + } topology; + + /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ + uint8_t writeback; + } __packed; /* From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:54:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15FE67B1; Thu, 4 Jul 2013 17:54:47 +0000 (UTC) (envelope-from bryanv@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 EBB5915ED; Thu, 4 Jul 2013 17:54:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64HskDN087009; Thu, 4 Jul 2013 17:54:46 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Hskqe087008; Thu, 4 Jul 2013 17:54:46 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041754.r64Hskqe087008@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252704 - head/sys/dev/virtio/balloon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:54:47 -0000 Author: bryanv Date: Thu Jul 4 17:54:46 2013 New Revision: 252704 URL: http://svnweb.freebsd.org/changeset/base/252704 Log: Merge virtio_balloon changes from projects/virtio Contains projects/virtio commits: r245717: virtio_balloon: Make the softc lock a regular mutex r245718: virtio_balloon: Remove two unuseful ASSERTs r245719: virtio_balloon: More verbose ASSERT messages r245720: virtio_balloon: Simplify lowmem handling in vtballoon_inflate() r252530: virtio_balloon: Use just a kthread instead of dedciated kproc r252568: virtio_balloon: Need to use kthread_exit() after r252530 MFC after: 1 month Modified: head/sys/dev/virtio/balloon/virtio_balloon.c Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:53:02 2013 (r252703) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:54:46 2013 (r252704) @@ -70,7 +70,7 @@ struct vtballoon_softc { uint32_t vtballoon_current_npages; TAILQ_HEAD(,vm_page) vtballoon_pages; - struct proc *vtballoon_kproc; + struct thread *vtballoon_td; uint32_t *vtballoon_page_frames; int vtballoon_timeout; }; @@ -127,9 +127,9 @@ CTASSERT(VTBALLOON_PAGES_PER_REQUEST * s #define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx #define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ - "VirtIO Balloon Lock", MTX_SPIN) -#define VTBALLOON_LOCK(_sc) mtx_lock_spin(VTBALLOON_MTX((_sc))) -#define VTBALLOON_UNLOCK(_sc) mtx_unlock_spin(VTBALLOON_MTX((_sc))) + "VirtIO Balloon Lock", MTX_DEF) +#define VTBALLOON_LOCK(_sc) mtx_lock(VTBALLOON_MTX((_sc))) +#define VTBALLOON_UNLOCK(_sc) mtx_unlock(VTBALLOON_MTX((_sc))) #define VTBALLOON_LOCK_DESTROY(_sc) mtx_destroy(VTBALLOON_MTX((_sc))) static device_method_t vtballoon_methods[] = { @@ -206,10 +206,10 @@ vtballoon_attach(device_t dev) goto fail; } - error = kproc_create(vtballoon_thread, sc, &sc->vtballoon_kproc, + error = kthread_add(vtballoon_thread, sc, NULL, &sc->vtballoon_td, 0, 0, "virtio_balloon"); if (error) { - device_printf(dev, "cannot create balloon kproc\n"); + device_printf(dev, "cannot create balloon kthread\n"); goto fail; } @@ -230,15 +230,14 @@ vtballoon_detach(device_t dev) sc = device_get_softc(dev); - if (sc->vtballoon_kproc != NULL) { + if (sc->vtballoon_td != NULL) { VTBALLOON_LOCK(sc); sc->vtballoon_flags |= VTBALLOON_FLAG_DETACH; wakeup_one(sc); - msleep_spin(sc->vtballoon_kproc, VTBALLOON_MTX(sc), - "vtbdth", 0); + msleep(sc->vtballoon_td, VTBALLOON_MTX(sc), 0, "vtbdth", 0); VTBALLOON_UNLOCK(sc); - sc->vtballoon_kproc = NULL; + sc->vtballoon_td = NULL; } if (device_is_attached(dev)) { @@ -320,28 +319,26 @@ vtballoon_inflate(struct vtballoon_softc int i; vq = sc->vtballoon_inflate_vq; - m = NULL; if (npages > VTBALLOON_PAGES_PER_REQUEST) npages = VTBALLOON_PAGES_PER_REQUEST; - KASSERT(npages > 0, ("balloon doesn't need inflating?")); for (i = 0; i < npages; i++) { - if ((m = vtballoon_alloc_page(sc)) == NULL) + if ((m = vtballoon_alloc_page(sc)) == NULL) { + sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT; break; + } sc->vtballoon_page_frames[i] = VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; - KASSERT(m->queue == PQ_NONE, ("allocated page on queue")); + KASSERT(m->queue == PQ_NONE, + ("%s: allocated page %p on queue", __func__, m)); TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, pageq); } if (i > 0) vtballoon_send_page_frames(sc, vq, i); - - if (m == NULL) - sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT; } static void @@ -357,11 +354,10 @@ vtballoon_deflate(struct vtballoon_softc if (npages > VTBALLOON_PAGES_PER_REQUEST) npages = VTBALLOON_PAGES_PER_REQUEST; - KASSERT(npages > 0, ("balloon doesn't need deflating?")); for (i = 0; i < npages; i++) { m = TAILQ_FIRST(&sc->vtballoon_pages); - KASSERT(m != NULL, ("no more pages to deflate")); + KASSERT(m != NULL, ("%s: no more pages to deflate", __func__)); sc->vtballoon_page_frames[i] = VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; @@ -383,7 +379,9 @@ vtballoon_deflate(struct vtballoon_softc KASSERT((TAILQ_EMPTY(&sc->vtballoon_pages) && sc->vtballoon_current_npages == 0) || (!TAILQ_EMPTY(&sc->vtballoon_pages) && - sc->vtballoon_current_npages != 0), ("balloon empty?")); + sc->vtballoon_current_npages != 0), + ("%s: bogus page count %d", __func__, + sc->vtballoon_current_npages)); } static void @@ -411,7 +409,7 @@ vtballoon_send_page_frames(struct vtball */ VTBALLOON_LOCK(sc); while ((c = virtqueue_dequeue(vq, NULL)) == NULL) - msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); + msleep(sc, VTBALLOON_MTX(sc), 0, "vtbspf", 0); VTBALLOON_UNLOCK(sc); KASSERT(c == vq, ("unexpected balloon operation response")); @@ -510,7 +508,7 @@ vtballoon_sleep(struct vtballoon_softc * if (current < desired && timeout == 0) break; - msleep_spin(sc, VTBALLOON_MTX(sc), "vtbslp", timeout); + msleep(sc, VTBALLOON_MTX(sc), 0, "vtbslp", timeout); } VTBALLOON_UNLOCK(sc); @@ -542,7 +540,7 @@ vtballoon_thread(void *xsc) } } - kproc_exit(0); + kthread_exit(); } static void From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:55:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2FCDC90F; Thu, 4 Jul 2013 17:55:54 +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 213CF1604; Thu, 4 Jul 2013 17:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Htsqd087249; Thu, 4 Jul 2013 17:55:54 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64HtqRl087237; Thu, 4 Jul 2013 17:55:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307041755.r64HtqRl087237@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 17:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252705 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:55:54 -0000 Author: np Date: Thu Jul 4 17:55:52 2013 New Revision: 252705 URL: http://svnweb.freebsd.org/changeset/base/252705 Log: - Read all TP parameters in one place. - Read the filter mode, calculate various shifts, and use them properly during active open (in select_ntuple). MFC after: 1 day Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_regs_values.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/adapter.h Thu Jul 4 17:55:52 2013 (r252705) @@ -562,7 +562,6 @@ struct adapter { struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; - uint32_t filter_mode; #ifdef TCP_OFFLOAD void *tom_softc; /* (struct tom_data *) */ Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/common/common.h Thu Jul 4 17:55:52 2013 (r252705) @@ -219,6 +219,12 @@ struct tp_params { unsigned int dack_re; /* DACK timer resolution */ unsigned int la_mask; /* what events are recorded by TP LA */ unsigned short tx_modq[NCHAN]; /* channel to modulation queue map */ + uint32_t vlan_pri_map; + uint32_t ingress_config; + int8_t vlan_shift; + int8_t vnic_shift; + int8_t port_shift; + int8_t protocol_shift; }; struct vpd_params { @@ -421,6 +427,8 @@ int t4_get_tp_version(struct adapter *ad int t4_check_fw_version(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); int t4_prep_adapter(struct adapter *adapter); +int t4_init_tp_params(struct adapter *adap); +int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct port_info *p, int mbox, int pf, int vf); int t4_reinit_adapter(struct adapter *adap); void t4_fatal_err(struct adapter *adapter); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Jul 4 17:55:52 2013 (r252705) @@ -5521,6 +5521,91 @@ int __devinit t4_prep_adapter(struct ada return 0; } +/** + * t4_init_tp_params - initialize adap->params.tp + * @adap: the adapter + * + * Initialize various fields of the adapter's TP Parameters structure. + */ +int __devinit t4_init_tp_params(struct adapter *adap) +{ + int chan; + u32 v; + + v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); + adap->params.tp.tre = G_TIMERRESOLUTION(v); + adap->params.tp.dack_re = G_DELAYEDACKRESOLUTION(v); + + /* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ + for (chan = 0; chan < NCHAN; chan++) + adap->params.tp.tx_modq[chan] = chan; + + /* + * Cache the adapter's Compressed Filter Mode and global Incress + * Configuration. + */ + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.vlan_pri_map, 1, + A_TP_VLAN_PRI_MAP); + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.ingress_config, 1, + A_TP_INGRESS_CONFIG); + + /* + * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field + * shift positions of several elements of the Compressed Filter Tuple + * for this adapter which we need frequently ... + */ + adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); + adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); + adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); + adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); + + /* + * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID + * represents the presense of an Outer VLAN instead of a VNIC ID. + */ + if ((adap->params.tp.ingress_config & F_VNIC) == 0) + adap->params.tp.vnic_shift = -1; + + return 0; +} + +/** + * t4_filter_field_shift - calculate filter field shift + * @adap: the adapter + * @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits) + * + * Return the shift position of a filter field within the Compressed + * Filter Tuple. The filter field is specified via its selection bit + * within TP_VLAN_PRI_MAL (filter mode). E.g. F_VLAN. + */ +int t4_filter_field_shift(const struct adapter *adap, int filter_sel) +{ + unsigned int filter_mode = adap->params.tp.vlan_pri_map; + unsigned int sel; + int field_shift; + + if ((filter_mode & filter_sel) == 0) + return -1; + + for (sel = 1, field_shift = 0; sel < filter_sel; sel <<= 1) { + switch (filter_mode & sel) { + case F_FCOE: field_shift += W_FT_FCOE; break; + case F_PORT: field_shift += W_FT_PORT; break; + case F_VNIC_ID: field_shift += W_FT_VNIC_ID; break; + case F_VLAN: field_shift += W_FT_VLAN; break; + case F_TOS: field_shift += W_FT_TOS; break; + case F_PROTOCOL: field_shift += W_FT_PROTOCOL; break; + case F_ETHERTYPE: field_shift += W_FT_ETHERTYPE; break; + case F_MACMATCH: field_shift += W_FT_MACMATCH; break; + case F_MPSHITTYPE: field_shift += W_FT_MPSHITTYPE; break; + case F_FRAGMENTATION: field_shift += W_FT_FRAGMENTATION; break; + } + } + return field_shift; +} + int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf) { u8 addr[6]; Modified: head/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_regs_values.h Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/common/t4_regs_values.h Thu Jul 4 17:55:52 2013 (r252705) @@ -189,4 +189,57 @@ #define X_MBOWNER_FW 1 #define X_MBOWNER_PL 2 +/* + * PCI-E definitions. + * ================== + */ + +#define X_WINDOW_SHIFT 10 +#define X_PCIEOFST_SHIFT 10 + +/* + * TP definitions. + * =============== + */ + +/* + * TP_VLAN_PRI_MAP controls which subset of fields will be present in the + * Compressed Filter Tuple for LE filters. Each bit set in TP_VLAN_PRI_MAP + * selects for a particular field being present. These fields, when present + * in the Compressed Filter Tuple, have the following widths in bits. + */ +#define W_FT_FCOE 1 +#define W_FT_PORT 3 +#define W_FT_VNIC_ID 17 +#define W_FT_VLAN 17 +#define W_FT_TOS 8 +#define W_FT_PROTOCOL 8 +#define W_FT_ETHERTYPE 16 +#define W_FT_MACMATCH 9 +#define W_FT_MPSHITTYPE 3 +#define W_FT_FRAGMENTATION 1 + +/* + * Some of the Compressed Filter Tuple fields have internal structure. These + * bit shifts/masks describe those structures. All shifts are relative to the + * base position of the fields within the Compressed Filter Tuple + */ +#define S_FT_VLAN_VLD 16 +#define V_FT_VLAN_VLD(x) ((x) << S_FT_VLAN_VLD) +#define F_FT_VLAN_VLD V_FT_VLAN_VLD(1U) + +#define S_FT_VNID_ID_VF 0 +#define M_FT_VNID_ID_VF 0x7fU +#define V_FT_VNID_ID_VF(x) ((x) << S_FT_VNID_ID_VF) +#define G_FT_VNID_ID_VF(x) (((x) >> S_FT_VNID_ID_VF) & M_FT_VNID_ID_VF) + +#define S_FT_VNID_ID_PF 7 +#define M_FT_VNID_ID_PF 0x7U +#define V_FT_VNID_ID_PF(x) ((x) << S_FT_VNID_ID_PF) +#define G_FT_VNID_ID_PF(x) (((x) >> S_FT_VNID_ID_PF) & M_FT_VNID_ID_PF) + +#define S_FT_VNID_ID_VLD 16 +#define V_FT_VNID_ID_VLD(x) ((x) << S_FT_VNID_ID_VLD) +#define F_FT_VNID_ID_VLD(x) V_FT_VNID_ID_VLD(1U) + #endif /* __T4_REGS_VALUES_H__ */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/t4_main.c Thu Jul 4 17:55:52 2013 (r252705) @@ -633,9 +633,6 @@ t4_attach(device_t dev) if (rc != 0) goto done; /* error message displayed already */ - for (i = 0; i < NCHAN; i++) - sc->params.tp.tx_modq[i] = i; - rc = t4_create_dma_tag(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -2089,6 +2086,7 @@ prep_firmware(struct adapter *sc) G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); + t4_get_tp_version(sc, &sc->params.tp_vers); /* Reset device */ if (need_fw_reset && @@ -6522,13 +6520,14 @@ get_filter_mode(struct adapter *sc, uint t4_read_indirect(sc, A_TP_PIO_ADDR, A_TP_PIO_DATA, &fconf, 1, A_TP_VLAN_PRI_MAP); - if (sc->filter_mode != fconf) { + if (sc->params.tp.vlan_pri_map != fconf) { log(LOG_WARNING, "%s: cached filter mode out of sync %x %x.\n", - device_get_nameunit(sc->dev), sc->filter_mode, fconf); - sc->filter_mode = fconf; + device_get_nameunit(sc->dev), sc->params.tp.vlan_pri_map, + fconf); + sc->params.tp.vlan_pri_map = fconf; } - *mode = fconf_to_mode(sc->filter_mode); + *mode = fconf_to_mode(sc->params.tp.vlan_pri_map); end_synchronized_op(sc, LOCK_HELD); return (0); @@ -6661,7 +6660,8 @@ set_filter(struct adapter *sc, struct t4 } /* Validate against the global filter mode */ - if ((sc->filter_mode | fspec_to_fconf(&t->fs)) != sc->filter_mode) { + if ((sc->params.tp.vlan_pri_map | fspec_to_fconf(&t->fs)) != + sc->params.tp.vlan_pri_map) { rc = E2BIG; goto done; } Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 17:55:52 2013 (r252705) @@ -474,16 +474,11 @@ t4_read_chip_settings(struct adapter *sc s->s_qpp = r & M_QUEUESPERPAGEPF0; } - r = t4_read_reg(sc, A_TP_TIMER_RESOLUTION); - sc->params.tp.tre = G_TIMERRESOLUTION(r); - sc->params.tp.dack_re = G_DELAYEDACKRESOLUTION(r); + t4_init_tp_params(sc); t4_read_mtu_tbl(sc, sc->params.mtus, NULL); t4_load_mtus(sc, sc->params.mtus, sc->params.a_wnd, sc->params.b_wnd); - t4_read_indirect(sc, A_TP_PIO_ADDR, A_TP_PIO_DATA, &sc->filter_mode, 1, - A_TP_VLAN_PRI_MAP); - return (rc); } Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 17:55:52 2013 (r252705) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "common/t4_regs_values.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -384,10 +385,18 @@ t4_connect(struct toedev *tod, struct so if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); - INIT_TP_WR(cpl, 0); + if (is_t4(sc)) { + INIT_TP_WR(cpl, 0); + cpl->params = select_ntuple(pi, toep->l2te); + } else { + struct cpl_t5_act_open_req6 *c5 = (void *)cpl; + + INIT_TP_WR(c5, 0); + c5->rsvd = 0; + c5->params = select_ntuple(pi, toep->l2te); + } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, qid_atid)); - cpl->local_port = inp->inp_lport; cpl->local_ip_hi = *(uint64_t *)&inp->in6p_laddr.s6_addr[0]; cpl->local_ip_lo = *(uint64_t *)&inp->in6p_laddr.s6_addr[8]; @@ -397,20 +406,19 @@ t4_connect(struct toedev *tod, struct so cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, toep->rx_credits, toep->ulp_mode); cpl->opt2 = calc_opt2a(so, toep); + } else { + struct cpl_act_open_req *cpl = wrtod(wr); + if (is_t4(sc)) { - cpl->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); + INIT_TP_WR(cpl, 0); + cpl->params = select_ntuple(pi, toep->l2te); } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; + struct cpl_t5_act_open_req *c5 = (void *)cpl; + INIT_TP_WR(c5, 0); c5->rsvd = 0; - c5->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); + c5->params = select_ntuple(pi, toep->l2te); } - } else { - struct cpl_act_open_req *cpl = wrtod(wr); - - INIT_TP_WR(cpl, 0); OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, @@ -418,16 +426,6 @@ t4_connect(struct toedev *tod, struct so cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale, toep->rx_credits, toep->ulp_mode); cpl->opt2 = calc_opt2a(so, toep); - if (is_t4(sc)) { - cpl->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); - } else { - struct cpl_t5_act_open_req6 *c5 = (void *)cpl; - - c5->rsvd = 0; - c5->params = select_ntuple(pi, toep->l2te, - sc->filter_mode); - } } CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Jul 4 17:55:52 2013 (r252705) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "common/t4_regs_values.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -513,38 +514,38 @@ calc_opt0(struct socket *so, struct port return htobe64(opt0); } -#define FILTER_SEL_WIDTH_P_FC (3 + 1) -#define FILTER_SEL_WIDTH_VIN_P_FC (6 + 7 + FILTER_SEL_WIDTH_P_FC) -#define FILTER_SEL_WIDTH_TAG_P_FC (3 + FILTER_SEL_WIDTH_VIN_P_FC) -#define FILTER_SEL_WIDTH_VLD_TAG_P_FC (1 + FILTER_SEL_WIDTH_TAG_P_FC) -#define VLAN_NONE 0xfff -#define FILTER_SEL_VLAN_NONE 0xffff - uint64_t -select_ntuple(struct port_info *pi, struct l2t_entry *e, uint32_t filter_mode) +select_ntuple(struct port_info *pi, struct l2t_entry *e) { + struct adapter *sc = pi->adapter; + struct tp_params *tp = &sc->params.tp; uint16_t viid = pi->viid; - uint32_t ntuple = 0; + uint64_t ntuple = 0; + + /* + * Initialize each of the fields which we care about which are present + * in the Compressed Filter Tuple. + */ + if (tp->vlan_shift >= 0 && e->vlan != CPL_L2T_VLAN_NONE) + ntuple |= (uint64_t)(F_FT_VLAN_VLD | e->vlan) << tp->vlan_shift; - if (filter_mode == HW_TPL_FR_MT_PR_IV_P_FC) { - if (e->vlan == VLAN_NONE) - ntuple |= FILTER_SEL_VLAN_NONE << FILTER_SEL_WIDTH_P_FC; - else { - ntuple |= e->vlan << FILTER_SEL_WIDTH_P_FC; - ntuple |= 1 << FILTER_SEL_WIDTH_VLD_TAG_P_FC; - } - ntuple |= e->lport << S_PORT; - ntuple |= IPPROTO_TCP << FILTER_SEL_WIDTH_VLD_TAG_P_FC; - } else if (filter_mode == HW_TPL_FR_MT_PR_OV_P_FC) { - ntuple |= G_FW_VIID_VIN(viid) << FILTER_SEL_WIDTH_P_FC; - ntuple |= G_FW_VIID_PFN(viid) << FILTER_SEL_WIDTH_VIN_P_FC; - ntuple |= G_FW_VIID_VIVLD(viid) << FILTER_SEL_WIDTH_TAG_P_FC; - ntuple |= e->lport << S_PORT; - ntuple |= IPPROTO_TCP << FILTER_SEL_WIDTH_VLD_TAG_P_FC; - } + if (tp->port_shift >= 0) + ntuple |= (uint64_t)e->lport << tp->port_shift; + + if (tp->protocol_shift >= 0) + ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift; + + if (tp->vnic_shift >= 0) { + uint32_t vf = G_FW_VIID_VIN(viid); + uint32_t pf = G_FW_VIID_PFN(viid); + uint32_t vld = G_FW_VIID_VIVLD(viid); + + ntuple |= (uint64_t)(V_FT_VNID_ID_VF(vf) | V_FT_VNID_ID_PF(pf) | + V_FT_VNID_ID_VLD(vld)) << tp->vnic_shift; + } - if (is_t4(pi->adapter)) - return (htobe32(ntuple)); + if (is_t4(sc)) + return (htobe32((uint32_t)ntuple)); else return (htobe64(V_FILTER_TUPLE(ntuple))); } Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Jul 4 17:54:46 2013 (r252704) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Jul 4 17:55:52 2013 (r252705) @@ -234,7 +234,7 @@ u_long select_rcv_wnd(struct socket *); int select_rcv_wscale(void); uint64_t calc_opt0(struct socket *, struct port_info *, struct l2t_entry *, int, int, int, int); -uint64_t select_ntuple(struct port_info *, struct l2t_entry *, uint32_t); +uint64_t select_ntuple(struct port_info *, struct l2t_entry *); void set_tcpddp_ulp_mode(struct toepcb *); int negative_advice(int); struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:55:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E588E916; Thu, 4 Jul 2013 17:55:58 +0000 (UTC) (envelope-from bryanv@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 D79DB1606; Thu, 4 Jul 2013 17:55:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Htww0087292; Thu, 4 Jul 2013 17:55:58 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64HtwuK087291; Thu, 4 Jul 2013 17:55:58 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041755.r64HtwuK087291@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252706 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:55:59 -0000 Author: bryanv Date: Thu Jul 4 17:55:58 2013 New Revision: 252706 URL: http://svnweb.freebsd.org/changeset/base/252706 Log: Merge vtnet changes from projects/virtio Minor changes to the network driver. A multiqueue driver that is a significant rewrite will be in merged shortly. Contains projects/virtio commits: r246058: vtnet: Move an mbuf ASSERT to the calling function r246059: vtnet: Tweak ASSERT message MFC after: 1 month Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:55:52 2013 (r252705) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:55:58 2013 (r252706) @@ -1747,7 +1747,6 @@ vtnet_tx_offload(struct vtnet_softc *sc, uint8_t ip_proto, gso_type; ifp = sc->vtnet_ifp; - M_ASSERTPKTHDR(m); ip_offset = sizeof(struct ether_header); if (m->m_len < ip_offset) { @@ -1865,7 +1864,7 @@ vtnet_enqueue_txbuf(struct vtnet_softc * sglist_init(&sg, VTNET_MAX_TX_SEGS, segs); error = sglist_append(&sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); KASSERT(error == 0 && sg.sg_nseg == 1, - ("cannot add header to sglist")); + ("%s: cannot add header to sglist error %d", __func__, error)); again: error = sglist_append_mbuf(&sg, m); @@ -1902,6 +1901,7 @@ vtnet_encap(struct vtnet_softc *sc, stru int error; m = *m_head; + M_ASSERTPKTHDR(m); txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO); if (txhdr == NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:57:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0DA11C58; Thu, 4 Jul 2013 17:57:31 +0000 (UTC) (envelope-from bryanv@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 F045F161B; Thu, 4 Jul 2013 17:57:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64HvUCF087631; Thu, 4 Jul 2013 17:57:30 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64HvRfL087607; Thu, 4 Jul 2013 17:57:27 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041757.r64HvRfL087607@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252707 - in head: share/man/man4 sys/dev/virtio sys/dev/virtio/balloon sys/dev/virtio/block sys/dev/virtio/network sys/dev/virtio/pci sys/dev/virtio/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:57:31 -0000 Author: bryanv Date: Thu Jul 4 17:57:26 2013 New Revision: 252707 URL: http://svnweb.freebsd.org/changeset/base/252707 Log: Merge virtio changes from projects/virtio Contains projects/virtio commits: r245738: virtio: Minor man page tweaks r246060: virtio: Cleanup feature description printing r246306: virtio: Remove old debugging flag r247238: virtio: Remove PRIx64 macros from format strings r247239: virtio: Constify some fields r247240: virtio: Minor code simplifications r249962: virtio: Update to my freebsd.org email address MFC after: 1 month Modified: head/share/man/man4/virtio.4 head/share/man/man4/virtio_balloon.4 head/share/man/man4/virtio_blk.4 head/share/man/man4/virtio_scsi.4 head/share/man/man4/vtnet.4 head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/scsi/virtio_scsivar.h head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_bus_if.m head/sys/dev/virtio/virtio_if.m head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/share/man/man4/virtio.4 ============================================================================== --- head/share/man/man4/virtio.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -53,10 +53,10 @@ This emulation is often inefficient. .Pp VirtIO defines an interface for efficient I/O between the hypervisor and VM. The -.Xr virtio 4 +.Nm module provides a shared memory transport called a virtqueue. The -.Xr virtio_pci 4 +.Xr virtio_pci device driver represents an emulated PCI device that the hypervisor makes available to the VM. This device provides the probing, configuration, and @@ -94,4 +94,4 @@ Support for VirtIO first appeared in .An -nosplit .Fx support for VirtIO was first added by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . Modified: head/share/man/man4/virtio_balloon.4 ============================================================================== --- head/share/man/man4/virtio_balloon.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_balloon.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -59,6 +59,6 @@ The hypervisor can later signal the ball The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . Modified: head/share/man/man4/virtio_blk.4 ============================================================================== --- head/share/man/man4/virtio_blk.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_blk.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -87,6 +87,6 @@ be toggled between writethrough and writ The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . Modified: head/share/man/man4/virtio_scsi.4 ============================================================================== --- head/share/man/man4/virtio_scsi.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_scsi.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -87,6 +87,6 @@ Enable tracing prints. The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 10.0 . Modified: head/share/man/man4/vtnet.4 ============================================================================== --- head/share/man/man4/vtnet.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/vtnet.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -89,7 +89,7 @@ The default value is 0. The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . .Sh CAVEATS Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -487,9 +487,6 @@ vtpci_alloc_virtqueues(device_t dev, int if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) - sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (idx = 0; idx < nvqs; idx++) { vqx = &sc->vtpci_vqx[idx]; info = &vq_info[idx]; Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012, Bryan Venteicher + * Copyright (c) 2012, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012, Bryan Venteicher + * Copyright (c) 2012, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtio.c ============================================================================== --- head/sys/dev/virtio/virtio.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -49,8 +48,8 @@ static int virtio_modevent(module_t, int static const char *virtio_feature_name(uint64_t, struct virtio_feature_desc *); static struct virtio_ident { - uint16_t devid; - char *name; + uint16_t devid; + const char *name; } virtio_ident_table[] = { { VIRTIO_ID_NETWORK, "Network" }, { VIRTIO_ID_BLOCK, "Block" }, @@ -87,9 +86,29 @@ virtio_device_name(uint16_t devid) return (NULL); } +static const char * +virtio_feature_name(uint64_t val, struct virtio_feature_desc *desc) +{ + int i, j; + struct virtio_feature_desc *descs[2] = { desc, + virtio_common_feature_desc }; + + for (i = 0; i < 2; i++) { + if (descs[i] == NULL) + continue; + + for (j = 0; descs[i][j].vfd_val != 0; j++) { + if (val == descs[i][j].vfd_val) + return (descs[i][j].vfd_str); + } + } + + return (NULL); +} + void virtio_describe(device_t dev, const char *msg, - uint64_t features, struct virtio_feature_desc *feature_desc) + uint64_t features, struct virtio_feature_desc *desc) { struct sbuf sb; uint64_t val; @@ -98,13 +117,12 @@ virtio_describe(device_t dev, const char int n; if ((buf = malloc(512, M_TEMP, M_NOWAIT)) == NULL) { - device_printf(dev, "%s features: 0x%"PRIx64"\n", msg, - features); + device_printf(dev, "%s features: %#jx\n", msg, (uintmax_t) features); return; } sbuf_new(&sb, buf, 512, SBUF_FIXEDLEN); - sbuf_printf(&sb, "%s features: 0x%"PRIx64, msg, features); + sbuf_printf(&sb, "%s features: %#jx", msg, (uintmax_t) features); for (n = 0, val = 1ULL << 63; val != 0; val >>= 1) { /* @@ -119,15 +137,9 @@ virtio_describe(device_t dev, const char else sbuf_cat(&sb, ","); - name = NULL; - if (feature_desc != NULL) - name = virtio_feature_name(val, feature_desc); + name = virtio_feature_name(val, desc); if (name == NULL) - name = virtio_feature_name(val, - virtio_common_feature_desc); - - if (name == NULL) - sbuf_printf(&sb, "0x%"PRIx64, val); + sbuf_printf(&sb, "%#jx", (uintmax_t) val); else sbuf_cat(&sb, name); } @@ -147,18 +159,6 @@ virtio_describe(device_t dev, const char free(buf, M_TEMP); } -static const char * -virtio_feature_name(uint64_t val, struct virtio_feature_desc *feature_desc) -{ - int i; - - for (i = 0; feature_desc[i].vfd_val != 0; i++) - if (val == feature_desc[i].vfd_val) - return (feature_desc[i].vfd_str); - - return (NULL); -} - /* * VirtIO bus method wrappers. */ @@ -251,13 +251,12 @@ virtio_modevent(module_t mod, int type, { int error; - error = 0; - switch (type) { case MOD_LOAD: case MOD_QUIESCE: case MOD_UNLOAD: case MOD_SHUTDOWN: + error = 0; break; default: error = EOPNOTSUPP; Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio.h Thu Jul 4 17:57:26 2013 (r252707) @@ -99,7 +99,7 @@ struct vq_alloc_info; struct virtio_feature_desc { uint64_t vfd_val; - char *vfd_str; + const char *vfd_str; }; const char *virtio_device_name(uint16_t devid); Modified: head/sys/dev/virtio/virtio_bus_if.m ============================================================================== --- head/sys/dev/virtio/virtio_bus_if.m Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio_bus_if.m Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2011, Bryan Venteicher +# Copyright (c) 2011, Bryan Venteicher # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,9 +50,6 @@ METHOD int alloc_virtqueues { int nvqs; struct vq_alloc_info *info; }; -HEADER { -#define VIRTIO_ALLOC_VQS_DISABLE_MSIX 0x1 -}; METHOD int setup_intr { device_t dev; Modified: head/sys/dev/virtio/virtio_if.m ============================================================================== --- head/sys/dev/virtio/virtio_if.m Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio_if.m Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2011, Bryan Venteicher +# Copyright (c) 2011, Bryan Venteicher # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtqueue.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher + * Copyright (c) 2011, Bryan Venteicher * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 17:59:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 600D3DDD; Thu, 4 Jul 2013 17:59:10 +0000 (UTC) (envelope-from bryanv@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 510361630; Thu, 4 Jul 2013 17:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64HxAVM087864; Thu, 4 Jul 2013 17:59:10 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Hx9wk087857; Thu, 4 Jul 2013 17:59:09 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041759.r64Hx9wk087857@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252708 - in head/sys/dev/virtio: . pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 17:59:10 -0000 Author: bryanv Date: Thu Jul 4 17:59:09 2013 New Revision: 252708 URL: http://svnweb.freebsd.org/changeset/base/252708 Log: Merge virtio_pci changes from projects/virtio This commit is primarily a significant cleanup to the interrupt allocation code that had gotten a bit jumbled from having to support per-vq MSIX, shared MSIX, MSI, and legacy style interrupts. Contains projects/virtio commits: r246064: virtio_pci: Rewrite allocation of interrupts r246065: virtio_pci: Remove spaces before a tab r246066: virtio_pci: Dynamically allocate the virtqueue array r246304: virtio_pci: Clean up after failed virtqueue alloc attempt r246305: virtio_pci: Move no interrupt check into the PCI interrupt handlers r246308: virtio_pci: Remove unused variable MFC after: 1 month Modified: head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtqueue.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:57:26 2013 (r252707) +++ head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:59:09 2013 (r252708) @@ -51,6 +51,17 @@ __FBSDID("$FreeBSD$"); #include "virtio_bus_if.h" #include "virtio_if.h" +struct vtpci_interrupt { + struct resource *vti_irq; + int vti_rid; + void *vti_handler; +}; + +struct vtpci_virtqueue { + struct virtqueue *vtv_vq; + int vtv_no_intr; +}; + struct vtpci_softc { device_t vtpci_dev; struct resource *vtpci_res; @@ -69,40 +80,22 @@ struct vtpci_softc { device_t vtpci_child_dev; struct virtio_feature_desc *vtpci_child_feat_desc; - /* - * Ideally, each virtqueue that the driver provides a callback for - * will receive its own MSIX vector. If there are not sufficient - * vectors available, we will then attempt to have all the VQs - * share one vector. Note that when using MSIX, the configuration - * changed notifications must be on their own vector. - * - * If MSIX is not available, we will attempt to have the whole - * device share one MSI vector, and then, finally, one legacy - * interrupt. - */ int vtpci_nvqs; - struct vtpci_virtqueue { - struct virtqueue *vq; - /* Device did not provide a callback for this virtqueue. */ - int no_intr; - /* Index into vtpci_intr_res[] below. Unused, then -1. */ - int ires_idx; - } vtpci_vqx[VIRTIO_MAX_VIRTQUEUES]; + struct vtpci_virtqueue *vtpci_vqs; /* - * When using MSIX interrupts, the first element of vtpci_intr_res[] - * is always the configuration changed notifications. The remaining - * element(s) are used for the virtqueues. + * Ideally, each virtqueue that the driver provides a callback for will + * receive its own MSIX vector. If there are not sufficient vectors + * available, then attempt to have all the VQs share one vector. For + * MSIX, the configuration changed notifications must be on their own + * vector. * - * With MSI and legacy interrupts, only the first element of - * vtpci_intr_res[] is used. + * If MSIX is not available, we will attempt to have the whole device + * share one MSI vector, and then, finally, one legacy interrupt. */ - int vtpci_nintr_res; - struct vtpci_intr_resource { - struct resource *irq; - int rid; - void *intrhand; - } vtpci_intr_res[1 + VIRTIO_MAX_VIRTQUEUES]; + struct vtpci_interrupt vtpci_device_interrupt; + struct vtpci_interrupt *vtpci_msix_vq_interrupts; + int vtpci_nmsix_resources; }; static int vtpci_probe(device_t); @@ -134,28 +127,35 @@ static void vtpci_describe_features(stru uint64_t); static void vtpci_probe_and_attach_child(struct vtpci_softc *); -static int vtpci_alloc_msix(struct vtpci_softc *, int); -static int vtpci_alloc_msi(struct vtpci_softc *); -static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); -static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); -static int vtpci_alloc_intr_msi(struct vtpci_softc *); -static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); +static int vtpci_alloc_intr_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_interrupt(struct vtpci_softc *, int, int, + struct vtpci_interrupt *); static int vtpci_alloc_intr_resources(struct vtpci_softc *); -static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, +static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_pervq_msix_interrupts(struct vtpci_softc *, enum intr_type); -static int vtpci_setup_msix_interrupts(struct vtpci_softc *, +static int vtpci_setup_msix_interrupts(struct vtpci_softc *, enum intr_type); -static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); +static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); -static int vtpci_register_msix_vector(struct vtpci_softc *, int, int); -static int vtpci_set_host_msix_vectors(struct vtpci_softc *); -static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); +static int vtpci_register_msix_vector(struct vtpci_softc *, int, + struct vtpci_interrupt *); +static int vtpci_set_host_msix_vectors(struct vtpci_softc *); +static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); +static void vtpci_free_interrupt(struct vtpci_softc *, + struct vtpci_interrupt *); static void vtpci_free_interrupts(struct vtpci_softc *); static void vtpci_free_virtqueues(struct vtpci_softc *); -static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_release_child_resources(struct vtpci_softc *); +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_reset(struct vtpci_softc *); static void vtpci_select_virtqueue(struct vtpci_softc *, int); @@ -480,15 +480,19 @@ vtpci_alloc_virtqueues(device_t dev, int uint16_t size; sc = device_get_softc(dev); - error = 0; if (sc->vtpci_nvqs != 0) return (EALREADY); - if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) + if (nvqs <= 0) return (EINVAL); + sc->vtpci_vqs = malloc(nvqs * sizeof(struct vtpci_virtqueue), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->vtpci_vqs == NULL) + return (ENOMEM); + for (idx = 0; idx < nvqs; idx++) { - vqx = &sc->vtpci_vqx[idx]; + vqx = &sc->vtpci_vqs[idx]; info = &vq_info[idx]; vtpci_select_virtqueue(sc, idx); @@ -505,12 +509,15 @@ vtpci_alloc_virtqueues(device_t dev, int vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); - vqx->vq = *info->vqai_vq = vq; - vqx->no_intr = info->vqai_intr == NULL; + vqx->vtv_vq = *info->vqai_vq = vq; + vqx->vtv_no_intr = info->vqai_intr == NULL; sc->vtpci_nvqs++; } + if (error) + vtpci_free_virtqueues(sc); + return (error); } @@ -771,7 +778,7 @@ vtpci_alloc_msix(struct vtpci_softc *sc, cnt = required; if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_nintr_res = required; + sc->vtpci_nmsix_resources = required; return (0); } @@ -794,10 +801,8 @@ vtpci_alloc_msi(struct vtpci_softc *sc) return (1); cnt = required; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_nintr_res = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) return (0); - } pci_release_msi(dev); @@ -814,7 +819,7 @@ vtpci_alloc_intr_msix_pervq(struct vtpci return (ENOTSUP); for (nvectors = 0, i = 0; i < sc->vtpci_nvqs; i++) { - if (sc->vtpci_vqx[i].no_intr == 0) + if (sc->vtpci_vqs[i].vtv_no_intr == 0) nvectors++; } @@ -868,54 +873,62 @@ vtpci_alloc_intr_legacy(struct vtpci_sof { sc->vtpci_flags |= VTPCI_FLAG_LEGACY; - sc->vtpci_nintr_res = 1; return (0); } static int -vtpci_alloc_intr_resources(struct vtpci_softc *sc) +vtpci_alloc_interrupt(struct vtpci_softc *sc, int rid, int flags, + struct vtpci_interrupt *intr) { - device_t dev; struct resource *irq; - struct vtpci_virtqueue *vqx; - int i, rid, flags, res_idx; - dev = sc->vtpci_dev; + irq = bus_alloc_resource_any(sc->vtpci_dev, SYS_RES_IRQ, &rid, flags); + if (irq == NULL) + return (ENXIO); - if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) { - rid = 0; - flags = RF_ACTIVE | RF_SHAREABLE; - } else { - rid = 1; - flags = RF_ACTIVE; - } + intr->vti_irq = irq; + intr->vti_rid = rid; - for (i = 0; i < sc->vtpci_nintr_res; i++) { - irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); - if (irq == NULL) - return (ENXIO); + return (0); +} - sc->vtpci_intr_res[i].irq = irq; - sc->vtpci_intr_res[i].rid = rid++; - } +static int +vtpci_alloc_intr_resources(struct vtpci_softc *sc) +{ + struct vtpci_interrupt *intr; + int i, rid, flags, nvq_intrs, error; + + rid = 0; + flags = RF_ACTIVE; + + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + flags |= RF_SHAREABLE; + else + rid = 1; /* - * Map the virtqueue into the correct index in vq_intr_res[]. The - * first index is reserved for configuration changed notifications. + * For legacy and MSI interrupts, this single resource handles all + * interrupts. For MSIX, this resource is used for the configuration + * changed interrupt. */ - for (i = 0, res_idx = 1; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; + intr = &sc->vtpci_device_interrupt; + error = vtpci_alloc_interrupt(sc, rid, flags, intr); + if (error || sc->vtpci_flags & (VTPCI_FLAG_LEGACY | VTPCI_FLAG_MSI)) + return (error); + + /* Subtract one for the configuration changed interrupt. */ + nvq_intrs = sc->vtpci_nmsix_resources - 1; + + intr = sc->vtpci_msix_vq_interrupts = malloc(nvq_intrs * + sizeof(struct vtpci_interrupt), M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->vtpci_msix_vq_interrupts == NULL) + return (ENOMEM); - if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { - if (vqx->no_intr != 0) - vqx->ires_idx = -1; - else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) - vqx->ires_idx = res_idx; - else - vqx->ires_idx = res_idx++; - } else - vqx->ires_idx = -1; + for (i = 0, rid++; i < nvq_intrs; i++, rid++, intr++) { + error = vtpci_alloc_interrupt(sc, rid, flags, intr); + if (error) + return (error); } return (0); @@ -924,63 +937,67 @@ vtpci_alloc_intr_resources(struct vtpci_ static int vtpci_setup_legacy_interrupt(struct vtpci_softc *sc, enum intr_type type) { - device_t dev; - struct vtpci_intr_resource *ires; + struct vtpci_interrupt *intr; int error; - dev = sc->vtpci_dev; - - ires = &sc->vtpci_intr_res[0]; - error = bus_setup_intr(dev, ires->irq, type, NULL, vtpci_legacy_intr, - sc, &ires->intrhand); + intr = &sc->vtpci_device_interrupt; + error = bus_setup_intr(sc->vtpci_dev, intr->vti_irq, type, NULL, + vtpci_legacy_intr, sc, &intr->vti_handler); return (error); } static int -vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) +vtpci_setup_pervq_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) { - device_t dev; - struct vtpci_intr_resource *ires; struct vtpci_virtqueue *vqx; + struct vtpci_interrupt *intr; int i, error; + intr = sc->vtpci_msix_vq_interrupts; + + for (i = 0; i < sc->vtpci_nvqs; i++) { + vqx = &sc->vtpci_vqs[i]; + + if (vqx->vtv_no_intr) + continue; + + error = bus_setup_intr(sc->vtpci_dev, intr->vti_irq, type, + vtpci_vq_intr_filter, vtpci_vq_intr, vqx->vtv_vq, + &intr->vti_handler); + if (error) + return (error); + + intr++; + } + + return (0); +} + +static int +vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) +{ + device_t dev; + struct vtpci_interrupt *intr; + int error; + dev = sc->vtpci_dev; + intr = &sc->vtpci_device_interrupt; - /* - * The first MSIX vector is used for configuration changed interrupts. - */ - ires = &sc->vtpci_intr_res[0]; - error = bus_setup_intr(dev, ires->irq, type, NULL, vtpci_config_intr, - sc, &ires->intrhand); + error = bus_setup_intr(dev, intr->vti_irq, type, NULL, + vtpci_config_intr, sc, &intr->vti_handler); if (error) return (error); if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) { - ires = &sc->vtpci_intr_res[1]; - - error = bus_setup_intr(dev, ires->irq, type, + intr = sc->vtpci_msix_vq_interrupts; + error = bus_setup_intr(dev, intr->vti_irq, type, vtpci_vq_shared_intr_filter, vtpci_vq_shared_intr, sc, - &ires->intrhand); - } else { - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; - if (vqx->ires_idx < 1) - continue; - - ires = &sc->vtpci_intr_res[vqx->ires_idx]; - error = bus_setup_intr(dev, ires->irq, type, - vtpci_vq_intr_filter, vtpci_vq_intr, vqx->vq, - &ires->intrhand); - if (error) - break; - } - } - - if (error == 0) - error = vtpci_set_host_msix_vectors(sc); + &intr->vti_handler); + } else + error = vtpci_setup_pervq_msix_interrupts(sc, type); - return (error); + return (error ? error : vtpci_set_host_msix_vectors(sc)); } static int @@ -990,7 +1007,7 @@ vtpci_setup_interrupts(struct vtpci_soft type |= INTR_MPSAFE; KASSERT(sc->vtpci_flags & VTPCI_FLAG_ITYPE_MASK, - ("no interrupt type selected: %#x", sc->vtpci_flags)); + ("%s: no interrupt type selected %#x", __func__, sc->vtpci_flags)); error = vtpci_alloc_intr_resources(sc); if (error) @@ -1007,34 +1024,24 @@ vtpci_setup_interrupts(struct vtpci_soft } static int -vtpci_register_msix_vector(struct vtpci_softc *sc, int offset, int res_idx) +vtpci_register_msix_vector(struct vtpci_softc *sc, int offset, + struct vtpci_interrupt *intr) { device_t dev; - uint16_t vector, rdvector; + uint16_t vector; dev = sc->vtpci_dev; - if (res_idx != -1) { + if (intr != NULL) { /* Map from guest rid to host vector. */ - vector = sc->vtpci_intr_res[res_idx].rid - 1; + vector = intr->vti_rid - 1; } else vector = VIRTIO_MSI_NO_VECTOR; - /* - * Assert the first resource is always used for the configuration - * changed interrupts. - */ - if (res_idx == 0) { - KASSERT(vector == 0 && offset == VIRTIO_MSI_CONFIG_VECTOR, - ("bad first res use vector:%d offset:%d", vector, offset)); - } else - KASSERT(offset == VIRTIO_MSI_QUEUE_VECTOR, ("bad offset")); - vtpci_write_config_2(sc, offset, vector); /* Read vector to determine if the host had sufficient resources. */ - rdvector = vtpci_read_config_2(sc, offset); - if (rdvector != vector) { + if (vtpci_read_config_2(sc, offset) != vector) { device_printf(dev, "insufficient host resources for MSIX interrupts\n"); return (ENODEV); @@ -1046,24 +1053,40 @@ vtpci_register_msix_vector(struct vtpci_ static int vtpci_set_host_msix_vectors(struct vtpci_softc *sc) { - struct vtpci_virtqueue *vqx; - int idx, error; + struct vtpci_interrupt *intr, *tintr; + int idx, offset, error; - error = vtpci_register_msix_vector(sc, VIRTIO_MSI_CONFIG_VECTOR, 0); + intr = &sc->vtpci_device_interrupt; + offset = VIRTIO_MSI_CONFIG_VECTOR; + + error = vtpci_register_msix_vector(sc, offset, intr); if (error) return (error); - for (idx = 0; idx < sc->vtpci_nvqs; idx++) { - vqx = &sc->vtpci_vqx[idx]; + intr = sc->vtpci_msix_vq_interrupts; + offset = VIRTIO_MSI_QUEUE_VECTOR; + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { vtpci_select_virtqueue(sc, idx); - error = vtpci_register_msix_vector(sc, VIRTIO_MSI_QUEUE_VECTOR, - vqx->ires_idx); + + if (sc->vtpci_vqs[idx].vtv_no_intr) + tintr = NULL; + else + tintr = intr; + + error = vtpci_register_msix_vector(sc, offset, tintr); if (error) - return (error); + break; + + /* + * For shared MSIX, all the virtqueues share the first + * interrupt. + */ + if ((sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) == 0) + intr++; } - return (0); + return (error); } static int @@ -1074,10 +1097,10 @@ vtpci_reinit_virtqueue(struct vtpci_soft int error; uint16_t size; - vqx = &sc->vtpci_vqx[idx]; - vq = vqx->vq; + vqx = &sc->vtpci_vqs[idx]; + vq = vqx->vtv_vq; - KASSERT(vq != NULL, ("vq %d not allocated", idx)); + KASSERT(vq != NULL, ("%s: vq %d not allocated", __func__, idx)); vtpci_select_virtqueue(sc, idx); size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); @@ -1093,35 +1116,50 @@ vtpci_reinit_virtqueue(struct vtpci_soft } static void -vtpci_free_interrupts(struct vtpci_softc *sc) +vtpci_free_interrupt(struct vtpci_softc *sc, struct vtpci_interrupt *intr) { device_t dev; - struct vtpci_intr_resource *ires; - int i; dev = sc->vtpci_dev; - for (i = 0; i < sc->vtpci_nintr_res; i++) { - ires = &sc->vtpci_intr_res[i]; + if (intr->vti_handler != NULL) { + bus_teardown_intr(dev, intr->vti_irq, intr->vti_handler); + intr->vti_handler = NULL; + } - if (ires->intrhand != NULL) { - bus_teardown_intr(dev, ires->irq, ires->intrhand); - ires->intrhand = NULL; - } + if (intr->vti_irq != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, intr->vti_rid, + intr->vti_irq); + intr->vti_irq = NULL; + intr->vti_rid = -1; + } +} - if (ires->irq != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, ires->rid, - ires->irq); - ires->irq = NULL; - } +static void +vtpci_free_interrupts(struct vtpci_softc *sc) +{ + struct vtpci_interrupt *intr; + int i, nvq_intrs; + + vtpci_free_interrupt(sc, &sc->vtpci_device_interrupt); - ires->rid = -1; + if (sc->vtpci_nmsix_resources != 0) { + nvq_intrs = sc->vtpci_nmsix_resources - 1; + sc->vtpci_nmsix_resources = 0; + + intr = sc->vtpci_msix_vq_interrupts; + if (intr != NULL) { + for (i = 0; i < nvq_intrs; i++, intr++) + vtpci_free_interrupt(sc, intr); + + free(sc->vtpci_msix_vq_interrupts, M_DEVBUF); + sc->vtpci_msix_vq_interrupts = NULL; + } } if (sc->vtpci_flags & (VTPCI_FLAG_MSI | VTPCI_FLAG_MSIX)) - pci_release_msi(dev); + pci_release_msi(sc->vtpci_dev); - sc->vtpci_nintr_res = 0; sc->vtpci_flags &= ~VTPCI_FLAG_ITYPE_MASK; } @@ -1129,19 +1167,32 @@ static void vtpci_free_virtqueues(struct vtpci_softc *sc) { struct vtpci_virtqueue *vqx; - int i; + int idx; - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + vqx = &sc->vtpci_vqs[idx]; + + vtpci_select_virtqueue(sc, idx); + vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, 0); - virtqueue_free(vqx->vq); - vqx->vq = NULL; + virtqueue_free(vqx->vtv_vq); + vqx->vtv_vq = NULL; } + free(sc->vtpci_vqs, M_DEVBUF); + sc->vtpci_vqs = NULL; sc->vtpci_nvqs = 0; } static void +vtpci_release_child_resources(struct vtpci_softc *sc) +{ + + vtpci_free_interrupts(sc); + vtpci_free_virtqueues(sc); +} + +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *sc) { int idx; @@ -1161,14 +1212,6 @@ vtpci_cleanup_setup_intr_attempt(struct } static void -vtpci_release_child_resources(struct vtpci_softc *sc) -{ - - vtpci_free_interrupts(sc); - vtpci_free_virtqueues(sc); -} - -static void vtpci_reset(struct vtpci_softc *sc) { @@ -1195,7 +1238,7 @@ vtpci_legacy_intr(void *xsc) uint8_t isr; sc = xsc; - vqx = &sc->vtpci_vqx[0]; + vqx = &sc->vtpci_vqs[0]; /* Reading the ISR also clears it. */ isr = vtpci_read_config_1(sc, VIRTIO_PCI_ISR); @@ -1204,8 +1247,10 @@ vtpci_legacy_intr(void *xsc) vtpci_config_intr(sc); if (isr & VIRTIO_PCI_ISR_INTR) { - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - virtqueue_intr(vqx->vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + virtqueue_intr(vqx->vtv_vq); + } } } @@ -1218,10 +1263,12 @@ vtpci_vq_shared_intr_filter(void *xsc) rc = 0; sc = xsc; - vqx = &sc->vtpci_vqx[0]; + vqx = &sc->vtpci_vqs[0]; - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - rc |= virtqueue_intr_filter(vqx->vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + rc |= virtqueue_intr_filter(vqx->vtv_vq); + } return (rc ? FILTER_SCHEDULE_THREAD : FILTER_STRAY); } @@ -1234,10 +1281,12 @@ vtpci_vq_shared_intr(void *xsc) int i; sc = xsc; - vqx = &sc->vtpci_vqx[0]; + vqx = &sc->vtpci_vqs[0]; - for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) - virtqueue_intr(vqx->vq); + for (i = 0; i < sc->vtpci_nvqs; i++, vqx++) { + if (vqx->vtv_no_intr == 0) + virtqueue_intr(vqx->vtv_vq); + } } static int Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Thu Jul 4 17:57:26 2013 (r252707) +++ head/sys/dev/virtio/virtio.h Thu Jul 4 17:59:09 2013 (r252708) @@ -71,11 +71,6 @@ struct vq_alloc_info; #define VIRTIO_TRANSPORT_F_END 32 /* - * Maximum number of virtqueues per device. - */ -#define VIRTIO_MAX_VIRTQUEUES 8 - -/* * Each virtqueue indirect descriptor list must be physically contiguous. * To allow us to malloc(9) each list individually, limit the number * supported to what will fit in one page. With 4KB pages, this is a limit Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:57:26 2013 (r252707) +++ head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:59:09 2013 (r252708) @@ -417,8 +417,6 @@ int virtqueue_intr_filter(struct virtqueue *vq) { - if (__predict_false(vq->vq_intrhand == NULL)) - return (0); if (vq->vq_used_cons_idx == vq->vq_ring.used->idx) return (0); @@ -431,8 +429,7 @@ void virtqueue_intr(struct virtqueue *vq) { - if (__predict_true(vq->vq_intrhand != NULL)) - vq->vq_intrhand(vq->vq_intrhand_arg); + vq->vq_intrhand(vq->vq_intrhand_arg); } int From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 18:00:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D80ACC9; Thu, 4 Jul 2013 18:00:27 +0000 (UTC) (envelope-from bryanv@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 CA426164A; Thu, 4 Jul 2013 18:00:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64I0RSG088476; Thu, 4 Jul 2013 18:00:27 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64I0RA6088475; Thu, 4 Jul 2013 18:00:27 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201307041800.r64I0RA6088475@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 4 Jul 2013 18:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252709 - head/sys/dev/virtio/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 18:00:27 -0000 Author: bryanv Date: Thu Jul 4 18:00:27 2013 New Revision: 252709 URL: http://svnweb.freebsd.org/changeset/base/252709 Log: Merge virtio_scsi change from projects/virtio r252680: Fix SIM lock not owned panic The CAM locking requirements of registering an async callback has changed so the SIM lock must be held. Remove code that explicitly dropped the lock around the register. Also return CAM_SEL_TIMEOUT instead of CAM_TID_INVALID for bad targets to avoid a lot console spam during bus scans. MFC after: 1 month Modified: head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:59:09 2013 (r252708) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 18:00:27 2013 (r252709) @@ -542,19 +542,14 @@ vtscsi_register_cam(struct vtscsi_softc goto fail; } - VTSCSI_UNLOCK(sc); - - /* - * The async register apparently needs to be done without - * the lock held, otherwise it can recurse on the lock. - */ if (vtscsi_register_async(sc) != CAM_REQ_CMP) { error = EIO; device_printf(dev, "cannot register async callback\n"); - VTSCSI_LOCK(sc); goto fail; } + VTSCSI_UNLOCK(sc); + return (0); fail: @@ -622,8 +617,6 @@ vtscsi_register_async(struct vtscsi_soft { struct ccb_setasync csa; - VTSCSI_LOCK_NOTOWNED(sc); - xpt_setup_ccb(&csa.ccb_h, sc->vtscsi_path, 5); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE | AC_FOUND_DEVICE; @@ -1238,7 +1231,7 @@ vtscsi_scsi_cmd_cam_status(struct virtio status = CAM_REQ_ABORTED; break; case VIRTIO_SCSI_S_BAD_TARGET: - status = CAM_TID_INVALID; + status = CAM_SEL_TIMEOUT; break; case VIRTIO_SCSI_S_RESET: status = CAM_SCSI_BUS_RESET; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 18:38:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 669ECC01; Thu, 4 Jul 2013 18:38:02 +0000 (UTC) (envelope-from trociny@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 4862F1854; Thu, 4 Jul 2013 18:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Ic2ae099779; Thu, 4 Jul 2013 18:38:02 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Ic1Ld099772; Thu, 4 Jul 2013 18:38:01 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307041838.r64Ic1Ld099772@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 4 Jul 2013 18:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252710 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 18:38:02 -0000 Author: trociny Date: Thu Jul 4 18:38:00 2013 New Revision: 252710 URL: http://svnweb.freebsd.org/changeset/base/252710 Log: In r227207, to fix the issue with possible NULL inp_socket pointer dereferencing, when checking for SO_REUSEPORT option (and SO_REUSEADDR for multicast), INP_REUSEPORT flag was introduced to cache the socket option. It was decided then that one flag would be enough to cache both SO_REUSEPORT and SO_REUSEADDR: when processing SO_REUSEADDR setsockopt(2), it was checked if it was called for a multicast address and INP_REUSEPORT was set accordingly. Unfortunately that approach does not work when setsockopt(2) is called before binding to a multicast address: the multicast check fails and INP_REUSEPORT is not set. Fix this by adding INP_REUSEADDR flag to unconditionally cache SO_REUSEADDR. PR: 179901 Submitted by: Michael Gmelin freebsd grem.de (initial version) Reviewed by: rwatson MFC after: 1 week Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Jul 4 18:00:27 2013 (r252709) +++ head/sys/netinet/in_pcb.c Thu Jul 4 18:38:00 2013 (r252710) @@ -467,6 +467,23 @@ in_pcb_lport(struct inpcb *inp, struct i return (0); } + +/* + * Return cached socket options. + */ +short +inp_so_options(const struct inpcb *inp) +{ + short so_options; + + so_options = 0; + + if ((inp->inp_flags2 & INP_REUSEPORT) != 0) + so_options |= SO_REUSEPORT; + if ((inp->inp_flags2 & INP_REUSEADDR) != 0) + so_options |= SO_REUSEADDR; + return (so_options); +} #endif /* INET || INET6 */ #ifdef INET @@ -595,8 +612,7 @@ in_pcbbind_setup(struct inpcb *inp, stru if (tw == NULL || (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } else if (t && (reuseport == 0 || - (t->inp_flags2 & INP_REUSEPORT) == 0)) { + } else if (t && (reuseport & inp_so_options(t)) == 0) { #ifdef INET6 if (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Jul 4 18:00:27 2013 (r252709) +++ head/sys/netinet/in_pcb.h Thu Jul 4 18:38:00 2013 (r252710) @@ -442,6 +442,7 @@ struct tcpcb * inp_inpcbtotcpcb(struct inpcb *inp); void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp); +short inp_so_options(const struct inpcb *inp); #endif /* _KERNEL */ @@ -543,6 +544,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ #define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ #define INP_FREED 0x00000010 /* inp itself is not valid */ +#define INP_REUSEADDR 0x00000020 /* SO_REUSEADDR option is set */ /* * Flags passed to in_pcblookup*() functions. Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jul 4 18:00:27 2013 (r252709) +++ head/sys/netinet/ip_output.c Thu Jul 4 18:38:00 2013 (r252710) @@ -900,13 +900,10 @@ ip_ctloutput(struct socket *so, struct s switch (sopt->sopt_name) { case SO_REUSEADDR: INP_WLOCK(inp); - if (IN_MULTICAST(ntohl(inp->inp_laddr.s_addr))) { - if ((so->so_options & - (SO_REUSEADDR | SO_REUSEPORT)) != 0) - inp->inp_flags2 |= INP_REUSEPORT; - else - inp->inp_flags2 &= ~INP_REUSEPORT; - } + if ((so->so_options & SO_REUSEADDR) != 0) + inp->inp_flags2 |= INP_REUSEADDR; + else + inp->inp_flags2 &= ~INP_REUSEADDR; INP_WUNLOCK(inp); error = 0; break; Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Jul 4 18:00:27 2013 (r252709) +++ head/sys/netinet6/in6_pcb.c Thu Jul 4 18:38:00 2013 (r252710) @@ -243,8 +243,7 @@ in6_pcbbind(register struct inpcb *inp, if (tw == NULL || (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } else if (t && (reuseport == 0 || - (t->inp_flags2 & INP_REUSEPORT) == 0)) { + } else if (t && (reuseport & inp_so_options(t)) == 0) { return (EADDRINUSE); } #ifdef INET @@ -265,8 +264,8 @@ in6_pcbbind(register struct inpcb *inp, INP_IPV6PROTO) == (t->inp_vflag & INP_IPV6PROTO)))) return (EADDRINUSE); - } else if (t && (reuseport == 0 || - (t->inp_flags2 & INP_REUSEPORT) == 0) && + } else if (t && + (reuseport & inp_so_options(t)) == 0 && (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || (t->inp_vflag & INP_IPV6PROTO) != 0)) return (EADDRINUSE); Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jul 4 18:00:27 2013 (r252709) +++ head/sys/netinet6/ip6_output.c Thu Jul 4 18:38:00 2013 (r252710) @@ -1477,13 +1477,10 @@ ip6_ctloutput(struct socket *so, struct switch (sopt->sopt_name) { case SO_REUSEADDR: INP_WLOCK(in6p); - if (IN_MULTICAST(ntohl(in6p->inp_laddr.s_addr))) { - if ((so->so_options & - (SO_REUSEADDR | SO_REUSEPORT)) != 0) - in6p->inp_flags2 |= INP_REUSEPORT; - else - in6p->inp_flags2 &= ~INP_REUSEPORT; - } + if ((so->so_options & SO_REUSEADDR) != 0) + in6p->inp_flags2 |= INP_REUSEADDR; + else + in6p->inp_flags2 &= ~INP_REUSEADDR; INP_WUNLOCK(in6p); error = 0; break; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 18:41:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C960EED; Thu, 4 Jul 2013 18:41:22 +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 6F2671888; Thu, 4 Jul 2013 18:41:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64IfMAp002037; Thu, 4 Jul 2013 18:41:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64IfLSf002033; Thu, 4 Jul 2013 18:41:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307041841.r64IfLSf002033@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 18:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252711 - in head/sys/dev/cxgbe: common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 18:41:22 -0000 Author: np Date: Thu Jul 4 18:41:21 2013 New Revision: 252711 URL: http://svnweb.freebsd.org/changeset/base/252711 Log: The T5 allows the driver to specify the ISS. Do so; use the ISS picked by the kernel. MFC after: 1 day Modified: head/sys/dev/cxgbe/common/t4_msg.h head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Thu Jul 4 18:38:00 2013 (r252710) +++ head/sys/dev/cxgbe/common/t4_msg.h Thu Jul 4 18:41:21 2013 (r252711) @@ -678,6 +678,15 @@ struct cpl_pass_accept_rpl { __be64 opt0; }; +struct cpl_t5_pass_accept_rpl { + WR_HDR; + union opcode_tid ot; + __be32 opt2; + __be64 opt0; + __be32 iss; + __be32 rsvd; +}; + struct cpl_act_open_req { WR_HDR; union opcode_tid ot; @@ -702,7 +711,7 @@ struct cpl_t5_act_open_req { __be32 local_ip; __be32 peer_ip; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; @@ -731,7 +740,7 @@ struct cpl_t5_act_open_req6 { __be64 peer_ip_hi; __be64 peer_ip_lo; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 18:38:00 2013 (r252710) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 18:41:21 2013 (r252711) @@ -247,8 +247,10 @@ calc_opt2a(struct socket *so, struct toe /* RX_COALESCE is always a valid value (M_RX_COALESCE). */ if (is_t4(sc)) opt2 |= F_RX_COALESCE_VALID; - else + else { opt2 |= F_T5_OPT_2_VALID; + opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ + } opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL @@ -392,7 +394,7 @@ t4_connect(struct toedev *tod, struct so struct cpl_t5_act_open_req6 *c5 = (void *)cpl; INIT_TP_WR(c5, 0); - c5->rsvd = 0; + c5->iss = htobe32(tp->iss); c5->params = select_ntuple(pi, toep->l2te); } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, @@ -416,7 +418,7 @@ t4_connect(struct toedev *tod, struct so struct cpl_t5_act_open_req *c5 = (void *)cpl; INIT_TP_WR(c5, 0); - c5->rsvd = 0; + c5->iss = htobe32(tp->iss); c5->params = select_ntuple(pi, toep->l2te); } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Jul 4 18:38:00 2013 (r252710) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Jul 4 18:41:21 2013 (r252711) @@ -674,6 +674,12 @@ t4_syncache_respond(struct toedev *tod, synqe->iss = be32toh(th->th_seq); synqe->ts = to.to_tsval; + if (is_t5(sc)) { + struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); + + rpl5->iss = th->th_seq; + } + e = &sc->l2t->l2tab[synqe->l2e_idx]; t4_l2t_send(sc, wr, e); @@ -1011,8 +1017,10 @@ calc_opt2p(struct adapter *sc, struct po /* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */ if (is_t4(sc)) opt2 |= F_RX_COALESCE_VALID; - else + else { opt2 |= F_T5_OPT_2_VALID; + opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ + } opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL @@ -1287,7 +1295,8 @@ do_pass_accept_req(struct sge_iq *iq, co if (synqe == NULL) REJECT_PASS_ACCEPT(); - wr = alloc_wrqe(sizeof(*rpl), &sc->sge.ctrlq[pi->port_id]); + wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : + sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[pi->port_id]); if (wr == NULL) REJECT_PASS_ACCEPT(); rpl = wrtod(wr); @@ -1328,7 +1337,13 @@ do_pass_accept_req(struct sge_iq *iq, co save_qids_in_mbuf(m, pi); get_qids_from_mbuf(m, NULL, &rxqid); - INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + if (is_t4(sc)) + INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + else { + struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; + + INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + } if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { ulp_mode = ULP_MODE_TCPDDP; synqe->flags |= TPF_SYNQE_TCPDDP; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 18:59:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 160BF5EB; Thu, 4 Jul 2013 18:59:59 +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 E2CC51937; Thu, 4 Jul 2013 18:59:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Ixwgj005894; Thu, 4 Jul 2013 18:59:58 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Ixwlp005893; Thu, 4 Jul 2013 18:59:58 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307041859.r64Ixwlp005893@svn.freebsd.org> From: Warren Block Date: Thu, 4 Jul 2013 18:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252713 - head/usr.sbin/powerd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 18:59:59 -0000 Author: wblock (doc committer) Date: Thu Jul 4 18:59:58 2013 New Revision: 252713 URL: http://svnweb.freebsd.org/changeset/base/252713 Log: Whitespace fixes: remove tabs on blank links, spaces following content, tabs after spaces. Reviewed by: gjb MFC after: 1 week Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Thu Jul 4 18:56:07 2013 (r252712) +++ head/usr.sbin/powerd/powerd.c Thu Jul 4 18:59:58 2013 (r252713) @@ -154,7 +154,7 @@ read_usage_times(int *load) error = sysctl(cp_times_mib, 2, cp_times, &cp_times_len, NULL, 0); if (error) return (error); - + if (load) { *load = 0; for (cpu = 0; cpu < ncpus; cpu++) { @@ -165,7 +165,7 @@ read_usage_times(int *load) } if (total == 0) continue; - *load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - + *load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / total; } } @@ -236,7 +236,7 @@ get_freq(void) { size_t len; int curfreq; - + len = sizeof(curfreq); if (sysctl(freq_mib, 4, &curfreq, &len, NULL, 0) != 0) { if (vflag) @@ -262,7 +262,7 @@ static int get_freq_id(int freq, int *freqs, int numfreqs) { int i = 1; - + while (i < numfreqs) { if (freqs[i] < freq) break; @@ -717,7 +717,7 @@ main(int argc, char * argv[]) idle = 0; if (set_freq(freq) != 0) { warn("error setting CPU freq %d", - freq); + freq); continue; } } @@ -730,7 +730,7 @@ main(int argc, char * argv[]) warn("read_usage_times() failed"); continue; } - + if (mode == MODE_ADAPTIVE) { if (load > cpu_running_mark) { if (load > 95 || load > cpu_running_mark * 2) @@ -741,7 +741,7 @@ main(int argc, char * argv[]) freq = freqs[0]; } else if (load < cpu_idle_mark && curfreq * load < freqs[get_freq_id( - freq * 7 / 8, freqs, numfreqs)] * + freq * 7 / 8, freqs, numfreqs)] * cpu_running_mark) { freq = freq * 7 / 8; if (freq < freqs[numfreqs - 1]) @@ -757,7 +757,7 @@ main(int argc, char * argv[]) freq = freqs[0] * 2; } else if (load < cpu_idle_mark / 2 && curfreq * load < freqs[get_freq_id( - freq * 31 / 32, freqs, numfreqs)] * + freq * 31 / 32, freqs, numfreqs)] * cpu_running_mark / 2) { freq = freq * 31 / 32; if (freq < freqs[numfreqs - 1]) From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:01:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A3F20737; Thu, 4 Jul 2013 19:01:18 +0000 (UTC) (envelope-from kib@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 9648D1947; Thu, 4 Jul 2013 19:01:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64J1Iqd007874; Thu, 4 Jul 2013 19:01:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64J1IYt007873; Thu, 4 Jul 2013 19:01:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307041901.r64J1IYt007873@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Jul 2013 19:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252714 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:01:18 -0000 Author: kib Date: Thu Jul 4 19:01:18 2013 New Revision: 252714 URL: http://svnweb.freebsd.org/changeset/base/252714 Log: The tvp vnode on rename is usually unlinked. Drop the cached null vnode for tvp to allow the free of the lower vnode, if needed. PR: kern/180236 Tested by: smh Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jul 4 18:59:58 2013 (r252713) +++ head/sys/fs/nullfs/null_vnops.c Thu Jul 4 19:01:18 2013 (r252714) @@ -554,6 +554,7 @@ null_rename(struct vop_rename_args *ap) struct vnode *fvp = ap->a_fvp; struct vnode *fdvp = ap->a_fdvp; struct vnode *tvp = ap->a_tvp; + struct null_node *tnn; /* Check for cross-device rename. */ if ((fvp->v_mount != tdvp->v_mount) || @@ -568,7 +569,11 @@ null_rename(struct vop_rename_args *ap) vrele(fvp); return (EXDEV); } - + + if (tvp != NULL) { + tnn = VTONULL(tvp); + tnn->null_flags |= NULLV_DROP; + } return (null_bypass((struct vop_generic_args *)ap)); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:03:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6EE59889; Thu, 4 Jul 2013 19:03:52 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-x232.google.com (mail-bk0-x232.google.com [IPv6:2a00:1450:4008:c01::232]) by mx1.freebsd.org (Postfix) with ESMTP id A19361957; Thu, 4 Jul 2013 19:03:51 +0000 (UTC) Received: by mail-bk0-f50.google.com with SMTP id ik8so779421bkc.9 for ; Thu, 04 Jul 2013 12:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Icyepyaol2tEDS15AwkpWqYRKjewm5+r6vPzhpOYKEI=; b=UxI96+PE8NCOufurqLOMuaSP6ewV8LlrrW6QrkeBfMc75owUBrlPqpiyIz5qwrNiXh aCGfiK+c5ufYYi355VpIVXNGpO+C4Ug/R4l1t9A5WBQFZ5OPjHdD052QvHKC0X+v77Me 93dnJvrvIZAcEAC890OQsZTpnK0MvGAq/eDzVAEDX1DEDDbmAB58tekqNTsDbP3jg5Hv 5B0inFkjk1d0/0lM4K356qGze8CCrrcJyJKK52t4qJ2gF77nvG+SSUi1kmHyGzH80jjw o+5tw+E/V+YB/jXt2S4CSAkQk7vC7dvipZXk8kxNMvL8Tq+Xr5ExpxsTYzYrsv97Jj2V Zovw== X-Received: by 10.205.32.198 with SMTP id sl6mr1299914bkb.20.1372964630543; Thu, 04 Jul 2013 12:03:50 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id rj6sm1342315bkb.12.2013.07.04.12.03.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Jul 2013 12:03:49 -0700 (PDT) Sender: Mikolaj Golub Date: Thu, 4 Jul 2013 22:03:47 +0300 From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r252710 - in head/sys: netinet netinet6 Message-ID: <20130704190345.GA12450@gmail.com> References: <201307041838.r64Ic1Ld099772@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <201307041838.r64Ic1Ld099772@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:03:52 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 04, 2013 at 06:38:01PM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Thu Jul 4 18:38:00 2013 > New Revision: 252710 > URL: http://svnweb.freebsd.org/changeset/base/252710 > > Log: > In r227207, to fix the issue with possible NULL inp_socket pointer > dereferencing, when checking for SO_REUSEPORT option (and SO_REUSEADDR > for multicast), INP_REUSEPORT flag was introduced to cache the socket > option. It was decided then that one flag would be enough to cache > both SO_REUSEPORT and SO_REUSEADDR: when processing SO_REUSEADDR > setsockopt(2), it was checked if it was called for a multicast address > and INP_REUSEPORT was set accordingly. > > Unfortunately that approach does not work when setsockopt(2) is called > before binding to a multicast address: the multicast check fails and > INP_REUSEPORT is not set. > > Fix this by adding INP_REUSEADDR flag to unconditionally cache > SO_REUSEADDR. > > PR: 179901 > Submitted by: Michael Gmelin freebsd grem.de (initial version) > Reviewed by: rwatson > MFC after: 1 week Also, in this PR another issue is reported by Michael: if SO_REUSEADDR is set for the first multicast bound socket and one tries to bind a socket to the same address:port with SO_REUSEPORT, it fails, although for multicast there should not be difference between SO_REUSEPORT and SO_REUSEADDR. This is an old issue (observed on FreeBSD7 too), but I would like to fix it. Below is a patch I am going to commit to HEAD. Though I am not going to MFC it before 9.2 unless I have strong support from people. -- Mikolaj Golub --9jxsPFA5p3P2qPhR Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="pr179901.2.1.patch" commit 7cf3a6a95d74ae91c80350fc1ae8e96fe59c3c65 Author: Mikolaj Golub Date: Sun Jun 30 00:09:20 2013 +0300 A complete duplication of binding should be allowed if on both new and duplicated sockets a multicast address is bound and either SO_REUSEPORT or SO_REUSEADDR is set. But actually it works for the following combinations: * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new; * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new; * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new; and fails for this: * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new. Fix the last case. PR: 179901 diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 3506b74..eb15a38 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -554,7 +554,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, * and a multicast address is bound on both * new and duplicated sockets. */ - if (so->so_options & SO_REUSEADDR) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (sin->sin_addr.s_addr != INADDR_ANY) { sin->sin_port = 0; /* yech... */ diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index a0a6874..fb84279 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -156,7 +156,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, * and a multicast address is bound on both * new and duplicated sockets. */ - if (so->so_options & SO_REUSEADDR) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; --9jxsPFA5p3P2qPhR-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:15:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7703DE47; Thu, 4 Jul 2013 19:15:42 +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 699031A1F; Thu, 4 Jul 2013 19:15:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64JFgQi011691; Thu, 4 Jul 2013 19:15:42 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64JFgCM011690; Thu, 4 Jul 2013 19:15:42 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307041915.r64JFgCM011690@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 19:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252715 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:15:42 -0000 Author: np Date: Thu Jul 4 19:15:41 2013 New Revision: 252715 URL: http://svnweb.freebsd.org/changeset/base/252715 Log: Ring the egress queue's doorbell as soon as there are 8 or more descriptors ready to be processed. MFC after: 1 day Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 19:01:18 2013 (r252714) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 19:15:41 2013 (r252715) @@ -1337,7 +1337,7 @@ t4_wrq_tx_locked(struct adapter *sc, str eq->pidx -= eq->cap; eq->pending += ndesc; - if (eq->pending > 16) + if (eq->pending >= 8) ring_eq_db(sc, eq); wrq->tx_wrs++; @@ -1508,8 +1508,8 @@ t4_eth_tx(struct ifnet *ifp, struct sge_ if (sgl.nsegs == 0) m_freem(m); doorbell: - if (eq->pending >= 64) - ring_eq_db(sc, eq); + if (eq->pending >= 8) + ring_eq_db(sc, eq); can_reclaim = reclaimable(eq); if (can_reclaim >= 32) From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:44:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D166759; Thu, 4 Jul 2013 19:44:31 +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 1F55A1BC1; Thu, 4 Jul 2013 19:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64JiVYl019907; Thu, 4 Jul 2013 19:44:31 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64JiUNE019906; Thu, 4 Jul 2013 19:44:30 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307041944.r64JiUNE019906@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 19:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252716 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:44:31 -0000 Author: np Date: Thu Jul 4 19:44:30 2013 New Revision: 252716 URL: http://svnweb.freebsd.org/changeset/base/252716 Log: Pay attention to TCP_NODELAY when it's set/unset after the connection is established. MFC after: 1 day Modified: head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Jul 4 19:15:41 2013 (r252715) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Jul 4 19:44:30 2013 (r252716) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_msg.h" #include "common/t4_regs.h" #include "common/t4_regs_values.h" +#include "common/t4_tcb.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -331,6 +332,30 @@ t4_pcb_detach(struct toedev *tod __unuse } /* + * setsockopt handler. + */ +static void +t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int dir, int name) +{ + struct adapter *sc = tod->tod_softc; + struct toepcb *toep = tp->t_toe; + + if (dir == SOPT_GET) + return; + + CTR4(KTR_CXGBE, "%s: tp %p, dir %u, name %u", __func__, tp, dir, name); + + switch (name) { + case TCP_NODELAY: + t4_set_tcb_field(sc, toep, 1, W_TCB_T_FLAGS, V_TF_NAGLE(1), + V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1)); + break; + default: + break; + } +} + +/* * The TOE driver will not receive any more CPLs for the tid associated with the * toepcb; release the hold on the inpcb. */ @@ -946,6 +971,7 @@ t4_tom_activate(struct adapter *sc) tod->tod_syncache_removed = t4_syncache_removed; tod->tod_syncache_respond = t4_syncache_respond; tod->tod_offload_socket = t4_offload_socket; + tod->tod_ctloutput = t4_ctloutput; for_each_port(sc, i) TOEDEV(sc->port[i]->ifp) = &td->tod; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:45:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A000B899; Thu, 4 Jul 2013 19:45:34 +0000 (UTC) (envelope-from adrian@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 921221BCD; Thu, 4 Jul 2013 19:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64JjYx3020106; Thu, 4 Jul 2013 19:45:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64JjY4w020105; Thu, 4 Jul 2013 19:45:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307041945.r64JjY4w020105@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 19:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252717 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:45:34 -0000 Author: adrian Date: Thu Jul 4 19:45:34 2013 New Revision: 252717 URL: http://svnweb.freebsd.org/changeset/base/252717 Log: Enable the station-side power management flag. It's not enabled by default in net80211 so this is a no-op unless if you enable it (ifconfig wlan0 powersave). Tested: * iwn0: mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3 TODO: * .. test on all the other NICs * See if I have to disable it during scan and such * Make it configurable live, rather than only after it's done its initial receive calibration. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Jul 4 19:44:30 2013 (r252716) +++ head/sys/dev/iwn/if_iwn.c Thu Jul 4 19:45:34 2013 (r252717) @@ -585,6 +585,7 @@ iwn_attach(device_t dev) | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ + | IEEE80211_C_PMGT /* Station-side power mgmt */ ; /* Read MAC address, channels, etc from EEPROM. */ @@ -4585,6 +4586,8 @@ iwn_collect_noise(struct iwn_softc *sc, { struct iwn_ops *ops = &sc->ops; struct iwn_calib_state *calib = &sc->calib; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; uint32_t val; int i; @@ -4623,12 +4626,9 @@ iwn_collect_noise(struct iwn_softc *sc, (void)iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1); #endif -#if 0 - /* XXX: not yet */ /* Enable power-saving mode if requested by user. */ - if (sc->sc_ic.ic_flags & IEEE80211_F_PMGTON) + if (ic->ic_flags & IEEE80211_F_PMGTON) (void)iwn_set_pslevel(sc, 0, 3, 1); -#endif } static int From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 19:47:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B612FA27; Thu, 4 Jul 2013 19:47:46 +0000 (UTC) (envelope-from tuexen@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 A89241BE0; Thu, 4 Jul 2013 19:47:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64Jlkbo020379; Thu, 4 Jul 2013 19:47:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64JlkM1020378; Thu, 4 Jul 2013 19:47:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307041947.r64JlkM1020378@svn.freebsd.org> From: Michael Tuexen Date: Thu, 4 Jul 2013 19:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252718 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:47:46 -0000 Author: tuexen Date: Thu Jul 4 19:47:46 2013 New Revision: 252718 URL: http://svnweb.freebsd.org/changeset/base/252718 Log: When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related) chunk, take always the T-bit into account, when checking the verification tag. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Jul 4 19:45:34 2013 (r252717) +++ head/sys/netinet/sctp_input.c Thu Jul 4 19:47:46 2013 (r252718) @@ -4568,8 +4568,10 @@ __attribute__((noinline)) if ((ch->chunk_type == SCTP_ABORT_ASSOCIATION) || (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) || (ch->chunk_type == SCTP_PACKET_DROPPED)) { - if ((vtag_in == asoc->my_vtag) || - ((ch->chunk_flags & SCTP_HAD_NO_TCB) && + /* Take the T-bit always into account. */ + if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && + (vtag_in == asoc->my_vtag)) || + (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:08:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4610DE33; Thu, 4 Jul 2013 20:08:43 +0000 (UTC) (envelope-from gonzo@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 373361C92; Thu, 4 Jul 2013 20:08:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64K8ga9026497; Thu, 4 Jul 2013 20:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64K8gi9026496; Thu, 4 Jul 2013 20:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307042008.r64K8gi9026496@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 4 Jul 2013 20:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252719 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:08:43 -0000 Author: gonzo Date: Thu Jul 4 20:08:42 2013 New Revision: 252719 URL: http://svnweb.freebsd.org/changeset/base/252719 Log: Add nodes for PWMSS1 and PWMSS2 Modified: head/sys/boot/fdt/dts/am335x.dtsi Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Thu Jul 4 19:47:46 2013 (r252718) +++ head/sys/boot/fdt/dts/am335x.dtsi Thu Jul 4 20:08:42 2013 (r252719) @@ -155,7 +155,7 @@ compatible = "ti,am335x-pwm"; #address-cells = <1>; #size-cells = <1>; - reg = < 0x48300000 0x100 /* PWMSS */ + reg = < 0x48300000 0x100 /* PWMSS0 */ 0x48300100 0x80 /* eCAP0 */ 0x48300180 0x80 /* eQEP0 */ 0x48300200 0x60 /* ePWM0 */ @@ -165,6 +165,34 @@ pwm-device-id = <0>; }; + pwm@48302000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48302000 0x100 /* PWMSS1 */ + 0x48302100 0x80 /* eCAP1 */ + 0x48302180 0x80 /* eQEP1 */ + 0x48302200 0x60 /* ePWM1 */ + >; + interrupts = <87 59>; /* ePWM1INT, ePWM1_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <1>; + }; + + pwm@48304000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48304000 0x100 /* PWMSS2 */ + 0x48304100 0x80 /* eCAP2 */ + 0x48304180 0x80 /* eQEP2 */ + 0x48304200 0x60 /* ePWM2 */ + >; + interrupts = <88 60>; /* ePWM2INT, ePWM2_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <2>; + }; + lcd: lcd@4830e000 { #address-cells = <1>; #size-cells = <0>; From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:10:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FA26FF2; Thu, 4 Jul 2013 20:10:35 +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 10B291CA6; Thu, 4 Jul 2013 20:10:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KAYER026882; Thu, 4 Jul 2013 20:10:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KAYqB026877; Thu, 4 Jul 2013 20:10:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042010.r64KAYqB026877@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 20:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252720 - in head/contrib/llvm: include/llvm/CodeGen lib/CodeGen lib/CodeGen/SelectionDAG X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:10:35 -0000 Author: dim Date: Thu Jul 4 20:10:33 2013 New Revision: 252720 URL: http://svnweb.freebsd.org/changeset/base/252720 Log: Pull in r185594 from llvm trunk: Add MachineBasicBlock::addLiveIn(). This function adds a live-in physical register to an MBB and ensures that it is copied to a virtual register immediately. Pull in r185615 from llvm trunk: Live-in copies go *after* EH_LABELs. This will soon be tested by exception handling working at all. Pull in r185617 from llvm trunk: Simplify landing pad lowering. Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering landing pad arguments. These nodes were previously legalized into CopyFromReg nodes, but that never worked properly because the CopyFromReg node weren't guaranteed to be scheduled at the top of the basic block. This meant the exception pointer and selector registers could be clobbered before being copied to a virtual register. This patch copies the two physical registers to virtual registers at the beginning of the basic block, and lowers the landingpad instruction directly to two CopyFromReg nodes reading the *virtual* registers. This is safe because virtual registers don't get clobbered. A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION nodes. Together, these changes fix llvm PR 16038 ('qt4 webcore file results in "Bad machine code: Using an undefined physical register"'), and should make it possible again to compile the www/qt4-webkit port again on the i386 arch, without using a CPUTYPE=i686 or higher setting. Modified: head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Thu Jul 4 20:08:42 2013 (r252719) +++ head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Thu Jul 4 20:10:33 2013 (r252720) @@ -115,6 +115,11 @@ public: /// there's no other convenient place for it to live right now. std::vector > PHINodesToUpdate; + /// If the current MBB is a landing pad, the exception pointer and exception + /// selector registers are copied into these virtual registers by + /// SelectionDAGISel::PrepareEHLandingPad(). + unsigned ExceptionPointerVirtReg, ExceptionSelectorVirtReg; + explicit FunctionLoweringInfo(const TargetLowering &TLI); /// set - Initialize this FunctionLoweringInfo with the given Function Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Thu Jul 4 20:08:42 2013 (r252719) +++ head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Thu Jul 4 20:10:33 2013 (r252720) @@ -296,6 +296,11 @@ public: /// is an error to add the same register to the same set more than once. void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); } + /// Add PhysReg as live in to this block, and ensure that there is a copy of + /// PhysReg to a virtual register of class RC. Return the virtual register + /// that is a copy of the live in PhysReg. + unsigned addLiveIn(unsigned PhysReg, const TargetRegisterClass *RC); + /// removeLiveIn - Remove the specified register from the live in set. /// void removeLiveIn(unsigned Reg); Modified: head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Thu Jul 4 20:08:42 2013 (r252719) +++ head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Thu Jul 4 20:10:33 2013 (r252720) @@ -19,6 +19,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SlotIndexes.h" @@ -341,6 +342,38 @@ bool MachineBasicBlock::isLiveIn(unsigne return I != livein_end(); } +unsigned +MachineBasicBlock::addLiveIn(unsigned PhysReg, const TargetRegisterClass *RC) { + assert(getParent() && "MBB must be inserted in function"); + assert(TargetRegisterInfo::isPhysicalRegister(PhysReg) && "Expected physreg"); + assert(RC && "Register class is required"); + assert((isLandingPad() || this == &getParent()->front()) && + "Only the entry block and landing pads can have physreg live ins"); + + bool LiveIn = isLiveIn(PhysReg); + iterator I = SkipPHIsAndLabels(begin()), E = end(); + MachineRegisterInfo &MRI = getParent()->getRegInfo(); + const TargetInstrInfo &TII = *getParent()->getTarget().getInstrInfo(); + + // Look for an existing copy. + if (LiveIn) + for (;I != E && I->isCopy(); ++I) + if (I->getOperand(1).getReg() == PhysReg) { + unsigned VirtReg = I->getOperand(0).getReg(); + if (!MRI.constrainRegClass(VirtReg, RC)) + llvm_unreachable("Incompatible live-in register class."); + return VirtReg; + } + + // No luck, create a virtual register. + unsigned VirtReg = MRI.createVirtualRegister(RC); + BuildMI(*this, I, DebugLoc(), TII.get(TargetOpcode::COPY), VirtReg) + .addReg(PhysReg, RegState::Kill); + if (!LiveIn) + addLiveIn(PhysReg); + return VirtReg; +} + void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) { getParent()->splice(NewAfter, this); } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Jul 4 20:08:42 2013 (r252719) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Jul 4 20:10:33 2013 (r252720) @@ -1910,33 +1910,25 @@ void SelectionDAGBuilder::visitLandingPa SmallVector ValueVTs; ComputeValueVTs(TLI, LP.getType(), ValueVTs); + assert(ValueVTs.size() == 2 && "Only two-valued landingpads are supported"); - // Insert the EXCEPTIONADDR instruction. - assert(FuncInfo.MBB->isLandingPad() && - "Call to eh.exception not in landing pad!"); - SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); + // Get the two live-in registers as SDValues. The physregs have already been + // copied into virtual registers. SDValue Ops[2]; - Ops[0] = DAG.getRoot(); - SDValue Op1 = DAG.getNode(ISD::EXCEPTIONADDR, getCurDebugLoc(), VTs, Ops, 1); - SDValue Chain = Op1.getValue(1); - - // Insert the EHSELECTION instruction. - VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); - Ops[0] = Op1; - Ops[1] = Chain; - SDValue Op2 = DAG.getNode(ISD::EHSELECTION, getCurDebugLoc(), VTs, Ops, 2); - Chain = Op2.getValue(1); - Op2 = DAG.getSExtOrTrunc(Op2, getCurDebugLoc(), MVT::i32); + Ops[0] = DAG.getZExtOrTrunc( + DAG.getCopyFromReg(DAG.getEntryNode(), getCurDebugLoc(), + FuncInfo.ExceptionPointerVirtReg, TLI.getPointerTy()), + getCurDebugLoc(), ValueVTs[0]); + Ops[1] = DAG.getZExtOrTrunc( + DAG.getCopyFromReg(DAG.getEntryNode(), getCurDebugLoc(), + FuncInfo.ExceptionSelectorVirtReg, TLI.getPointerTy()), + getCurDebugLoc(), ValueVTs[1]); - Ops[0] = Op1; - Ops[1] = Op2; + // Merge into one. SDValue Res = DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(), DAG.getVTList(&ValueVTs[0], ValueVTs.size()), &Ops[0], 2); - - std::pair RetPair = std::make_pair(Res, Chain); - setValue(&LP, RetPair.first); - DAG.setRoot(RetPair.second); + setValue(&LP, Res); } /// handleSmallSwitchCaseRange - Emit a series of specific tests (suitable for Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 4 20:08:42 2013 (r252719) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 4 20:10:33 2013 (r252720) @@ -827,12 +827,13 @@ void SelectionDAGISel::PrepareEHLandingP .addSym(Label); // Mark exception register as live in. - unsigned Reg = TLI.getExceptionPointerRegister(); - if (Reg) MBB->addLiveIn(Reg); + const TargetRegisterClass *PtrRC = TLI.getRegClassFor(TLI.getPointerTy()); + if (unsigned Reg = TLI.getExceptionPointerRegister()) + FuncInfo->ExceptionPointerVirtReg = MBB->addLiveIn(Reg, PtrRC); // Mark exception selector register as live in. - Reg = TLI.getExceptionSelectorRegister(); - if (Reg) MBB->addLiveIn(Reg); + if (unsigned Reg = TLI.getExceptionSelectorRegister()) + FuncInfo->ExceptionSelectorVirtReg = MBB->addLiveIn(Reg, PtrRC); } /// isFoldedOrDeadInstruction - Return true if the specified instruction is @@ -970,6 +971,8 @@ void SelectionDAGISel::SelectAllBasicBlo FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); // Setup an EH landing-pad block. + FuncInfo->ExceptionPointerVirtReg = 0; + FuncInfo->ExceptionSelectorVirtReg = 0; if (FuncInfo->MBB->isLandingPad()) PrepareEHLandingPad(); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:12:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 212FD1C0; Thu, 4 Jul 2013 20:12:15 +0000 (UTC) (envelope-from dteske@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 01B1D1CB3; Thu, 4 Jul 2013 20:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KCEjh028809; Thu, 4 Jul 2013 20:12:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KCDqe028796; Thu, 4 Jul 2013 20:12:13 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307042012.r64KCDqe028796@svn.freebsd.org> From: Devin Teske Date: Thu, 4 Jul 2013 20:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252721 - head/usr.sbin/bsdconfig/share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:12:15 -0000 Author: dteske Date: Thu Jul 4 20:12:12 2013 New Revision: 252721 URL: http://svnweb.freebsd.org/changeset/base/252721 Log: Implement $probe_only for the media access modules. sysinstall(8) was allowed to ignore the probe_only argument of its member functions solely because in the C language, the file accessor methods open and return a file descriptor and reading of the data is optional. In shell, the file accessor methods return data on stdout and that data should not be ignored (large files could block execution). So, we must adhere to the probe_only flags and in some cases (in the case of FTP, for example) change the `get' strategy to simply test existence and return an appropriate status. This was required because the up-coming package management stuff makes heavy use of the probe_only argument to try different package suffixes. Every media access module must implement $probe_only for the `get' accessor. Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/common.subr head/usr.sbin/bsdconfig/share/media/directory.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/ufs.subr head/usr.sbin/bsdconfig/share/media/usb.subr Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -146,8 +146,8 @@ f_media_init_cdrom() # f_media_get_cdrom $device $file [$probe_only] # -# Returns data from $file on a mounted CDROM device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# Returns data from $file on a mounted CDROM device. Similar to cat(1). If +# $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_cdrom() { @@ -156,7 +156,7 @@ f_media_get_cdrom() f_dprintf "f_media_get_cdrom: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_cdrom $device Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/common.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -83,16 +83,18 @@ f_media_verify() f_struct device_media || f_media_get_type } -# f_media_generic_get $base $file +# f_media_generic_get $base $file [$probe_only] # -# A generic open which follows a well-known "path" of places to look. +# A generic open which follows a well-known "path" of places to look. If +# $probe_only is present and non-NULL, returns success if $file exists. # f_media_generic_get() { - local base="$1" file="$2" + local base="$1" file="$2" probe_only="$3" local fname=f_media_generic_get - f_dprintf "%s: base=[%s] files=[%s]" $fname "$base" "$file" + f_dprintf "%s: base=[%s] files=[%s] probe_only=%s" \ + $fname "$base" "$file" "$probe_only" local rel path f_getvar $VAR_RELNAME rel @@ -104,10 +106,19 @@ f_media_generic_get() ; do if [ -f "$path" -a -r "$path" ]; then f_dprintf "%s: file exists path=[%s]" $fname "$path" + [ "$probe_only" ] && return $SUCCESS cat "$path" return fi done + + path="$base/releases/$rel/$file" # Final path to try + if [ -f "$path" -a -r "$path" ]; then + f_dprintf "%s: file exists path=[%s]" $fname "$path" + [ "$probe_only" ] && return $SUCCESS + elif [ "$probe_only" ]; then + return $FAILURE + fi cat "$base/releases/$rel/$file" # Final path to try } Modified: head/usr.sbin/bsdconfig/share/media/directory.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/directory.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/directory.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -117,7 +117,8 @@ f_media_init_directory() # f_media_get_directory $device $file [$probe_only] # # Returns data from $file in the existing/current filesystem. Similar to -# cat(1). $probe_only is currently unused by this media type. +# cat(1). If $probe_only is present and non-NULL, returns success if $file +# exists. # f_media_get_directory() { @@ -127,7 +128,7 @@ f_media_get_directory() "$dev" "$file" "$probe_only" device_$dev get private path - f_media_generic_get "$path" "$file" + f_media_generic_get "$path" "$file" "$probe_only" } # f_media_shutdown_directory $device Modified: head/usr.sbin/bsdconfig/share/media/dos.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/dos.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/dos.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -125,7 +125,7 @@ f_media_init_dos() # f_media_get_dos $device $file [$probe_only] # # Returns data from $file on a mounted DOS partition device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# If $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_dos() { @@ -134,7 +134,7 @@ f_media_get_dos() f_dprintf "f_media_get_dos: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_dos $device Modified: head/usr.sbin/bsdconfig/share/media/floppy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/floppy.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/floppy.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -178,6 +178,8 @@ f_media_get_floppy() f_media_init_floppy "$dev" || return $FAILURE nretries=$(( $nretries - 1 )) done + elif [ "$probe_only" ]; then + return $SUCCESS fi cat "$fp" } Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -792,8 +792,8 @@ f_media_init_ftp() # # Returns data from $file on an FTP server using ftp(1). Please note that # $device is unused but must be present (even if null). Information is instead -# gathered from the environment. $probe_only is currently unused by this media -# type. +# gathered from the environment. If $probe_only is present and non-NULL, +# returns success if $file exists. # # Variables from variable.subr used to configure the connection are as follows # (all of which are configured by f_media_set_ftp above): @@ -900,6 +900,17 @@ f_media_get_ftp() f_dprintf "sending ftp request for: %s" "ftp://$host$port/$dir/$file" + if [ "$probe_only" ]; then + local url="ftp://$userpass$host$port/$dir/$file" + [ "$use_anon" ] && url="ftp://$host$port/$dir/$file" + if ! size=$( fetch -s "$url" 2>&1 ) || ! f_isinteger "$size" + then + f_dprintf "request failed! size response=[%s]" "$size" + return $FAILURE + fi + return $SUCCESS + fi + eval FTPMODE=\"\$mode\" ${use_anon:+FTPANONPASS=\"\$pass\"} \ ftp -V ${use_anon:+-a} -o - \ \"ftp://\$userpass\$host\$port/\$dir/\$file\" 2> /dev/null Modified: head/usr.sbin/bsdconfig/share/media/nfs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/nfs.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/nfs.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -210,8 +210,8 @@ f_media_init_nfs() # f_media_get_nfs $device $file [$probe_only] # -# Returns data from $file on a mounted NFS device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# Returns data from $file on a mounted NFS device. Similar to cat(1). If +# $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_nfs() { @@ -220,7 +220,7 @@ f_media_get_nfs() f_dprintf "f_media_get_nfs: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_nfs $device Modified: head/usr.sbin/bsdconfig/share/media/ufs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ufs.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/ufs.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -155,7 +155,7 @@ f_media_init_ufs() # f_media_get_ufs $device $file [$probe_only] # # Returns data from $file on a mounted UFS partition device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# If $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_ufs() { @@ -164,7 +164,7 @@ f_media_get_ufs() f_dprintf "f_media_get_ufs: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_ufs $device Modified: head/usr.sbin/bsdconfig/share/media/usb.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/usb.subr Thu Jul 4 20:10:33 2013 (r252720) +++ head/usr.sbin/bsdconfig/share/media/usb.subr Thu Jul 4 20:12:12 2013 (r252721) @@ -135,7 +135,7 @@ f_media_init_usb() # f_media_get_usb $device $file [$probe_only] # # Returns data from $file on a mounted USB disk device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# If $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_usb() { @@ -144,7 +144,7 @@ f_media_get_usb() f_dprintf "f_media_get_usb: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_usb $device From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:13:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EA2A30F; Thu, 4 Jul 2013 20:13:23 +0000 (UTC) (envelope-from gonzo@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 300551CC4; Thu, 4 Jul 2013 20:13:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KDNPa029025; Thu, 4 Jul 2013 20:13:23 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KDN85029024; Thu, 4 Jul 2013 20:13:23 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307042013.r64KDN85029024@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 4 Jul 2013 20:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252722 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:13:23 -0000 Author: gonzo Date: Thu Jul 4 20:13:22 2013 New Revision: 252722 URL: http://svnweb.freebsd.org/changeset/base/252722 Log: Add support for ePWM submodule of PWMSS ePWM is controlled by sysctl nodes dev.am335x_pwm.N.period, dev.am335x_pwm.N.dutyA and dev.am335x_pwm.N.dutyB that controls PWM period and duty cycles for channels A and B respectively. Period and duty cycle are measured in clock ticks. Default clock frequency for AM335x PWM subsystem is 100MHz Modified: head/sys/arm/ti/am335x/am335x_pwm.c Modified: head/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pwm.c Thu Jul 4 20:12:12 2013 (r252721) +++ head/sys/arm/ti/am335x/am335x_pwm.c Thu Jul 4 20:13:22 2013 (r252722) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -50,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include "am335x_pwm.h" #include "am335x_scm.h" +/* In ticks */ +#define DEFAULT_PWM_PERIOD 1000 + #define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ @@ -96,15 +100,24 @@ static struct resource_spec am335x_pwm_m #define ECCTL2_TSCTRSTOP_FREERUN (1 << 4) #define EPWM_TBCTL 0x00 +#define TBCTL_FREERUN (2 << 14) #define TBCTL_PHDIR_UP (1 << 13) #define TBCTL_PHDIR_DOWN (0 << 13) #define TBCTL_CLKDIV(x) ((x) << 10) +#define TBCTL_CLKDIV_MASK (3 << 10) #define TBCTL_HSPCLKDIV(x) ((x) << 7) +#define TBCTL_HSPCLKDIV_MASK (3 << 7) #define TBCTL_SYNCOSEL_DISABLED (3 << 4) #define TBCTL_PRDLD_SHADOW (0 << 3) #define TBCTL_PRDLD_IMMEDIATE (0 << 3) #define TBCTL_PHSEN_ENABLED (1 << 2) #define TBCTL_PHSEN_DISABLED (0 << 2) +#define TBCTL_CTRMODE_MASK (3) +#define TBCTL_CTRMODE_UP (0 << 0) +#define TBCTL_CTRMODE_DOWN (1 << 0) +#define TBCTL_CTRMODE_UPDOWN (2 << 0) +#define TBCTL_CTRMODE_FREEZE (3 << 0) + #define EPWM_TBSTS 0x02 #define EPWM_TBPHSHR 0x04 #define EPWM_TBPHS 0x06 @@ -130,10 +143,14 @@ static struct resource_spec am335x_pwm_m /* CMPCTL_LOADAMODE_ZERO */ #define EPWM_AQCTLA 0x16 #define EPWM_AQCTLB 0x18 -#define AQCTL_CAU_NONE (0 << 0) -#define AQCTL_CAU_CLEAR (1 << 0) -#define AQCTL_CAU_SET (2 << 0) -#define AQCTL_CAU_TOGGLE (3 << 0) +#define AQCTL_CBU_NONE (0 << 8) +#define AQCTL_CBU_CLEAR (1 << 8) +#define AQCTL_CBU_SET (2 << 8) +#define AQCTL_CBU_TOGGLE (3 << 8) +#define AQCTL_CAU_NONE (0 << 4) +#define AQCTL_CAU_CLEAR (1 << 4) +#define AQCTL_CAU_SET (2 << 4) +#define AQCTL_CAU_TOGGLE (3 << 4) #define AQCTL_ZRO_NONE (0 << 0) #define AQCTL_ZRO_CLEAR (1 << 0) #define AQCTL_ZRO_SET (2 << 0) @@ -141,6 +158,15 @@ static struct resource_spec am335x_pwm_m #define EPWM_AQSFRC 0x1a #define EPWM_AQCSFRC 0x1c +/* Trip-Zone module */ +#define EPWM_TZCTL 0x28 +#define EPWM_TZFLG 0x2C +/* High-Resolution PWM */ +#define EPWM_HRCTL 0x40 +#define HRCTL_DELMODE_BOTH 3 +#define HRCTL_DELMODE_FALL 2 +#define HRCTL_DELMODE_RISE 1 + static device_probe_t am335x_pwm_probe; static device_attach_t am335x_pwm_attach; static device_detach_t am335x_pwm_detach; @@ -150,6 +176,13 @@ struct am335x_pwm_softc { struct mtx sc_mtx; struct resource *sc_mem_res[4]; int sc_id; + /* sysctl for configuration */ + struct sysctl_oid *sc_period_oid; + struct sysctl_oid *sc_chanA_oid; + struct sysctl_oid *sc_chanB_oid; + uint32_t sc_pwm_period; + uint32_t sc_pwm_dutyA; + uint32_t sc_pwm_dutyB; }; static device_method_t am335x_pwm_methods[] = { @@ -209,6 +242,71 @@ am335x_pwm_config_ecas(int unit, int per } static int +am335x_pwm_sysctl_duty(SYSCTL_HANDLER_ARGS) +{ + struct am335x_pwm_softc *sc = (struct am335x_pwm_softc*)arg1; + int error; + uint32_t duty; + + if (oidp == sc->sc_chanA_oid) + duty = sc->sc_pwm_dutyA; + else + duty = sc->sc_pwm_dutyB; + error = sysctl_handle_int(oidp, &duty, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + if (duty > sc->sc_pwm_period) { + device_printf(sc->sc_dev, "Duty cycle can't be greater then period\n"); + return (EINVAL); + } + + PWM_LOCK(sc); + if (oidp == sc->sc_chanA_oid) { + sc->sc_pwm_dutyA = duty; + EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); + } + else { + sc->sc_pwm_dutyB = duty; + EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); + } + PWM_UNLOCK(sc); + + return (error); +} + +static int +am335x_pwm_sysctl_period(SYSCTL_HANDLER_ARGS) +{ + struct am335x_pwm_softc *sc = (struct am335x_pwm_softc*)arg1; + int error; + uint32_t period; + + period = sc->sc_pwm_period; + error = sysctl_handle_int(oidp, &period, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + + if (period < 1) + return (EINVAL); + + if ((period < sc->sc_pwm_dutyA) || (period < sc->sc_pwm_dutyB)) { + device_printf(sc->sc_dev, "Period can't be less then duty cycle\n"); + return (EINVAL); + } + + + PWM_LOCK(sc); + sc->sc_pwm_period = period; + EPWM_WRITE2(sc, EPWM_TBPRD, period - 1); + PWM_UNLOCK(sc); + + return (error); +} + +static int am335x_pwm_probe(device_t dev) { if (!ofw_bus_is_compatible(dev, "ti,am335x-pwm")) @@ -227,6 +325,8 @@ am335x_pwm_attach(device_t dev) uint32_t reg; phandle_t node; pcell_t did; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -252,6 +352,47 @@ am335x_pwm_attach(device_t dev) reg |= (1 << sc->sc_id); ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); + /* Init backlight interface */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree = device_get_sysctl_tree(sc->sc_dev); + + sc->sc_period_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "period", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_pwm_sysctl_period, "I", "PWM period"); + + sc->sc_chanA_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "dutyA", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_pwm_sysctl_duty, "I", "Channel A duty cycles"); + + sc->sc_chanB_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "dutyB", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_pwm_sysctl_duty, "I", "Channel B duty cycles"); + + + /* CONFIGURE EPWM1 */ + reg = EPWM_READ2(sc, EPWM_TBCTL); + reg &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); + EPWM_WRITE2(sc, EPWM_TBCTL, reg); + + sc->sc_pwm_period = DEFAULT_PWM_PERIOD; + sc->sc_pwm_dutyA = 0; + sc->sc_pwm_dutyB = 0; + + EPWM_WRITE2(sc, EPWM_TBPRD, sc->sc_pwm_period - 1); + EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); + EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); + + EPWM_WRITE2(sc, EPWM_AQCTLA, (AQCTL_ZRO_SET | AQCTL_CAU_CLEAR)); + EPWM_WRITE2(sc, EPWM_AQCTLB, (AQCTL_ZRO_SET | AQCTL_CBU_CLEAR)); + + /* START EPWM */ + reg &= ~TBCTL_CTRMODE_MASK; + reg |= TBCTL_CTRMODE_UP | TBCTL_FREERUN; + EPWM_WRITE2(sc, EPWM_TBCTL, reg); + + EPWM_WRITE2(sc, EPWM_TZCTL, 0xf); + reg = EPWM_READ2(sc, EPWM_TZFLG); + return (0); fail: PWM_LOCK_DESTROY(sc); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:17:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C912A4F0; Thu, 4 Jul 2013 20:17:12 +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 B789D1CE6; Thu, 4 Jul 2013 20:17:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KHCO0029565; Thu, 4 Jul 2013 20:17:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KH9gQ029542; Thu, 4 Jul 2013 20:17:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042017.r64KH9gQ029542@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 20:17: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: r252723 - in stable/9: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:17:12 -0000 Author: dim Date: Thu Jul 4 20:17:04 2013 New Revision: 252723 URL: http://svnweb.freebsd.org/changeset/base/252723 Log: Merge clang 3.3 release and various fixes: r241214, r246705, r248548, r249423, r249817, r250217, r250593, r250616, r250997, r251216, r251662, r251761, r251785, r251790, r252039. MFC r241214 (by jkim): Do not install incomplete unwind.h from clang. This header file was meant to be a wrapper for the canonical system header file. Unfortunately, we do not have one (yet) and some times it is causing weird failures when clang is used for building ports. More complete and correct file will come from libcxxrt in the future. Discussed with: dim, kib, theraven MFC r246705 (by andrew): Allow us to build clang for ARM EABI. Clang and llvm use the arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or armv6 and are building for EABI. Reviewed by: dim MFC r248548 (by andrew): Pull in r177252 from upstream clang trunk: Make sure to use same EABI version for external assembler as for integrated as. This allows us to use gcc on a world built with clang on ARM. MFC r249423: Upgrade our copy of llvm/clang to trunk r178860, in preparation of the upcoming 3.3 release (branching and freezing expected in a few weeks). Preliminary release notes can be found at the usual location: An MFC is planned once the actual 3.3 release is finished. MFC r249817: Pull in r180121 from upstream llvm trunk: LoopVectorizer: Fix 15830. When scalarizing and unrolling stores make sure that the order in which the elements are scalarized is the same as the original order. This fixes a miscompilation in FreeBSD's regex library. This should fix lib/libc/regex/regcomp.c at -O3 with clang 3.3 r178860 on CPUs with SSE. Before this change, the vectorizer could incorrectly rearrange the second loop in computejumps(), leading to possibly invalid entries in the re_gets::charjump table. The net result was that for example "sed s/@CC@/foo/" failed to work correctly, leading to trouble with many configure scripts. MFC r250217: Allow building clang on older FreeBSD releases, where log2() does not exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone MFC r250593: Pull in r181286 from upstream llvm trunk: LoopVectorize: getConsecutiveVector must respect signed arithmetic We were passing an i32 to ConstantInt::get where an i64 was needed and we must also pass the sign if we pass negatives numbers. The start index passed to getConsecutiveVector must also be signed. Should fix PR15882. This should fix Firefox crashes some people have been reporting, when it is compiled with -O3. MFC r250616: Use an ugly hack to get around bootstrapping problems when building clang on head between r239347 and r245428. The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id for the clock_gettime() function and friends, but it was only added in , not in . Any program including would therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the value of _POSIX_CPUTIME indicates its existence. The latter revision synchronized the defines again. Work around this problem by defining the id on the command line for the particular .cpp file that needs it. If the id ever changes value, this hack will need to be updated. MFC r250997: Pull in r182656 from upstream llvm trunk: LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases. Fixes PR16139. This should fix clang assertion failures when optimizing at -O3, similar to: Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"), function canVectorize, file contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171. Reported by: O. Hartmann PR: ports/178332, ports/178977 MFC r251216 (by ed): Pull in r183033 and r183036 from LLVM trunk: Add support for optimized (non-generic) atomic libcalls. For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc) provide atomic functions that pass parameters by value and return results directly. libgcc and libcompiler-rt only provide optimized libcalls for __atomic_fetch_*, as generic libcalls on non-integer types would make little sense. This means that we can finally make __atomic_fetch_* work on architectures for which we don't provide these operations as builtins (e.g. ARM). This should fix the dreaded "cannot compile this atomic library call yet" error that would pop up once every while. This should make it possible for me to get C11 atomics working on all of our platforms. MFC r251662: Upgrade our copy of llvm/clang to 3.3 release. Release notes are still in the works, these will follow soon. MFC r251761: Pull in r181620 from llvm trunk: [ms-inline asm] Fix a crasher when we fail on a direct match. The issue was that the MatchingInlineAsm and VariantID args to the MatchInstructionImpl function weren't being set properly. Specifically, when parsing intel syntax, the parser thought it was parsing inline assembly in the at&t dialect; that will never be the case. The crash was caused when the emitter tried to emit the instruction, but the operands weren't set. When parsing inline assembly we only set the opcode, not the operands, which is used to lookup the instruction descriptor. rdar://13854391 and PR15945 Also, this commit reverts r176036. Now that we're correctly parsing the intel syntax the pushad/popad don't match properly. I've reimplemented that fix using a MnemonicAlias. Pull in r183907 from llvm trunk: X86: Make the cmov aliases work with intel syntax too. These commits make a number of Intel-style inline assembly mnemonics aliases (occurring in several ports) work properly, which could cause assertions otherwise. Reported by: kwm, bapt MFC r251785 (by ed) Pull in r184040 from upstream clang trunk: Emit native implementations of atomic operations on FreeBSD/armv6. Just like on Linux, FreeBSD/armv6 assumes the system supports ldrex/strex unconditionally. It is also used by the kernel. We can therefore enable support for it, like we do on Linux. While there, change one of the unit tests to explicitly test against armv5 instead of armv7, as it actually tests whether libcalls are emitted. MFC r251790 (by andrew): Pull in r183926 from LLVM trunk: Allow clang to build __clear_cache on ARM. __clear_cache is special. It needs no signature, but is a real function in compiler_rt or libgcc. Patch by Andrew Turner. This allows us to build the __clear_cache function in compiler-rt. MFC r252039: Pull in r183984 from llvm trunk: Make PrologEpilogInserter save/restore all callee saved registers in functions which call __builtin_unwind_init() __builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh. Goes part of the way toward fixing PR8541. This obsoletes the ugly hack to libgcc's unwind code from r245272, and should also work for other arches, so revert the hack too. Added: stable/9/contrib/llvm/include/llvm/ADT/None.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/ADT/None.h stable/9/contrib/llvm/include/llvm/ADT/SparseMultiSet.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/ADT/SparseMultiSet.h stable/9/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h stable/9/contrib/llvm/include/llvm/Analysis/CallPrinter.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/CallPrinter.h stable/9/contrib/llvm/include/llvm/Analysis/PtrUseVisitor.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/PtrUseVisitor.h stable/9/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/DAGCombine.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/DAGCombine.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveRegMatrix.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/LiveRegMatrix.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h - copied, changed from r249423, head/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDFS.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/ScheduleDFS.h stable/9/contrib/llvm/include/llvm/CodeGen/VirtRegMap.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/VirtRegMap.h stable/9/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h - copied, changed from r249423, head/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h stable/9/contrib/llvm/include/llvm/IR/ - copied from r249423, head/contrib/llvm/include/llvm/IR/ stable/9/contrib/llvm/include/llvm/IRReader/ - copied from r249423, head/contrib/llvm/include/llvm/IRReader/ stable/9/contrib/llvm/include/llvm/InstVisitor.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/InstVisitor.h stable/9/contrib/llvm/include/llvm/LinkAllIR.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/LinkAllIR.h stable/9/contrib/llvm/include/llvm/MC/MCELF.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/MC/MCELF.h stable/9/contrib/llvm/include/llvm/MC/MCELFStreamer.h - copied, changed from r249423, head/contrib/llvm/include/llvm/MC/MCELFStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCInstBuilder.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/MC/MCInstBuilder.h stable/9/contrib/llvm/include/llvm/Option/ - copied from r249423, head/contrib/llvm/include/llvm/Option/ stable/9/contrib/llvm/include/llvm/Support/ArrayRecycler.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ArrayRecycler.h stable/9/contrib/llvm/include/llvm/Support/CBindingWrapping.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/Support/CBindingWrapping.h stable/9/contrib/llvm/include/llvm/Support/Compression.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/Support/Compression.h stable/9/contrib/llvm/include/llvm/Support/ConvertUTF.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ConvertUTF.h stable/9/contrib/llvm/include/llvm/Support/ErrorOr.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ErrorOr.h stable/9/contrib/llvm/include/llvm/Support/Watchdog.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/Watchdog.h stable/9/contrib/llvm/include/llvm/Support/YAMLTraits.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/YAMLTraits.h stable/9/contrib/llvm/include/llvm/Target/CostTable.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Target/CostTable.h stable/9/contrib/llvm/include/llvm/Transforms/ObjCARC.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Transforms/ObjCARC.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h - copied, changed from r249423, head/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h stable/9/contrib/llvm/lib/Analysis/IPA/CallPrinter.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/IPA/CallPrinter.cpp stable/9/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp stable/9/contrib/llvm/lib/Analysis/PtrUseVisitor.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/PtrUseVisitor.cpp stable/9/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp stable/9/contrib/llvm/lib/CodeGen/ErlangGC.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/ErlangGC.cpp stable/9/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp stable/9/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp - copied, changed from r249423, head/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp stable/9/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.cpp - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.h - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.h stable/9/contrib/llvm/lib/DebugInfo/DWARFRelocMap.h - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFRelocMap.h stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp - copied, changed from r249423, head/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp stable/9/contrib/llvm/lib/IR/ - copied from r249423, head/contrib/llvm/lib/IR/ stable/9/contrib/llvm/lib/IRReader/ - copied from r249423, head/contrib/llvm/lib/IRReader/ stable/9/contrib/llvm/lib/Option/ - copied from r249423, head/contrib/llvm/lib/Option/ stable/9/contrib/llvm/lib/Support/Compression.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Support/Compression.cpp stable/9/contrib/llvm/lib/Support/ConvertUTF.c - copied unchanged from r249423, head/contrib/llvm/lib/Support/ConvertUTF.c stable/9/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp stable/9/contrib/llvm/lib/Support/Unix/Watchdog.inc - copied unchanged from r249423, head/contrib/llvm/lib/Support/Unix/Watchdog.inc stable/9/contrib/llvm/lib/Support/Watchdog.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/Watchdog.cpp stable/9/contrib/llvm/lib/Support/Windows/Watchdog.inc - copied unchanged from r249423, head/contrib/llvm/lib/Support/Windows/Watchdog.inc stable/9/contrib/llvm/lib/Support/YAMLTraits.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/YAMLTraits.cpp stable/9/contrib/llvm/lib/Target/AArch64/ - copied from r249423, head/contrib/llvm/lib/Target/AArch64/ stable/9/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/LICENSE.TXT - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/LICENSE.TXT stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOp.h - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOp.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.h stable/9/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsOs16.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsOs16.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsOs16.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsOs16.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp stable/9/contrib/llvm/lib/Target/PowerPC/AsmParser/ - copied from r251662, head/contrib/llvm/lib/Target/PowerPC/AsmParser/ stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/R600/ - copied from r249423, head/contrib/llvm/lib/Target/R600/ stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUELFObjectWriter.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/R600/R600Packetizer.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/R600Packetizer.cpp stable/9/contrib/llvm/lib/Target/R600/SIDefines.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/SIDefines.h stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h stable/9/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td - copied, changed from r249423, head/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td stable/9/contrib/llvm/lib/Target/SystemZ/ - copied from r251662, head/contrib/llvm/lib/Target/SystemZ/ stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp stable/9/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp stable/9/contrib/llvm/lib/Target/X86/X86SchedHaswell.td - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86SchedHaswell.td stable/9/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td stable/9/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/Disassembler/ - copied from r249423, head/contrib/llvm/lib/Target/XCore/Disassembler/ stable/9/contrib/llvm/lib/Target/XCore/InstPrinter/ - copied from r249423, head/contrib/llvm/lib/Target/XCore/InstPrinter/ stable/9/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.h stable/9/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ - copied from r249423, head/contrib/llvm/lib/Transforms/ObjCARC/ stable/9/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h stable/9/contrib/llvm/tools/clang/include/clang/AST/AttrIterator.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/AttrIterator.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.td - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.td stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def - copied, changed from r251662, head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/CommentOptions.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/CommentOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OperatorPrecedence.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OperatorPrecedence.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h stable/9/contrib/llvm/tools/clang/include/clang/Format/ - copied from r249423, head/contrib/llvm/tools/clang/include/clang/Format/ stable/9/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransProtectedScope.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/ARCMigrate/TransProtectedScope.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/CharInfo.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/CharInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp stable/9/contrib/llvm/tools/clang/lib/Format/ - copied from r249423, head/contrib/llvm/tools/clang/lib/Format/ stable/9/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp stable/9/contrib/llvm/tools/clang/lib/Format/BreakableToken.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/BreakableToken.h stable/9/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp stable/9/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h stable/9/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdnoreturn.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/stdnoreturn.h stable/9/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h stable/9/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp stable/9/contrib/llvm/tools/llvm-objdump/COFFDump.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-objdump/COFFDump.cpp stable/9/contrib/llvm/tools/llvm-objdump/ELFDump.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-objdump/ELFDump.cpp stable/9/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/Error.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/Error.cpp stable/9/contrib/llvm/tools/llvm-readobj/Error.h - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/Error.h stable/9/contrib/llvm/tools/llvm-readobj/MachODumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/MachODumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ObjDumper.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/ObjDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ObjDumper.h - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/ObjDumper.h stable/9/contrib/llvm/tools/llvm-readobj/StreamWriter.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/StreamWriter.cpp stable/9/contrib/llvm/tools/llvm-readobj/StreamWriter.h - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/StreamWriter.h stable/9/contrib/llvm/tools/llvm-readobj/llvm-readobj.h - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/llvm-readobj.h stable/9/contrib/llvm/tools/llvm-symbolizer/ - copied from r249423, head/contrib/llvm/tools/llvm-symbolizer/ stable/9/contrib/llvm/utils/TableGen/CTagsEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/utils/TableGen/CTagsEmitter.cpp stable/9/contrib/llvm/utils/TableGen/OptParserEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/utils/TableGen/OptParserEmitter.cpp stable/9/lib/clang/include/clang/AST/AttrDump.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/AttrDump.inc stable/9/lib/clang/include/clang/AST/CommentCommandList.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/CommentCommandList.inc stable/9/lib/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.inc stable/9/lib/clang/include/clang/Parse/AttrExprArgs.inc - copied unchanged from r251662, head/lib/clang/include/clang/Parse/AttrExprArgs.inc stable/9/lib/clang/include/clang/Sema/AttrSpellingListIndex.inc - copied unchanged from r249423, head/lib/clang/include/clang/Sema/AttrSpellingListIndex.inc stable/9/lib/clang/include/llvm/IR/ - copied from r249423, head/lib/clang/include/llvm/IR/ stable/9/lib/clang/libllvmirreader/ - copied from r249423, head/lib/clang/libllvmirreader/ stable/9/lib/clang/libllvmobjcarcopts/ - copied from r249423, head/lib/clang/libllvmobjcarcopts/ Deleted: stable/9/contrib/llvm/include/llvm-c/EnhancedDisassembly.h stable/9/contrib/llvm/include/llvm/ADT/InMemoryStruct.h stable/9/contrib/llvm/include/llvm/AddressingMode.h stable/9/contrib/llvm/include/llvm/Argument.h stable/9/contrib/llvm/include/llvm/Attributes.h stable/9/contrib/llvm/include/llvm/BasicBlock.h stable/9/contrib/llvm/include/llvm/CallGraphSCCPass.h stable/9/contrib/llvm/include/llvm/CallingConv.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineLoopRanges.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAGILP.h stable/9/contrib/llvm/include/llvm/Constant.h stable/9/contrib/llvm/include/llvm/Constants.h stable/9/contrib/llvm/include/llvm/DataLayout.h stable/9/contrib/llvm/include/llvm/DefaultPasses.h stable/9/contrib/llvm/include/llvm/DerivedTypes.h stable/9/contrib/llvm/include/llvm/Function.h stable/9/contrib/llvm/include/llvm/GlobalAlias.h stable/9/contrib/llvm/include/llvm/GlobalValue.h stable/9/contrib/llvm/include/llvm/GlobalVariable.h stable/9/contrib/llvm/include/llvm/IRBuilder.h stable/9/contrib/llvm/include/llvm/InlineAsm.h stable/9/contrib/llvm/include/llvm/InstrTypes.h stable/9/contrib/llvm/include/llvm/Instruction.def stable/9/contrib/llvm/include/llvm/Instruction.h stable/9/contrib/llvm/include/llvm/Instructions.h stable/9/contrib/llvm/include/llvm/IntrinsicInst.h stable/9/contrib/llvm/include/llvm/Intrinsics.h stable/9/contrib/llvm/include/llvm/Intrinsics.td stable/9/contrib/llvm/include/llvm/IntrinsicsARM.td stable/9/contrib/llvm/include/llvm/IntrinsicsCellSPU.td stable/9/contrib/llvm/include/llvm/IntrinsicsHexagon.td stable/9/contrib/llvm/include/llvm/IntrinsicsMips.td stable/9/contrib/llvm/include/llvm/IntrinsicsNVVM.td stable/9/contrib/llvm/include/llvm/IntrinsicsPowerPC.td stable/9/contrib/llvm/include/llvm/IntrinsicsX86.td stable/9/contrib/llvm/include/llvm/IntrinsicsXCore.td stable/9/contrib/llvm/include/llvm/LLVMContext.h stable/9/contrib/llvm/include/llvm/LinkAllVMCore.h stable/9/contrib/llvm/include/llvm/MC/EDInstInfo.h stable/9/contrib/llvm/include/llvm/MC/MCTargetAsmLexer.h stable/9/contrib/llvm/include/llvm/MDBuilder.h stable/9/contrib/llvm/include/llvm/Metadata.h stable/9/contrib/llvm/include/llvm/Module.h stable/9/contrib/llvm/include/llvm/Object/MachOObject.h stable/9/contrib/llvm/include/llvm/OperandTraits.h stable/9/contrib/llvm/include/llvm/Operator.h stable/9/contrib/llvm/include/llvm/Support/IRReader.h stable/9/contrib/llvm/include/llvm/Support/InstVisitor.h stable/9/contrib/llvm/include/llvm/SymbolTableListTraits.h stable/9/contrib/llvm/include/llvm/Target/TargetTransformImpl.h stable/9/contrib/llvm/include/llvm/TargetTransformInfo.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/AddrModeMatcher.h stable/9/contrib/llvm/include/llvm/Type.h stable/9/contrib/llvm/include/llvm/TypeBuilder.h stable/9/contrib/llvm/include/llvm/TypeFinder.h stable/9/contrib/llvm/include/llvm/Use.h stable/9/contrib/llvm/include/llvm/User.h stable/9/contrib/llvm/include/llvm/Value.h stable/9/contrib/llvm/include/llvm/ValueSymbolTable.h stable/9/contrib/llvm/lib/Analysis/DbgInfoPrinter.cpp stable/9/contrib/llvm/lib/Analysis/InlineCost.cpp stable/9/contrib/llvm/lib/CodeGen/CodePlacementOpt.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalUnion.h stable/9/contrib/llvm/lib/CodeGen/LiveRegMatrix.h stable/9/contrib/llvm/lib/CodeGen/MachineLoopRanges.cpp stable/9/contrib/llvm/lib/CodeGen/MachineTraceMetrics.h stable/9/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp stable/9/contrib/llvm/lib/CodeGen/VirtRegMap.h stable/9/contrib/llvm/lib/DebugInfo/DWARFFormValue.h stable/9/contrib/llvm/lib/Linker/LinkArchives.cpp stable/9/contrib/llvm/lib/Linker/LinkItems.cpp stable/9/contrib/llvm/lib/Linker/Linker.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInfo.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInst.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInst.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDMain.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDOperand.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDOperand.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDToken.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDToken.h stable/9/contrib/llvm/lib/MC/MCELF.h stable/9/contrib/llvm/lib/MC/MCTargetAsmLexer.cpp stable/9/contrib/llvm/lib/Object/MachOObject.cpp stable/9/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmLexer.cpp stable/9/contrib/llvm/lib/Target/CellSPU/ stable/9/contrib/llvm/lib/Target/Hexagon/HexagonImmediates.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMCInst.h stable/9/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp stable/9/contrib/llvm/lib/Target/NVPTX/InstPrinter/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/TargetInfo/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/VectorElementize.cpp stable/9/contrib/llvm/lib/Target/NVPTX/gen-register-defs.py stable/9/contrib/llvm/lib/Target/PTX/ stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCBaseInfo.h stable/9/contrib/llvm/lib/Target/R600/AMDILPeepholeOptimizer.cpp stable/9/contrib/llvm/lib/Target/TargetInstrInfo.cpp stable/9/contrib/llvm/lib/Target/TargetRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/TargetTransformImpl.cpp stable/9/contrib/llvm/lib/Target/X86/AsmParser/X86AsmLexer.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BlackList.h stable/9/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp stable/9/contrib/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp stable/9/contrib/llvm/lib/VMCore/ stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTTypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/ConvertUTF.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPMutationListener.h stable/9/contrib/llvm/tools/clang/lib/AST/CommentDumper.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/Makefile stable/9/contrib/llvm/tools/clang/lib/Basic/ConvertUTF.c stable/9/contrib/llvm/tools/clang/lib/Basic/ConvertUTFWrapper.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroArgs.h stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/CMakeLists.txt stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/Makefile stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/CMakeLists.txt stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/Makefile stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp stable/9/contrib/llvm/utils/TableGen/EDEmitter.cpp stable/9/lib/clang/include/ARMGenEDInfo.inc stable/9/lib/clang/include/MipsGenEDInfo.inc stable/9/lib/clang/include/X86GenEDInfo.inc stable/9/lib/clang/include/llvm/Intrinsics.gen Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/contrib/gcc/unwind-dw2.c stable/9/contrib/llvm/LICENSE.TXT stable/9/contrib/llvm/include/llvm-c/Core.h stable/9/contrib/llvm/include/llvm-c/Disassembler.h stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h stable/9/contrib/llvm/include/llvm-c/Initialization.h stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h stable/9/contrib/llvm/include/llvm-c/Object.h stable/9/contrib/llvm/include/llvm-c/Target.h stable/9/contrib/llvm/include/llvm-c/TargetMachine.h stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h stable/9/contrib/llvm/include/llvm-c/lto.h stable/9/contrib/llvm/include/llvm/ADT/APFloat.h stable/9/contrib/llvm/include/llvm/ADT/APInt.h stable/9/contrib/llvm/include/llvm/ADT/APSInt.h stable/9/contrib/llvm/include/llvm/ADT/ArrayRef.h stable/9/contrib/llvm/include/llvm/ADT/BitVector.h stable/9/contrib/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h stable/9/contrib/llvm/include/llvm/ADT/DeltaAlgorithm.h stable/9/contrib/llvm/include/llvm/ADT/DenseMap.h stable/9/contrib/llvm/include/llvm/ADT/DenseSet.h stable/9/contrib/llvm/include/llvm/ADT/DepthFirstIterator.h stable/9/contrib/llvm/include/llvm/ADT/FoldingSet.h stable/9/contrib/llvm/include/llvm/ADT/Hashing.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableList.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableMap.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableSet.h stable/9/contrib/llvm/include/llvm/ADT/IntervalMap.h stable/9/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h stable/9/contrib/llvm/include/llvm/ADT/MapVector.h stable/9/contrib/llvm/include/llvm/ADT/NullablePtr.h stable/9/contrib/llvm/include/llvm/ADT/Optional.h stable/9/contrib/llvm/include/llvm/ADT/OwningPtr.h stable/9/contrib/llvm/include/llvm/ADT/PointerIntPair.h stable/9/contrib/llvm/include/llvm/ADT/PointerUnion.h stable/9/contrib/llvm/include/llvm/ADT/PostOrderIterator.h stable/9/contrib/llvm/include/llvm/ADT/PriorityQueue.h stable/9/contrib/llvm/include/llvm/ADT/SCCIterator.h stable/9/contrib/llvm/include/llvm/ADT/STLExtras.h stable/9/contrib/llvm/include/llvm/ADT/SmallBitVector.h stable/9/contrib/llvm/include/llvm/ADT/SmallPtrSet.h stable/9/contrib/llvm/include/llvm/ADT/SmallSet.h stable/9/contrib/llvm/include/llvm/ADT/SmallString.h stable/9/contrib/llvm/include/llvm/ADT/SmallVector.h stable/9/contrib/llvm/include/llvm/ADT/SparseSet.h stable/9/contrib/llvm/include/llvm/ADT/Statistic.h stable/9/contrib/llvm/include/llvm/ADT/StringExtras.h stable/9/contrib/llvm/include/llvm/ADT/StringMap.h stable/9/contrib/llvm/include/llvm/ADT/StringRef.h stable/9/contrib/llvm/include/llvm/ADT/StringSet.h stable/9/contrib/llvm/include/llvm/ADT/TinyPtrVector.h stable/9/contrib/llvm/include/llvm/ADT/Triple.h stable/9/contrib/llvm/include/llvm/ADT/Twine.h stable/9/contrib/llvm/include/llvm/ADT/ValueMap.h stable/9/contrib/llvm/include/llvm/ADT/VariadicFunction.h stable/9/contrib/llvm/include/llvm/ADT/ilist.h stable/9/contrib/llvm/include/llvm/ADT/ilist_node.h stable/9/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h stable/9/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h stable/9/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h stable/9/contrib/llvm/include/llvm/Analysis/CFGPrinter.h stable/9/contrib/llvm/include/llvm/Analysis/CallGraph.h stable/9/contrib/llvm/include/llvm/Analysis/CaptureTracking.h stable/9/contrib/llvm/include/llvm/Analysis/CodeMetrics.h stable/9/contrib/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h stable/9/contrib/llvm/include/llvm/Analysis/DependenceAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/DominatorInternals.h stable/9/contrib/llvm/include/llvm/Analysis/Dominators.h stable/9/contrib/llvm/include/llvm/Analysis/IVUsers.h stable/9/contrib/llvm/include/llvm/Analysis/InlineCost.h stable/9/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h stable/9/contrib/llvm/include/llvm/Analysis/Interval.h stable/9/contrib/llvm/include/llvm/Analysis/IntervalIterator.h stable/9/contrib/llvm/include/llvm/Analysis/IntervalPartition.h stable/9/contrib/llvm/include/llvm/Analysis/LibCallAliasAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/Loads.h stable/9/contrib/llvm/include/llvm/Analysis/LoopInfo.h stable/9/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h stable/9/contrib/llvm/include/llvm/Analysis/LoopIterator.h stable/9/contrib/llvm/include/llvm/Analysis/LoopPass.h stable/9/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h stable/9/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/PHITransAddr.h stable/9/contrib/llvm/include/llvm/Analysis/Passes.h stable/9/contrib/llvm/include/llvm/Analysis/PathNumbering.h stable/9/contrib/llvm/include/llvm/Analysis/PathProfileInfo.h stable/9/contrib/llvm/include/llvm/Analysis/PostDominators.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileDataLoader.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileInfo.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h stable/9/contrib/llvm/include/llvm/Analysis/RegionInfo.h stable/9/contrib/llvm/include/llvm/Analysis/RegionIterator.h stable/9/contrib/llvm/include/llvm/Analysis/RegionPass.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h stable/9/contrib/llvm/include/llvm/Analysis/SparsePropagation.h stable/9/contrib/llvm/include/llvm/Analysis/Trace.h stable/9/contrib/llvm/include/llvm/Analysis/ValueTracking.h stable/9/contrib/llvm/include/llvm/Assembly/PrintModulePass.h stable/9/contrib/llvm/include/llvm/Bitcode/Archive.h stable/9/contrib/llvm/include/llvm/Bitcode/BitCodes.h stable/9/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h stable/9/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h stable/9/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h stable/9/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h stable/9/contrib/llvm/include/llvm/CodeGen/Analysis.h stable/9/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h stable/9/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h stable/9/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h stable/9/contrib/llvm/include/llvm/CodeGen/CommandFlags.h stable/9/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h stable/9/contrib/llvm/include/llvm/CodeGen/FastISel.h stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/GCMetadata.h stable/9/contrib/llvm/include/llvm/CodeGen/GCs.h stable/9/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h stable/9/contrib/llvm/include/llvm/CodeGen/IntrinsicLowering.h stable/9/contrib/llvm/include/llvm/CodeGen/JITCodeEmitter.h stable/9/contrib/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h stable/9/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h stable/9/contrib/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h stable/9/contrib/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveInterval.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveStackAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveVariables.h stable/9/contrib/llvm/include/llvm/CodeGen/MachORelocation.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineCodeEmitter.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineCodeInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineDominators.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunction.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunctionPass.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstr.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineMemOperand.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineOperand.h stable/9/contrib/llvm/include/llvm/CodeGen/MachinePostDominators.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Graph.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicSolver.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Math.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Solution.h stable/9/contrib/llvm/include/llvm/CodeGen/Passes.h stable/9/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h stable/9/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h stable/9/contrib/llvm/include/llvm/CodeGen/RegAllocRegistry.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h stable/9/contrib/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h stable/9/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h stable/9/contrib/llvm/include/llvm/CodeGen/SchedulerRegistry.h stable/9/contrib/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h stable/9/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h stable/9/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h stable/9/contrib/llvm/include/llvm/CodeGen/TargetSchedule.h stable/9/contrib/llvm/include/llvm/CodeGen/ValueTypes.h stable/9/contrib/llvm/include/llvm/CodeGen/ValueTypes.td stable/9/contrib/llvm/include/llvm/DIBuilder.h stable/9/contrib/llvm/include/llvm/DebugInfo.h stable/9/contrib/llvm/include/llvm/DebugInfo/DIContext.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/GenericValue.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/Interpreter.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JIT.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JITEventListener.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JITMemoryManager.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/MCJIT.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/OProfileWrapper.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectBuffer.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectImage.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h stable/9/contrib/llvm/include/llvm/GVMaterializer.h stable/9/contrib/llvm/include/llvm/IR/Argument.h stable/9/contrib/llvm/include/llvm/IR/Attributes.h stable/9/contrib/llvm/include/llvm/IR/BasicBlock.h stable/9/contrib/llvm/include/llvm/IR/Constants.h stable/9/contrib/llvm/include/llvm/IR/DataLayout.h stable/9/contrib/llvm/include/llvm/IR/DerivedTypes.h stable/9/contrib/llvm/include/llvm/IR/GlobalValue.h stable/9/contrib/llvm/include/llvm/IR/IRBuilder.h stable/9/contrib/llvm/include/llvm/IR/Intrinsics.h stable/9/contrib/llvm/include/llvm/IR/IntrinsicsMips.td stable/9/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td stable/9/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/9/contrib/llvm/include/llvm/IR/LLVMContext.h stable/9/contrib/llvm/include/llvm/IR/MDBuilder.h stable/9/contrib/llvm/include/llvm/IR/Module.h stable/9/contrib/llvm/include/llvm/IR/Type.h stable/9/contrib/llvm/include/llvm/IR/Use.h stable/9/contrib/llvm/include/llvm/IR/Value.h stable/9/contrib/llvm/include/llvm/InitializePasses.h stable/9/contrib/llvm/include/llvm/LinkAllPasses.h stable/9/contrib/llvm/include/llvm/Linker.h stable/9/contrib/llvm/include/llvm/MC/MCAsmBackend.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfoCOFF.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfoDarwin.h stable/9/contrib/llvm/include/llvm/MC/MCAsmLayout.h stable/9/contrib/llvm/include/llvm/MC/MCAssembler.h stable/9/contrib/llvm/include/llvm/MC/MCAtom.h stable/9/contrib/llvm/include/llvm/MC/MCCodeEmitter.h stable/9/contrib/llvm/include/llvm/MC/MCContext.h stable/9/contrib/llvm/include/llvm/MC/MCDisassembler.h stable/9/contrib/llvm/include/llvm/MC/MCDwarf.h stable/9/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCExpr.h stable/9/contrib/llvm/include/llvm/MC/MCFixedLenDisassembler.h stable/9/contrib/llvm/include/llvm/MC/MCInst.h stable/9/contrib/llvm/include/llvm/MC/MCInstPrinter.h stable/9/contrib/llvm/include/llvm/MC/MCInstrDesc.h stable/9/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h stable/9/contrib/llvm/include/llvm/MC/MCObjectStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCParser/AsmCond.h stable/9/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h stable/9/contrib/llvm/include/llvm/MC/MCRegisterInfo.h stable/9/contrib/llvm/include/llvm/MC/MCSchedule.h stable/9/contrib/llvm/include/llvm/MC/MCSection.h stable/9/contrib/llvm/include/llvm/MC/MCSectionCOFF.h stable/9/contrib/llvm/include/llvm/MC/MCSectionELF.h stable/9/contrib/llvm/include/llvm/MC/MCSectionMachO.h stable/9/contrib/llvm/include/llvm/MC/MCStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h stable/9/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h stable/9/contrib/llvm/include/llvm/MC/MCValue.h stable/9/contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MachineLocation.h stable/9/contrib/llvm/include/llvm/MC/SubtargetFeature.h stable/9/contrib/llvm/include/llvm/Object/Archive.h stable/9/contrib/llvm/include/llvm/Object/Binary.h stable/9/contrib/llvm/include/llvm/Object/ELF.h stable/9/contrib/llvm/include/llvm/Object/MachO.h stable/9/contrib/llvm/include/llvm/Object/MachOFormat.h stable/9/contrib/llvm/include/llvm/Object/ObjectFile.h stable/9/contrib/llvm/include/llvm/Object/RelocVisitor.h stable/9/contrib/llvm/include/llvm/Pass.h stable/9/contrib/llvm/include/llvm/PassAnalysisSupport.h stable/9/contrib/llvm/include/llvm/PassManager.h stable/9/contrib/llvm/include/llvm/PassManagers.h stable/9/contrib/llvm/include/llvm/PassRegistry.h stable/9/contrib/llvm/include/llvm/PassSupport.h stable/9/contrib/llvm/include/llvm/Support/AlignOf.h stable/9/contrib/llvm/include/llvm/Support/Allocator.h stable/9/contrib/llvm/include/llvm/Support/Atomic.h stable/9/contrib/llvm/include/llvm/Support/CFG.h stable/9/contrib/llvm/include/llvm/Support/COFF.h stable/9/contrib/llvm/include/llvm/Support/CallSite.h stable/9/contrib/llvm/include/llvm/Support/Casting.h stable/9/contrib/llvm/include/llvm/Support/CodeGen.h stable/9/contrib/llvm/include/llvm/Support/CommandLine.h stable/9/contrib/llvm/include/llvm/Support/Compiler.h stable/9/contrib/llvm/include/llvm/Support/ConstantFolder.h stable/9/contrib/llvm/include/llvm/Support/ConstantRange.h stable/9/contrib/llvm/include/llvm/Support/DOTGraphTraits.h stable/9/contrib/llvm/include/llvm/Support/DataExtractor.h stable/9/contrib/llvm/include/llvm/Support/DataFlow.h stable/9/contrib/llvm/include/llvm/Support/DataStream.h stable/9/contrib/llvm/include/llvm/Support/DebugLoc.h stable/9/contrib/llvm/include/llvm/Support/Dwarf.h stable/9/contrib/llvm/include/llvm/Support/DynamicLibrary.h stable/9/contrib/llvm/include/llvm/Support/ELF.h stable/9/contrib/llvm/include/llvm/Support/Endian.h stable/9/contrib/llvm/include/llvm/Support/Errno.h stable/9/contrib/llvm/include/llvm/Support/ErrorHandling.h stable/9/contrib/llvm/include/llvm/Support/FEnv.h stable/9/contrib/llvm/include/llvm/Support/FileOutputBuffer.h stable/9/contrib/llvm/include/llvm/Support/FileSystem.h stable/9/contrib/llvm/include/llvm/Support/FormattedStream.h stable/9/contrib/llvm/include/llvm/Support/GCOV.h stable/9/contrib/llvm/include/llvm/Support/GetElementPtrTypeIterator.h stable/9/contrib/llvm/include/llvm/Support/GraphWriter.h stable/9/contrib/llvm/include/llvm/Support/Host.h stable/9/contrib/llvm/include/llvm/Support/IncludeFile.h stable/9/contrib/llvm/include/llvm/Support/InstIterator.h stable/9/contrib/llvm/include/llvm/Support/IntegersSubset.h stable/9/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h stable/9/contrib/llvm/include/llvm/Support/LEB128.h stable/9/contrib/llvm/include/llvm/Support/Locale.h stable/9/contrib/llvm/include/llvm/Support/LockFileManager.h stable/9/contrib/llvm/include/llvm/Support/MathExtras.h stable/9/contrib/llvm/include/llvm/Support/Memory.h stable/9/contrib/llvm/include/llvm/Support/MemoryBuffer.h stable/9/contrib/llvm/include/llvm/Support/MemoryObject.h stable/9/contrib/llvm/include/llvm/Support/Mutex.h stable/9/contrib/llvm/include/llvm/Support/NoFolder.h stable/9/contrib/llvm/include/llvm/Support/PassNameParser.h stable/9/contrib/llvm/include/llvm/Support/PathV1.h stable/9/contrib/llvm/include/llvm/Support/PatternMatch.h stable/9/contrib/llvm/include/llvm/Support/PredIteratorCache.h stable/9/contrib/llvm/include/llvm/Support/Process.h stable/9/contrib/llvm/include/llvm/Support/Program.h stable/9/contrib/llvm/include/llvm/Support/Recycler.h stable/9/contrib/llvm/include/llvm/Support/Regex.h stable/9/contrib/llvm/include/llvm/Support/RegistryParser.h stable/9/contrib/llvm/include/llvm/Support/SMLoc.h stable/9/contrib/llvm/include/llvm/Support/SaveAndRestore.h stable/9/contrib/llvm/include/llvm/Support/Signals.h stable/9/contrib/llvm/include/llvm/Support/Solaris.h stable/9/contrib/llvm/include/llvm/Support/SourceMgr.h stable/9/contrib/llvm/include/llvm/Support/StreamableMemoryObject.h stable/9/contrib/llvm/include/llvm/Support/StringPool.h stable/9/contrib/llvm/include/llvm/Support/SwapByteOrder.h stable/9/contrib/llvm/include/llvm/Support/TargetFolder.h stable/9/contrib/llvm/include/llvm/Support/TargetRegistry.h stable/9/contrib/llvm/include/llvm/Support/ThreadLocal.h stable/9/contrib/llvm/include/llvm/Support/Threading.h stable/9/contrib/llvm/include/llvm/Support/TimeValue.h stable/9/contrib/llvm/include/llvm/Support/Timer.h stable/9/contrib/llvm/include/llvm/Support/ToolOutputFile.h stable/9/contrib/llvm/include/llvm/Support/Valgrind.h stable/9/contrib/llvm/include/llvm/Support/ValueHandle.h stable/9/contrib/llvm/include/llvm/Support/Win64EH.h stable/9/contrib/llvm/include/llvm/Support/YAMLParser.h stable/9/contrib/llvm/include/llvm/Support/circular_raw_ostream.h stable/9/contrib/llvm/include/llvm/Support/raw_ostream.h stable/9/contrib/llvm/include/llvm/Support/system_error.h stable/9/contrib/llvm/include/llvm/Support/type_traits.h stable/9/contrib/llvm/include/llvm/TableGen/Error.h stable/9/contrib/llvm/include/llvm/TableGen/Record.h stable/9/contrib/llvm/include/llvm/TableGen/StringMatcher.h stable/9/contrib/llvm/include/llvm/Target/Mangler.h stable/9/contrib/llvm/include/llvm/Target/Target.td stable/9/contrib/llvm/include/llvm/Target/TargetCallingConv.h stable/9/contrib/llvm/include/llvm/Target/TargetFrameLowering.h stable/9/contrib/llvm/include/llvm/Target/TargetInstrInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetJITInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetLowering.h stable/9/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h stable/9/contrib/llvm/include/llvm/Target/TargetMachine.h stable/9/contrib/llvm/include/llvm/Target/TargetOptions.h stable/9/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetSchedule.td stable/9/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td stable/9/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h stable/9/contrib/llvm/include/llvm/Transforms/IPO.h stable/9/contrib/llvm/include/llvm/Transforms/IPO/InlinerPass.h stable/9/contrib/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h stable/9/contrib/llvm/include/llvm/Transforms/Instrumentation.h stable/9/contrib/llvm/include/llvm/Transforms/Scalar.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/IntegerDivision.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/Local.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h stable/9/contrib/llvm/include/llvm/Transforms/Vectorize.h stable/9/contrib/llvm/lib/Analysis/AliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/AliasAnalysisCounter.cpp stable/9/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp stable/9/contrib/llvm/lib/Analysis/AliasDebugger.cpp stable/9/contrib/llvm/lib/Analysis/AliasSetTracker.cpp stable/9/contrib/llvm/lib/Analysis/Analysis.cpp stable/9/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp stable/9/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp stable/9/contrib/llvm/lib/Analysis/CFGPrinter.cpp stable/9/contrib/llvm/lib/Analysis/CaptureTracking.cpp stable/9/contrib/llvm/lib/Analysis/CodeMetrics.cpp stable/9/contrib/llvm/lib/Analysis/ConstantFolding.cpp stable/9/contrib/llvm/lib/Analysis/CostModel.cpp stable/9/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/DominanceFrontier.cpp stable/9/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp stable/9/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp stable/9/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp stable/9/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp stable/9/contrib/llvm/lib/Analysis/IPA/IPA.cpp stable/9/contrib/llvm/lib/Analysis/IVUsers.cpp stable/9/contrib/llvm/lib/Analysis/InstCount.cpp stable/9/contrib/llvm/lib/Analysis/InstructionSimplify.cpp stable/9/contrib/llvm/lib/Analysis/Interval.cpp stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp stable/9/contrib/llvm/lib/Analysis/LibCallAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/LibCallSemantics.cpp stable/9/contrib/llvm/lib/Analysis/Lint.cpp stable/9/contrib/llvm/lib/Analysis/Loads.cpp stable/9/contrib/llvm/lib/Analysis/LoopInfo.cpp stable/9/contrib/llvm/lib/Analysis/MemDepPrinter.cpp stable/9/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp stable/9/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp stable/9/contrib/llvm/lib/Analysis/NoAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/PHITransAddr.cpp stable/9/contrib/llvm/lib/Analysis/PathNumbering.cpp stable/9/contrib/llvm/lib/Analysis/PathProfileInfo.cpp stable/9/contrib/llvm/lib/Analysis/PathProfileVerifier.cpp stable/9/contrib/llvm/lib/Analysis/PostDominators.cpp stable/9/contrib/llvm/lib/Analysis/ProfileDataLoader.cpp stable/9/contrib/llvm/lib/Analysis/ProfileDataLoaderPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileEstimatorPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfo.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileVerifierPass.cpp stable/9/contrib/llvm/lib/Analysis/RegionInfo.cpp stable/9/contrib/llvm/lib/Analysis/RegionPrinter.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolution.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp stable/9/contrib/llvm/lib/Analysis/SparsePropagation.cpp stable/9/contrib/llvm/lib/Analysis/Trace.cpp stable/9/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ValueTracking.cpp stable/9/contrib/llvm/lib/Archive/Archive.cpp stable/9/contrib/llvm/lib/Archive/ArchiveInternals.h stable/9/contrib/llvm/lib/Archive/ArchiveReader.cpp stable/9/contrib/llvm/lib/Archive/ArchiveWriter.cpp stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp stable/9/contrib/llvm/lib/AsmParser/LLLexer.h stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp stable/9/contrib/llvm/lib/AsmParser/LLParser.h stable/9/contrib/llvm/lib/AsmParser/LLToken.h stable/9/contrib/llvm/lib/AsmParser/Parser.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitReader.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h stable/9/contrib/llvm/lib/Bitcode/Writer/BitWriter.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h stable/9/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp stable/9/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h stable/9/contrib/llvm/lib/CodeGen/AllocationOrder.cpp stable/9/contrib/llvm/lib/CodeGen/AllocationOrder.h stable/9/contrib/llvm/lib/CodeGen/Analysis.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp stable/9/contrib/llvm/lib/CodeGen/BranchFolding.cpp stable/9/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp stable/9/contrib/llvm/lib/CodeGen/CallingConvLower.cpp stable/9/contrib/llvm/lib/CodeGen/CodeGen.cpp stable/9/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp stable/9/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h stable/9/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp stable/9/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp stable/9/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp stable/9/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp stable/9/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp stable/9/contrib/llvm/lib/CodeGen/ExpandISelPseudos.cpp stable/9/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp stable/9/contrib/llvm/lib/CodeGen/GCMetadata.cpp stable/9/contrib/llvm/lib/CodeGen/GCStrategy.cpp stable/9/contrib/llvm/lib/CodeGen/IfConversion.cpp stable/9/contrib/llvm/lib/CodeGen/InlineSpiller.cpp stable/9/contrib/llvm/lib/CodeGen/InterferenceCache.cpp stable/9/contrib/llvm/lib/CodeGen/InterferenceCache.h stable/9/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp stable/9/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp stable/9/contrib/llvm/lib/CodeGen/LexicalScopes.cpp stable/9/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp stable/9/contrib/llvm/lib/CodeGen/LiveInterval.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRangeCalc.h stable/9/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp stable/9/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp stable/9/contrib/llvm/lib/CodeGen/LiveVariables.cpp stable/9/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineCSE.cpp stable/9/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunctionPass.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp stable/9/contrib/llvm/lib/CodeGen/MachineInstr.cpp stable/9/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp stable/9/contrib/llvm/lib/CodeGen/MachineLICM.cpp stable/9/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp stable/9/contrib/llvm/lib/CodeGen/MachineScheduler.cpp stable/9/contrib/llvm/lib/CodeGen/MachineSink.cpp stable/9/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp stable/9/contrib/llvm/lib/CodeGen/MachineVerifier.cpp stable/9/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp stable/9/contrib/llvm/lib/CodeGen/PHIElimination.cpp stable/9/contrib/llvm/lib/CodeGen/PHIEliminationUtils.cpp stable/9/contrib/llvm/lib/CodeGen/Passes.cpp stable/9/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp stable/9/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp stable/9/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp stable/9/contrib/llvm/lib/CodeGen/PrologEpilogInserter.h stable/9/contrib/llvm/lib/CodeGen/PseudoSourceValue.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocBase.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocBase.h stable/9/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocFast.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterPressure.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeOrdering.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/9/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp stable/9/contrib/llvm/lib/CodeGen/ShrinkWrapping.cpp stable/9/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp stable/9/contrib/llvm/lib/CodeGen/SlotIndexes.cpp stable/9/contrib/llvm/lib/CodeGen/SpillPlacement.cpp stable/9/contrib/llvm/lib/CodeGen/Spiller.cpp stable/9/contrib/llvm/lib/CodeGen/SplitKit.cpp stable/9/contrib/llvm/lib/CodeGen/StackColoring.cpp stable/9/contrib/llvm/lib/CodeGen/StackProtector.cpp stable/9/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp stable/9/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp stable/9/contrib/llvm/lib/CodeGen/TailDuplication.cpp stable/9/contrib/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetOptionsImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetSchedule.cpp stable/9/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp stable/9/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp stable/9/contrib/llvm/lib/CodeGen/VirtRegMap.cpp stable/9/contrib/llvm/lib/DebugInfo/DIContext.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.h stable/9/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h stable/9/contrib/llvm/lib/DebugInfo/DWARFContext.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFContext.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugLine.h stable/9/contrib/llvm/lib/DebugInfo/DWARFFormValue.cpp stable/9/contrib/llvm/lib/ExecutionEngine/EventListenerCommon.h stable/9/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp stable/9/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp stable/9/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp stable/9/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.h stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h stable/9/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp stable/9/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h stable/9/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp stable/9/contrib/llvm/lib/IR/AsmWriter.cpp stable/9/contrib/llvm/lib/IR/AttributeImpl.h stable/9/contrib/llvm/lib/IR/Attributes.cpp stable/9/contrib/llvm/lib/IR/Constants.cpp stable/9/contrib/llvm/lib/IR/ConstantsContext.h stable/9/contrib/llvm/lib/IR/Core.cpp stable/9/contrib/llvm/lib/IR/DIBuilder.cpp stable/9/contrib/llvm/lib/IR/DataLayout.cpp stable/9/contrib/llvm/lib/IR/DebugInfo.cpp stable/9/contrib/llvm/lib/IR/Function.cpp stable/9/contrib/llvm/lib/IR/Metadata.cpp stable/9/contrib/llvm/lib/IR/PassManager.cpp stable/9/contrib/llvm/lib/IR/Type.cpp stable/9/contrib/llvm/lib/IR/Value.cpp stable/9/contrib/llvm/lib/IR/Verifier.cpp stable/9/contrib/llvm/lib/Linker/LinkModules.cpp stable/9/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/9/contrib/llvm/lib/MC/MCAsmInfo.cpp stable/9/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp stable/9/contrib/llvm/lib/MC/MCAsmStreamer.cpp stable/9/contrib/llvm/lib/MC/MCAssembler.cpp stable/9/contrib/llvm/lib/MC/MCContext.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h stable/9/contrib/llvm/lib/MC/MCDwarf.cpp stable/9/contrib/llvm/lib/MC/MCELF.cpp stable/9/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp stable/9/contrib/llvm/lib/MC/MCELFStreamer.cpp stable/9/contrib/llvm/lib/MC/MCExpr.cpp stable/9/contrib/llvm/lib/MC/MCInstPrinter.cpp stable/9/contrib/llvm/lib/MC/MCMachOStreamer.cpp stable/9/contrib/llvm/lib/MC/MCNullStreamer.cpp stable/9/contrib/llvm/lib/MC/MCObjectFileInfo.cpp stable/9/contrib/llvm/lib/MC/MCObjectStreamer.cpp stable/9/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/MCAsmLexer.cpp stable/9/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCPureStreamer.cpp stable/9/contrib/llvm/lib/MC/MCSection.cpp stable/9/contrib/llvm/lib/MC/MCSectionCOFF.cpp stable/9/contrib/llvm/lib/MC/MCSectionELF.cpp stable/9/contrib/llvm/lib/MC/MCSectionMachO.cpp stable/9/contrib/llvm/lib/MC/MCStreamer.cpp stable/9/contrib/llvm/lib/MC/MCSubtargetInfo.cpp stable/9/contrib/llvm/lib/MC/MCWin64EH.cpp stable/9/contrib/llvm/lib/MC/MachObjectWriter.cpp stable/9/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp stable/9/contrib/llvm/lib/MC/WinCOFFStreamer.cpp stable/9/contrib/llvm/lib/Object/Archive.cpp stable/9/contrib/llvm/lib/Object/COFFObjectFile.cpp stable/9/contrib/llvm/lib/Object/ELFObjectFile.cpp stable/9/contrib/llvm/lib/Object/MachOObjectFile.cpp stable/9/contrib/llvm/lib/Object/Object.cpp stable/9/contrib/llvm/lib/Object/ObjectFile.cpp stable/9/contrib/llvm/lib/Support/APFloat.cpp stable/9/contrib/llvm/lib/Support/APInt.cpp stable/9/contrib/llvm/lib/Support/Allocator.cpp stable/9/contrib/llvm/lib/Support/CommandLine.cpp stable/9/contrib/llvm/lib/Support/ConstantRange.cpp stable/9/contrib/llvm/lib/Support/CrashRecoveryContext.cpp stable/9/contrib/llvm/lib/Support/DataExtractor.cpp stable/9/contrib/llvm/lib/Support/DataStream.cpp stable/9/contrib/llvm/lib/Support/Debug.cpp stable/9/contrib/llvm/lib/Support/Disassembler.cpp stable/9/contrib/llvm/lib/Support/Dwarf.cpp stable/9/contrib/llvm/lib/Support/DynamicLibrary.cpp stable/9/contrib/llvm/lib/Support/ErrorHandling.cpp stable/9/contrib/llvm/lib/Support/FileOutputBuffer.cpp stable/9/contrib/llvm/lib/Support/FileUtilities.cpp stable/9/contrib/llvm/lib/Support/FoldingSet.cpp stable/9/contrib/llvm/lib/Support/GraphWriter.cpp stable/9/contrib/llvm/lib/Support/Host.cpp stable/9/contrib/llvm/lib/Support/LocaleWindows.inc stable/9/contrib/llvm/lib/Support/LocaleXlocale.inc stable/9/contrib/llvm/lib/Support/LockFileManager.cpp stable/9/contrib/llvm/lib/Support/Memory.cpp stable/9/contrib/llvm/lib/Support/MemoryBuffer.cpp stable/9/contrib/llvm/lib/Support/Path.cpp stable/9/contrib/llvm/lib/Support/PathV2.cpp stable/9/contrib/llvm/lib/Support/PluginLoader.cpp stable/9/contrib/llvm/lib/Support/PrettyStackTrace.cpp stable/9/contrib/llvm/lib/Support/Process.cpp stable/9/contrib/llvm/lib/Support/Program.cpp stable/9/contrib/llvm/lib/Support/Regex.cpp stable/9/contrib/llvm/lib/Support/SmallPtrSet.cpp stable/9/contrib/llvm/lib/Support/SourceMgr.cpp stable/9/contrib/llvm/lib/Support/Statistic.cpp stable/9/contrib/llvm/lib/Support/StringRef.cpp stable/9/contrib/llvm/lib/Support/Threading.cpp stable/9/contrib/llvm/lib/Support/TimeValue.cpp stable/9/contrib/llvm/lib/Support/Timer.cpp stable/9/contrib/llvm/lib/Support/Triple.cpp stable/9/contrib/llvm/lib/Support/Unix/Memory.inc stable/9/contrib/llvm/lib/Support/Unix/PathV2.inc stable/9/contrib/llvm/lib/Support/Unix/Process.inc stable/9/contrib/llvm/lib/Support/Unix/Program.inc stable/9/contrib/llvm/lib/Support/Unix/Signals.inc stable/9/contrib/llvm/lib/Support/Unix/TimeValue.inc stable/9/contrib/llvm/lib/Support/Unix/Unix.h stable/9/contrib/llvm/lib/Support/Windows/Memory.inc stable/9/contrib/llvm/lib/Support/Windows/Path.inc stable/9/contrib/llvm/lib/Support/Windows/PathV2.inc stable/9/contrib/llvm/lib/Support/Windows/Process.inc stable/9/contrib/llvm/lib/Support/Windows/Program.inc stable/9/contrib/llvm/lib/Support/Windows/Signals.inc stable/9/contrib/llvm/lib/Support/YAMLParser.cpp stable/9/contrib/llvm/lib/Support/raw_ostream.cpp stable/9/contrib/llvm/lib/Support/regcomp.c stable/9/contrib/llvm/lib/Support/system_error.cpp stable/9/contrib/llvm/lib/TableGen/Error.cpp stable/9/contrib/llvm/lib/TableGen/Main.cpp stable/9/contrib/llvm/lib/TableGen/Record.cpp stable/9/contrib/llvm/lib/TableGen/TGLexer.cpp stable/9/contrib/llvm/lib/TableGen/TGLexer.h stable/9/contrib/llvm/lib/TableGen/TGParser.cpp stable/9/contrib/llvm/lib/TableGen/TGParser.h stable/9/contrib/llvm/lib/TableGen/TableGenBackend.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h stable/9/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td stable/9/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/9/contrib/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp stable/9/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp stable/9/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARM.h stable/9/contrib/llvm/lib/Target/ARM/ARM.td stable/9/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h stable/9/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMCallingConv.h stable/9/contrib/llvm/lib/Target/ARM/ARMCallingConv.td stable/9/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h stable/9/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelLowering.h stable/9/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td stable/9/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td stable/9/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td stable/9/contrib/llvm/lib/Target/ARM/ARMJITInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMJITInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMSchedule.td stable/9/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td stable/9/contrib/llvm/lib/Target/ARM/ARMScheduleSwift.td stable/9/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMSubtarget.h stable/9/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h stable/9/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.h stable/9/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp stable/9/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp stable/9/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp stable/9/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp stable/9/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp stable/9/contrib/llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.h stable/9/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h stable/9/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp stable/9/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp stable/9/contrib/llvm/lib/Target/CppBackend/CPPTargetMachine.h stable/9/contrib/llvm/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/Hexagon.h stable/9/contrib/llvm/lib/Target/Hexagon/Hexagon.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonExpandPredSpillCode.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSplitTFRCondSets.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp stable/9/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp stable/9/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.h stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Hexagon/TargetInfo/HexagonTargetInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp stable/9/contrib/llvm/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp stable/9/contrib/llvm/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h stable/9/contrib/llvm/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeFrameLowering.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeMCInstLower.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeMachineFunction.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/MBlaze/TargetInfo/MBlazeTargetInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp stable/9/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430CallingConv.td stable/9/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td stable/9/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.h stable/9/contrib/llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp stable/9/contrib/llvm/lib/Target/Mangler.cpp stable/9/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp stable/9/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp stable/9/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp stable/9/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips.h stable/9/contrib/llvm/lib/Target/Mips/Mips.td stable/9/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h stable/9/contrib/llvm/lib/Target/Mips/MipsCallingConv.td stable/9/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsCondMov.td stable/9/contrib/llvm/lib/Target/Mips/MipsDSPInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td stable/9/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSubtarget.h stable/9/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h stable/9/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.h stable/9/contrib/llvm/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXBaseInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/NVPTX/ManagedStringPool.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTX.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTX.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXNumRegisters.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSection.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXutil.cpp stable/9/contrib/llvm/lib/Target/NVPTX/TargetInfo/NVPTXTargetInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/cl_common_defines.h stable/9/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h stable/9/contrib/llvm/lib/Target/PowerPC/PPC.h stable/9/contrib/llvm/lib/Target/PowerPC/PPC.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCScheduleG5.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.h stable/9/contrib/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPU.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUCallingConv.td stable/9/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td stable/9/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILBase.td stable/9/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp stable/9/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.h stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/R600/Processors.td stable/9/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp stable/9/contrib/llvm/lib/Target/R600/R600Defines.h stable/9/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp stable/9/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp stable/9/contrib/llvm/lib/Target/R600/R600InstrInfo.h stable/9/contrib/llvm/lib/Target/R600/R600Instructions.td stable/9/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/R600/R600RegisterInfo.td stable/9/contrib/llvm/lib/Target/R600/R600Schedule.td stable/9/contrib/llvm/lib/Target/R600/SIISelLowering.cpp stable/9/contrib/llvm/lib/Target/R600/SIISelLowering.h stable/9/contrib/llvm/lib/Target/R600/SIInstrFormats.td stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.h stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.td stable/9/contrib/llvm/lib/Target/R600/SIInstructions.td stable/9/contrib/llvm/lib/Target/R600/SIIntrinsics.td stable/9/contrib/llvm/lib/Target/R600/SIRegisterInfo.td stable/9/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/Sparc/FPMover.cpp stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td stable/9/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td stable/9/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h stable/9/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h stable/9/contrib/llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp stable/9/contrib/llvm/lib/Target/Target.cpp stable/9/contrib/llvm/lib/Target/TargetIntrinsicInfo.cpp stable/9/contrib/llvm/lib/Target/TargetLibraryInfo.cpp stable/9/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp stable/9/contrib/llvm/lib/Target/TargetMachine.cpp stable/9/contrib/llvm/lib/Target/TargetMachineC.cpp stable/9/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp stable/9/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.h stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/X86/TargetInfo/X86TargetInfo.cpp stable/9/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp stable/9/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h stable/9/contrib/llvm/lib/Target/X86/X86.h stable/9/contrib/llvm/lib/Target/X86/X86.td stable/9/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/X86AsmPrinter.h stable/9/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.h stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td stable/9/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/9/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp stable/9/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86FrameLowering.h stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.h stable/9/contrib/llvm/lib/Target/X86/X86Instr3DNow.td stable/9/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td stable/9/contrib/llvm/lib/Target/X86/X86InstrCMovSetCC.td stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/9/contrib/llvm/lib/Target/X86/X86InstrControl.td stable/9/contrib/llvm/lib/Target/X86/X86InstrExtension.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFMA.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFPStack.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFormats.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.td stable/9/contrib/llvm/lib/Target/X86/X86InstrMMX.td stable/9/contrib/llvm/lib/Target/X86/X86InstrSSE.td stable/9/contrib/llvm/lib/Target/X86/X86InstrShiftRotate.td stable/9/contrib/llvm/lib/Target/X86/X86InstrSystem.td stable/9/contrib/llvm/lib/Target/X86/X86InstrTSX.td stable/9/contrib/llvm/lib/Target/X86/X86JITInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86JITInfo.h stable/9/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp stable/9/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86RegisterInfo.h stable/9/contrib/llvm/lib/Target/X86/X86Schedule.td stable/9/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h stable/9/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/9/contrib/llvm/lib/Target/X86/X86TargetMachine.h stable/9/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h stable/9/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp stable/9/contrib/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp stable/9/contrib/llvm/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp stable/9/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCore.h stable/9/contrib/llvm/lib/Target/XCore/XCore.td stable/9/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h stable/9/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrFormats.td stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td stable/9/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td stable/9/contrib/llvm/lib/Target/XCore/XCoreSubtarget.h stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp stable/9/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp stable/9/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp stable/9/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp stable/9/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/9/contrib/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp stable/9/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp stable/9/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp stable/9/contrib/llvm/lib/Transforms/IPO/Inliner.cpp stable/9/contrib/llvm/lib/Transforms/IPO/Internalize.cpp stable/9/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp stable/9/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp stable/9/contrib/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp stable/9/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h stable/9/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BlackList.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/MaximumSpanningTree.h stable/9/contrib/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ConstantProp.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/DCE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/GVN.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LICM.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SROA.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Sink.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp stable/9/contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp stable/9/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp stable/9/contrib/llvm/lib/Transforms/Utils/InstructionNamer.cpp stable/9/contrib/llvm/lib/Transforms/Utils/IntegerDivision.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Local.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Mem2Reg.cpp stable/9/contrib/llvm/lib/Transforms/Utils/MetaRenamer.cpp stable/9/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Utils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/Vectorize.cpp stable/9/contrib/llvm/tools/bugpoint/BugDriver.cpp stable/9/contrib/llvm/tools/bugpoint/BugDriver.h stable/9/contrib/llvm/tools/bugpoint/CrashDebugger.cpp stable/9/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp stable/9/contrib/llvm/tools/bugpoint/ExtractFunction.cpp stable/9/contrib/llvm/tools/bugpoint/ListReducer.h stable/9/contrib/llvm/tools/bugpoint/Miscompilation.cpp stable/9/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp stable/9/contrib/llvm/tools/bugpoint/ToolRunner.h stable/9/contrib/llvm/tools/bugpoint/bugpoint.cpp stable/9/contrib/llvm/tools/clang/LICENSE.TXT stable/9/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang-c/CXString.h stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMT.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMTActions.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/FileRemapper.h stable/9/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/9/contrib/llvm/tools/clang/include/clang/AST/AST.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Attr.h stable/9/contrib/llvm/tools/clang/include/clang/AST/BuiltinTypes.def stable/9/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Comment.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentCommands.td stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentLexer.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Decl.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclAccessPair.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DependentDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Expr.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h stable/9/contrib/llvm/tools/clang/include/clang/AST/LambdaMangleContext.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Mangle.h stable/9/contrib/llvm/tools/clang/include/clang/AST/NSAPI.h stable/9/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h stable/9/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h stable/9/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h stable/9/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Stmt.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtGraphTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TemplateName.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeLocVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeOrdering.h stable/9/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h stable/9/contrib/llvm/tools/clang/include/clang/AST/VTTBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchFinder.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersMacros.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Dominators.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/LiveVariables.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/FlowSensitive/DataflowSolver.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Support/BlkExprDeclBitVector.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Support/BumpVector.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/MacroBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Module.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Version.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td stable/9/contrib/llvm/tools/clang/include/clang/CodeGen/ModuleBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Arg.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Driver.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Job.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/OptSpecifier.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Option.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Options.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/Phases.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Tool.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Types.def stable/9/contrib/llvm/tools/clang/include/clang/Driver/Types.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Util.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/Commit.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/EditedSource.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/Rewriters.h stable/9/contrib/llvm/tools/clang/include/clang/Format/Format.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ChainedDiagnosticConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ChainedIncludesSource.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticRenderer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LayoutOverrideSource.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LogDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/MultiplexConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOutputOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticBuffer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/VerifyDiagnosticConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ExternalPreprocessorSource.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PTHManager.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Token.h stable/9/contrib/llvm/tools/clang/include/clang/Parse/Parser.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Core/RewriteRope.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Core/Rewriter.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/ASTConsumers.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/FixItRewriter.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CXXFieldCollector.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/IdentifierResolver.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/MultiplexExternalSemaSource.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ObjCMethodList.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Overload.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Scope.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Sema.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Template.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/TypoCorrection.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ContinuousRangeMap.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/Module.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ModuleManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerOptInfo.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerRegistry.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/FileMatchTrie.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/JSONCompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Internals.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/PlistReporter.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransAPIUses.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransARCAssign.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransAutoreleasePool.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCAttrs.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCCalls.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnusedInitDelegate.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransformActions.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h stable/9/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CXXABI.h stable/9/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Comment.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentBriefParser.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Decl.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclGroup.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Expr.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp stable/9/contrib/llvm/tools/clang/lib/AST/InheritViz.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Mangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Stmt.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TemplateName.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.h stable/9/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CFGStmtMap.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/FormatStringParsing.h stable/9/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/LangOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Module.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/SourceLocation.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/TokenKinds.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/VersionTuple.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCUDANV.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h stable/9/contrib/llvm/tools/clang/lib/Driver/Action.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/CC1AsOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Driver.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/InputInfo.h stable/9/contrib/llvm/tools/clang/lib/Driver/Job.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Option.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Phases.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.h stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h stable/9/contrib/llvm/tools/clang/lib/Driver/Types.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/WindowsToolChain.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/Commit.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp stable/9/contrib/llvm/tools/clang/lib/Format/Format.cpp stable/9/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp stable/9/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h stable/9/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp stable/9/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ChainedIncludesSource.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/LayoutOverrideSource.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticBuffer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp stable/9/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp stable/9/contrib/llvm/tools/clang/lib/Headers/altivec.h stable/9/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/avxintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h stable/9/contrib/llvm/tools/clang/lib/Headers/emmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/f16cintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/immintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/mm3dnow.h stable/9/contrib/llvm/tools/clang/lib/Headers/mm_malloc.h stable/9/contrib/llvm/tools/clang/lib/Headers/module.map stable/9/contrib/llvm/tools/clang/lib/Headers/pmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/smmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdalign.h stable/9/contrib/llvm/tools/clang/lib/Headers/stddef.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdint.h stable/9/contrib/llvm/tools/clang/lib/Headers/tmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/unwind.h stable/9/contrib/llvm/tools/clang/lib/Headers/x86intrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/xopintrin.h stable/9/contrib/llvm/tools/clang/lib/Lex/HeaderMap.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroArgs.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/TokenConcatenation.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h stable/9/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/Parser.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/DeltaTree.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/HTMLRewrite.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/Rewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/TokenRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FixItRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteMacros.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/Sema.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h stable/9/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/GeneratePCH.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/Module.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckers.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/APSIntType.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FunctionSummary.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/FileMatchTrie.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp stable/9/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp stable/9/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp stable/9/contrib/llvm/tools/clang/tools/driver/driver.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h stable/9/contrib/llvm/tools/llc/llc.cpp stable/9/contrib/llvm/tools/lli/RecordingMemoryManager.cpp stable/9/contrib/llvm/tools/lli/RecordingMemoryManager.h stable/9/contrib/llvm/tools/lli/RemoteTarget.h stable/9/contrib/llvm/tools/lli/lli.cpp stable/9/contrib/llvm/tools/llvm-ar/llvm-ar.cpp stable/9/contrib/llvm/tools/llvm-as/llvm-as.cpp stable/9/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp stable/9/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp stable/9/contrib/llvm/tools/llvm-diff/DiffConsumer.h stable/9/contrib/llvm/tools/llvm-diff/DiffLog.cpp stable/9/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp stable/9/contrib/llvm/tools/llvm-diff/DifferenceEngine.h stable/9/contrib/llvm/tools/llvm-diff/llvm-diff.cpp stable/9/contrib/llvm/tools/llvm-dis/llvm-dis.cpp stable/9/contrib/llvm/tools/llvm-extract/llvm-extract.cpp stable/9/contrib/llvm/tools/llvm-link/llvm-link.cpp stable/9/contrib/llvm/tools/llvm-mc/Disassembler.cpp stable/9/contrib/llvm/tools/llvm-mc/Disassembler.h stable/9/contrib/llvm/tools/llvm-mc/llvm-mc.cpp stable/9/contrib/llvm/tools/llvm-nm/llvm-nm.cpp stable/9/contrib/llvm/tools/llvm-objdump/MachODump.cpp stable/9/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/9/contrib/llvm/tools/llvm-objdump/llvm-objdump.h stable/9/contrib/llvm/tools/llvm-prof/llvm-prof.cpp stable/9/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp stable/9/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp stable/9/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp stable/9/contrib/llvm/tools/llvm-stress/llvm-stress.cpp stable/9/contrib/llvm/tools/macho-dump/macho-dump.cpp stable/9/contrib/llvm/tools/opt/AnalysisWrappers.cpp stable/9/contrib/llvm/tools/opt/GraphPrinters.cpp stable/9/contrib/llvm/tools/opt/PrintSCC.cpp stable/9/contrib/llvm/tools/opt/opt.cpp stable/9/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp stable/9/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp stable/9/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h stable/9/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenInstruction.h stable/9/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h stable/9/contrib/llvm/utils/TableGen/CodeGenMapTable.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenRegisters.h stable/9/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenSchedule.h stable/9/contrib/llvm/utils/TableGen/CodeGenTarget.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenTarget.h stable/9/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp stable/9/contrib/llvm/utils/TableGen/DAGISelMatcher.h stable/9/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp stable/9/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp stable/9/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp stable/9/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp stable/9/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp stable/9/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp stable/9/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp stable/9/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.cpp stable/9/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp stable/9/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h stable/9/contrib/llvm/utils/TableGen/SetTheory.cpp stable/9/contrib/llvm/utils/TableGen/SetTheory.h stable/9/contrib/llvm/utils/TableGen/StringToOffsetTable.h stable/9/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp stable/9/contrib/llvm/utils/TableGen/TableGen.cpp stable/9/contrib/llvm/utils/TableGen/TableGenBackends.h stable/9/contrib/llvm/utils/TableGen/X86DisassemblerShared.h stable/9/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp stable/9/contrib/llvm/utils/TableGen/X86DisassemblerTables.h stable/9/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp stable/9/contrib/llvm/utils/TableGen/X86RecognizableInstr.h stable/9/etc/mtree/BSD.include.dist stable/9/lib/clang/Makefile stable/9/lib/clang/clang.build.mk stable/9/lib/clang/include/Makefile stable/9/lib/clang/include/clang/Basic/Version.inc stable/9/lib/clang/include/llvm/Config/config.h stable/9/lib/clang/include/llvm/Config/llvm-config.h stable/9/lib/clang/libclanganalysis/Makefile stable/9/lib/clang/libclangarcmigrate/Makefile stable/9/lib/clang/libclangast/Makefile stable/9/lib/clang/libclangbasic/Makefile stable/9/lib/clang/libclangcodegen/Makefile stable/9/lib/clang/libclangedit/Makefile stable/9/lib/clang/libclangfrontend/Makefile stable/9/lib/clang/libclanglex/Makefile stable/9/lib/clang/libclangparse/Makefile stable/9/lib/clang/libclangrewritefrontend/Makefile stable/9/lib/clang/libclangsema/Makefile stable/9/lib/clang/libclangserialization/Makefile stable/9/lib/clang/libclangstaticanalyzercheckers/Makefile stable/9/lib/clang/libclangstaticanalyzercore/Makefile stable/9/lib/clang/libclangstaticanalyzerfrontend/Makefile stable/9/lib/clang/libllvmanalysis/Makefile stable/9/lib/clang/libllvmarmasmparser/Makefile stable/9/lib/clang/libllvmarmcodegen/Makefile stable/9/lib/clang/libllvmarmdesc/Makefile stable/9/lib/clang/libllvmarmdisassembler/Makefile stable/9/lib/clang/libllvmasmprinter/Makefile stable/9/lib/clang/libllvmbitreader/Makefile stable/9/lib/clang/libllvmbitwriter/Makefile stable/9/lib/clang/libllvmcodegen/Makefile stable/9/lib/clang/libllvmcore/Makefile stable/9/lib/clang/libllvmdebuginfo/Makefile stable/9/lib/clang/libllvminstrumentation/Makefile stable/9/lib/clang/libllvmipa/Makefile stable/9/lib/clang/libllvmlinker/Makefile stable/9/lib/clang/libllvmmc/Makefile stable/9/lib/clang/libllvmmcdisassembler/Makefile stable/9/lib/clang/libllvmmcjit/Makefile stable/9/lib/clang/libllvmmipscodegen/Makefile stable/9/lib/clang/libllvmmipsdesc/Makefile stable/9/lib/clang/libllvmmipsdisassembler/Makefile stable/9/lib/clang/libllvmobject/Makefile stable/9/lib/clang/libllvmpowerpccodegen/Makefile stable/9/lib/clang/libllvmscalaropts/Makefile stable/9/lib/clang/libllvmsupport/Makefile stable/9/lib/clang/libllvmtablegen/Makefile stable/9/lib/clang/libllvmtarget/Makefile stable/9/lib/clang/libllvmtransformutils/Makefile stable/9/lib/clang/libllvmvectorize/Makefile stable/9/lib/clang/libllvmx86asmparser/Makefile stable/9/lib/clang/libllvmx86codegen/Makefile stable/9/lib/clang/libllvmx86disassembler/Makefile stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/usr.bin/clang/bugpoint/Makefile stable/9/usr.bin/clang/bugpoint/bugpoint.1 stable/9/usr.bin/clang/clang-tblgen/Makefile stable/9/usr.bin/clang/clang/Makefile stable/9/usr.bin/clang/clang/clang.1 stable/9/usr.bin/clang/llc/Makefile stable/9/usr.bin/clang/llc/llc.1 stable/9/usr.bin/clang/lli/Makefile stable/9/usr.bin/clang/lli/lli.1 stable/9/usr.bin/clang/llvm-ar/Makefile stable/9/usr.bin/clang/llvm-ar/llvm-ar.1 stable/9/usr.bin/clang/llvm-as/Makefile stable/9/usr.bin/clang/llvm-as/llvm-as.1 stable/9/usr.bin/clang/llvm-bcanalyzer/Makefile stable/9/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 stable/9/usr.bin/clang/llvm-diff/Makefile stable/9/usr.bin/clang/llvm-diff/llvm-diff.1 stable/9/usr.bin/clang/llvm-dis/Makefile stable/9/usr.bin/clang/llvm-dis/llvm-dis.1 stable/9/usr.bin/clang/llvm-extract/Makefile stable/9/usr.bin/clang/llvm-extract/llvm-extract.1 stable/9/usr.bin/clang/llvm-link/Makefile stable/9/usr.bin/clang/llvm-link/llvm-link.1 stable/9/usr.bin/clang/llvm-mc/Makefile stable/9/usr.bin/clang/llvm-nm/Makefile stable/9/usr.bin/clang/llvm-nm/llvm-nm.1 stable/9/usr.bin/clang/llvm-objdump/Makefile stable/9/usr.bin/clang/llvm-prof/Makefile stable/9/usr.bin/clang/llvm-prof/llvm-prof.1 stable/9/usr.bin/clang/llvm-ranlib/Makefile stable/9/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 stable/9/usr.bin/clang/llvm-rtdyld/Makefile stable/9/usr.bin/clang/macho-dump/Makefile stable/9/usr.bin/clang/opt/Makefile stable/9/usr.bin/clang/opt/opt.1 stable/9/usr.bin/clang/tblgen/Makefile stable/9/usr.bin/clang/tblgen/tblgen.1 Directory Properties: stable/9/contrib/gcc/ (props changed) stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/lib/ (props changed) stable/9/lib/clang/ (props changed) stable/9/lib/clang/include/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/clang/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/Makefile.inc1 Thu Jul 4 20:17:04 2013 (r252723) @@ -371,7 +371,7 @@ IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFL # kernel stage KMAKEENV= ${WMAKEENV} -KMAKE= ${KMAKEENV} ${MAKE} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} +KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} # # buildworld Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/ObsoleteFiles.inc Thu Jul 4 20:17:04 2013 (r252723) @@ -38,6 +38,38 @@ # xargs -n1 | sort | uniq -d; # done +# 20130704: new clang import which bumps version from 3.2 to 3.3. +OLD_FILES+=usr/include/clang/3.2/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.2/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.2/altivec.h +OLD_FILES+=usr/include/clang/3.2/ammintrin.h +OLD_FILES+=usr/include/clang/3.2/avx2intrin.h +OLD_FILES+=usr/include/clang/3.2/avxintrin.h +OLD_FILES+=usr/include/clang/3.2/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.2/bmiintrin.h +OLD_FILES+=usr/include/clang/3.2/cpuid.h +OLD_FILES+=usr/include/clang/3.2/emmintrin.h +OLD_FILES+=usr/include/clang/3.2/f16cintrin.h +OLD_FILES+=usr/include/clang/3.2/fma4intrin.h +OLD_FILES+=usr/include/clang/3.2/fmaintrin.h +OLD_FILES+=usr/include/clang/3.2/immintrin.h +OLD_FILES+=usr/include/clang/3.2/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.2/mm3dnow.h +OLD_FILES+=usr/include/clang/3.2/mm_malloc.h +OLD_FILES+=usr/include/clang/3.2/mmintrin.h +OLD_FILES+=usr/include/clang/3.2/module.map +OLD_FILES+=usr/include/clang/3.2/nmmintrin.h +OLD_FILES+=usr/include/clang/3.2/pmmintrin.h +OLD_FILES+=usr/include/clang/3.2/popcntintrin.h +OLD_FILES+=usr/include/clang/3.2/rtmintrin.h +OLD_FILES+=usr/include/clang/3.2/smmintrin.h +OLD_FILES+=usr/include/clang/3.2/tmmintrin.h +OLD_FILES+=usr/include/clang/3.2/unwind.h +OLD_FILES+=usr/include/clang/3.2/wmmintrin.h +OLD_FILES+=usr/include/clang/3.2/x86intrin.h +OLD_FILES+=usr/include/clang/3.2/xmmintrin.h +OLD_FILES+=usr/include/clang/3.2/xopintrin.h +OLD_DIRS+=usr/include/clang/3.2 # 20130701: vfs_mount.9 removed OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20130624: vinum.4 removed Modified: stable/9/contrib/gcc/unwind-dw2.c ============================================================================== --- stable/9/contrib/gcc/unwind-dw2.c Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/gcc/unwind-dw2.c Thu Jul 4 20:17:04 2013 (r252723) @@ -1438,17 +1438,6 @@ uw_init_context_1 (struct _Unwind_Contex context->ra = __builtin_extract_return_addr (outer_ra); } -#if defined(__clang__) && defined(__amd64__) -/* Some versions of clang don't save and restore all callee registers, if a - __builtin_eh_return() intrinsic is used in a function. This is particularly - bad on amd64. For now, use the following ugly hack to force it to assume - those registers are clobbered, when invoking __builtin_eh_return(), so it - will emit code to save and restore them. */ -#define CLOBBER_REGS_HACK \ - __asm __volatile(" " : : : "r15", "r14", "r13", "r12", "rbx", "rdx", "rax"); -#else -#define CLOBBER_REGS_HACK -#endif /* __clang__ */ /* Install TARGET into CURRENT so that we can return to it. This is a macro because __builtin_eh_return must be invoked in the context of @@ -1459,7 +1448,6 @@ uw_init_context_1 (struct _Unwind_Contex { \ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ - CLOBBER_REGS_HACK \ __builtin_eh_return (offset, handler); \ } \ while (0) Modified: stable/9/contrib/llvm/LICENSE.TXT ============================================================================== --- stable/9/contrib/llvm/LICENSE.TXT Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/LICENSE.TXT Thu Jul 4 20:17:04 2013 (r252723) @@ -4,7 +4,7 @@ LLVM Release License University of Illinois/NCSA Open Source License -Copyright (c) 2003-2012 University of Illinois at Urbana-Champaign. +Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: @@ -64,7 +64,7 @@ Program Directory Autoconf llvm/autoconf llvm/projects/ModuleMaker/autoconf llvm/projects/sample/autoconf -CellSPU backend llvm/lib/Target/CellSPU/README.txt Google Test llvm/utils/unittest/googletest OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} +ARM contributions llvm/lib/Target/ARM/LICENSE.TXT Modified: stable/9/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Core.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Core.h Thu Jul 4 20:17:04 2013 (r252723) @@ -18,13 +18,6 @@ #include "llvm/Support/DataTypes.h" #ifdef __cplusplus - -/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap' - and 'unwrap' conversion functions. */ -#include "llvm/IRBuilder.h" -#include "llvm/Module.h" -#include "llvm/PassRegistry.h" - extern "C" { #endif @@ -60,11 +53,6 @@ extern "C" { * with C++ due to name mangling. So in addition to C, this interface enables * tools written in such languages. * - * When included into a C++ source file, also declares 'wrap' and 'unwrap' - * helpers to perform opaque reference<-->pointer conversions. These helpers - * are shorter and more tightly typed than writing the casts by hand when - * authoring bindings. In assert builds, they will do runtime type checking. - * * @{ */ @@ -173,10 +161,11 @@ typedef enum { LLVMUWTable = 1 << 30, LLVMNonLazyBind = 1 << 31 - /* FIXME: This attribute is currently not included in the C API as + /* FIXME: These attributes are currently not included in the C API as a temporary measure until the API/ABI impact to the C API is understood and the path forward agreed upon. - LLVMAddressSafety = 1ULL << 32 + LLVMAddressSafety = 1ULL << 32, + LLVMStackProtectStrongAttribute = 1ULL<<33 */ } LLVMAttribute; @@ -351,12 +340,74 @@ typedef enum { LLVMLandingPadFilter /**< A filter clause */ } LLVMLandingPadClauseTy; +typedef enum { + LLVMNotThreadLocal = 0, + LLVMGeneralDynamicTLSModel, + LLVMLocalDynamicTLSModel, + LLVMInitialExecTLSModel, + LLVMLocalExecTLSModel +} LLVMThreadLocalMode; + +typedef enum { + LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */ + LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees + somewhat sane results, lock free. */ + LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the + operations affecting a specific address, + a consistent ordering exists */ + LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort + necessary to acquire a lock to access other + memory with normal loads and stores. */ + LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with + a barrier of the sort necessary to release + a lock. */ + LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a + Release barrier (for fences and + operations which both read and write + memory). */ + LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics + for loads and Release + semantics for stores. + Additionally, it guarantees + that a total ordering exists + between all + SequentiallyConsistent + operations. */ +} LLVMAtomicOrdering; + +typedef enum { + LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */ + LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */ + LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */ + LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */ + LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */ + LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */ + LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */ + LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the + original using a signed comparison and return + the old one */ + LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the + original using a signed comparison and return + the old one */ + LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the + original using an unsigned comparison and return + the old one */ + LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the + original using an unsigned comparison and return + the old one */ +} LLVMAtomicRMWBinOp; + /** * @} */ void LLVMInitializeCore(LLVMPassRegistryRef R); +/** Deallocate and destroy all ManagedStatic variables. + @see llvm::llvm_shutdown + @see ManagedStatic */ +void LLVMShutdown(); + /*===-- Error handling ----------------------------------------------------===*/ @@ -1051,24 +1102,24 @@ LLVMTypeRef LLVMX86MMXType(void); macro(SwitchInst) \ macro(UnreachableInst) \ macro(ResumeInst) \ - macro(UnaryInstruction) \ - macro(AllocaInst) \ - macro(CastInst) \ - macro(BitCastInst) \ - macro(FPExtInst) \ - macro(FPToSIInst) \ - macro(FPToUIInst) \ - macro(FPTruncInst) \ - macro(IntToPtrInst) \ - macro(PtrToIntInst) \ - macro(SExtInst) \ - macro(SIToFPInst) \ - macro(TruncInst) \ - macro(UIToFPInst) \ - macro(ZExtInst) \ - macro(ExtractValueInst) \ - macro(LoadInst) \ - macro(VAArgInst) + macro(UnaryInstruction) \ + macro(AllocaInst) \ + macro(CastInst) \ + macro(BitCastInst) \ + macro(FPExtInst) \ + macro(FPToSIInst) \ + macro(FPToUIInst) \ + macro(FPTruncInst) \ + macro(IntToPtrInst) \ + macro(PtrToIntInst) \ + macro(SExtInst) \ + macro(SIToFPInst) \ + macro(TruncInst) \ + macro(UIToFPInst) \ + macro(ZExtInst) \ + macro(ExtractValueInst) \ + macro(LoadInst) \ + macro(VAArgInst) /** * @defgroup LLVMCCoreValueGeneral General APIs @@ -1600,6 +1651,10 @@ LLVMBool LLVMIsThreadLocal(LLVMValueRef void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal); LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant); +LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar); +void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode); +LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); +void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); /** * @} @@ -1688,6 +1743,13 @@ void LLVMSetGC(LLVMValueRef Fn, const ch void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA); /** + * Add a target-dependent attribute to a fuction + * @see llvm::AttrBuilder::addAttribute() + */ +void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, + const char *V); + +/** * Obtain an attribute from a function. * * @see llvm::Function::getAttributes() @@ -2509,6 +2571,10 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuil const char *Name); LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); +LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, + LLVMValueRef PTR, LLVMValueRef Val, + LLVMAtomicOrdering ordering, + LLVMBool singleThread); /** * @} @@ -2547,6 +2613,15 @@ LLVMBool LLVMCreateMemoryBufferWithConte char **OutMessage); LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage); +LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, + size_t InputDataLength, + const char *BufferName, + LLVMBool RequiresNullTerminator); +LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, + size_t InputDataLength, + const char *BufferName); +const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf); +size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf); void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); /** @@ -2619,6 +2694,30 @@ void LLVMDisposePassManager(LLVMPassMana */ /** + * @defgroup LLVMCCoreThreading Threading + * + * Handle the structures needed to make LLVM safe for multithreading. + * + * @{ + */ + +/** Allocate and initialize structures needed to make LLVM safe for + multithreading. The return value indicates whether multithreaded + initialization succeeded. Must be executed in isolation from all + other LLVM api calls. + @see llvm::llvm_start_multithreaded */ +LLVMBool LLVMStartMultithreaded(); + +/** Deallocate structures necessary to make LLVM safe for multithreading. + Must be executed in isolation from all other LLVM api calls. + @see llvm::llvm_stop_multithreaded */ +void LLVMStopMultithreaded(); + +/** Check whether LLVM is executing in thread-safe mode or not. + @see llvm::llvm_is_multithreaded */ +LLVMBool LLVMIsMultithreaded(); + +/** * @} */ @@ -2626,102 +2725,12 @@ void LLVMDisposePassManager(LLVMPassMana * @} */ -#ifdef __cplusplus -} +/** + * @} + */ -namespace llvm { - class MemoryBuffer; - class PassManagerBase; - - #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - inline ty *unwrap(ref P) { \ - return reinterpret_cast(P); \ - } \ - \ - inline ref wrap(const ty *P) { \ - return reinterpret_cast(const_cast(P)); \ - } - - #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \ - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - \ - template \ - inline T *unwrap(ref P) { \ - return cast(unwrap(P)); \ - } - - #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \ - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - \ - template \ - inline T *unwrap(ref P) { \ - T *Q = (T*)unwrap(P); \ - assert(Q && "Invalid cast!"); \ - return Q; \ - } - - DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef ) - DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef ) - DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef ) - DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassRegistry, LLVMPassRegistryRef ) - /* LLVMModuleProviderRef exists for historical reasons, but now just holds a - * Module. - */ - inline Module *unwrap(LLVMModuleProviderRef MP) { - return reinterpret_cast(MP); - } - - #undef DEFINE_STDCXX_CONVERSION_FUNCTIONS - #undef DEFINE_ISA_CONVERSION_FUNCTIONS - #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS - - /* Specialized opaque context conversions. - */ - inline LLVMContext **unwrap(LLVMContextRef* Tys) { - return reinterpret_cast(Tys); - } - - inline LLVMContextRef *wrap(const LLVMContext **Tys) { - return reinterpret_cast(const_cast(Tys)); - } - - /* Specialized opaque type conversions. - */ - inline Type **unwrap(LLVMTypeRef* Tys) { - return reinterpret_cast(Tys); - } - - inline LLVMTypeRef *wrap(Type **Tys) { - return reinterpret_cast(const_cast(Tys)); - } - - /* Specialized opaque value conversions. - */ - inline Value **unwrap(LLVMValueRef *Vals) { - return reinterpret_cast(Vals); - } - - template - inline T **unwrap(LLVMValueRef *Vals, unsigned Length) { - #ifdef DEBUG - for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I) - cast(*I); - #endif - (void)Length; - return reinterpret_cast(Vals); - } - - inline LLVMValueRef *wrap(const Value **Vals) { - return reinterpret_cast(const_cast(Vals)); - } +#ifdef __cplusplus } - #endif /* !defined(__cplusplus) */ #endif /* !defined(LLVM_C_CORE_H) */ Modified: stable/9/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Disassembler.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Disassembler.h Thu Jul 4 20:17:04 2013 (r252723) @@ -139,13 +139,26 @@ extern "C" { * by passing a block of information in the DisInfo parameter and specifying the * TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it - * returns NULL. + * returns NULL. This function is equivalent to calling LLVMCreateDisasmCPU() + * with an empty CPU name. */ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp); /** + * Create a disassembler for the TripleName and a specific CPU. Symbolic + * disassembly is supported by passing a block of information in the DisInfo + * parameter and specifying the TagType and callback functions as described + * above. These can all be passed * as NULL. If successful, this returns a + * disassembler context. If not, it returns NULL. + */ +LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, + void *DisInfo, int TagType, + LLVMOpInfoCallback GetOpInfo, + LLVMSymbolLookupCallback SymbolLookUp); + +/** * Set the disassembler's options. Returns 1 if it can set the Options and 0 * otherwise. */ @@ -153,6 +166,10 @@ int LLVMSetDisasmOptions(LLVMDisasmConte /* The option to produce marked up assembly. */ #define LLVMDisassembler_Option_UseMarkup 1 +/* The option to print immediates as hex. */ +#define LLVMDisassembler_Option_PrintImmHex 2 +/* The option use the other assembler printer variant */ +#define LLVMDisassembler_Option_AsmPrinterVariant 4 /** * Dispose of a disassembler context. Modified: stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h Thu Jul 4 20:17:04 2013 (r252723) @@ -21,6 +21,7 @@ #include "llvm-c/Core.h" #include "llvm-c/Target.h" +#include "llvm-c/TargetMachine.h" #ifdef __cplusplus extern "C" { @@ -34,11 +35,19 @@ extern "C" { */ void LLVMLinkInJIT(void); +void LLVMLinkInMCJIT(void); void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; +struct LLVMMCJITCompilerOptions { + unsigned OptLevel; + LLVMCodeModel CodeModel; + LLVMBool NoFramePointerElim; + LLVMBool EnableFastISel; +}; + /*===-- Operations on generic values --------------------------------------===*/ LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, @@ -75,6 +84,31 @@ LLVMBool LLVMCreateJITCompilerForModule( unsigned OptLevel, char **OutError); +void LLVMInitializeMCJITCompilerOptions( + struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions); + +/** + * Create an MCJIT execution engine for a module, with the given options. It is + * the responsibility of the caller to ensure that all fields in Options up to + * the given SizeOfOptions are initialized. It is correct to pass a smaller + * value of SizeOfOptions that omits some fields. The canonical way of using + * this is: + * + * LLVMMCJITCompilerOptions options; + * LLVMInitializeMCJITCompilerOptions(&options, sizeof(options)); + * ... fill in those options you care about + * LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options), + * &error); + * + * Note that this is also correct, though possibly suboptimal: + * + * LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error); + */ +LLVMBool LLVMCreateMCJITCompilerForModule( + LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, + struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions, + char **OutError); + /** Deprecated: Use LLVMCreateExecutionEngineForModule instead. */ LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE, LLVMModuleProviderRef MP, @@ -123,7 +157,8 @@ LLVMBool LLVMRemoveModuleProvider(LLVMEx LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, LLVMValueRef *OutFn); -void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, LLVMValueRef Fn); +void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, + LLVMValueRef Fn); LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE); @@ -137,27 +172,7 @@ void *LLVMGetPointerToGlobal(LLVMExecuti */ #ifdef __cplusplus -} - -namespace llvm { - struct GenericValue; - class ExecutionEngine; - - #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - inline ty *unwrap(ref P) { \ - return reinterpret_cast(P); \ - } \ - \ - inline ref wrap(const ty *P) { \ - return reinterpret_cast(const_cast(P)); \ - } - - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ExecutionEngine, LLVMExecutionEngineRef) - - #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS -} - +} #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/Initialization.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Initialization.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Initialization.h Thu Jul 4 20:17:04 2013 (r252723) @@ -34,6 +34,7 @@ extern "C" { void LLVMInitializeCore(LLVMPassRegistryRef R); void LLVMInitializeTransformUtils(LLVMPassRegistryRef R); void LLVMInitializeScalarOpts(LLVMPassRegistryRef R); +void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R); void LLVMInitializeVectorization(LLVMPassRegistryRef R); void LLVMInitializeInstCombine(LLVMPassRegistryRef R); void LLVMInitializeIPO(LLVMPassRegistryRef R); Modified: stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Thu Jul 4 20:17:04 2013 (r252723) @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#ifndef __LTO_CAPI_H__ -#define __LTO_CAPI_H__ +#ifndef LLVM_C_LINKTIMEOPTIMIZER_H +#define LLVM_C_LINKTIMEOPTIMIZER_H #ifdef __cplusplus extern "C" { Modified: stable/9/contrib/llvm/include/llvm-c/Object.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Object.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Object.h Thu Jul 4 20:17:04 2013 (r252723) @@ -23,8 +23,6 @@ #include "llvm/Config/llvm-config.h" #ifdef __cplusplus -#include "llvm/Object/ObjectFile.h" - extern "C" { #endif @@ -99,50 +97,6 @@ const char *LLVMGetRelocationValueString #ifdef __cplusplus } - -namespace llvm { - namespace object { - inline ObjectFile *unwrap(LLVMObjectFileRef OF) { - return reinterpret_cast(OF); - } - - inline LLVMObjectFileRef wrap(const ObjectFile *OF) { - return reinterpret_cast(const_cast(OF)); - } - - inline section_iterator *unwrap(LLVMSectionIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMSectionIteratorRef - wrap(const section_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - inline symbol_iterator *unwrap(LLVMSymbolIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMSymbolIteratorRef - wrap(const symbol_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - inline relocation_iterator *unwrap(LLVMRelocationIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMRelocationIteratorRef - wrap(const relocation_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - } -} - #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Target.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Target.h Thu Jul 4 20:17:04 2013 (r252723) @@ -235,29 +235,6 @@ void LLVMDisposeTargetData(LLVMTargetDat #ifdef __cplusplus } - -namespace llvm { - class DataLayout; - class TargetLibraryInfo; - - inline DataLayout *unwrap(LLVMTargetDataRef P) { - return reinterpret_cast(P); - } - - inline LLVMTargetDataRef wrap(const DataLayout *P) { - return reinterpret_cast(const_cast(P)); - } - - inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) { - return reinterpret_cast(P); - } - - inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) { - TargetLibraryInfo *X = const_cast(P); - return reinterpret_cast(X); - } -} - #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/TargetMachine.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/TargetMachine.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/TargetMachine.h Thu Jul 4 20:17:04 2013 (r252723) @@ -20,11 +20,12 @@ #define LLVM_C_TARGETMACHINE_H #include "llvm-c/Core.h" +#include "llvm-c/Target.h" #ifdef __cplusplus extern "C" { #endif -typedef struct LLVMTargetMachine *LLVMTargetMachineRef; +typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef; typedef struct LLVMTarget *LLVMTargetRef; typedef enum { @@ -113,30 +114,11 @@ LLVMTargetDataRef LLVMGetTargetMachineDa LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage); - - - +/** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */ +LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, + LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf); #ifdef __cplusplus } - -namespace llvm { - class TargetMachine; - class Target; - - inline TargetMachine *unwrap(LLVMTargetMachineRef P) { - return reinterpret_cast(P); - } - inline Target *unwrap(LLVMTargetRef P) { - return reinterpret_cast(P); - } - inline LLVMTargetMachineRef wrap(const TargetMachine *P) { - return reinterpret_cast( - const_cast(P)); - } - inline LLVMTargetRef wrap(const Target * P) { - return reinterpret_cast(const_cast(P)); - } -} #endif #endif Modified: stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h Thu Jul 4 20:17:04 2013 (r252723) @@ -11,8 +11,8 @@ |* *| \*===----------------------------------------------------------------------===*/ -#ifndef LLVM_C_PASSMANAGERBUILDER -#define LLVM_C_PASSMANAGERBUILDER +#ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H +#define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H #include "llvm-c/Core.h" @@ -77,8 +77,8 @@ LLVMPassManagerBuilderPopulateModulePass /** See llvm::PassManagerBuilder::populateLTOPassManager. */ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, LLVMPassManagerRef PM, - bool Internalize, - bool RunInliner); + LLVMBool Internalize, + LLVMBool RunInliner); /** * @} @@ -86,16 +86,6 @@ void LLVMPassManagerBuilderPopulateLTOPa #ifdef __cplusplus } - -namespace llvm { - inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) { - return reinterpret_cast(P); - } - - inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) { - return reinterpret_cast(P); - } -} #endif #endif Modified: stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h Thu Jul 4 20:17:04 2013 (r252723) @@ -39,6 +39,9 @@ void LLVMAddBBVectorizePass(LLVMPassMana /** See llvm::createLoopVectorizePass function. */ void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM); +/** See llvm::createSLPVectorizerPass function. */ +void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM); + /** * @} */ Modified: stable/9/contrib/llvm/include/llvm-c/lto.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/lto.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/lto.h Thu Jul 4 20:17:04 2013 (r252723) @@ -13,8 +13,8 @@ |* *| \*===----------------------------------------------------------------------===*/ -#ifndef LTO_H -#define LTO_H 1 +#ifndef LLVM_C_LTO_H +#define LLVM_C_LTO_H #include #include @@ -291,6 +291,13 @@ lto_codegen_compile_to_file(lto_code_gen extern void lto_codegen_debug_options(lto_code_gen_t cg, const char *); +/** + * Initializes LLVM disassemblers. + * FIXME: This doesn't really belong here. + */ +extern void +lto_initialize_disassembler(void); + #ifdef __cplusplus } #endif Modified: stable/9/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/ADT/APFloat.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm/ADT/APFloat.h Thu Jul 4 20:17:04 2013 (r252723) @@ -97,8 +97,8 @@ nexttoward. */ -#ifndef LLVM_FLOAT_H -#define LLVM_FLOAT_H +#ifndef LLVM_ADT_APFLOAT_H +#define LLVM_ADT_APFLOAT_H // APInt contains static functions implementing bignum arithmetic. #include "llvm/ADT/APInt.h" @@ -184,9 +184,9 @@ namespace llvm { APFloat(const fltSemantics &, integerPart); APFloat(const fltSemantics &, fltCategory, bool negative); APFloat(const fltSemantics &, uninitializedTag); + APFloat(const fltSemantics &, const APInt &); explicit APFloat(double d); explicit APFloat(float f); - explicit APFloat(const APInt &, bool isIEEE = false); APFloat(const APFloat &); ~APFloat(); @@ -300,7 +300,7 @@ namespace llvm { /* The definition of equality is not straightforward for floating point, so we won't use operator==. Use one of the following, or write whatever it is you really mean. */ - // bool operator==(const APFloat &) const; // DO NOT IMPLEMENT + bool operator==(const APFloat &) const LLVM_DELETED_FUNCTION; /* IEEE comparison with another floating point number (NaNs compare unordered, 0==-0). */ @@ -327,6 +327,7 @@ namespace llvm { bool isNegative() const { return sign; } bool isPosZero() const { return isZero() && !isNegative(); } bool isNegZero() const { return isZero() && isNegative(); } + bool isDenormal() const; APFloat& operator=(const APFloat &); @@ -422,7 +423,7 @@ namespace llvm { APInt convertQuadrupleAPFloatToAPInt() const; APInt convertF80LongDoubleAPFloatToAPInt() const; APInt convertPPCDoubleDoubleAPFloatToAPInt() const; - void initFromAPInt(const APInt& api, bool isIEEE = false); + void initFromAPInt(const fltSemantics *Sem, const APInt& api); void initFromHalfAPInt(const APInt& api); void initFromFloatAPInt(const APInt& api); void initFromDoubleAPInt(const APInt& api); @@ -462,4 +463,4 @@ namespace llvm { hash_code hash_value(const APFloat &Arg); } /* namespace llvm */ -#endif /* LLVM_FLOAT_H */ +#endif /* LLVM_ADT_APFLOAT_H */ Modified: stable/9/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/ADT/APInt.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm/ADT/APInt.h Thu Jul 4 20:17:04 2013 (r252723) @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_APINT_H -#define LLVM_APINT_H +#ifndef LLVM_ADT_APINT_H +#define LLVM_ADT_APINT_H #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" @@ -274,7 +274,7 @@ public: initSlowCase(that); } -#if LLVM_USE_RVALUE_REFERENCES +#if LLVM_HAS_RVALUE_REFERENCES /// @brief Move Constructor. APInt(APInt&& that) : BitWidth(that.BitWidth), VAL(that.VAL) { that.BitWidth = 0; @@ -427,7 +427,7 @@ public: /// @returns the all-ones value for an APInt of the specified bit-width. /// @brief Get the all-ones value. static APInt getAllOnesValue(unsigned numBits) { - return APInt(numBits, -1ULL, true); + return APInt(numBits, UINT64_MAX, true); } /// @returns the '0' value for an APInt of the specified bit-width. @@ -498,13 +498,24 @@ public: if (loBitsSet == 0) return APInt(numBits, 0); if (loBitsSet == APINT_BITS_PER_WORD) - return APInt(numBits, -1ULL); + return APInt(numBits, UINT64_MAX); // For small values, return quickly. if (loBitsSet <= APINT_BITS_PER_WORD) - return APInt(numBits, -1ULL >> (APINT_BITS_PER_WORD - loBitsSet)); + return APInt(numBits, UINT64_MAX >> (APINT_BITS_PER_WORD - loBitsSet)); return getAllOnesValue(numBits).lshr(numBits - loBitsSet); } + /// \brief Return a value containing V broadcasted over NewLen bits. + static APInt getSplat(unsigned NewLen, const APInt &V) { + assert(NewLen >= V.getBitWidth() && "Can't splat to smaller bit width!"); + + APInt Val = V.zextOrSelf(NewLen); + for (unsigned I = V.getBitWidth(); I < NewLen; I <<= 1) + Val |= Val << I; + + return Val; + } + /// \brief Determine if two APInts have the same value, after zero-extending /// one of them (if needed!) to ensure that the bit-widths match. static bool isSameValue(const APInt &I1, const APInt &I2) { @@ -601,7 +612,7 @@ public: return AssignSlowCase(RHS); } -#if LLVM_USE_RVALUE_REFERENCES +#if LLVM_HAS_RVALUE_REFERENCES /// @brief Move assignment operator. APInt& operator=(APInt&& that) { if (!isSingleWord()) @@ -799,16 +810,7 @@ public: /// Signed divide this APInt by APInt RHS. /// @brief Signed division function for APInt. - APInt sdiv(const APInt &RHS) const { - if (isNegative()) - if (RHS.isNegative()) - return (-(*this)).udiv(-RHS); - else - return -((-(*this)).udiv(RHS)); - else if (RHS.isNegative()) - return -(this->udiv(-RHS)); - return this->udiv(RHS); - } + APInt sdiv(const APInt &RHS) const; /// Perform an unsigned remainder operation on this APInt with RHS being the /// divisor. Both this and RHS are treated as unsigned quantities for purposes @@ -821,16 +823,7 @@ public: /// Signed remainder operation on APInt. /// @brief Function for signed remainder operation. - APInt srem(const APInt &RHS) const { - if (isNegative()) - if (RHS.isNegative()) - return -((-(*this)).urem(-RHS)); - else - return -((-(*this)).urem(RHS)); - else if (RHS.isNegative()) - return this->urem(-RHS); - return this->urem(RHS); - } + APInt srem(const APInt &RHS) const; /// Sometimes it is convenient to divide two APInt values and obtain both the /// quotient and remainder. This function does both operations in the same @@ -842,24 +835,9 @@ public: APInt &Quotient, APInt &Remainder); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:17:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AFB0F618; Thu, 4 Jul 2013 20:17:39 +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 9ED8E1CEA; Thu, 4 Jul 2013 20:17:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KHdhx029644; Thu, 4 Jul 2013 20:17:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KHd3g029643; Thu, 4 Jul 2013 20:17:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307042017.r64KHd3g029643@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 20:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252724 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:17:39 -0000 Author: np Date: Thu Jul 4 20:17:39 2013 New Revision: 252724 URL: http://svnweb.freebsd.org/changeset/base/252724 Log: On-the-fly changes to the interrupt coalescing timer should apply to the TOE rx queues too. MFC after: 1 day Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jul 4 20:17:04 2013 (r252723) +++ head/sys/dev/cxgbe/t4_main.c Thu Jul 4 20:17:39 2013 (r252724) @@ -4646,6 +4646,9 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_AR struct adapter *sc = pi->adapter; int idx, rc, i; struct sge_rxq *rxq; +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif uint8_t v; idx = pi->tmr_idx; @@ -4670,6 +4673,15 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_AR rxq->iq.intr_params = v; #endif } +#ifdef TCP_OFFLOAD + for_each_ofld_rxq(pi, i, ofld_rxq) { +#ifdef atomic_store_rel_8 + atomic_store_rel_8(&ofld_rxq->iq.intr_params, v); +#else + ofld_rxq->iq.intr_params = v; +#endif + } +#endif pi->tmr_idx = idx; end_synchronized_op(sc, LOCK_HELD); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:40:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40A8FD4E; Thu, 4 Jul 2013 20:40:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 08FC11DC2; Thu, 4 Jul 2013 20:40:48 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id B6CECF07; Thu, 4 Jul 2013 22:36:04 +0200 (CEST) Date: Thu, 4 Jul 2013 22:41:12 +0200 From: Pawel Jakub Dawidek To: "Pedro F. Giffuni" Subject: Re: svn commit: r252435 - in head/sys/ufs: ffs ufs Message-ID: <20130704204112.GC1402@garage.freebsd.pl> References: <201307010300.r6130GWT035496@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q9KOos5vDmpwPx9o" Content-Disposition: inline In-Reply-To: <201307010300.r6130GWT035496@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:40:49 -0000 --q9KOos5vDmpwPx9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 01, 2013 at 03:00:16AM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Jul 1 03:00:15 2013 > New Revision: 252435 > URL: http://svnweb.freebsd.org/changeset/base/252435 >=20 > Log: > Change i_gen in UFS to an unsigned type. > =20 > In UFS, i_gen is a random generated value and there is not way for > it to be negative. Actually, the value of i_gen is just used to > match bit patterns and it is of not consequence if the values are > signed or not. > =20 > Following other filesystems, set it to unsigned and use it as such, > =20 > Discussed by: mckusick > Reviewed by: mckusick (previous version) > MFC after: 4 weeks [...] > printf("ufs_extattr_get (%s): inode number inconsistency (%d, %jd)\n", > - mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (intmax_t)ip->i_gen); > + mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, (uintmax_t)ip->i_gen); For uintmax_t you also need to change %jd to %ju. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --q9KOos5vDmpwPx9o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHV3egACgkQForvXbEpPzRYMQCfZmA25OrItS3NSYXcgxvcm/9A EnwAoJZmG8gYdirggMhTxjVEPSdDuPLi =5qT9 -----END PGP SIGNATURE----- --q9KOos5vDmpwPx9o-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 20:57:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05C9A463; Thu, 4 Jul 2013 20:57:17 +0000 (UTC) (envelope-from rpaulo@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 EC3991E7F; Thu, 4 Jul 2013 20:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KvGng041018; Thu, 4 Jul 2013 20:57:16 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KvFWI041007; Thu, 4 Jul 2013 20:57:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307042057.r64KvFWI041007@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 20:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252725 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 20:57:17 -0000 Author: rpaulo Date: Thu Jul 4 20:57:15 2013 New Revision: 252725 URL: http://svnweb.freebsd.org/changeset/base/252725 Log: Set ic_cryptocaps to make sure wpa_supplicant works with WEP. Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_rum.c Thu Jul 4 20:57:15 2013 (r252725) @@ -502,6 +502,12 @@ rum_attach(device_t self) | IEEE80211_C_WPA /* 802.11i */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_uath.c Thu Jul 4 20:57:15 2013 (r252725) @@ -457,6 +457,12 @@ uath_attach(device_t dev) IEEE80211_C_BGSCAN | /* capable of bg scanning */ IEEE80211_C_TXFRAG; /* handle tx frags */ + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + /* put a regulatory domain to reveal informations. */ uath_regdomain = sc->sc_devcap.regDomain; Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_upgt.c Thu Jul 4 20:57:15 2013 (r252725) @@ -353,6 +353,12 @@ upgt_attach(device_t dev) | IEEE80211_C_WPA /* 802.11i */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_ural.c Thu Jul 4 20:57:15 2013 (r252725) @@ -487,6 +487,12 @@ ural_attach(device_t self) | IEEE80211_C_WPA /* 802.11i */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_urtw.c Thu Jul 4 20:57:15 2013 (r252725) @@ -893,6 +893,12 @@ urtw_attach(device_t dev) IEEE80211_C_BGSCAN | /* capable of bg scanning */ IEEE80211_C_WPA; /* 802.11i */ + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Jul 4 20:57:15 2013 (r252725) @@ -419,6 +419,12 @@ urtwn_attach(device_t self) | IEEE80211_C_WPA /* 802.11i */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jul 4 20:17:39 2013 (r252724) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jul 4 20:57:15 2013 (r252725) @@ -400,6 +400,12 @@ zyd_attach(device_t dev) | IEEE80211_C_WPA /* 802.11i */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_AES_CCM | + IEEE80211_CRYPTO_TKIPMIC | + IEEE80211_CRYPTO_TKIP; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 21:12:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD228947; Thu, 4 Jul 2013 21:12:59 +0000 (UTC) (envelope-from rpaulo@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 BB46F1F1A; Thu, 4 Jul 2013 21:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LCxcf046805; Thu, 4 Jul 2013 21:12:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64LCwVc046799; Thu, 4 Jul 2013 21:12:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307042112.r64LCwVc046799@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 21:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252726 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hostapd/logwatch contrib/wpa/patches contrib/wpa/src contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto cont... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 21:12:59 -0000 Author: rpaulo Date: Thu Jul 4 21:12:58 2013 New Revision: 252726 URL: http://svnweb.freebsd.org/changeset/base/252726 Log: Merge hostapd / wpa_supplicant 2.0. Reviewed by: adrian (driver_bsd + usr.sbin/wpa) Added: head/contrib/wpa/hostapd/hlr_auc_gw.txt - copied unchanged from r252191, vendor/wpa/dist/hostapd/hlr_auc_gw.txt head/contrib/wpa/hostapd/hostapd.eap_user_sqlite - copied unchanged from r252191, vendor/wpa/dist/hostapd/hostapd.eap_user_sqlite head/contrib/wpa/patches/openssl-0.9.8x-tls-extensions.patch - copied unchanged from r252191, vendor/wpa/dist/patches/openssl-0.9.8x-tls-extensions.patch head/contrib/wpa/src/ap/eap_user_db.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/eap_user_db.c head/contrib/wpa/src/ap/gas_serv.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/gas_serv.c head/contrib/wpa/src/ap/gas_serv.h - copied unchanged from r252191, vendor/wpa/dist/src/ap/gas_serv.h head/contrib/wpa/src/ap/hs20.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/hs20.c head/contrib/wpa/src/ap/hs20.h - copied unchanged from r252191, vendor/wpa/dist/src/ap/hs20.h head/contrib/wpa/src/ap/ieee802_11_shared.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/ieee802_11_shared.c head/contrib/wpa/src/ap/ieee802_11_vht.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/ieee802_11_vht.c head/contrib/wpa/src/ap/p2p_hostapd.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/p2p_hostapd.c head/contrib/wpa/src/ap/p2p_hostapd.h - copied unchanged from r252191, vendor/wpa/dist/src/ap/p2p_hostapd.h head/contrib/wpa/src/ap/vlan_util.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/vlan_util.c head/contrib/wpa/src/ap/vlan_util.h - copied unchanged from r252191, vendor/wpa/dist/src/ap/vlan_util.h head/contrib/wpa/src/ap/wnm_ap.c - copied unchanged from r252191, vendor/wpa/dist/src/ap/wnm_ap.c head/contrib/wpa/src/ap/wnm_ap.h - copied unchanged from r252191, vendor/wpa/dist/src/ap/wnm_ap.h head/contrib/wpa/src/common/gas.c - copied unchanged from r252191, vendor/wpa/dist/src/common/gas.c head/contrib/wpa/src/common/gas.h - copied unchanged from r252191, vendor/wpa/dist/src/common/gas.h head/contrib/wpa/src/crypto/aes-ccm.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/aes-ccm.c head/contrib/wpa/src/crypto/aes-gcm.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/aes-gcm.c head/contrib/wpa/src/crypto/random.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/random.c head/contrib/wpa/src/crypto/random.h - copied unchanged from r252191, vendor/wpa/dist/src/crypto/random.h head/contrib/wpa/src/crypto/sha1-prf.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/sha1-prf.c head/contrib/wpa/src/crypto/sha256-prf.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/sha256-prf.c head/contrib/wpa/src/crypto/sha256-tlsprf.c - copied unchanged from r252191, vendor/wpa/dist/src/crypto/sha256-tlsprf.c head/contrib/wpa/src/crypto/sha256_i.h - copied unchanged from r252191, vendor/wpa/dist/src/crypto/sha256_i.h head/contrib/wpa/src/drivers/android_drv.h - copied unchanged from r252191, vendor/wpa/dist/src/drivers/android_drv.h head/contrib/wpa/src/drivers/driver_bsd.c - copied, changed from r252196, vendor/wpa/dist/src/drivers/driver_bsd.c head/contrib/wpa/src/drivers/driver_common.c - copied unchanged from r252191, vendor/wpa/dist/src/drivers/driver_common.c head/contrib/wpa/src/drivers/driver_privsep.c - copied unchanged from r252385, vendor/wpa/dist/src/drivers/driver_privsep.c head/contrib/wpa/src/drivers/drivers.mk - copied unchanged from r252191, vendor/wpa/dist/src/drivers/drivers.mk head/contrib/wpa/src/drivers/linux_wext.h - copied unchanged from r252191, vendor/wpa/dist/src/drivers/linux_wext.h head/contrib/wpa/src/drivers/rfkill.c - copied unchanged from r252191, vendor/wpa/dist/src/drivers/rfkill.c head/contrib/wpa/src/drivers/rfkill.h - copied unchanged from r252191, vendor/wpa/dist/src/drivers/rfkill.h head/contrib/wpa/src/eap_common/eap_pwd_common.c - copied unchanged from r252191, vendor/wpa/dist/src/eap_common/eap_pwd_common.c head/contrib/wpa/src/eap_common/eap_pwd_common.h - copied unchanged from r252191, vendor/wpa/dist/src/eap_common/eap_pwd_common.h head/contrib/wpa/src/eap_peer/eap_pwd.c - copied unchanged from r252191, vendor/wpa/dist/src/eap_peer/eap_pwd.c head/contrib/wpa/src/eap_server/eap_server_pwd.c - copied unchanged from r252191, vendor/wpa/dist/src/eap_server/eap_server_pwd.c head/contrib/wpa/src/l2_packet/l2_packet_privsep.c - copied unchanged from r252385, vendor/wpa/dist/src/l2_packet/l2_packet_privsep.c head/contrib/wpa/src/p2p/ - copied from r252191, vendor/wpa/dist/src/p2p/ head/contrib/wpa/src/radius/radius_das.c - copied unchanged from r252191, vendor/wpa/dist/src/radius/radius_das.c head/contrib/wpa/src/radius/radius_das.h - copied unchanged from r252191, vendor/wpa/dist/src/radius/radius_das.h head/contrib/wpa/src/rsn_supp/tdls.c - copied unchanged from r252191, vendor/wpa/dist/src/rsn_supp/tdls.c head/contrib/wpa/src/utils/edit.c - copied unchanged from r252191, vendor/wpa/dist/src/utils/edit.c head/contrib/wpa/src/utils/edit.h - copied unchanged from r252191, vendor/wpa/dist/src/utils/edit.h head/contrib/wpa/src/utils/edit_readline.c - copied unchanged from r252191, vendor/wpa/dist/src/utils/edit_readline.c head/contrib/wpa/src/utils/edit_simple.c - copied unchanged from r252191, vendor/wpa/dist/src/utils/edit_simple.c head/contrib/wpa/src/utils/ext_password.c - copied unchanged from r252191, vendor/wpa/dist/src/utils/ext_password.c head/contrib/wpa/src/utils/ext_password.h - copied unchanged from r252191, vendor/wpa/dist/src/utils/ext_password.h head/contrib/wpa/src/utils/ext_password_i.h - copied unchanged from r252191, vendor/wpa/dist/src/utils/ext_password_i.h head/contrib/wpa/src/utils/ext_password_test.c - copied unchanged from r252191, vendor/wpa/dist/src/utils/ext_password_test.c head/contrib/wpa/src/wps/wps_attr_parse.h - copied unchanged from r252191, vendor/wpa/dist/src/wps/wps_attr_parse.h head/contrib/wpa/src/wps/wps_validate.c - copied unchanged from r252191, vendor/wpa/dist/src/wps/wps_validate.c head/contrib/wpa/wpa_supplicant/README-HS20 - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/README-HS20 head/contrib/wpa/wpa_supplicant/README-P2P - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/README-P2P head/contrib/wpa/wpa_supplicant/autoscan.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/autoscan.c head/contrib/wpa/wpa_supplicant/autoscan.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/autoscan.h head/contrib/wpa/wpa_supplicant/autoscan_exponential.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/autoscan_exponential.c head/contrib/wpa/wpa_supplicant/autoscan_periodic.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/autoscan_periodic.c head/contrib/wpa/wpa_supplicant/bgscan_learn.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/bgscan_learn.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_p2p.c head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/dbus/dbus_new_handlers_p2p.h head/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in head/contrib/wpa/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in head/contrib/wpa/wpa_supplicant/examples/dbus-listen-preq.py - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/dbus-listen-preq.py head/contrib/wpa/wpa_supplicant/examples/p2p/ - copied from r252191, vendor/wpa/dist/wpa_supplicant/examples/p2p/ head/contrib/wpa/wpa_supplicant/examples/p2p-action-udhcp.sh - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/p2p-action-udhcp.sh head/contrib/wpa/wpa_supplicant/examples/p2p-action.sh - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/p2p-action.sh head/contrib/wpa/wpa_supplicant/examples/udhcpd-p2p.conf - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/udhcpd-p2p.conf head/contrib/wpa/wpa_supplicant/examples/wps-ap-cli - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/wps-ap-cli head/contrib/wpa/wpa_supplicant/examples/wps-nfc.py - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/examples/wps-nfc.py head/contrib/wpa/wpa_supplicant/gas_query.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/gas_query.c head/contrib/wpa/wpa_supplicant/gas_query.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/gas_query.h head/contrib/wpa/wpa_supplicant/hs20_supplicant.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/hs20_supplicant.c head/contrib/wpa/wpa_supplicant/hs20_supplicant.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/hs20_supplicant.h head/contrib/wpa/wpa_supplicant/interworking.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/interworking.c head/contrib/wpa/wpa_supplicant/interworking.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/interworking.h head/contrib/wpa/wpa_supplicant/nfc_pw_token.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/nfc_pw_token.c head/contrib/wpa/wpa_supplicant/offchannel.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/offchannel.c head/contrib/wpa/wpa_supplicant/offchannel.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/offchannel.h head/contrib/wpa/wpa_supplicant/p2p_supplicant.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/p2p_supplicant.c head/contrib/wpa/wpa_supplicant/p2p_supplicant.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/p2p_supplicant.h head/contrib/wpa/wpa_supplicant/utils/ - copied from r252191, vendor/wpa/dist/wpa_supplicant/utils/ head/contrib/wpa/wpa_supplicant/wifi_display.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wifi_display.c head/contrib/wpa/wpa_supplicant/wifi_display.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wifi_display.h head/contrib/wpa/wpa_supplicant/wnm_sta.c - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wnm_sta.c head/contrib/wpa/wpa_supplicant/wnm_sta.h - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wnm_sta.h head/contrib/wpa/wpa_supplicant/wpa_supplicant_conf.mk - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wpa_supplicant_conf.mk head/contrib/wpa/wpa_supplicant/wpa_supplicant_conf.sh - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wpa_supplicant_conf.sh head/contrib/wpa/wpa_supplicant/wpa_supplicant_template.conf - copied unchanged from r252191, vendor/wpa/dist/wpa_supplicant/wpa_supplicant_template.conf head/usr.sbin/wpa/wpa_priv/ head/usr.sbin/wpa/wpa_priv/Makefile (contents, props changed) Deleted: head/contrib/wpa/hostapd/.gitignore head/contrib/wpa/src/crypto/md5-non-fips.c head/contrib/wpa/src/drivers/driver_ndiswrapper.c head/contrib/wpa/src/wps/wps_nfc.c head/contrib/wpa/src/wps/wps_nfc_pn531.c head/contrib/wpa/src/wps/wps_ufd.c head/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service head/contrib/wpa/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service head/contrib/wpa/wpa_supplicant/mlme.c head/contrib/wpa/wpa_supplicant/mlme.h head/contrib/wpa/wpa_supplicant/wpa_supplicant.nsi head/usr.sbin/wpa/hostapd/driver_freebsd.c head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Modified: head/contrib/wpa/COPYING head/contrib/wpa/README head/contrib/wpa/hostapd/ChangeLog head/contrib/wpa/hostapd/Makefile (contents, props changed) head/contrib/wpa/hostapd/README head/contrib/wpa/hostapd/README-WPS head/contrib/wpa/hostapd/config_file.c (contents, props changed) head/contrib/wpa/hostapd/config_file.h (contents, props changed) head/contrib/wpa/hostapd/ctrl_iface.c (contents, props changed) head/contrib/wpa/hostapd/ctrl_iface.h (contents, props changed) head/contrib/wpa/hostapd/defconfig head/contrib/wpa/hostapd/dump_state.c (contents, props changed) head/contrib/wpa/hostapd/dump_state.h (contents, props changed) head/contrib/wpa/hostapd/eap_register.c (contents, props changed) head/contrib/wpa/hostapd/eap_register.h (contents, props changed) head/contrib/wpa/hostapd/hlr_auc_gw.c (contents, props changed) head/contrib/wpa/hostapd/hostapd.conf (contents, props changed) head/contrib/wpa/hostapd/hostapd.eap_user head/contrib/wpa/hostapd/hostapd_cli.c (contents, props changed) head/contrib/wpa/hostapd/main.c (contents, props changed) head/contrib/wpa/hostapd/nt_password_hash.c (contents, props changed) head/contrib/wpa/src/Makefile head/contrib/wpa/src/ap/accounting.c (contents, props changed) head/contrib/wpa/src/ap/accounting.h (contents, props changed) head/contrib/wpa/src/ap/ap_config.c (contents, props changed) head/contrib/wpa/src/ap/ap_config.h (contents, props changed) head/contrib/wpa/src/ap/ap_drv_ops.c (contents, props changed) head/contrib/wpa/src/ap/ap_drv_ops.h (contents, props changed) head/contrib/wpa/src/ap/ap_list.c (contents, props changed) head/contrib/wpa/src/ap/ap_list.h (contents, props changed) head/contrib/wpa/src/ap/ap_mlme.c (contents, props changed) head/contrib/wpa/src/ap/ap_mlme.h (contents, props changed) head/contrib/wpa/src/ap/authsrv.c (contents, props changed) head/contrib/wpa/src/ap/authsrv.h (contents, props changed) head/contrib/wpa/src/ap/beacon.c (contents, props changed) head/contrib/wpa/src/ap/beacon.h (contents, props changed) head/contrib/wpa/src/ap/ctrl_iface_ap.c (contents, props changed) head/contrib/wpa/src/ap/ctrl_iface_ap.h (contents, props changed) head/contrib/wpa/src/ap/drv_callbacks.c (contents, props changed) head/contrib/wpa/src/ap/hostapd.c (contents, props changed) head/contrib/wpa/src/ap/hostapd.h (contents, props changed) head/contrib/wpa/src/ap/hw_features.c (contents, props changed) head/contrib/wpa/src/ap/hw_features.h (contents, props changed) head/contrib/wpa/src/ap/iapp.c (contents, props changed) head/contrib/wpa/src/ap/iapp.h (contents, props changed) head/contrib/wpa/src/ap/ieee802_11.c (contents, props changed) head/contrib/wpa/src/ap/ieee802_11.h (contents, props changed) head/contrib/wpa/src/ap/ieee802_11_auth.c (contents, props changed) head/contrib/wpa/src/ap/ieee802_11_auth.h (contents, props changed) head/contrib/wpa/src/ap/ieee802_11_ht.c (contents, props changed) head/contrib/wpa/src/ap/ieee802_1x.c (contents, props changed) head/contrib/wpa/src/ap/ieee802_1x.h (contents, props changed) head/contrib/wpa/src/ap/peerkey_auth.c (contents, props changed) head/contrib/wpa/src/ap/pmksa_cache_auth.c (contents, props changed) head/contrib/wpa/src/ap/pmksa_cache_auth.h (contents, props changed) head/contrib/wpa/src/ap/preauth_auth.c (contents, props changed) head/contrib/wpa/src/ap/preauth_auth.h (contents, props changed) head/contrib/wpa/src/ap/sta_info.c (contents, props changed) head/contrib/wpa/src/ap/sta_info.h (contents, props changed) head/contrib/wpa/src/ap/tkip_countermeasures.c (contents, props changed) head/contrib/wpa/src/ap/tkip_countermeasures.h (contents, props changed) head/contrib/wpa/src/ap/utils.c (contents, props changed) head/contrib/wpa/src/ap/vlan_init.c (contents, props changed) head/contrib/wpa/src/ap/wmm.c (contents, props changed) head/contrib/wpa/src/ap/wpa_auth.c (contents, props changed) head/contrib/wpa/src/ap/wpa_auth.h (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_ft.c (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_glue.c (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_glue.h (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_i.h (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_ie.c (contents, props changed) head/contrib/wpa/src/ap/wpa_auth_ie.h (contents, props changed) head/contrib/wpa/src/ap/wps_hostapd.c (contents, props changed) head/contrib/wpa/src/ap/wps_hostapd.h (contents, props changed) head/contrib/wpa/src/common/defs.h head/contrib/wpa/src/common/eapol_common.h head/contrib/wpa/src/common/ieee802_11_common.c head/contrib/wpa/src/common/ieee802_11_common.h head/contrib/wpa/src/common/ieee802_11_defs.h head/contrib/wpa/src/common/privsep_commands.h head/contrib/wpa/src/common/version.h head/contrib/wpa/src/common/wpa_common.c head/contrib/wpa/src/common/wpa_common.h head/contrib/wpa/src/common/wpa_ctrl.c head/contrib/wpa/src/common/wpa_ctrl.h head/contrib/wpa/src/crypto/Makefile head/contrib/wpa/src/crypto/aes-cbc.c (contents, props changed) head/contrib/wpa/src/crypto/aes-ctr.c (contents, props changed) head/contrib/wpa/src/crypto/aes-eax.c (contents, props changed) head/contrib/wpa/src/crypto/aes-encblock.c (contents, props changed) head/contrib/wpa/src/crypto/aes-internal-dec.c (contents, props changed) head/contrib/wpa/src/crypto/aes-internal-enc.c (contents, props changed) head/contrib/wpa/src/crypto/aes-internal.c (contents, props changed) head/contrib/wpa/src/crypto/aes-omac1.c (contents, props changed) head/contrib/wpa/src/crypto/aes-unwrap.c (contents, props changed) head/contrib/wpa/src/crypto/aes-wrap.c (contents, props changed) head/contrib/wpa/src/crypto/aes.h head/contrib/wpa/src/crypto/aes_i.h (contents, props changed) head/contrib/wpa/src/crypto/aes_wrap.h head/contrib/wpa/src/crypto/crypto.h head/contrib/wpa/src/crypto/crypto_cryptoapi.c head/contrib/wpa/src/crypto/crypto_gnutls.c head/contrib/wpa/src/crypto/crypto_internal-cipher.c (contents, props changed) head/contrib/wpa/src/crypto/crypto_internal-modexp.c (contents, props changed) head/contrib/wpa/src/crypto/crypto_internal-rsa.c (contents, props changed) head/contrib/wpa/src/crypto/crypto_internal.c head/contrib/wpa/src/crypto/crypto_libtomcrypt.c head/contrib/wpa/src/crypto/crypto_none.c head/contrib/wpa/src/crypto/crypto_nss.c (contents, props changed) head/contrib/wpa/src/crypto/crypto_openssl.c head/contrib/wpa/src/crypto/des-internal.c (contents, props changed) head/contrib/wpa/src/crypto/des_i.h (contents, props changed) head/contrib/wpa/src/crypto/dh_group5.c (contents, props changed) head/contrib/wpa/src/crypto/dh_group5.h (contents, props changed) head/contrib/wpa/src/crypto/dh_groups.c head/contrib/wpa/src/crypto/dh_groups.h head/contrib/wpa/src/crypto/fips_prf_cryptoapi.c (contents, props changed) head/contrib/wpa/src/crypto/fips_prf_gnutls.c (contents, props changed) head/contrib/wpa/src/crypto/fips_prf_internal.c (contents, props changed) head/contrib/wpa/src/crypto/fips_prf_nss.c (contents, props changed) head/contrib/wpa/src/crypto/fips_prf_openssl.c (contents, props changed) head/contrib/wpa/src/crypto/md4-internal.c (contents, props changed) head/contrib/wpa/src/crypto/md5-internal.c (contents, props changed) head/contrib/wpa/src/crypto/md5.c head/contrib/wpa/src/crypto/md5.h head/contrib/wpa/src/crypto/md5_i.h (contents, props changed) head/contrib/wpa/src/crypto/milenage.c (contents, props changed) head/contrib/wpa/src/crypto/milenage.h (contents, props changed) head/contrib/wpa/src/crypto/ms_funcs.c head/contrib/wpa/src/crypto/ms_funcs.h head/contrib/wpa/src/crypto/rc4.c head/contrib/wpa/src/crypto/sha1-internal.c (contents, props changed) head/contrib/wpa/src/crypto/sha1-pbkdf2.c (contents, props changed) head/contrib/wpa/src/crypto/sha1-tlsprf.c (contents, props changed) head/contrib/wpa/src/crypto/sha1-tprf.c (contents, props changed) head/contrib/wpa/src/crypto/sha1.c head/contrib/wpa/src/crypto/sha1.h head/contrib/wpa/src/crypto/sha1_i.h (contents, props changed) head/contrib/wpa/src/crypto/sha256-internal.c (contents, props changed) head/contrib/wpa/src/crypto/sha256.c head/contrib/wpa/src/crypto/sha256.h head/contrib/wpa/src/crypto/tls.h head/contrib/wpa/src/crypto/tls_gnutls.c head/contrib/wpa/src/crypto/tls_internal.c head/contrib/wpa/src/crypto/tls_none.c head/contrib/wpa/src/crypto/tls_nss.c (contents, props changed) head/contrib/wpa/src/crypto/tls_openssl.c head/contrib/wpa/src/crypto/tls_schannel.c head/contrib/wpa/src/drivers/driver.h head/contrib/wpa/src/drivers/driver_ndis.c head/contrib/wpa/src/drivers/driver_ndis.h head/contrib/wpa/src/drivers/driver_ndis_.c head/contrib/wpa/src/drivers/driver_wired.c head/contrib/wpa/src/drivers/drivers.c head/contrib/wpa/src/drivers/drivers.mak head/contrib/wpa/src/drivers/ndis_events.c head/contrib/wpa/src/eap_common/chap.c head/contrib/wpa/src/eap_common/chap.h head/contrib/wpa/src/eap_common/eap_common.c head/contrib/wpa/src/eap_common/eap_common.h head/contrib/wpa/src/eap_common/eap_defs.h head/contrib/wpa/src/eap_common/eap_fast_common.c head/contrib/wpa/src/eap_common/eap_fast_common.h head/contrib/wpa/src/eap_common/eap_gpsk_common.c head/contrib/wpa/src/eap_common/eap_gpsk_common.h head/contrib/wpa/src/eap_common/eap_ikev2_common.c head/contrib/wpa/src/eap_common/eap_ikev2_common.h head/contrib/wpa/src/eap_common/eap_pax_common.c head/contrib/wpa/src/eap_common/eap_pax_common.h head/contrib/wpa/src/eap_common/eap_peap_common.c head/contrib/wpa/src/eap_common/eap_peap_common.h head/contrib/wpa/src/eap_common/eap_psk_common.c head/contrib/wpa/src/eap_common/eap_psk_common.h head/contrib/wpa/src/eap_common/eap_sake_common.c head/contrib/wpa/src/eap_common/eap_sake_common.h head/contrib/wpa/src/eap_common/eap_sim_common.c head/contrib/wpa/src/eap_common/eap_sim_common.h head/contrib/wpa/src/eap_common/eap_tlv_common.h head/contrib/wpa/src/eap_common/eap_ttls.h head/contrib/wpa/src/eap_common/eap_wsc_common.c head/contrib/wpa/src/eap_common/eap_wsc_common.h head/contrib/wpa/src/eap_common/ikev2_common.c head/contrib/wpa/src/eap_common/ikev2_common.h head/contrib/wpa/src/eap_peer/eap.c head/contrib/wpa/src/eap_peer/eap.h head/contrib/wpa/src/eap_peer/eap_aka.c head/contrib/wpa/src/eap_peer/eap_config.h head/contrib/wpa/src/eap_peer/eap_fast.c head/contrib/wpa/src/eap_peer/eap_fast_pac.c head/contrib/wpa/src/eap_peer/eap_fast_pac.h head/contrib/wpa/src/eap_peer/eap_gpsk.c head/contrib/wpa/src/eap_peer/eap_gtc.c head/contrib/wpa/src/eap_peer/eap_i.h head/contrib/wpa/src/eap_peer/eap_ikev2.c head/contrib/wpa/src/eap_peer/eap_leap.c head/contrib/wpa/src/eap_peer/eap_md5.c head/contrib/wpa/src/eap_peer/eap_methods.c head/contrib/wpa/src/eap_peer/eap_methods.h head/contrib/wpa/src/eap_peer/eap_mschapv2.c head/contrib/wpa/src/eap_peer/eap_otp.c head/contrib/wpa/src/eap_peer/eap_pax.c head/contrib/wpa/src/eap_peer/eap_peap.c head/contrib/wpa/src/eap_peer/eap_psk.c head/contrib/wpa/src/eap_peer/eap_sake.c head/contrib/wpa/src/eap_peer/eap_sim.c head/contrib/wpa/src/eap_peer/eap_tls.c head/contrib/wpa/src/eap_peer/eap_tls_common.c head/contrib/wpa/src/eap_peer/eap_tls_common.h head/contrib/wpa/src/eap_peer/eap_tnc.c head/contrib/wpa/src/eap_peer/eap_ttls.c head/contrib/wpa/src/eap_peer/eap_vendor_test.c head/contrib/wpa/src/eap_peer/eap_wsc.c head/contrib/wpa/src/eap_peer/ikev2.c head/contrib/wpa/src/eap_peer/ikev2.h head/contrib/wpa/src/eap_peer/mschapv2.c head/contrib/wpa/src/eap_peer/mschapv2.h head/contrib/wpa/src/eap_peer/tncc.c head/contrib/wpa/src/eap_peer/tncc.h head/contrib/wpa/src/eap_server/eap.h head/contrib/wpa/src/eap_server/eap_i.h head/contrib/wpa/src/eap_server/eap_methods.h head/contrib/wpa/src/eap_server/eap_server.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_aka.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_fast.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_gpsk.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_gtc.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_identity.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_ikev2.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_md5.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_methods.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_mschapv2.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_pax.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_peap.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_psk.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_sake.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_sim.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_tls.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_tls_common.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_tnc.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_ttls.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_vendor_test.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_server_wsc.c (contents, props changed) head/contrib/wpa/src/eap_server/eap_sim_db.c head/contrib/wpa/src/eap_server/eap_sim_db.h head/contrib/wpa/src/eap_server/eap_tls_common.h head/contrib/wpa/src/eap_server/ikev2.c head/contrib/wpa/src/eap_server/ikev2.h head/contrib/wpa/src/eap_server/tncs.c head/contrib/wpa/src/eap_server/tncs.h head/contrib/wpa/src/eapol_auth/eapol_auth_dump.c (contents, props changed) head/contrib/wpa/src/eapol_auth/eapol_auth_sm.c (contents, props changed) head/contrib/wpa/src/eapol_auth/eapol_auth_sm.h (contents, props changed) head/contrib/wpa/src/eapol_auth/eapol_auth_sm_i.h (contents, props changed) head/contrib/wpa/src/eapol_supp/eapol_supp_sm.c head/contrib/wpa/src/eapol_supp/eapol_supp_sm.h head/contrib/wpa/src/l2_packet/l2_packet.h head/contrib/wpa/src/l2_packet/l2_packet_freebsd.c head/contrib/wpa/src/l2_packet/l2_packet_ndis.c head/contrib/wpa/src/l2_packet/l2_packet_none.c head/contrib/wpa/src/radius/radius.c head/contrib/wpa/src/radius/radius.h head/contrib/wpa/src/radius/radius_client.c head/contrib/wpa/src/radius/radius_client.h head/contrib/wpa/src/radius/radius_server.c head/contrib/wpa/src/radius/radius_server.h head/contrib/wpa/src/rsn_supp/peerkey.c head/contrib/wpa/src/rsn_supp/peerkey.h head/contrib/wpa/src/rsn_supp/pmksa_cache.c head/contrib/wpa/src/rsn_supp/pmksa_cache.h head/contrib/wpa/src/rsn_supp/preauth.c head/contrib/wpa/src/rsn_supp/preauth.h head/contrib/wpa/src/rsn_supp/wpa.c head/contrib/wpa/src/rsn_supp/wpa.h head/contrib/wpa/src/rsn_supp/wpa_ft.c head/contrib/wpa/src/rsn_supp/wpa_i.h head/contrib/wpa/src/rsn_supp/wpa_ie.c head/contrib/wpa/src/rsn_supp/wpa_ie.h head/contrib/wpa/src/tls/Makefile head/contrib/wpa/src/tls/asn1.c head/contrib/wpa/src/tls/asn1.h head/contrib/wpa/src/tls/bignum.c head/contrib/wpa/src/tls/bignum.h head/contrib/wpa/src/tls/libtommath.c head/contrib/wpa/src/tls/pkcs1.c (contents, props changed) head/contrib/wpa/src/tls/pkcs1.h (contents, props changed) head/contrib/wpa/src/tls/pkcs5.c (contents, props changed) head/contrib/wpa/src/tls/pkcs5.h (contents, props changed) head/contrib/wpa/src/tls/pkcs8.c (contents, props changed) head/contrib/wpa/src/tls/pkcs8.h (contents, props changed) head/contrib/wpa/src/tls/rsa.c head/contrib/wpa/src/tls/rsa.h head/contrib/wpa/src/tls/tlsv1_client.c head/contrib/wpa/src/tls/tlsv1_client.h head/contrib/wpa/src/tls/tlsv1_client_i.h head/contrib/wpa/src/tls/tlsv1_client_read.c head/contrib/wpa/src/tls/tlsv1_client_write.c head/contrib/wpa/src/tls/tlsv1_common.c head/contrib/wpa/src/tls/tlsv1_common.h head/contrib/wpa/src/tls/tlsv1_cred.c head/contrib/wpa/src/tls/tlsv1_cred.h head/contrib/wpa/src/tls/tlsv1_record.c head/contrib/wpa/src/tls/tlsv1_record.h head/contrib/wpa/src/tls/tlsv1_server.c head/contrib/wpa/src/tls/tlsv1_server.h head/contrib/wpa/src/tls/tlsv1_server_i.h head/contrib/wpa/src/tls/tlsv1_server_read.c head/contrib/wpa/src/tls/tlsv1_server_write.c head/contrib/wpa/src/tls/x509v3.c head/contrib/wpa/src/tls/x509v3.h head/contrib/wpa/src/utils/Makefile head/contrib/wpa/src/utils/base64.c head/contrib/wpa/src/utils/base64.h head/contrib/wpa/src/utils/build_config.h head/contrib/wpa/src/utils/common.c head/contrib/wpa/src/utils/common.h head/contrib/wpa/src/utils/eloop.c head/contrib/wpa/src/utils/eloop.h head/contrib/wpa/src/utils/eloop_none.c head/contrib/wpa/src/utils/eloop_win.c head/contrib/wpa/src/utils/includes.h head/contrib/wpa/src/utils/ip_addr.c head/contrib/wpa/src/utils/ip_addr.h head/contrib/wpa/src/utils/list.h (contents, props changed) head/contrib/wpa/src/utils/os.h head/contrib/wpa/src/utils/os_internal.c head/contrib/wpa/src/utils/os_none.c head/contrib/wpa/src/utils/os_unix.c head/contrib/wpa/src/utils/os_win32.c head/contrib/wpa/src/utils/pcsc_funcs.c head/contrib/wpa/src/utils/pcsc_funcs.h head/contrib/wpa/src/utils/radiotap.h (contents, props changed) head/contrib/wpa/src/utils/radiotap_iter.h (contents, props changed) head/contrib/wpa/src/utils/state_machine.h head/contrib/wpa/src/utils/trace.c (contents, props changed) head/contrib/wpa/src/utils/trace.h (contents, props changed) head/contrib/wpa/src/utils/uuid.c head/contrib/wpa/src/utils/uuid.h head/contrib/wpa/src/utils/wpa_debug.c head/contrib/wpa/src/utils/wpa_debug.h head/contrib/wpa/src/utils/wpabuf.c head/contrib/wpa/src/utils/wpabuf.h head/contrib/wpa/src/wps/http_client.c (contents, props changed) head/contrib/wpa/src/wps/http_client.h (contents, props changed) head/contrib/wpa/src/wps/http_server.c (contents, props changed) head/contrib/wpa/src/wps/http_server.h (contents, props changed) head/contrib/wpa/src/wps/httpread.c head/contrib/wpa/src/wps/httpread.h head/contrib/wpa/src/wps/ndef.c (contents, props changed) head/contrib/wpa/src/wps/upnp_xml.c (contents, props changed) head/contrib/wpa/src/wps/upnp_xml.h (contents, props changed) head/contrib/wpa/src/wps/wps.c head/contrib/wpa/src/wps/wps.h head/contrib/wpa/src/wps/wps_attr_build.c head/contrib/wpa/src/wps/wps_attr_parse.c head/contrib/wpa/src/wps/wps_attr_process.c head/contrib/wpa/src/wps/wps_common.c head/contrib/wpa/src/wps/wps_defs.h head/contrib/wpa/src/wps/wps_dev_attr.c head/contrib/wpa/src/wps/wps_dev_attr.h head/contrib/wpa/src/wps/wps_enrollee.c head/contrib/wpa/src/wps/wps_er.c (contents, props changed) head/contrib/wpa/src/wps/wps_er.h (contents, props changed) head/contrib/wpa/src/wps/wps_er_ssdp.c (contents, props changed) head/contrib/wpa/src/wps/wps_i.h head/contrib/wpa/src/wps/wps_registrar.c head/contrib/wpa/src/wps/wps_upnp.c head/contrib/wpa/src/wps/wps_upnp.h head/contrib/wpa/src/wps/wps_upnp_ap.c (contents, props changed) head/contrib/wpa/src/wps/wps_upnp_event.c head/contrib/wpa/src/wps/wps_upnp_i.h head/contrib/wpa/src/wps/wps_upnp_ssdp.c head/contrib/wpa/src/wps/wps_upnp_web.c head/contrib/wpa/wpa_supplicant/.gitignore head/contrib/wpa/wpa_supplicant/ChangeLog head/contrib/wpa/wpa_supplicant/Makefile head/contrib/wpa/wpa_supplicant/README head/contrib/wpa/wpa_supplicant/README-WPS head/contrib/wpa/wpa_supplicant/ap.c (contents, props changed) head/contrib/wpa/wpa_supplicant/ap.h (contents, props changed) head/contrib/wpa/wpa_supplicant/bgscan.c (contents, props changed) head/contrib/wpa/wpa_supplicant/bgscan.h (contents, props changed) head/contrib/wpa/wpa_supplicant/bgscan_simple.c (contents, props changed) head/contrib/wpa/wpa_supplicant/blacklist.c head/contrib/wpa/wpa_supplicant/blacklist.h head/contrib/wpa/wpa_supplicant/bss.c (contents, props changed) head/contrib/wpa/wpa_supplicant/bss.h (contents, props changed) head/contrib/wpa/wpa_supplicant/config.c head/contrib/wpa/wpa_supplicant/config.h head/contrib/wpa/wpa_supplicant/config_file.c head/contrib/wpa/wpa_supplicant/config_none.c head/contrib/wpa/wpa_supplicant/config_ssid.h head/contrib/wpa/wpa_supplicant/ctrl_iface.c head/contrib/wpa/wpa_supplicant/ctrl_iface.h head/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c head/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c head/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c head/contrib/wpa/wpa_supplicant/dbus/Makefile (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_common.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_common.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_common_i.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_dict_helpers.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_dict_helpers.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_new_introspect.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_old.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_old.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h (contents, props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c (contents, props changed) head/contrib/wpa/wpa_supplicant/defconfig head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_background.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_background.sgml head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_cli.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_cli.sgml head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_gui.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_gui.sgml head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_passphrase.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_passphrase.sgml head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_priv.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_priv.sgml head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.sgml head/contrib/wpa/wpa_supplicant/driver_i.h (contents, props changed) head/contrib/wpa/wpa_supplicant/eap_register.c (contents, props changed) head/contrib/wpa/wpa_supplicant/eapol_test.c head/contrib/wpa/wpa_supplicant/events.c head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py (contents, props changed) head/contrib/wpa/wpa_supplicant/ibss_rsn.c (contents, props changed) head/contrib/wpa/wpa_supplicant/ibss_rsn.h (contents, props changed) head/contrib/wpa/wpa_supplicant/main.c head/contrib/wpa/wpa_supplicant/main_none.c head/contrib/wpa/wpa_supplicant/notify.c (contents, props changed) head/contrib/wpa/wpa_supplicant/notify.h (contents, props changed) head/contrib/wpa/wpa_supplicant/preauth_test.c head/contrib/wpa/wpa_supplicant/scan.c head/contrib/wpa/wpa_supplicant/scan.h (contents, props changed) head/contrib/wpa/wpa_supplicant/sme.c (contents, props changed) head/contrib/wpa/wpa_supplicant/sme.h (contents, props changed) head/contrib/wpa/wpa_supplicant/tests/test_eap_sim_common.c head/contrib/wpa/wpa_supplicant/tests/test_wpa.c head/contrib/wpa/wpa_supplicant/wpa_cli.c head/contrib/wpa/wpa_supplicant/wpa_passphrase.c head/contrib/wpa/wpa_supplicant/wpa_priv.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h head/contrib/wpa/wpa_supplicant/wpas_glue.c head/contrib/wpa/wpa_supplicant/wpas_glue.h head/contrib/wpa/wpa_supplicant/wps_supplicant.c head/contrib/wpa/wpa_supplicant/wps_supplicant.h head/usr.sbin/wpa/Makefile.crypto head/usr.sbin/wpa/Makefile.inc head/usr.sbin/wpa/hostapd/Makefile head/usr.sbin/wpa/hostapd_cli/Makefile head/usr.sbin/wpa/wpa_cli/Makefile head/usr.sbin/wpa/wpa_passphrase/Makefile head/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: head/contrib/wpa/ (props changed) head/contrib/wpa/hostapd/eap_testing.txt (props changed) head/contrib/wpa/hostapd/hostapd.8 (props changed) head/contrib/wpa/hostapd/hostapd_cli.1 (props changed) head/contrib/wpa/hostapd/logwatch/hostapd.conf (props changed) head/contrib/wpa/hostapd/wired.conf (props changed) head/contrib/wpa/src/ap/Makefile (props changed) head/contrib/wpa/src/ap/vlan_init.h (props changed) head/contrib/wpa/src/ap/wmm.h (props changed) head/contrib/wpa/src/eapol_auth/Makefile (props changed) head/contrib/wpa/src/utils/radiotap.c (props changed) head/contrib/wpa/src/wps/http.h (props changed) head/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf (props changed) head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py (props changed) head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py (props changed) head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py (props changed) Modified: head/contrib/wpa/COPYING ============================================================================== --- head/contrib/wpa/COPYING Thu Jul 4 20:57:15 2013 (r252725) +++ head/contrib/wpa/COPYING Thu Jul 4 21:12:58 2013 (r252726) @@ -1,340 +1,22 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 +wpa_supplicant and hostapd +-------------------------- - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +Copyright (c) 2002-2012, Jouni Malinen and contributors +All Rights Reserved. - Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. +See the README file for the current license terms. - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +This software was previously distributed under BSD/GPL v2 dual license +terms that allowed either of those license alternatives to be +selected. As of February 11, 2012, the project has chosen to use only +the BSD license option for future distribution. As such, the GPL v2 +license option is no longer used. It should be noted that the BSD +license option (the one with advertisement clause removed) is compatible +with GPL and as such, does not prevent use of this software in projects +that use GPL. + +Some of the files may still include pointers to GPL version 2 license +terms. However, such copyright and license notifications are maintained +only for attribution purposes and any distribution of this software +after February 11, 2012 is no longer under the GPL v2 option. Modified: head/contrib/wpa/README ============================================================================== --- head/contrib/wpa/README Thu Jul 4 20:57:15 2013 (r252725) +++ head/contrib/wpa/README Thu Jul 4 21:12:58 2013 (r252726) @@ -1,19 +1,56 @@ -wpa_supplicant and hostapd v0.6.x ---------------------------------- +wpa_supplicant and hostapd +-------------------------- -Copyright (c) 2002-2007, Jouni Malinen and contributors +Copyright (c) 2002-2012, Jouni Malinen and contributors All Rights Reserved. -These program is dual-licensed under both the GPL version 2 and BSD -license. Either license may be used at your option. +These programs are licensed under the BSD license (the one with +advertisement clause removed). + +If you are submitting changes to the project, please see CONTRIBUTIONS +file for more instructions. This package may include either wpa_supplicant, hostapd, or both. See README file respective subdirectories (wpa_supplicant/README or hostapd/README) for more details. -Source code files have been moved around in v0.6.x releases and -compared to earlier releases, the programs are now build by first -going to a subdirectory (wpa_supplicant or hostapd) and creating -build configuration (.config) and running 'make' there (for -Linux/BSD/cygwin builds). +Source code files were moved around in v0.6.x releases and compared to +earlier releases, the programs are now built by first going to a +subdirectory (wpa_supplicant or hostapd) and creating build +configuration (.config) and running 'make' there (for Linux/BSD/cygwin +builds). + + +License +------- + +This software may be distributed, used, and modified under the terms of +BSD license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Modified: head/contrib/wpa/hostapd/ChangeLog ============================================================================== --- head/contrib/wpa/hostapd/ChangeLog Thu Jul 4 20:57:15 2013 (r252725) +++ head/contrib/wpa/hostapd/ChangeLog Thu Jul 4 21:12:58 2013 (r252726) @@ -1,20 +1,206 @@ ChangeLog for hostapd -2010-09-07 - v0.7.3 - * fixed re-association after WPS not initializing WPA state machine in - some cases - * fixed WPS IE update on reconfiguration - * fixed WPS code not to proxy Probe Request frames for foreign SSIDs - * added WPS workaround for open networks and some known interop issues - * fixed WPS Diffie-Hellman derivation to use correct public key length - * fixed FT RRB messages on big endian CPUs - * changed WPS protection for brute force AP PIN attacks to disable AP - PIN only temporarily (but with increasing time) to avoid usability - issues on Label-only devices - * added wps_ap_pin command for more secure handling of AP PIN - operations (e.g., to generate a random AP PIN and only use it for - short amount of time) - * fixed HT STBC negotiation +2013-01-12 - v2.0 + * added AP-STA-DISCONNECTED ctrl_iface event + * improved debug logging (human readable event names, interface name + included in more entries) + * added number of small changes to make it easier for static analyzers + to understand the implementation + * added a workaround for Windows 7 Michael MIC failure reporting and + use of the Secure bit in EAPOL-Key msg 3/4 + * fixed number of small bugs (see git logs for more details) + * changed OpenSSL to read full certificate chain from server_cert file + * nl80211: number of updates to use new cfg80211/nl80211 functionality + - replace monitor interface with nl80211 commands + - additional information for driver-based AP SME + * EAP-pwd: + - fix KDF for group 21 and zero-padding + - added support for fragmentation + - increased maximum number of hunting-and-pecking iterations + * avoid excessive Probe Response retries for broadcast Probe Request + frames (only with drivers using hostapd SME/MLME) + * added preliminary support for using TLS v1.2 (CONFIG_TLSV12=y) + * fixed WPS operation stopping on dual concurrent AP + * added wps_rf_bands configuration parameter for overriding RF Bands + value for WPS + * added support for getting per-device PSK from RADIUS Tunnel-Password + * added support for libnl 3.2 and newer + * increased initial group key handshake retransmit timeout to 500 ms + * added a workaround for 4-way handshake to update SNonce even after + having sent EAPOL-Key 3/4 to avoid issues with some supplicant + implementations that can change SNonce for each EAP-Key 2/4 + * added a workaround for EAPOL-Key 4/4 using incorrect type value in + WPA2 mode (some deployed stations use WPA type in that message) + * added a WPS workaround for mixed mode AP Settings with Windows 7 + * changed WPS AP PIN disabling mechanism to disable the PIN after 10 + consecutive failures in addition to using the exponential lockout + period + * added support for WFA Hotspot 2.0 + - GAS/ANQP advertisement of network information + - disable_dgaf parameter to disable downstream group-addressed + forwarding + * simplified licensing terms by selecting the BSD license as the only + alternative + * EAP-SIM: fixed re-authentication not to update pseudonym + * EAP-SIM: use Notification round before EAP-Failure + * EAP-AKA: added support for AT_COUNTER_TOO_SMALL + * EAP-AKA: skip AKA/Identity exchange if EAP identity is recognized + * EAP-AKA': fixed identity for MK derivation + * EAP-AKA': updated to RFC 5448 (username prefixes changed); note: this + breaks interoperability with older versions + * EAP-SIM/AKA: allow pseudonym to be used after unknown reauth id + * changed ANonce to be a random number instead of Counter-based + * added support for canceling WPS operations with hostapd_cli wps_cancel + * fixed EAP/WPS to PSK transition on reassociation in cases where + deauthentication is missed + * hlr_auc_gw enhancements: + - a new command line parameter -u can be used to enable updating of + SQN in Milenage file + - use 5 bit IND for SQN updates + - SQLite database can now be used to store Milenage information + * EAP-SIM/AKA DB: added optional use of SQLite database for pseudonyms + and reauth data + * added support for Chargeable-User-Identity (RFC 4372) + * added radius_auth_req_attr and radius_acct_req_attr configuration + parameters to allow adding/overriding of RADIUS attributes in + Access-Request and Accounting-Request packets + * added support for RADIUS dynamic authorization server (RFC 5176) + * added initial support for WNM operations + - BSS max idle period + - WNM-Sleep Mode + * added new WPS NFC ctrl_iface mechanism + - removed obsoleted WPS_OOB command (including support for deprecated + UFD config_method) + * added FT support for drivers that implement MLME internally + * added SA Query support for drivers that implement MLME internally + * removed default ACM=1 from AC_VO and AC_VI + * changed VENDOR-TEST EAP method to use proper private enterprise number + (this will not interoperate with older versions) + * added hostapd.conf parameter vendor_elements to allow arbitrary vendor + specific elements to be added to the Beacon and Probe Response frames + * added support for configuring GCMP cipher for IEEE 802.11ad + * added support for 256-bit AES with internal TLS implementation + * changed EAPOL transmission to use AC_VO if WMM is active + * fixed EAP-TLS/PEAP/TTLS/FAST server to validate TLS Message Length + correctly; invalid messages could have caused the hostapd process to + terminate before this fix [CVE-2012-4445] + * limit number of active wildcard PINs for WPS Registrar to one to avoid + confusing behavior with multiple wildcard PINs + * added a workaround for WPS PBC session overlap detection to avoid + interop issues with deployed station implementations that do not + remove active PBC indication from Probe Request frames properly + * added support for using SQLite for the eap_user database + * added Acct-Session-Id attribute into Access-Request messages + * fixed EAPOL frame transmission to non-QoS STAs with nl80211 + (do not send QoS frames if the STA did not negotiate use of QoS for + this association) + +2012-05-10 - v1.0 + * Add channel selection support in hostapd. See hostapd.conf. + * Add support for IEEE 802.11v Time Advertisement mechanism with UTC + TSF offset. See hostapd.conf for config info. + * Delay STA entry removal until Deauth/Disassoc TX status in AP mode. + This allows the driver to use PS buffering of Deauthentication and + Disassociation frames when the STA is in power save sleep. Only + available with drivers that provide TX status events for Deauth/ + Disassoc frames (nl80211). + * Allow PMKSA caching to be disabled on the Authenticator. See + hostap.conf config parameter disable_pmksa_caching. + * atheros: Add support for IEEE 802.11w configuration. + * bsd: Add support for setting HT values in IFM_MMASK. + * Allow client isolation to be configured with ap_isolate. Client + isolation can be used to prevent low-level bridging of frames + between associated stations in the BSS. By default, this bridging + is allowed. + * Allow coexistance of HT BSSes with WEP/TKIP BSSes. + * Add require_ht config parameter, which can be used to configure + hostapd to reject association with any station that does not support + HT PHY. + * Add support for writing debug log to a file using "-f" option. Also + add relog CLI command to re-open the log file. + * Add bridge handling for WDS STA interfaces. By default they are + added to the configured bridge of the AP interface (if present), + but the user can also specify a separate bridge using cli command + wds_bridge. + * hostapd_cli: + - Add wds_bridge command for specifying bridge for WDS STA + interfaces. + - Add relog command for reopening log file. + - Send AP-STA-DISCONNECTED event when an AP disconnects a station + due to inactivity. + - Add wps_config ctrl_interface command for configuring AP. This + command can be used to configure the AP using the internal WPS + registrar. It works in the same way as new AP settings received + from an ER. + - Many WPS/WPS ER commands - see WPS/WPS ER sections for details. + - Add command get version, that returns hostapd version string. + * WNM: Add BSS Transition Management Request for ESS Disassoc Imminent. + Use hostapd_cli ess_disassoc (STA addr) (URL) to send the + notification to the STA. + * Allow AP mode to disconnect STAs based on low ACK condition (when + the data connection is not working properly, e.g., due to the STA + going outside the range of the AP). Disabled by default, enable by + config option disassoc_low_ack. + * Add WPA_IGNORE_CONFIG_ERRORS build option to continue in case of bad + config file. + * WPS: + - Send AP Settings as a wrapped Credential attribute to ctrl_iface + in WPS-NEW-AP-SETTINGS. + - Dispatch more WPS events through hostapd ctrl_iface. + - Add mechanism for indicating non-standard WPS errors. + - Change concurrent radio AP to use only one WPS UPnP instance. + - Add wps_check_pin command for processing PIN from user input. + UIs can use this command to process a PIN entered by a user and to + validate the checksum digit (if present). + - Add hostap_cli get_config command to display current AP config. + - Add new hostapd_cli command, wps_ap_pin, to manage AP PIN at + runtime and support dynamic AP PIN management. + - Disable AP PIN after 10 consecutive failures. Slow down attacks + on failures up to 10. + - Allow AP to start in Enrollee mode without AP PIN for probing, + to be compatible with Windows 7. + - Add Config Error into WPS-FAIL events to provide more info + to the user on how to resolve the issue. + - When controlling multiple interfaces: + - apply WPS commands to all interfaces configured to use WPS + - apply WPS config changes to all interfaces that use WPS + - when an attack is detected on any interface, disable AP PIN on + all interfaces + * WPS ER: + - Show SetSelectedRegistrar events as ctrl_iface events. + - Add special AP Setup Locked mode to allow read only ER. + ap_setup_locked=2 can now be used to enable a special mode where + WPS ER can learn the current AP settings, but cannot change them. + * WPS 2.0: Add support for WPS 2.0 (CONFIG_WPS2) + - Add build option CONFIG_WPS_EXTENSIBILITY_TESTING to enable tool + for testing protocol extensibility. + - Add build option CONFIG_WPS_STRICT to allow disabling of WPS + workarounds. + - Add support for AuthorizedMACs attribute. + * TDLS: + - Allow TDLS use or TDLS channel switching in the BSS to be + prohibited in the BSS, using config params tdls_prohibit and + tdls_prohibit_chan_switch. + * EAP server: Add support for configuring fragment size (see + fragment_size in hostapd.conf). + * wlantest: Add a tool wlantest for IEEE802.11 protocol testing. + wlantest can be used to capture frames from a monitor interface + for realtime capturing or from pcap files for offline analysis. + * Interworking: Support added for 802.11u. Enable in .config with + CONFIG_INTERWORKING. See hostapd.conf for config parameters for + interworking. + * Android: Add build and runtime support for Android hostapd. + * Add a new debug message level for excessive information. Use + -ddd to enable. + * TLS: Add support for tls_disable_time_checks=1 in client mode. + * Internal TLS: + - Add support for TLS v1.1 (RFC 4346). Enable with build parameter + CONFIG_TLSV11. + - Add domainComponent parser for X.509 names + * Reorder some IEs to get closer to IEEE 802.11 standard. Move + WMM into end of Beacon, Probe Resp and (Re)Assoc Resp frames. + Move HT IEs to be later in (Re)Assoc Resp. + * Many bugfixes. 2010-04-18 - v0.7.2 * fix WPS internal Registrar use when an external Registrar is also @@ -98,7 +284,7 @@ ChangeLog for hostapd * updated management frame protection to use IEEE Std 802.11w-2009 * fixed number of small WPS issues and added workarounds to interoperate with common deployed broken implementations - * added some IEEE 802.11n co-existance rules to disable 40 MHz channels + * added some IEEE 802.11n co-existence rules to disable 40 MHz channels or modify primary/secondary channels if needed based on neighboring networks * added support for NFC out-of-band mechanism with WPS Modified: head/contrib/wpa/hostapd/Makefile ============================================================================== --- head/contrib/wpa/hostapd/Makefile Thu Jul 4 20:57:15 2013 (r252725) +++ head/contrib/wpa/hostapd/Makefile Thu Jul 4 21:12:58 2013 (r252726) @@ -43,6 +43,7 @@ OBJS += ../src/ap/utils.o OBJS += ../src/ap/authsrv.o OBJS += ../src/ap/ieee802_1x.o OBJS += ../src/ap/ap_config.o +OBJS += ../src/ap/eap_user_db.o OBJS += ../src/ap/ieee802_11_auth.o OBJS += ../src/ap/sta_info.o OBJS += ../src/ap/wpa_auth.o @@ -51,6 +52,10 @@ OBJS += ../src/ap/ap_mlme.o OBJS += ../src/ap/wpa_auth_ie.o OBJS += ../src/ap/preauth_auth.o OBJS += ../src/ap/pmksa_cache_auth.o +OBJS += ../src/ap/ieee802_11_shared.o +OBJS += ../src/ap/beacon.o + +OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o NEED_RC4=y NEED_AES=y @@ -63,18 +68,25 @@ CFLAGS += -DHOSTAPD ifdef CONFIG_WPA_TRACE CFLAGS += -DWPA_TRACE OBJS += ../src/utils/trace.o +HOBJS += ../src/utils/trace.o LDFLAGS += -rdynamic CFLAGS += -funwind-tables ifdef CONFIG_WPA_TRACE_BFD CFLAGS += -DWPA_TRACE_BFD LIBS += -lbfd LIBS_c += -lbfd +LIBS_h += -lbfd endif endif -OBJS += ../src/utils/eloop.o +ifndef CONFIG_ELOOP +CONFIG_ELOOP=eloop +endif +OBJS += ../src/utils/$(CONFIG_ELOOP).o +OBJS_c += ../src/utils/$(CONFIG_ELOOP).o OBJS += ../src/utils/common.o OBJS += ../src/utils/wpa_debug.o +OBJS_c += ../src/utils/wpa_debug.o OBJS += ../src/utils/wpabuf.o OBJS += ../src/utils/os_$(CONFIG_OS).o OBJS += ../src/utils/ip_addr.o @@ -99,6 +111,7 @@ CONFIG_NO_ACCOUNTING=y else OBJS += ../src/radius/radius.o OBJS += ../src/radius/radius_client.o +OBJS += ../src/radius/radius_das.o endif ifdef CONFIG_NO_ACCOUNTING @@ -111,6 +124,12 @@ ifdef CONFIG_NO_VLAN CFLAGS += -DCONFIG_NO_VLAN else OBJS += ../src/ap/vlan_init.o +ifdef CONFIG_VLAN_NETLINK +ifdef CONFIG_FULL_DYNAMIC_VLAN +OBJS += ../src/ap/vlan_util.o +endif +CFLAGS += -DCONFIG_VLAN_NETLINK +endif endif ifdef CONFIG_NO_CTRL_IFACE @@ -153,10 +172,23 @@ NEED_AES_OMAC1=y NEED_AES_UNWRAP=y endif +ifdef CONFIG_SAE +CFLAGS += -DCONFIG_SAE +endif + +ifdef CONFIG_WNM +CFLAGS += -DCONFIG_WNM +OBJS += ../src/ap/wnm_ap.o +endif + ifdef CONFIG_IEEE80211N CFLAGS += -DCONFIG_IEEE80211N endif +ifdef CONFIG_IEEE80211AC +CFLAGS += -DCONFIG_IEEE80211AC +endif + include ../src/drivers/drivers.mak OBJS += $(DRV_AP_OBJS) CFLAGS += $(DRV_AP_CFLAGS) @@ -192,6 +224,14 @@ OBJS += ../src/eap_server/eap_server_tls TLS_FUNCS=y endif +ifdef CONFIG_EAP_UNAUTH_TLS +CFLAGS += -DEAP_SERVER_UNAUTH_TLS +ifndef CONFIG_EAP_TLS +OBJS += ../src/eap_server/eap_server_tls.o +TLS_FUNCS=y +endif +endif + ifdef CONFIG_EAP_PEAP CFLAGS += -DEAP_SERVER_PEAP OBJS += ../src/eap_server/eap_server_peap.o @@ -274,6 +314,12 @@ NEED_SHA256=y NEED_AES_OMAC1=y endif +ifdef CONFIG_EAP_PWD +CFLAGS += -DEAP_SERVER_PWD +OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o +NEED_SHA256=y +endif + ifdef CONFIG_EAP_VENDOR_TEST CFLAGS += -DEAP_SERVER_VENDOR_TEST OBJS += ../src/eap_server/eap_server_vendor_test.o @@ -289,6 +335,10 @@ NEED_AES_UNWRAP=y endif ifdef CONFIG_WPS +ifdef CONFIG_WPS2 +CFLAGS += -DCONFIG_WPS2 +endif + CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC OBJS += ../src/utils/uuid.o OBJS += ../src/ap/wps_hostapd.o @@ -308,25 +358,10 @@ NEED_AES_CBC=y NEED_MODEXP=y CONFIG_EAP=y -ifdef CONFIG_WPS_UFD -CFLAGS += -DCONFIG_WPS_UFD -OBJS += ../src/wps/wps_ufd.o -NEED_WPS_OOB=y -endif - ifdef CONFIG_WPS_NFC CFLAGS += -DCONFIG_WPS_NFC OBJS += ../src/wps/ndef.o -OBJS += ../src/wps/wps_nfc.o NEED_WPS_OOB=y -ifdef CONFIG_WPS_NFC_PN531 -PN531_PATH ?= /usr/local/src/nfc -CFLAGS += -DCONFIG_WPS_NFC_PN531 -CFLAGS += -I${PN531_PATH}/inc -OBJS += ../src/wps/wps_nfc_pn531.o -LIBS += ${PN531_PATH}/lib/wpsnfc.dll -LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll -endif endif ifdef NEED_WPS_OOB @@ -346,6 +381,15 @@ OBJS += ../src/wps/http_client.o OBJS += ../src/wps/http_server.o endif +ifdef CONFIG_WPS_STRICT +CFLAGS += -DCONFIG_WPS_STRICT +OBJS += ../src/wps/wps_validate.o +endif + +ifdef CONFIG_WPS_TESTING +CFLAGS += -DCONFIG_WPS_TESTING +endif + endif ifdef CONFIG_EAP_IKEV2 @@ -406,6 +450,15 @@ ifndef CONFIG_TLS CONFIG_TLS=openssl endif +ifdef CONFIG_TLSV11 +CFLAGS += -DCONFIG_TLSV11 +endif + +ifdef CONFIG_TLSV12 +CFLAGS += -DCONFIG_TLSV12 +NEED_SHA256=y +endif + ifeq ($(CONFIG_TLS), openssl) ifdef TLS_FUNCS OBJS += ../src/crypto/tls_openssl.o @@ -424,10 +477,6 @@ ifeq ($(CONFIG_TLS), gnutls) ifdef TLS_FUNCS OBJS += ../src/crypto/tls_gnutls.o LIBS += -lgnutls -lgpg-error -ifdef CONFIG_GNUTLS_EXTRA -CFLAGS += -DCONFIG_GNUTLS_EXTRA -LIBS += -lgnutls-extra -endif endif OBJS += ../src/crypto/crypto_gnutls.o HOBJS += ../src/crypto/crypto_gnutls.o @@ -489,6 +538,9 @@ OBJS += ../src/tls/pkcs8.o NEED_SHA256=y NEED_BASE64=y NEED_TLS_PRF=y +ifdef CONFIG_TLSV12 +NEED_TLS_PRF_SHA256=y +endif NEED_MODEXP=y NEED_CIPHER=y CFLAGS += -DCONFIG_TLS_INTERNAL @@ -602,14 +654,19 @@ OBJS += $(AESOBJS) endif ifdef NEED_SHA1 +ifneq ($(CONFIG_TLS), openssl) SHA1OBJS += ../src/crypto/sha1.o +endif +SHA1OBJS += ../src/crypto/sha1-prf.o ifdef CONFIG_INTERNAL_SHA1 SHA1OBJS += ../src/crypto/sha1-internal.o ifdef NEED_FIPS186_2_PRF SHA1OBJS += ../src/crypto/fips_prf_internal.o endif endif +ifneq ($(CONFIG_TLS), openssl) SHA1OBJS += ../src/crypto/sha1-pbkdf2.o +endif ifdef NEED_T_PRF SHA1OBJS += ../src/crypto/sha1-tprf.o endif @@ -625,6 +682,7 @@ endif ifdef NEED_MD5 ifdef CONFIG_INTERNAL_MD5 OBJS += ../src/crypto/md5-internal.o +HOBJS += ../src/crypto/md5-internal.o endif endif @@ -647,10 +705,17 @@ endif endif ifdef NEED_SHA256 +CFLAGS += -DCONFIG_SHA256 +ifneq ($(CONFIG_TLS), openssl) OBJS += ../src/crypto/sha256.o +endif +OBJS += ../src/crypto/sha256-prf.o ifdef CONFIG_INTERNAL_SHA256 OBJS += ../src/crypto/sha256-internal.o endif +ifdef NEED_TLS_PRF_SHA256 +OBJS += ../src/crypto/sha256-tlsprf.o +endif endif ifdef NEED_DH_GROUPS @@ -665,6 +730,16 @@ OBJS += ../src/crypto/dh_group5.o endif endif +ifdef CONFIG_NO_RANDOM_POOL +CFLAGS += -DCONFIG_NO_RANDOM_POOL +else +OBJS += ../src/crypto/random.o +HOBJS += ../src/crypto/random.o +HOBJS += ../src/utils/eloop.o +HOBJS += $(SHA1OBJS) +HOBJS += ../src/crypto/md5.o +endif + ifdef CONFIG_RADIUS_SERVER CFLAGS += -DRADIUS_SERVER OBJS += ../src/radius/radius_server.o @@ -689,7 +764,6 @@ OBJS += ../src/utils/base64.o endif ifdef NEED_AP_MLME -OBJS += ../src/ap/beacon.o OBJS += ../src/ap/wmm.o OBJS += ../src/ap/ap_list.o OBJS += ../src/ap/ieee802_11.o @@ -700,10 +774,49 @@ ifdef CONFIG_IEEE80211N OBJS += ../src/ap/ieee802_11_ht.o endif +ifdef CONFIG_IEEE80211AC +OBJS += ../src/ap/ieee802_11_vht.o +endif + +ifdef CONFIG_P2P_MANAGER +CFLAGS += -DCONFIG_P2P_MANAGER +OBJS += ../src/ap/p2p_hostapd.o +endif + +ifdef CONFIG_HS20 +CFLAGS += -DCONFIG_HS20 +OBJS += ../src/ap/hs20.o +CONFIG_INTERWORKING=y +endif + +ifdef CONFIG_INTERWORKING +CFLAGS += -DCONFIG_INTERWORKING +OBJS += ../src/common/gas.o +OBJS += ../src/ap/gas_serv.o +endif + +OBJS += ../src/drivers/driver_common.o + +ifdef CONFIG_WPA_CLI_EDIT +OBJS_c += ../src/utils/edit.o +else +OBJS_c += ../src/utils/edit_simple.o +endif + ifdef CONFIG_NO_STDOUT_DEBUG CFLAGS += -DCONFIG_NO_STDOUT_DEBUG endif +ifdef CONFIG_DEBUG_FILE +CFLAGS += -DCONFIG_DEBUG_FILE +endif + +ifdef CONFIG_SQLITE +CFLAGS += -DCONFIG_SQLITE +LIBS += -lsqlite3 +LIBS_h += -lsqlite3 +endif + ALL=hostapd hostapd_cli all: verify_config $(ALL) @@ -729,7 +842,8 @@ verify_config: fi install: all - for i in $(ALL); do cp -f $$i /usr/local/bin/$$i; done *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 21:16:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1EAA1AC6; Thu, 4 Jul 2013 21:16:51 +0000 (UTC) (envelope-from adrian@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 10A791F3C; Thu, 4 Jul 2013 21:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LGpod047360; Thu, 4 Jul 2013 21:16:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64LGnZ5047347; Thu, 4 Jul 2013 21:16:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307042116.r64LGnZ5047347@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 21:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252727 - in head/sys: dev/iwn dev/ral net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 21:16:51 -0000 Author: adrian Date: Thu Jul 4 21:16:49 2013 New Revision: 252727 URL: http://svnweb.freebsd.org/changeset/base/252727 Log: Implement basic 802.11n awareness in the PHY and AMRR rate control code. * Add 802.11n 2ghz and 5ghz tables, including legacy rates and up to MCS23 rates (3x3.) * Populate the rate code -> rate index lookup table with MCS _and_ normal rates, but _not_ the basic rate flag. Since the basic rate flag is the same as the MCS flag, we can only use one. * Introduce some accessor inlines that do PLCP and rate table lookup/access and enforce that it doesn't set the basic rate bit. They're not designed for MCS rates, so it will panic. * Start converting drivers that use the rate table stuff to use the accessor inlines and strip the basic flag. * Teach AMRR about basic 11n - it's still as crap for MCS as it is being used by iwn, so it's not a step _backwardS_. * Convert iwn over to accept 11n MCS rates rather than 'translate' legacy to MCS rates. It doesn't use a lookup table any longer; instead it's a function which takes the current node (for HT parameters) and the rate code, and returns the hardware PLCP code to use. Tested: * ath - it's a no-op, and it works that way * iwn - both 11n and non-11n Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_phy.c head/sys/net80211/ieee80211_phy.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/dev/iwn/if_iwn.c Thu Jul 4 21:16:49 2013 (r252727) @@ -335,6 +335,8 @@ enum { IWN_DEBUG_NODE = 0x00000400, /* node management */ IWN_DEBUG_LED = 0x00000800, /* led management */ IWN_DEBUG_CMD = 0x00001000, /* cmd submission */ + IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ + IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ IWN_DEBUG_ANY = 0xffffffff }; @@ -2098,56 +2100,106 @@ rate2plcp(int rate) return 0; } -static void -iwn_newassoc(struct ieee80211_node *ni, int isnew) +/* + * Calculate the required PLCP value from the given rate, + * to the given node. + * + * This will take the node configuration (eg 11n, rate table + * setup, etc) into consideration. + */ +static uint32_t +iwn_rate_to_plcp(struct iwn_softc *sc, struct ieee80211_node *ni, + uint8_t rate) { #define RV(v) ((v) & IEEE80211_RATE_VAL) struct ieee80211com *ic = ni->ni_ic; - struct iwn_softc *sc = ic->ic_ifp->if_softc; - struct iwn_node *wn = (void *)ni; uint8_t txant1, txant2; - int i, plcp, rate, ridx; + uint32_t plcp = 0; + int ridx; /* Use the first valid TX antenna. */ txant1 = IWN_LSB(sc->txchainmask); txant2 = IWN_LSB(sc->txchainmask & ~txant1); + /* + * If it's an MCS rate, let's set the plcp correctly + * and set the relevant flags based on the node config. + */ if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - ridx = ni->ni_rates.rs_nrates - 1; - for (i = ni->ni_htrates.rs_nrates - 1; i >= 0; i--) { - plcp = RV(ni->ni_htrates.rs_rates[i]) | IWN_RFLAG_MCS; - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { - plcp |= IWN_RFLAG_HT40; - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) - plcp |= IWN_RFLAG_SGI; - } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + /* + * Set the initial PLCP value to be between 0->31 for + * MCS 0 -> MCS 31, then set the "I'm an MCS rate!" + * flag. + */ + plcp = RV(rate) | IWN_RFLAG_MCS; + + /* + * XXX the following should only occur if both + * the local configuration _and_ the remote node + * advertise these capabilities. Thus this code + * may need fixing! + */ + + /* + * Set the channel width and guard interval. + */ + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + plcp |= IWN_RFLAG_HT40; + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) plcp |= IWN_RFLAG_SGI; - if (RV(ni->ni_htrates.rs_rates[i]) > 7) - plcp |= IWN_RFLAG_ANT(txant1 | txant2); - else - plcp |= IWN_RFLAG_ANT(txant1); - if (ridx >= 0) { - rate = RV(ni->ni_rates.rs_rates[ridx]); - wn->ridx[rate] = plcp; - } - wn->ridx[IEEE80211_RATE_MCS | i] = plcp; - ridx--; + } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) { + plcp |= IWN_RFLAG_SGI; } - } else { - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - rate = RV(ni->ni_rates.rs_rates[i]); - plcp = rate2plcp(rate); - ridx = ic->ic_rt->rateCodeToIndex[rate]; - if (ridx < IWN_RIDX_OFDM6 && - IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) - plcp |= IWN_RFLAG_CCK; + + /* + * If it's a two stream rate, enable TX on both + * antennas. + * + * XXX three stream rates? + */ + if (rate > 0x87) + plcp |= IWN_RFLAG_ANT(txant1 | txant2); + else plcp |= IWN_RFLAG_ANT(txant1); - wn->ridx[rate] = htole32(plcp); - } - } + } else { + /* + * Set the initial PLCP - fine for both + * OFDM and CCK rates. + */ + plcp = rate2plcp(rate); + + /* Set CCK flag if it's CCK */ + + /* XXX It would be nice to have a method + * to map the ridx -> phy table entry + * so we could just query that, rather than + * this hack to check against IWN_RIDX_OFDM6. + */ + ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, + rate & IEEE80211_RATE_VAL); + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + plcp |= IWN_RFLAG_CCK; + + /* Set antenna configuration */ + plcp |= IWN_RFLAG_ANT(txant1); + } + + DPRINTF(sc, IWN_DEBUG_TXRATE, "%s: rate=0x%02x, plcp=0x%08x\n", + __func__, + rate, + plcp); + + return (htole32(plcp)); #undef RV } +static void +iwn_newassoc(struct ieee80211_node *ni, int isnew) +{ + /* Doesn't do anything at the moment */ +} + static int iwn_media_change(struct ifnet *ifp) { @@ -3401,7 +3453,8 @@ iwn_tx_data(struct iwn_softc *sc, struct (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } - ridx = ic->ic_rt->rateCodeToIndex[rate]; + ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, + rate & IEEE80211_RATE_VAL); /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -3507,7 +3560,7 @@ iwn_tx_data(struct iwn_softc *sc, struct tx->rts_ntries = 60; tx->data_ntries = 15; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->rate = wn->ridx[rate]; + tx->rate = iwn_rate_to_plcp(sc, ni, rate); if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; @@ -3638,7 +3691,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st /* Choose a TX rate index. */ rate = params->ibp_rate0; - ridx = ic->ic_rt->rateCodeToIndex[rate]; + ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, + rate & IEEE80211_RATE_VAL); if (ridx == (uint8_t)-1) { /* XXX fall back to mcast/mgmt rate? */ m_freem(m); @@ -3714,14 +3768,18 @@ iwn_tx_data_raw(struct iwn_softc *sc, st tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); + + /* XXX should just use iwn_rate_to_plcp() */ tx->rate = htole32(rate2plcp(rate)); if (ridx < IWN_RIDX_OFDM6 && IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) tx->rate |= htole32(IWN_RFLAG_CCK); + /* Group or management frame. */ tx->linkq = 0; txant = IWN_LSB(sc->txchainmask); tx->rate |= htole32(IWN_RFLAG_ANT(txant)); + /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); @@ -4077,14 +4135,20 @@ iwn_set_link_quality(struct iwn_softc *s else txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { + uint32_t plcp; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) rate = IEEE80211_RATE_MCS | txrate; else rate = RV(rs->rs_rates[txrate]); - linkq.retry[i] = wn->ridx[rate]; - if ((le32toh(wn->ridx[rate]) & IWN_RFLAG_MCS) && - RV(le32toh(wn->ridx[rate])) > 7) + /* Do rate -> PLCP config mapping */ + plcp = iwn_rate_to_plcp(sc, ni, rate); + linkq.retry[i] = plcp; + + /* Special case for dual-stream rates? */ + if ((le32toh(plcp) & IWN_RFLAG_MCS) && + RV(le32toh(plcp)) > 7) linkq.mimo = i + 1; /* Next retry at immediate lower bit-rate. */ @@ -4940,6 +5004,13 @@ iwn_set_pslevel(struct iwn_softc *sc, in uint32_t reg; int i; + DPRINTF(sc, IWN_DEBUG_PWRSAVE, + "%s: dtim=%d, level=%d, async=%d\n", + __func__, + dtim, + level, + async); + /* Select which PS parameters to use. */ if (dtim <= 2) pmgt = &iwn_pmgt[0][level]; Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/dev/iwn/if_iwnvar.h Thu Jul 4 21:16:49 2013 (r252727) @@ -102,7 +102,6 @@ struct iwn_node { struct ieee80211_node ni; /* must be the first */ uint16_t disable_tid; uint8_t id; - uint32_t ridx[256]; struct { uint64_t bitmap; int startidx; Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/dev/ral/rt2560.c Thu Jul 4 21:16:49 2013 (r252727) @@ -2370,7 +2370,7 @@ rt2560_set_basicrates(struct rt2560_soft if (!(rate & IEEE80211_RATE_BASIC)) continue; - mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; + mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate)); } RAL_WRITE(sc, RT2560_ARSP_PLCP_1, mask); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/dev/ral/rt2661.c Thu Jul 4 21:16:49 2013 (r252727) @@ -1923,7 +1923,7 @@ rt2661_set_basicrates(struct rt2661_soft if (!(rate & IEEE80211_RATE_BASIC)) continue; - mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; + mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate)); } RAL_WRITE(sc, RT2661_TXRX_CSR5, mask); Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/dev/ral/rt2860.c Thu Jul 4 21:16:49 2013 (r252727) @@ -1528,7 +1528,7 @@ rt2860_tx(struct rt2860_softc *sc, struc tid = 0; } ring = &sc->txq[qid]; - ridx = ic->ic_rt->rateCodeToIndex[rate]; + ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, rate); /* get MCS code from rate index */ mcs = rt2860_rates[ridx].mcs; @@ -1779,7 +1779,8 @@ rt2860_tx_raw(struct rt2860_softc *sc, s /* Choose a TX rate index. */ rate = params->ibp_rate0; - ridx = ic->ic_rt->rateCodeToIndex[rate]; + ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, + rate & IEEE80211_RATE_VAL); if (ridx == (uint8_t)-1) { /* XXX fall back to mcast/mgmt rate? */ m_freem(m); @@ -2311,7 +2312,7 @@ rt2860_set_basicrates(struct rt2860_soft if (!(rate & IEEE80211_RATE_BASIC)) continue; - mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)]; + mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate)); } RAL_WRITE(sc, RT2860_LEGACY_BASIC_RATE, mask); Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/net80211/ieee80211_amrr.c Thu Jul 4 21:16:49 2013 (r252727) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include @@ -128,13 +129,25 @@ amrr_deinit(struct ieee80211vap *vap) free(vap->iv_rs, M_80211_RATECTL); } +static int +amrr_node_is_11n(struct ieee80211_node *ni) +{ + + if (ni->ni_chan == NULL) + return (0); + if (ni->ni_chan == IEEE80211_CHAN_ANYC) + return (0); + return (IEEE80211_IS_CHAN_HT(ni->ni_chan)); +} + static void amrr_node_init(struct ieee80211_node *ni) { - const struct ieee80211_rateset *rs = &ni->ni_rates; + const struct ieee80211_rateset *rs = NULL; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_amrr *amrr = vap->iv_rs; struct ieee80211_amrr_node *amn; + uint8_t rate; if (ni->ni_rctls == NULL) { ni->ni_rctls = amn = malloc(sizeof(struct ieee80211_amrr_node), @@ -152,16 +165,50 @@ amrr_node_init(struct ieee80211_node *ni amn->amn_txcnt = amn->amn_retrycnt = 0; amn->amn_success_threshold = amrr->amrr_min_success_threshold; - /* pick initial rate */ - for (amn->amn_rix = rs->rs_nrates - 1; - amn->amn_rix > 0 && (rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) > 72; - amn->amn_rix--) - ; - ni->ni_txrate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + /* 11n or not? Pick the right rateset */ + if (amrr_node_is_11n(ni)) { + /* XXX ew */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "%s: 11n node", __func__); + rs = (struct ieee80211_rateset *) &ni->ni_htrates; + } else { + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "%s: non-11n node", __func__); + rs = &ni->ni_rates; + } + + /* Initial rate - lowest */ + rate = rs->rs_rates[0]; + + /* XXX clear the basic rate flag if it's not 11n */ + if (! amrr_node_is_11n(ni)) + rate &= IEEE80211_RATE_VAL; + + /* pick initial rate from the rateset - HT or otherwise */ + for (amn->amn_rix = rs->rs_nrates - 1; amn->amn_rix > 0; + amn->amn_rix--) { + /* legacy - anything < 36mbit, stop searching */ + /* 11n - stop at MCS4 / MCS12 / MCS28 */ + if (amrr_node_is_11n(ni) && + (rs->rs_rates[amn->amn_rix] & 0x7) < 4) + break; + else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72) + break; + rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + } + + /* if the rate is an 11n rate, ensure the MCS bit is set */ + if (amrr_node_is_11n(ni)) + rate |= IEEE80211_RATE_MCS; + + /* Assign initial rate from the rateset */ + ni->ni_txrate = rate; amn->amn_ticks = ticks; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR initial rate %d", ni->ni_txrate); + "AMRR: nrates=%d, initial rate %d", + rs->rs_nrates, + rate); } static void @@ -175,19 +222,34 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_node *ni) { int rix = amn->amn_rix; + const struct ieee80211_rateset *rs = NULL; KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); + /* 11n or not? Pick the right rateset */ + if (amrr_node_is_11n(ni)) { + /* XXX ew */ + rs = (struct ieee80211_rateset *) &ni->ni_htrates; + } else { + rs = &ni->ni_rates; + } + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, + "AMRR: current rate %d, txcnt=%d, retrycnt=%d", + rs->rs_rates[rix] & IEEE80211_RATE_VAL, + amn->amn_txcnt, + amn->amn_retrycnt); + if (is_success(amn)) { amn->amn_success++; if (amn->amn_success >= amn->amn_success_threshold && - rix + 1 < ni->ni_rates.rs_nrates) { + rix + 1 < rs->rs_nrates) { amn->amn_recovery = 1; amn->amn_success = 0; rix++; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR increasing rate %d (txcnt=%d retrycnt=%d)", - ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL, + rs->rs_rates[rix] & IEEE80211_RATE_VAL, amn->amn_txcnt, amn->amn_retrycnt); } else { amn->amn_recovery = 0; @@ -208,7 +270,7 @@ amrr_update(struct ieee80211_amrr *amrr, rix--; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR decreasing rate %d (txcnt=%d retrycnt=%d)", - ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL, + rs->rs_rates[rix] & IEEE80211_RATE_VAL, amn->amn_txcnt, amn->amn_retrycnt); } amn->amn_recovery = 0; @@ -231,14 +293,27 @@ amrr_rate(struct ieee80211_node *ni, voi { struct ieee80211_amrr_node *amn = ni->ni_rctls; struct ieee80211_amrr *amrr = amn->amn_amrr; + const struct ieee80211_rateset *rs = NULL; int rix; + /* 11n or not? Pick the right rateset */ + if (amrr_node_is_11n(ni)) { + /* XXX ew */ + rs = (struct ieee80211_rateset *) &ni->ni_htrates; + } else { + rs = &ni->ni_rates; + } + if (is_enough(amn) && (ticks - amn->amn_ticks) > amrr->amrr_interval) { rix = amrr_update(amrr, amn, ni); if (rix != amn->amn_rix) { /* update public rate */ - ni->ni_txrate = - ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL; + ni->ni_txrate = rs->rs_rates[rix]; + /* XXX strip basic rate flag from txrate, if non-11n */ + if (amrr_node_is_11n(ni)) + ni->ni_txrate |= IEEE80211_RATE_MCS; + else + ni->ni_txrate &= IEEE80211_RATE_VAL; amn->amn_rix = rix; } amn->amn_ticks = ticks; Modified: head/sys/net80211/ieee80211_phy.c ============================================================================== --- head/sys/net80211/ieee80211_phy.c Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/net80211/ieee80211_phy.c Thu Jul 4 21:16:49 2013 (r252727) @@ -60,8 +60,11 @@ struct ieee80211_ds_plcp_hdr { #define TURBO IEEE80211_T_TURBO #define HALF IEEE80211_T_OFDM_HALF #define QUART IEEE80211_T_OFDM_QUARTER +#define HT IEEE80211_T_HT +/* XXX the 11n and the basic rate flag are unfortunately overlapping. Grr. */ +#define N(r) (IEEE80211_RATE_MCS | r) #define PBCC (IEEE80211_T_OFDM_QUARTER+1) /* XXX */ -#define B(r) (0x80 | r) +#define B(r) (IEEE80211_RATE_BASIC | r) #define Mb(x) (x*1000) static struct ieee80211_rate_table ieee80211_11b_table = { @@ -176,6 +179,98 @@ static struct ieee80211_rate_table ieee8 }, }; +static struct ieee80211_rate_table ieee80211_11ng_table = { + .rateCount = 36, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = CCK, 1000, 0x00, B(2), 0 }, + [1] = { .phy = CCK, 2000, 0x04, B(4), 1 }, + [2] = { .phy = CCK, 5500, 0x04, B(11), 2 }, + [3] = { .phy = CCK, 11000, 0x04, B(22), 3 }, + [4] = { .phy = OFDM, 6000, 0x00, 12, 4 }, + [5] = { .phy = OFDM, 9000, 0x00, 18, 4 }, + [6] = { .phy = OFDM, 12000, 0x00, 24, 6 }, + [7] = { .phy = OFDM, 18000, 0x00, 36, 6 }, + [8] = { .phy = OFDM, 24000, 0x00, 48, 8 }, + [9] = { .phy = OFDM, 36000, 0x00, 72, 8 }, + [10] = { .phy = OFDM, 48000, 0x00, 96, 8 }, + [11] = { .phy = OFDM, 54000, 0x00, 108, 8 }, + + [12] = { .phy = HT, 6500, 0x00, N(0), 4 }, + [13] = { .phy = HT, 13000, 0x00, N(1), 6 }, + [14] = { .phy = HT, 19500, 0x00, N(2), 6 }, + [15] = { .phy = HT, 26000, 0x00, N(3), 8 }, + [16] = { .phy = HT, 39000, 0x00, N(4), 8 }, + [17] = { .phy = HT, 52000, 0x00, N(5), 8 }, + [18] = { .phy = HT, 58500, 0x00, N(6), 8 }, + [19] = { .phy = HT, 65000, 0x00, N(7), 8 }, + + [20] = { .phy = HT, 13000, 0x00, N(8), 4 }, + [21] = { .phy = HT, 26000, 0x00, N(9), 6 }, + [22] = { .phy = HT, 39000, 0x00, N(10), 6 }, + [23] = { .phy = HT, 52000, 0x00, N(11), 8 }, + [24] = { .phy = HT, 78000, 0x00, N(12), 8 }, + [25] = { .phy = HT, 104000, 0x00, N(13), 8 }, + [26] = { .phy = HT, 117000, 0x00, N(14), 8 }, + [27] = { .phy = HT, 130000, 0x00, N(15), 8 }, + + [28] = { .phy = HT, 19500, 0x00, N(16), 4 }, + [29] = { .phy = HT, 39000, 0x00, N(17), 6 }, + [30] = { .phy = HT, 58500, 0x00, N(18), 6 }, + [31] = { .phy = HT, 78000, 0x00, N(19), 8 }, + [32] = { .phy = HT, 117000, 0x00, N(20), 8 }, + [33] = { .phy = HT, 156000, 0x00, N(21), 8 }, + [34] = { .phy = HT, 175500, 0x00, N(22), 8 }, + [35] = { .phy = HT, 195000, 0x00, N(23), 8 }, + + }, +}; + +static struct ieee80211_rate_table ieee80211_11na_table = { + .rateCount = 32, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = OFDM, 6000, 0x00, B(12), 0 }, + [1] = { .phy = OFDM, 9000, 0x00, 18, 0 }, + [2] = { .phy = OFDM, 12000, 0x00, B(24), 2 }, + [3] = { .phy = OFDM, 18000, 0x00, 36, 2 }, + [4] = { .phy = OFDM, 24000, 0x00, B(48), 4 }, + [5] = { .phy = OFDM, 36000, 0x00, 72, 4 }, + [6] = { .phy = OFDM, 48000, 0x00, 96, 4 }, + [7] = { .phy = OFDM, 54000, 0x00, 108, 4 }, + + [8] = { .phy = HT, 6500, 0x00, N(0), 0 }, + [9] = { .phy = HT, 13000, 0x00, N(1), 2 }, + [10] = { .phy = HT, 19500, 0x00, N(2), 2 }, + [11] = { .phy = HT, 26000, 0x00, N(3), 4 }, + [12] = { .phy = HT, 39000, 0x00, N(4), 4 }, + [13] = { .phy = HT, 52000, 0x00, N(5), 4 }, + [14] = { .phy = HT, 58500, 0x00, N(6), 4 }, + [15] = { .phy = HT, 65000, 0x00, N(7), 4 }, + + [16] = { .phy = HT, 13000, 0x00, N(8), 0 }, + [17] = { .phy = HT, 26000, 0x00, N(9), 2 }, + [18] = { .phy = HT, 39000, 0x00, N(10), 2 }, + [19] = { .phy = HT, 52000, 0x00, N(11), 4 }, + [20] = { .phy = HT, 78000, 0x00, N(12), 4 }, + [21] = { .phy = HT, 104000, 0x00, N(13), 4 }, + [22] = { .phy = HT, 117000, 0x00, N(14), 4 }, + [23] = { .phy = HT, 130000, 0x00, N(15), 4 }, + + [24] = { .phy = HT, 19500, 0x00, N(16), 0 }, + [25] = { .phy = HT, 39000, 0x00, N(17), 2 }, + [26] = { .phy = HT, 58500, 0x00, N(18), 2 }, + [27] = { .phy = HT, 78000, 0x00, N(19), 4 }, + [28] = { .phy = HT, 117000, 0x00, N(20), 4 }, + [29] = { .phy = HT, 156000, 0x00, N(21), 4 }, + [30] = { .phy = HT, 175500, 0x00, N(22), 4 }, + [31] = { .phy = HT, 195000, 0x00, N(23), 4 }, + + }, +}; + #undef Mb #undef B #undef OFDM @@ -184,6 +279,8 @@ static struct ieee80211_rate_table ieee8 #undef CCK #undef TURBO #undef XR +#undef HT +#undef N /* * Setup a rate table's reverse lookup table and fill in @@ -210,15 +307,23 @@ ieee80211_setup_ratetable(struct ieee802 uint8_t cix = rt->info[i].ctlRateIndex; uint8_t ctl_rate = rt->info[cix].dot11Rate; - rt->rateCodeToIndex[code] = i; - if (code & IEEE80211_RATE_BASIC) { - /* - * Map w/o basic rate bit too. - */ - code &= IEEE80211_RATE_VAL; - rt->rateCodeToIndex[code] = i; + /* + * Map without the basic rate bit. + * + * It's up to the caller to ensure that the basic + * rate bit is stripped here. + * + * For HT, use the MCS rate bit. + */ + code &= IEEE80211_RATE_VAL; + if (rt->info[i].phy == IEEE80211_T_HT) { + code |= IEEE80211_RATE_MCS; } + /* XXX assume the control rate is non-MCS? */ + ctl_rate &= IEEE80211_RATE_VAL; + rt->rateCodeToIndex[code] = i; + /* * XXX for 11g the control rate to use for 5.5 and 11 Mb/s * depends on whether they are marked as basic rates; @@ -247,11 +352,10 @@ ieee80211_phy_init(void) static struct ieee80211_rate_table * const ratetables[] = { &ieee80211_half_table, &ieee80211_quarter_table, - &ieee80211_11a_table, - &ieee80211_11g_table, + &ieee80211_11na_table, + &ieee80211_11ng_table, &ieee80211_turbog_table, &ieee80211_turboa_table, - &ieee80211_turboa_table, &ieee80211_11a_table, &ieee80211_11g_table, &ieee80211_11b_table @@ -276,9 +380,9 @@ ieee80211_get_ratetable(struct ieee80211 else if (IEEE80211_IS_CHAN_QUARTER(c)) rt = &ieee80211_quarter_table; else if (IEEE80211_IS_CHAN_HTA(c)) - rt = &ieee80211_11a_table; /* XXX */ + rt = &ieee80211_11na_table; else if (IEEE80211_IS_CHAN_HTG(c)) - rt = &ieee80211_11g_table; /* XXX */ + rt = &ieee80211_11ng_table; else if (IEEE80211_IS_CHAN_108G(c)) rt = &ieee80211_turbog_table; else if (IEEE80211_IS_CHAN_ST(c)) @@ -463,3 +567,66 @@ ieee80211_compute_duration(const struct } return txTime; } + +static const uint16_t ht20_bps[32] = { + 26, 52, 78, 104, 156, 208, 234, 260, + 52, 104, 156, 208, 312, 416, 468, 520, + 78, 156, 234, 312, 468, 624, 702, 780, + 104, 208, 312, 416, 624, 832, 936, 1040 +}; +static const uint16_t ht40_bps[32] = { + 54, 108, 162, 216, 324, 432, 486, 540, + 108, 216, 324, 432, 648, 864, 972, 1080, + 162, 324, 486, 648, 972, 1296, 1458, 1620, + 216, 432, 648, 864, 1296, 1728, 1944, 2160 +}; + + +#define OFDM_PLCP_BITS 22 +#define HT_L_STF 8 +#define HT_L_LTF 8 +#define HT_L_SIG 4 +#define HT_SIG 8 +#define HT_STF 4 +#define HT_LTF(n) ((n) * 4) + +#define HT_RC_2_MCS(_rc) ((_rc) & 0xf) +#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) +#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS) + +/* + * Calculate the transmit duration of an 11n frame. + */ +uint32_t +ieee80211_compute_duration_ht(uint32_t frameLen, uint16_t rate, + int streams, int isht40, int isShortGI) +{ + uint32_t bitsPerSymbol, numBits, numSymbols, txTime; + + KASSERT(rate & IEEE80211_RATE_MCS, ("not mcs %d", rate)); + KASSERT((rate &~ IEEE80211_RATE_MCS) < 31, ("bad mcs 0x%x", rate)); + + if (isht40) + bitsPerSymbol = ht40_bps[rate & 0x1f]; + else + bitsPerSymbol = ht20_bps[rate & 0x1f]; + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + if (isShortGI) + txTime = ((numSymbols * 18) + 4) / 5; /* 3.6us */ + else + txTime = numSymbols * 4; /* 4us */ + return txTime + HT_L_STF + HT_L_LTF + + HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); +} + +#undef IS_HT_RATE +#undef HT_RC_2_STREAMS +#undef HT_RC_2_MCS +#undef HT_LTF +#undef HT_STF +#undef HT_SIG +#undef HT_L_SIG +#undef HT_L_LTF +#undef HT_L_STF +#undef OFDM_PLCP_BITS Modified: head/sys/net80211/ieee80211_phy.h ============================================================================== --- head/sys/net80211/ieee80211_phy.h Thu Jul 4 21:12:58 2013 (r252726) +++ head/sys/net80211/ieee80211_phy.h Thu Jul 4 21:16:49 2013 (r252727) @@ -60,6 +60,8 @@ struct ieee80211_channel; +#define IEEE80211_RATE_TABLE_SIZE 128 + struct ieee80211_rate_table { int rateCount; /* NB: for proper padding */ uint8_t rateCodeToIndex[256]; /* back mapping */ @@ -74,7 +76,7 @@ struct ieee80211_rate_table { * rate; used for dur. calcs */ uint16_t lpAckDuration; /* long preamble ACK dur. */ uint16_t spAckDuration; /* short preamble ACK dur. */ - } info[32]; + } info[IEEE80211_RATE_TABLE_SIZE]; }; const struct ieee80211_rate_table *ieee80211_get_ratetable( @@ -83,7 +85,14 @@ const struct ieee80211_rate_table *ieee8 static __inline__ uint8_t ieee80211_ack_rate(const struct ieee80211_rate_table *rt, uint8_t rate) { - uint8_t cix = rt->info[rt->rateCodeToIndex[rate]].ctlRateIndex; + /* + * XXX Assert this is for a legacy rate; not for an MCS rate. + * If the caller wishes to use it for a basic rate, they should + * clear the high bit first. + */ + KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); + + uint8_t cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex; KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate)); return rt->info[cix].dot11Rate; } @@ -91,7 +100,14 @@ ieee80211_ack_rate(const struct ieee8021 static __inline__ uint8_t ieee80211_ctl_rate(const struct ieee80211_rate_table *rt, uint8_t rate) { - uint8_t cix = rt->info[rt->rateCodeToIndex[rate]].ctlRateIndex; + /* + * XXX Assert this is for a legacy rate; not for an MCS rate. + * If the caller wishes to use it for a basic rate, they should + * clear the high bit first. + */ + KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); + + uint8_t cix = rt->info[rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]].ctlRateIndex; KASSERT(cix != (uint8_t)-1, ("rate %d has no info", rate)); return rt->info[cix].dot11Rate; } @@ -99,7 +115,14 @@ ieee80211_ctl_rate(const struct ieee8021 static __inline__ enum ieee80211_phytype ieee80211_rate2phytype(const struct ieee80211_rate_table *rt, uint8_t rate) { - uint8_t rix = rt->rateCodeToIndex[rate]; + /* + * XXX Assert this is for a legacy rate; not for an MCS rate. + * If the caller wishes to use it for a basic rate, they should + * clear the high bit first. + */ + KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); + + uint8_t rix = rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]; KASSERT(rix != (uint8_t)-1, ("rate %d has no info", rate)); return rt->info[rix].phy; } @@ -107,6 +130,13 @@ ieee80211_rate2phytype(const struct ieee static __inline__ int ieee80211_isratevalid(const struct ieee80211_rate_table *rt, uint8_t rate) { + /* + * XXX Assert this is for a legacy rate; not for an MCS rate. + * If the caller wishes to use it for a basic rate, they should + * clear the high bit first. + */ + KASSERT(! (rate & 0x80), ("rate %d is basic/mcs?", rate)); + return rt->rateCodeToIndex[rate] != (uint8_t)-1; } @@ -134,6 +164,14 @@ ieee80211_ack_duration(const struct ieee } } +static __inline__ uint8_t +ieee80211_legacy_rate_lookup(const struct ieee80211_rate_table *rt, + uint8_t rate) +{ + + return (rt->rateCodeToIndex[rate & IEEE80211_RATE_VAL]); +} + /* * Compute the time to transmit a frame of length frameLen bytes * using the specified 802.11 rate code, phy, and short preamble @@ -151,5 +189,10 @@ uint8_t ieee80211_plcp2rate(uint8_t, en * Convert 802.11 rate code to PLCP signal. */ uint8_t ieee80211_rate2plcp(int, enum ieee80211_phytype); + +uint32_t ieee80211_compute_duration_ht(uint32_t frameLen, + uint16_t rate, int streams, int isht40, + int isShortGI); + #endif /* _KERNEL */ #endif /* !_NET80211_IEEE80211_PHY_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 21:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 910ADC29; Thu, 4 Jul 2013 21:19:02 +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 834631F53; Thu, 4 Jul 2013 21:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LJ2SV047653; Thu, 4 Jul 2013 21:19:02 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64LJ1P7047645; Thu, 4 Jul 2013 21:19:01 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307042119.r64LJ1P7047645@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 4 Jul 2013 21:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252728 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 21:19:02 -0000 Author: np Date: Thu Jul 4 21:19:01 2013 New Revision: 252728 URL: http://svnweb.freebsd.org/changeset/base/252728 Log: - Make note of interface MTU change if the rx queues exist, and not just when the interface is up. - Add a tunable to control the TOE's rx coalesce feature (enabled by default as it always has been). Consider the interface MTU or the coalesce size when deciding which cluster zone to use to fill the offload rx queue's free list. The tunable is: dev.{t4nex,t5nex}..toe.rx_coalesce MFC after: 1 day Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/adapter.h Thu Jul 4 21:19:01 2013 (r252728) @@ -132,7 +132,6 @@ enum { #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif - OFLD_BUF_SIZE = MJUM16BYTES, /* size of fl buffer for TOE rxq */ CTRL_EQ_QSIZE = 128, Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/offload.h Thu Jul 4 21:19:01 2013 (r252728) @@ -140,6 +140,7 @@ struct tom_tunables { int ddp; int indsz; int ddp_thres; + int rx_coalesce; }; int t4_register_uld(struct uld_info *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/t4_main.c Thu Jul 4 21:19:01 2013 (r252728) @@ -1072,9 +1072,10 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned if (rc) return (rc); ifp->if_mtu = mtu; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (pi->flags & PORT_INIT_DONE) { t4_update_fl_bufsize(ifp); - rc = update_mac_settings(pi, XGMAC_MTU); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rc = update_mac_settings(pi, XGMAC_MTU); } end_synchronized_op(sc, 0); break; @@ -4381,6 +4382,10 @@ t4_sysctls(struct adapter *sc) G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp_thres", CTLFLAG_RW, &sc->tt.ddp_thres, 0, "DDP threshold"); + + sc->tt.rx_coalesce = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", + CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); } #endif Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jul 4 21:19:01 2013 (r252728) @@ -659,6 +659,18 @@ mtu_to_bufsize(int mtu) return (bufsize); } +#ifdef TCP_OFFLOAD +static inline int +mtu_to_bufsize_toe(struct adapter *sc, int mtu) +{ + + if (sc->tt.rx_coalesce) + return (G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2))); + + return (mtu); +} +#endif + int t4_setup_port_queues(struct port_info *pi) { @@ -673,9 +685,10 @@ t4_setup_port_queues(struct port_info *p #endif char name[16]; struct adapter *sc = pi->adapter; + struct ifnet *ifp = pi->ifp; struct sysctl_oid *oid = device_get_sysctl_tree(pi->dev); struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - int bufsize = mtu_to_bufsize(pi->ifp->if_mtu); + int bufsize; oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD, NULL, "rx queues"); @@ -696,6 +709,7 @@ t4_setup_port_queues(struct port_info *p * a) initialize iq and fl * b) allocate queue iff it will take direct interrupts. */ + bufsize = mtu_to_bufsize(ifp->if_mtu); for_each_rxq(pi, i, rxq) { init_iq(&rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, pi->qsize_rxq, @@ -719,6 +733,7 @@ t4_setup_port_queues(struct port_info *p } #ifdef TCP_OFFLOAD + bufsize = mtu_to_bufsize_toe(sc, ifp->if_mtu); for_each_ofld_rxq(pi, i, ofld_rxq) { init_iq(&ofld_rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, @@ -726,7 +741,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(&ofld_rxq->fl, pi->qsize_rxq / 8, OFLD_BUF_SIZE, name); + init_fl(&ofld_rxq->fl, pi->qsize_rxq / 8, bufsize, name); if (sc->flags & INTR_DIRECT || (sc->intr_count > 1 && pi->nofldrxq > pi->nrxq)) { @@ -1557,9 +1572,13 @@ t4_update_fl_bufsize(struct ifnet *ifp) { struct port_info *pi = ifp->if_softc; struct sge_rxq *rxq; +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif struct sge_fl *fl; - int i, bufsize = mtu_to_bufsize(ifp->if_mtu); + int i, bufsize; + bufsize = mtu_to_bufsize(ifp->if_mtu); for_each_rxq(pi, i, rxq) { fl = &rxq->fl; @@ -1567,6 +1586,16 @@ t4_update_fl_bufsize(struct ifnet *ifp) set_fl_tag_idx(fl, bufsize); FL_UNLOCK(fl); } +#ifdef TCP_OFFLOAD + bufsize = mtu_to_bufsize_toe(pi->adapter, ifp->if_mtu); + for_each_ofld_rxq(pi, i, ofld_rxq) { + fl = &ofld_rxq->fl; + + FL_LOCK(fl); + set_fl_tag_idx(fl, bufsize); + FL_UNLOCK(fl); + } +#endif } int Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Jul 4 21:19:01 2013 (r252728) @@ -251,7 +251,8 @@ calc_opt2a(struct socket *so, struct toe opt2 |= F_T5_OPT_2_VALID; opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ } - opt2 |= V_RX_COALESCE(M_RX_COALESCE); + if (sc->tt.rx_coalesce) + opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL if (toep->ulp_mode == ULP_MODE_TCPDDP) Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Jul 4 21:16:49 2013 (r252727) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Jul 4 21:19:01 2013 (r252728) @@ -1021,7 +1021,8 @@ calc_opt2p(struct adapter *sc, struct po opt2 |= F_T5_OPT_2_VALID; opt2 |= F_CONG_CNTRL_VALID; /* OPT_2_ISS really, for T5 */ } - opt2 |= V_RX_COALESCE(M_RX_COALESCE); + if (sc->tt.rx_coalesce) + opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL if (ulp_mode == ULP_MODE_TCPDDP) From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 21:31:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81D94E1F; Thu, 4 Jul 2013 21:31:29 +0000 (UTC) (envelope-from rpaulo@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 72D321FC3; Thu, 4 Jul 2013 21:31:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LVTtu052372; Thu, 4 Jul 2013 21:31:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64LVTbJ052371; Thu, 4 Jul 2013 21:31:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307042131.r64LVTbJ052371@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 21:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252729 - in head/contrib/wpa: hostapd src src/ap src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_auth src/eapol_supp src/l2_packet src/p2p src/ra... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 21:31:29 -0000 Author: rpaulo Date: Thu Jul 4 21:31:28 2013 New Revision: 252729 URL: http://svnweb.freebsd.org/changeset/base/252729 Log: Remove unused files / directories. Deleted: head/contrib/wpa/hostapd/Makefile head/contrib/wpa/src/Makefile head/contrib/wpa/src/ap/Makefile head/contrib/wpa/src/common/Makefile head/contrib/wpa/src/crypto/Makefile head/contrib/wpa/src/drivers/Makefile head/contrib/wpa/src/drivers/android_drv.h head/contrib/wpa/src/drivers/drivers.mak head/contrib/wpa/src/drivers/drivers.mk head/contrib/wpa/src/drivers/linux_wext.h head/contrib/wpa/src/drivers/rfkill.c head/contrib/wpa/src/drivers/rfkill.h head/contrib/wpa/src/eap_common/Makefile head/contrib/wpa/src/eap_peer/Makefile head/contrib/wpa/src/eap_server/Makefile head/contrib/wpa/src/eapol_auth/Makefile head/contrib/wpa/src/eapol_supp/Makefile head/contrib/wpa/src/l2_packet/Makefile head/contrib/wpa/src/lib.rules head/contrib/wpa/src/p2p/Makefile head/contrib/wpa/src/radius/Makefile head/contrib/wpa/src/rsn_supp/Makefile head/contrib/wpa/src/tls/Makefile head/contrib/wpa/src/utils/Makefile head/contrib/wpa/src/wps/Makefile head/contrib/wpa/wpa_supplicant/Makefile head/contrib/wpa/wpa_supplicant/dbus/ head/contrib/wpa/wpa_supplicant/doc/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 21:57:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B9F4875; Thu, 4 Jul 2013 21:57:10 +0000 (UTC) (envelope-from smh@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 5D38F1100; Thu, 4 Jul 2013 21:57:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LvAhV059228; Thu, 4 Jul 2013 21:57:10 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Lv9FW059220; Thu, 4 Jul 2013 21:57:09 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307042157.r64Lv9FW059220@svn.freebsd.org> From: Steven Hartland Date: Thu, 4 Jul 2013 21:57: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: r252730 - in stable/9/sys: cam/ata cam/scsi geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 21:57:10 -0000 Author: smh Date: Thu Jul 4 21:57:09 2013 New Revision: 252730 URL: http://svnweb.freebsd.org/changeset/base/252730 Log: MFC r249940: Teach GEOM and CAM about the difference between the max "size" of r/w and delete requests. MFC r252657: Bump disk(9) ABI version to signify the addition of d_delmaxsize. Make the addition of the d_delmaxsize binary compatible. This allows storage drivers compiled for 9.0 and 9.1 to work by preserving the ABI for disks. Reviewed by: mav Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/geom/geom_disk.c stable/9/sys/geom/geom_disk.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/cam/ata/ata_da.c Thu Jul 4 21:57:09 2013 (r252730) @@ -1239,10 +1239,15 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * + softc->trim_max_ranges; } else if ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT)) { softc->disk->d_flags |= DISKFLAG_CANDELETE; - } + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Jul 4 21:57:09 2013 (r252730) @@ -1064,8 +1064,11 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemaxsysctl(SYSCTL_HANDLER_ARGS); static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); +static off_t dadeletemaxsize(struct da_softc *softc, + da_delete_methods delete_method); static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method); static void daprobedone(struct cam_periph *periph, union ccb *ccb); @@ -1692,6 +1695,10 @@ dasysctlinit(void *context, int pending) softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_max", CTLTYPE_U64 | CTLFLAG_RW, + softc, 0, dadeletemaxsysctl, "Q", + "Maximum BIO_DELETE size"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1737,6 +1744,29 @@ dasysctlinit(void *context, int pending) } static int +dadeletemaxsysctl(SYSCTL_HANDLER_ARGS) +{ + int error; + uint64_t value; + struct da_softc *softc; + + softc = (struct da_softc *)arg1; + + value = softc->disk->d_delmaxsize; + error = sysctl_handle_64(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + /* only accept values smaller than the calculated value */ + if (value > dadeletemaxsize(softc, softc->delete_method)) { + return (EINVAL); + } + softc->disk->d_delmaxsize = value; + + return (0); +} + +static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS) { int error, value; @@ -1774,6 +1804,7 @@ dadeletemethodset(struct da_softc *softc softc->delete_method = delete_method; + softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method); if (softc->delete_method > DA_DELETE_DISABLE) softc->disk->d_flags |= DISKFLAG_CANDELETE; @@ -1781,6 +1812,33 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } +static off_t +dadeletemaxsize(struct da_softc *softc, da_delete_methods delete_method) +{ + off_t sectors; + + switch(delete_method) { + case DA_DELETE_UNMAP: + sectors = (off_t)softc->unmap_max_lba * softc->unmap_max_ranges; + break; + case DA_DELETE_ATA_TRIM: + sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + break; + case DA_DELETE_WS16: + sectors = (off_t)min(softc->ws_max_blks, WS16_MAX_BLKS); + break; + case DA_DELETE_ZERO: + case DA_DELETE_WS10: + sectors = (off_t)min(softc->ws_max_blks, WS10_MAX_BLKS); + break; + default: + return 0; + } + + return (off_t)softc->params.secsize * + min(sectors, (off_t)softc->params.sectors); +} + static void daprobedone(struct cam_periph *periph, union ccb *ccb) { @@ -2304,8 +2362,13 @@ skipstate: } else if (softc->delete_method == DA_DELETE_ZERO || softc->delete_method == DA_DELETE_WS10 || softc->delete_method == DA_DELETE_WS16) { + /* + * We calculate ws_max_blks here based off d_delmaxsize instead + * of using softc->ws_max_blks as it is absolute max for the + * device not the protocol max which may well be lower + */ uint64_t ws_max_blks; - ws_max_blks = softc->ws_max_blks / softc->params.secsize; + ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize; softc->delete_running = 1; lba = bp->bio_pblkno; count = 0; Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/geom/geom_disk.c Thu Jul 4 21:57:09 2013 (r252730) @@ -155,6 +155,13 @@ g_disk_access(struct g_provider *pp, int dp->d_name, dp->d_unit); dp->d_maxsize = DFLTPHYS; } + if (dp->d_delmaxsize == 0) { + if (bootverbose && dp->d_flags & DISKFLAG_CANDELETE) { + printf("WARNING: Disk drive %s%d has no " + "d_delmaxsize\n", dp->d_name, dp->d_unit); + } + dp->d_delmaxsize = dp->d_maxsize; + } } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { g_disk_lock_giant(dp); @@ -299,6 +306,12 @@ g_disk_start(struct bio *bp) break; } do { + off_t d_maxsize; + + d_maxsize = (bp->bio_cmd == BIO_DELETE && + (dp->d_flags & DISKFLAG_LACKS_DELMAX) == 0) ? + dp->d_delmaxsize : dp->d_maxsize; + bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -313,18 +326,20 @@ g_disk_start(struct bio *bp) bp2->bio_ma_offset %= PAGE_SIZE; bp2->bio_ma_n -= off / PAGE_SIZE; } - if (bp2->bio_length > dp->d_maxsize) { + if (bp2->bio_length > d_maxsize) { /* * XXX: If we have a stripesize we should really - * use it here. + * use it here. Care should be taken in the delete + * case if this is done as deletes can be very + * sensitive to size given how they are processed. */ - bp2->bio_length = dp->d_maxsize; + bp2->bio_length = d_maxsize; if ((bp->bio_flags & BIO_UNMAPPED) != 0) { bp2->bio_ma_n = howmany( bp2->bio_ma_offset + bp2->bio_length, PAGE_SIZE); } - off += dp->d_maxsize; + off += d_maxsize; /* * To avoid a race, we need to grab the next bio * before we schedule this one. See "notes". @@ -603,7 +618,8 @@ void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_02 && version != DISK_VERSION_01) { + if (version != DISK_VERSION_03 && version != DISK_VERSION_02 && + version != DISK_VERSION_01) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); @@ -613,6 +629,8 @@ disk_create(struct disk *dp, int version } if (version == DISK_VERSION_01) dp->d_flags |= DISKFLAG_LACKS_GONE; + if (version < DISK_VERSION_03) + dp->d_flags |= DISKFLAG_LACKS_DELMAX; KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); Modified: stable/9/sys/geom/geom_disk.h ============================================================================== --- stable/9/sys/geom/geom_disk.h Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/geom/geom_disk.h Thu Jul 4 21:57:09 2013 (r252730) @@ -99,6 +99,9 @@ struct disk { /* new fields in stable - don't use if DISKFLAG_LACKS_GONE is set */ disk_gone_t *d_gone; + + /* new fields in stable - don't use if DISKFLAG_LACKS_DELMAX is set */ + off_t d_delmaxsize; }; #define DISKFLAG_NEEDSGIANT 0x1 @@ -106,7 +109,8 @@ struct disk { #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 #define DISKFLAG_LACKS_GONE 0x10 -#define DISKFLAG_UNMAPPED_BIO 0x20 +#define DISKFLAG_UNMAPPED_BIO 0x20 +#define DISKFLAG_LACKS_DELMAX 0x40 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); @@ -119,7 +123,8 @@ void disk_media_gone(struct disk *dp, in #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a #define DISK_VERSION_02 0x5856105b -#define DISK_VERSION DISK_VERSION_02 +#define DISK_VERSION_03 0x5856105c +#define DISK_VERSION DISK_VERSION_03 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 22:09:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E1FAFC9F; Thu, 4 Jul 2013 22:09:14 +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 D302C1170; Thu, 4 Jul 2013 22:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9EbQ062867; Thu, 4 Jul 2013 22:09:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9EbD062866; Thu, 4 Jul 2013 22:09:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9EbD062866@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09:14 +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: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/9/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) stable/8/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 22:09:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FF50CA0; Thu, 4 Jul 2013 22:09:15 +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 3165B1171; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9F1V062873; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9Fcx062872; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9Fcx062872@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 22:09:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9559CCA2; Thu, 4 Jul 2013 22:09:15 +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 867F01172; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9FgB062881; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9FfA062879; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9FfA062879@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 22:26:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 954DC59E; Thu, 4 Jul 2013 22:26:38 +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 877D31206; Thu, 4 Jul 2013 22:26:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64MQcNK068558; Thu, 4 Jul 2013 22:26:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64MQcFo068557; Thu, 4 Jul 2013 22:26:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307042226.r64MQcFo068557@svn.freebsd.org> From: Martin Matuska Date: Thu, 4 Jul 2013 22:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252732 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 22:26:38 -0000 Author: mm Date: Thu Jul 4 22:26:38 2013 New Revision: 252732 URL: http://svnweb.freebsd.org/changeset/base/252732 Log: Fix misleading or remove irrelevant illumos messages and manpage references in the zfs command. PR: bin/178996 Submitted by: Peter Schaefer MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Jul 4 22:09:14 2013 (r252731) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Jul 4 22:26:38 2013 (r252732) @@ -5601,8 +5601,8 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot share '%s': " "legacy share\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use share(1M) to " - "share this filesystem, or set " + (void) fprintf(stderr, gettext("to " + "share this filesystem set " "sharenfs property on\n")); return (1); } @@ -5618,7 +5618,7 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot %s '%s': " "legacy mountpoint\n"), cmdname, zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use %s(1M) to " + (void) fprintf(stderr, gettext("use %s(8) to " "%s this filesystem\n"), cmdname, cmdname); return (1); } @@ -6056,8 +6056,10 @@ unshare_unmount_path(int op, char *path, strcmp(smbshare_prop, "off") == 0) { (void) fprintf(stderr, gettext("cannot unshare " "'%s': legacy share\n"), path); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this filesystem\n")); +#endif } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot unshare '%s': " "not currently shared\n"), path); @@ -6076,7 +6078,7 @@ unshare_unmount_path(int op, char *path, (void) fprintf(stderr, gettext("cannot unmount " "'%s': legacy mountpoint\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use umount(1M) " + (void) fprintf(stderr, gettext("use umount(8) " "to unmount this filesystem\n")); } else { ret = zfs_unmountall(zhp, flags); @@ -6298,9 +6300,11 @@ unshare_unmount(int op, int argc, char * (void) fprintf(stderr, gettext("cannot " "unshare '%s': legacy share\n"), zfs_get_name(zhp)); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this " "filesystem\n")); +#endif ret = 1; } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot " @@ -6318,7 +6322,7 @@ unshare_unmount(int op, int argc, char * "unmount '%s': legacy " "mountpoint\n"), zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use " - "umount(1M) to unmount this " + "umount(8) to unmount this " "filesystem\n")); ret = 1; } else if (!zfs_is_mounted(zhp, NULL)) { @@ -6504,12 +6508,12 @@ manual_mount(int argc, char **argv) } } else { (void) fprintf(stderr, gettext("filesystem '%s' cannot be " - "mounted using 'mount -F zfs'\n"), dataset); + "mounted using 'mount -t zfs'\n"), dataset); (void) fprintf(stderr, gettext("Use 'zfs set mountpoint=%s' " "instead.\n"), path); - (void) fprintf(stderr, gettext("If you must use 'mount -F zfs' " - "or /etc/vfstab, use 'zfs set mountpoint=legacy'.\n")); - (void) fprintf(stderr, gettext("See zfs(1M) for more " + (void) fprintf(stderr, gettext("If you must use 'mount -t zfs' " + "or /etc/fstab, use 'zfs set mountpoint=legacy'.\n")); + (void) fprintf(stderr, gettext("See zfs(8) for more " "information.\n")); ret = 1; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 23:01:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 149BCE0E; Thu, 4 Jul 2013 23:01:25 +0000 (UTC) (envelope-from rpaulo@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 E1C1912F7; Thu, 4 Jul 2013 23:01:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64N1OwJ079492; Thu, 4 Jul 2013 23:01:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64N1Oux079491; Thu, 4 Jul 2013 23:01:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307042301.r64N1Oux079491@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 23:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252733 - head/contrib/wpa/wpa_supplicant/dbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 23:01:25 -0000 Author: rpaulo Date: Thu Jul 4 23:01:24 2013 New Revision: 252733 URL: http://svnweb.freebsd.org/changeset/base/252733 Log: Restore the dbus directory that was not meant to be deleted in r252729. Added: head/contrib/wpa/wpa_supplicant/dbus/ - copied from r252732, vendor/wpa/dist/wpa_supplicant/dbus/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 4 23:05:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 06061DC; Thu, 4 Jul 2013 23:05:29 +0000 (UTC) (envelope-from rpaulo@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 D258B1318; Thu, 4 Jul 2013 23:05:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64N5SWj080324; Thu, 4 Jul 2013 23:05:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64N5SMg080322; Thu, 4 Jul 2013 23:05:28 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307042305.r64N5SMg080322@svn.freebsd.org> From: Rui Paulo Date: Thu, 4 Jul 2013 23:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252734 - in head/contrib/wpa: src/crypto src/drivers src/radius src/tls src/utils wpa_supplicant wpa_supplicant/dbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 23:05:29 -0000 Author: rpaulo Date: Thu Jul 4 23:05:28 2013 New Revision: 252734 URL: http://svnweb.freebsd.org/changeset/base/252734 Log: Delete .gitignore files. Deleted: head/contrib/wpa/src/crypto/.gitignore head/contrib/wpa/src/drivers/.gitignore head/contrib/wpa/src/radius/.gitignore head/contrib/wpa/src/tls/.gitignore head/contrib/wpa/src/utils/.gitignore head/contrib/wpa/wpa_supplicant/.gitignore head/contrib/wpa/wpa_supplicant/dbus/.gitignore From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 00:03:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DAADABC; Fri, 5 Jul 2013 00:03:54 +0000 (UTC) (envelope-from adrian@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 2FFCE162A; Fri, 5 Jul 2013 00:03:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6503sRi000392; Fri, 5 Jul 2013 00:03:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6503sD8000391; Fri, 5 Jul 2013 00:03:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307050003.r6503sD8000391@svn.freebsd.org> From: Adrian Chadd Date: Fri, 5 Jul 2013 00:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252736 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 00:03:54 -0000 Author: adrian Date: Fri Jul 5 00:03:53 2013 New Revision: 252736 URL: http://svnweb.freebsd.org/changeset/base/252736 Log: Document the current 11n rate selection shortcoming in the AMRR code. Modified: head/sys/net80211/ieee80211_amrr.c Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Thu Jul 4 23:08:27 2013 (r252735) +++ head/sys/net80211/ieee80211_amrr.c Fri Jul 5 00:03:53 2013 (r252736) @@ -240,6 +240,14 @@ amrr_update(struct ieee80211_amrr *amrr, amn->amn_txcnt, amn->amn_retrycnt); + /* + * XXX This is totally bogus for 11n, as although high MCS + * rates for each stream may be failing, the next stream + * should be checked. + * + * Eg, if MCS5 is ok but MCS6/7 isn't, and we can go up to + * MCS23, we should skip 6/7 and try 8 onwards. + */ if (is_success(amn)) { amn->amn_success++; if (amn->amn_success >= amn->amn_success_threshold && From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 00:19:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B2E9CD8; Fri, 5 Jul 2013 00:19:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id 66E641681; Fri, 5 Jul 2013 00:19:03 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id ld11so1691017pab.36 for ; Thu, 04 Jul 2013 17:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=MeNp/fdz+zhfrYGcpMlFYLFl4/URAv+WoygvWfwwbW8=; b=YfAWyZ0w9hIa8a/lSW6vis4rwb5tl5nZo8co3cUOkotEQmP5ZGHVdYz6Oi9bJt3yEA 8gcZIhu1lqxURbbdOBbZGrJoKUwFGudTG4QX1JEEZkpM0Tb0wLliQfHlX4YxKAzDjlqu +YIV96AdOw+HEINHIOwSRbP2+uGCFYDLfGndRVtlvSVHiwI5Mt4gDLHLxMZwDBLGp5cG 6k6tsSEiljSx6dnDFHV4xFny4vn5j8snpyAUlAei0sN7XsTY9v+ZGHZFuGJ1mMEy5Dkk pRsujfstou+SeOOUVn+uvvHYx0nNSGmRlBSvhh5yt/XTTL7Bay6i9HSRa5w3QhswozNi RmYg== X-Received: by 10.68.43.8 with SMTP id s8mr7407119pbl.139.1372983542832; Thu, 04 Jul 2013 17:19:02 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id b4sm4624598pbm.6.2013.07.04.17.19.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Jul 2013 17:19:02 -0700 (PDT) Subject: Re: svn commit: r252734 - in head/contrib/wpa: src/crypto src/drivers src/radius src/tls src/utils wpa_supplicant wpa_supplicant/dbus Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201307042305.r64N5SMg080322@svn.freebsd.org> Date: Thu, 4 Jul 2013 17:18:58 -0700 Content-Transfer-Encoding: 7bit Message-Id: <0CE6AD86-1C9E-43EF-83D6-409974D6F952@gmail.com> References: <201307042305.r64N5SMg080322@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 00:19:03 -0000 On Jul 4, 2013, at 4:05 PM, Rui Paulo wrote: > Author: rpaulo > Date: Thu Jul 4 23:05:28 2013 > New Revision: 252734 > URL: http://svnweb.freebsd.org/changeset/base/252734 > > Log: > Delete .gitignore files. > > Deleted: > head/contrib/wpa/src/crypto/.gitignore > head/contrib/wpa/src/drivers/.gitignore > head/contrib/wpa/src/radius/.gitignore > head/contrib/wpa/src/tls/.gitignore > head/contrib/wpa/src/utils/.gitignore > head/contrib/wpa/wpa_supplicant/.gitignore > head/contrib/wpa/wpa_supplicant/dbus/.gitignore Should these files and others in r252729 be added to FreeBSD-Update? From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 00:24:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A97AAE4B; Fri, 5 Jul 2013 00:24:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 95E5A16A6; Fri, 5 Jul 2013 00:24:07 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:a9e2:619c:ecb6:ceaa] (unknown [IPv6:2601:9:4d00:119:a9e2:619c:ecb6:ceaa]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id C1BB23982B; Thu, 4 Jul 2013 17:24:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252734 - in head/contrib/wpa: src/crypto src/drivers src/radius src/tls src/utils wpa_supplicant wpa_supplicant/dbus From: Rui Paulo In-Reply-To: <0CE6AD86-1C9E-43EF-83D6-409974D6F952@gmail.com> Date: Thu, 4 Jul 2013 17:24:06 -0700 Content-Transfer-Encoding: 7bit Message-Id: <5A0E12A3-2C00-4347-B26E-15BDA1DD2CBC@FreeBSD.org> References: <201307042305.r64N5SMg080322@svn.freebsd.org> <0CE6AD86-1C9E-43EF-83D6-409974D6F952@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 00:24:07 -0000 On 4 Jul 2013, at 17:18, Garrett Cooper wrote: > On Jul 4, 2013, at 4:05 PM, Rui Paulo wrote: > >> Author: rpaulo >> Date: Thu Jul 4 23:05:28 2013 >> New Revision: 252734 >> URL: http://svnweb.freebsd.org/changeset/base/252734 >> >> Log: >> Delete .gitignore files. >> >> Deleted: >> head/contrib/wpa/src/crypto/.gitignore >> head/contrib/wpa/src/drivers/.gitignore >> head/contrib/wpa/src/radius/.gitignore >> head/contrib/wpa/src/tls/.gitignore >> head/contrib/wpa/src/utils/.gitignore >> head/contrib/wpa/wpa_supplicant/.gitignore >> head/contrib/wpa/wpa_supplicant/dbus/.gitignore > > Should these files and others in r252729 be added to FreeBSD-Update? What is "FreeBSD-Update" ? -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 00:44:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE1303B8; Fri, 5 Jul 2013 00:44:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id 88754173A; Fri, 5 Jul 2013 00:44:14 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id fa11so1726351pad.33 for ; Thu, 04 Jul 2013 17:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=FbVLkboMKgK5MYHANGMzPs24xv99TZJhdrrfgfCHPo4=; b=m0iDv8D9jYKyjdknZgbo/1sMv0JVHYYyPRItJ0BnxcaLzMLL7ulE19HbbnvffvFDkE QYSS/GrcR/o6JlcdH9imL/ghqlaTjSDiZys2umVCQ2Hb70m5MiQ13YyPuJXJMUJ1p9VK W6/HifaH9vfNlU30539vWwZfQxQpsHv1/HQ23KwfkGLCSSR/IG4GUJpDgBEpByBoLbBf MQ1O4HeM5MPl3L1LOKDEFmo7Zvfms3u8u/sbIwTrl7GT5NltIkOAtlZo+qZkabZvdb1L 76CuB1Enk0gt98300ImntGUmRivJGxBvlZlE2YK5VLrlkFUU4hxUR9+xto4wuuuR/KkO CoBQ== X-Received: by 10.68.253.161 with SMTP id ab1mr7385115pbd.76.1372985054281; Thu, 04 Jul 2013 17:44:14 -0700 (PDT) Received: from [192.168.20.5] (c-98-203-241-95.hsd1.wa.comcast.net. [98.203.241.95]) by mx.google.com with ESMTPSA id 4sm4652936pbw.32.2013.07.04.17.44.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Jul 2013 17:44:13 -0700 (PDT) Subject: Re: svn commit: r252734 - in head/contrib/wpa: src/crypto src/drivers src/radius src/tls src/utils wpa_supplicant wpa_supplicant/dbus Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <5A0E12A3-2C00-4347-B26E-15BDA1DD2CBC@FreeBSD.org> Date: Thu, 4 Jul 2013 17:44:05 -0700 Content-Transfer-Encoding: 7bit Message-Id: <7DF4C85F-8901-4B0C-9501-A48630DDE16E@gmail.com> References: <201307042305.r64N5SMg080322@svn.freebsd.org> <0CE6AD86-1C9E-43EF-83D6-409974D6F952@gmail.com> <5A0E12A3-2C00-4347-B26E-15BDA1DD2CBC@FreeBSD.org> To: Rui Paulo X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 00:44:14 -0000 On Jul 4, 2013, at 5:24 PM, Rui Paulo wrote: > On 4 Jul 2013, at 17:18, Garrett Cooper wrote: > >> On Jul 4, 2013, at 4:05 PM, Rui Paulo wrote: >> >>> Author: rpaulo >>> Date: Thu Jul 4 23:05:28 2013 >>> New Revision: 252734 >>> URL: http://svnweb.freebsd.org/changeset/base/252734 >>> >>> Log: >>> Delete .gitignore files. >>> >>> Deleted: >>> head/contrib/wpa/src/crypto/.gitignore >>> head/contrib/wpa/src/drivers/.gitignore >>> head/contrib/wpa/src/radius/.gitignore >>> head/contrib/wpa/src/tls/.gitignore >>> head/contrib/wpa/src/utils/.gitignore >>> head/contrib/wpa/wpa_supplicant/.gitignore >>> head/contrib/wpa/wpa_supplicant/dbus/.gitignore >> >> Should these files and others in r252729 be added to FreeBSD-Update? > > What is "FreeBSD-Update" ? I meant FREEBSD-{upgrade,Xlist}. Example: svn://svn.freebsd.org/base/head/contrib/atf/FREEBSD-upgrade svn://svn.freebsd.org/base/head/contrib/atf/FREEBSD-Xlist Cheers! From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:18:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26F74B87; Fri, 5 Jul 2013 01:18:55 +0000 (UTC) (envelope-from dteske@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 1841C1844; Fri, 5 Jul 2013 01:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651IsgK021964; Fri, 5 Jul 2013 01:18:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651IskI021963; Fri, 5 Jul 2013 01:18:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050118.r651IskI021963@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252737 - head/usr.sbin/bsdconfig/share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:18:55 -0000 Author: dteske Date: Fri Jul 5 01:18:54 2013 New Revision: 252737 URL: http://svnweb.freebsd.org/changeset/base/252737 Log: Set name of device to directory path (displayed during package operations). Modified: head/usr.sbin/bsdconfig/share/media/directory.subr Modified: head/usr.sbin/bsdconfig/share/media/directory.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/directory.subr Fri Jul 5 00:03:53 2013 (r252736) +++ head/usr.sbin/bsdconfig/share/media/directory.subr Fri Jul 5 01:18:54 2013 (r252737) @@ -69,6 +69,7 @@ f_media_set_directory() [ "$path" ] || return $FAILURE f_struct_new DEVICE device_directory + device_directory set name "$path" device_directory set get f_media_get_directory device_directory set init f_media_init_directory device_directory set shutdown f_media_shutdown_directory From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:21:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45099CCA; Fri, 5 Jul 2013 01:21:02 +0000 (UTC) (envelope-from dteske@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 366241850; Fri, 5 Jul 2013 01:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651L13I023914; Fri, 5 Jul 2013 01:21:01 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651L1Rj023913; Fri, 5 Jul 2013 01:21:01 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050121.r651L1Rj023913@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252738 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:21:02 -0000 Author: dteske Date: Fri Jul 5 01:21:01 2013 New Revision: 252738 URL: http://svnweb.freebsd.org/changeset/base/252738 Log: Allow global default as general fall-back for package management routines. Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 01:18:54 2013 (r252737) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 01:21:01 2013 (r252738) @@ -207,7 +207,8 @@ f_index_read() # f_index_extract_pages $var_to_get $var_basename $pagesize [$category] # -# Extracts the package INDEX into a series of sequential variables +# Extracts the package INDEX ($PACKAGE_INDEX by default if/when $var_to_get is +# NULL; but should not be missing) into a series of sequential variables # corresponding to "pages" containing up to $pagesize packages. The package # INDEX data must be contained in the variable $var_to_get. The extracted pages # are stored in variables ${var_basename}_# -- where "#" is a the page number. @@ -217,7 +218,7 @@ f_index_read() # f_index_extract_pages() { - local var_to_get="$1" var_basename="$2" pagesize="$3" + local var_to_get="${1:-PACKAGE_INDEX}" var_basename="$2" pagesize="$3" local category="$4" # Optional eval "$( From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:22:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67E0AE0C; Fri, 5 Jul 2013 01:22:38 +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 59C621859; Fri, 5 Jul 2013 01:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651McSM024182; Fri, 5 Jul 2013 01:22:38 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651McZD024181; Fri, 5 Jul 2013 01:22:38 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307050122.r651McZD024181@svn.freebsd.org> From: Rick Macklem Date: Fri, 5 Jul 2013 01:22:38 +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: r252739 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:22:38 -0000 Author: rmacklem Date: Fri Jul 5 01:22:37 2013 New Revision: 252739 URL: http://svnweb.freebsd.org/changeset/base/252739 Log: MFC: r252067 Since some NFSv4 servers enforce the requirement for a reserved port#, enable use of the (no)resvport mount option for NFSv4. I had thought that the RFC required that non-reserved port #s be allowed, but I couldn't find it in the RFC. Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 5 01:21:01 2013 (r252738) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 5 01:22:37 2013 (r252739) @@ -588,12 +588,6 @@ nfs_decode_args(struct mount *mp, struct nmp->nm_flag &= ~NFSMNT_RDIRPLUS; } - /* Clear NFSMNT_RESVPORT for NFSv4, since it is not required. */ - if ((argp->flags & NFSMNT_NFSV4) != 0) { - argp->flags &= ~NFSMNT_RESVPORT; - nmp->nm_flag &= ~NFSMNT_RESVPORT; - } - /* Re-bind if rsrvd port requested and wasn't on one */ adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT) && (argp->flags & NFSMNT_RESVPORT); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:28:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CE5DC3A4; Fri, 5 Jul 2013 01:28:30 +0000 (UTC) (envelope-from dteske@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 C09A718BC; Fri, 5 Jul 2013 01:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651SU6r024927; Fri, 5 Jul 2013 01:28:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651SUcA024926; Fri, 5 Jul 2013 01:28:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050128.r651SUcA024926@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252740 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:28:30 -0000 Author: dteske Date: Fri Jul 5 01:28:30 2013 New Revision: 252740 URL: http://svnweb.freebsd.org/changeset/base/252740 Log: Comments. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:22:37 2013 (r252739) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:28:30 2013 (r252740) @@ -48,8 +48,11 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ GLOBALS -PACKAGE_CATEGORIES= -SELECTED_PACKAGES= +# +# Variables used to track runtime states +# +PACKAGE_CATEGORIES= # List of package categories parsed from INDEX +SELECTED_PACKAGES= # Packages selected by user in [X]dialog(1) interface # # Options @@ -157,6 +160,15 @@ f_package_deselect() f_package_detect_installed() { local installed package varpkg + # + # XXX KLUDGE ALERT! This makes evil assumptions about how XXX + # packages register themselves and should *really* be done with + # `pkg_info -e ' except that this is too slow for an + # item check routine.. :-( + # + # NOTE: When transitioning to pkgng, make a single fork to `pkg' to + # produce a list of all installed packages and parse _that_ + # installed=$( find -s /var/db/pkg -mindepth 1 -maxdepth 1 -type d | sed -e 's:/var/db/pkg/::' ) for package in $installed; do From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:30:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB1F84EF; Fri, 5 Jul 2013 01:30:13 +0000 (UTC) (envelope-from dteske@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 9DF1118CA; Fri, 5 Jul 2013 01:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651UDdn025254; Fri, 5 Jul 2013 01:30:13 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651UDaj025253; Fri, 5 Jul 2013 01:30:13 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050130.r651UDaj025253@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252741 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:30:13 -0000 Author: dteske Date: Fri Jul 5 01:30:13 2013 New Revision: 252741 URL: http://svnweb.freebsd.org/changeset/base/252741 Log: Get rid of place-holder in preparation for incoming package mgmt code. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:28:30 2013 (r252740) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:30:13 2013 (r252741) @@ -658,9 +658,6 @@ f_package_review() f_package_deselect "$package" done - # XXX - f_show_msg "Coming soon..." - return $SUCCESS } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:32:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5E01633; Fri, 5 Jul 2013 01:32:39 +0000 (UTC) (envelope-from dteske@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 B80BB18D6; Fri, 5 Jul 2013 01:32:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651Wdus027159; Fri, 5 Jul 2013 01:32:39 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651WdSr027158; Fri, 5 Jul 2013 01:32:39 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050132.r651WdSr027158@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252742 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:32:39 -0000 Author: dteske Date: Fri Jul 5 01:32:39 2013 New Revision: 252742 URL: http://svnweb.freebsd.org/changeset/base/252742 Log: Remove separate processing of dependent packages from the "Review" screen since f_package_add (packageAdd resword) processes dependencies itself. NOTE: This is in preparation for incoming package management code. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:30:13 2013 (r252741) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:32:39 2013 (r252742) @@ -620,23 +620,14 @@ f_package_review() # # Process each of the selected packages: - # + First, process dependencies. - # + Second, process packages marked for Install. - # + Third, process packages marked for Re-install. + # + First, process packages marked for Install. + # + Second, process packages marked for Re-install. # + Finally, process packages marked for Uninstall. # for package in $SELECTED_PACKAGES; do mark= f_str2varname "$package" varpkg f_getvar _mark_$varpkg mark - [ "$mark" = "D" ] || continue - # XXX Install dependency - f_package_deselect "$package" - done - for package in $SELECTED_PACKAGES; do - mark= - f_str2varname "$package" varpkg - f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue # XXX Install package f_package_deselect "$package" From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:34:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9BDE78F; Fri, 5 Jul 2013 01:34:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id B3BA318F1; Fri, 5 Jul 2013 01:34:51 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:a9e2:619c:ecb6:ceaa] (unknown [IPv6:2601:9:4d00:119:a9e2:619c:ecb6:ceaa]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 1B5A13982B; Thu, 4 Jul 2013 18:34:51 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252734 - in head/contrib/wpa: src/crypto src/drivers src/radius src/tls src/utils wpa_supplicant wpa_supplicant/dbus From: Rui Paulo In-Reply-To: <7DF4C85F-8901-4B0C-9501-A48630DDE16E@gmail.com> Date: Thu, 4 Jul 2013 18:34:50 -0700 Content-Transfer-Encoding: 7bit Message-Id: <1370AFC0-F4E7-4CE5-88DC-10B9E4A3274B@FreeBSD.org> References: <201307042305.r64N5SMg080322@svn.freebsd.org> <0CE6AD86-1C9E-43EF-83D6-409974D6F952@gmail.com> <5A0E12A3-2C00-4347-B26E-15BDA1DD2CBC@FreeBSD.org> <7DF4C85F-8901-4B0C-9501-A48630DDE16E@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:34:51 -0000 On 4 Jul 2013, at 17:44, Garrett Cooper wrote: > On Jul 4, 2013, at 5:24 PM, Rui Paulo wrote: > >> On 4 Jul 2013, at 17:18, Garrett Cooper wrote: >> >>> On Jul 4, 2013, at 4:05 PM, Rui Paulo wrote: >>> >>>> Author: rpaulo >>>> Date: Thu Jul 4 23:05:28 2013 >>>> New Revision: 252734 >>>> URL: http://svnweb.freebsd.org/changeset/base/252734 >>>> >>>> Log: >>>> Delete .gitignore files. >>>> >>>> Deleted: >>>> head/contrib/wpa/src/crypto/.gitignore >>>> head/contrib/wpa/src/drivers/.gitignore >>>> head/contrib/wpa/src/radius/.gitignore >>>> head/contrib/wpa/src/tls/.gitignore >>>> head/contrib/wpa/src/utils/.gitignore >>>> head/contrib/wpa/wpa_supplicant/.gitignore >>>> head/contrib/wpa/wpa_supplicant/dbus/.gitignore >>> >>> Should these files and others in r252729 be added to FreeBSD-Update? >> >> What is "FreeBSD-Update" ? > > I meant FREEBSD-{upgrade,Xlist}. Example: > > svn://svn.freebsd.org/base/head/contrib/atf/FREEBSD-upgrade > svn://svn.freebsd.org/base/head/contrib/atf/FREEBSD-Xlist Yes, we should create one for the WPA tools. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:37:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 806AE8DB; Fri, 5 Jul 2013 01:37:36 +0000 (UTC) (envelope-from dteske@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 731491904; Fri, 5 Jul 2013 01:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651ba2n027833; Fri, 5 Jul 2013 01:37:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651baQc027832; Fri, 5 Jul 2013 01:37:36 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050137.r651baQc027832@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252743 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:37:36 -0000 Author: dteske Date: Fri Jul 5 01:37:35 2013 New Revision: 252743 URL: http://svnweb.freebsd.org/changeset/base/252743 Log: Add mustberoot.subr to the list of includes for scripts, exposing the helper function f_mustberoot_init() to make it easy to write scripts that can more easily transition to the super-user via sudo(8). Modified: head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:32:39 2013 (r252742) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:37:35 2013 (r252743) @@ -34,6 +34,7 @@ f_dprintf "%s: loading includes..." scri f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/any.subr f_include $BSDCFG_SHARE/media/tcpip.subr +f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/packages/packages.subr f_include $BSDCFG_SHARE/variable.subr From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:38:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7046BA22; Fri, 5 Jul 2013 01:38:43 +0000 (UTC) (envelope-from dteske@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 61A371911; Fri, 5 Jul 2013 01:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651chVW028003; Fri, 5 Jul 2013 01:38:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651cg7N028000; Fri, 5 Jul 2013 01:38:42 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050138.r651cg7N028000@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252744 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:38:43 -0000 Author: dteske Date: Fri Jul 5 01:38:42 2013 New Revision: 252744 URL: http://svnweb.freebsd.org/changeset/base/252744 Log: Add debugging for each of the initialized default variables. Modified: head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Fri Jul 5 01:37:35 2013 (r252743) +++ head/usr.sbin/bsdconfig/share/variable.subr Fri Jul 5 01:38:42 2013 (r252744) @@ -106,6 +106,8 @@ f_variable_get_value() # f_variable_set_defaults() { + f_dprintf "f_variable_set_defaults: Initializing defaults..." + # # Initialize various user-edittable values to their defaults # @@ -120,6 +122,27 @@ f_variable_set_defaults() setvar $VAR_PKG_TMPDIR "/var/tmp" setvar $VAR_RELNAME "$UNAME_R" + # + # Debugging + # + if f_debugging; then + local var + for var in \ + $VAR_EDITOR \ + $VAR_FTP_STATE \ + $VAR_FTP_USER \ + $VAR_HOSTNAME \ + $VAR_MEDIA_TIMEOUT \ + $VAR_NFS_SECURE \ + $VAR_NFS_TCP \ + $VAR_NFS_V3 \ + $VAR_PKG_TMPDIR \ + $VAR_RELNAME \ + ; do + f_quietly f_getvar $var + done + fi + f_dprintf "f_variable_set_defaults: Defaults initialized." } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:45:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9532FBBA; Fri, 5 Jul 2013 01:45:00 +0000 (UTC) (envelope-from dteske@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 8202C1944; Fri, 5 Jul 2013 01:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651j0dX030446; Fri, 5 Jul 2013 01:45:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651ixFu030415; Fri, 5 Jul 2013 01:44:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050144.r651ixFu030415@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252745 - in head/usr.sbin/bsdconfig: include share share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:45:00 -0000 Author: dteske Date: Fri Jul 5 01:44:59 2013 New Revision: 252745 URL: http://svnweb.freebsd.org/changeset/base/252745 Log: Add the necessary code to install packages (uninstall and re-install still pending). Both scripted access (packageAdd) and UI access have been tested successfully with a variation of different situations including: + Install a package with no dependencies + Install a package with dependencies that are already installed + Install a package with dependencies where some are already installed + Repeat each of the above from FTP and local Directory + Purposefully do things like try to install a package that does not exist + Try to install a package for which a dependency could not be loaded + Try to install a package that is in the INDEX bot not on the media + And many more. Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Fri Jul 5 01:38:42 2013 (r252744) +++ head/usr.sbin/bsdconfig/include/messages.subr Fri Jul 5 01:44:59 2013 (r252745) @@ -34,6 +34,8 @@ hline_arrows_tab_punc_enter="Use arrows, hline_choose_help_for_more_information_on_media_types="Choose Help for more information on the various media types" msg_accept_continue="Accept/Continue" msg_accessibility_desc="Ports to help disabled users." +msg_adding_package_as_a_dependency_from_media="Adding %s (as a dependency) from %s" +msg_adding_package_from_media="Adding %s from %s" msg_afterstep_desc="Ports to support the AfterStep window manager." msg_all="All" msg_all_desc="All available packages in all categories." @@ -174,6 +176,7 @@ msg_invalid_ipv4_address="Invalid IPv4 a msg_invalid_name_server_ip_address_specified="Invalid name server IP address specified" msg_invalid_netmask_value="Invalid netmask value" msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir" +msg_io_error_while_reading_in_the_package="I/O error while reading in the %s package." msg_io_or_format_error_on_index_file="I/O or format error on %s file.\nPlease verify media (or path to media) and try again." msg_ipv4_address="IPv4 Address" msg_ipv4_gateway="IPv4 Gateway" @@ -196,6 +199,7 @@ msg_length_of_specified_url_is_too_long= msg_linux_desc="Linux programs that can run under binary compatibility." msg_lisp_desc="Software related to the Lisp language." msg_lithuania="Lithuania" +msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_up_host="Looking up host %s" @@ -238,6 +242,7 @@ msg_no_dos_primary_partitions_found="No msg_no_floppy_devices_found="No floppy devices found! Please check that your system's configuration\nis correct. For more information, consult the hardware guide in the Doc\nmenu." msg_no_gateway_has_been_set="No gateway has been set. You will be unable to access hosts\nnot on your local network" msg_no_network_devices="No network devices available!" +msg_no_package_name_passed_in_package_variable="No package name passed in package variable" msg_no_packages_were_selected_for_extraction="No packages were selected for extraction." msg_no_such_file_or_directory="%s: %s: No such file or directory" msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)" @@ -250,7 +255,9 @@ msg_ok="OK" msg_options="Options" msg_options_editor="Options Editor" msg_other="other" +msg_package_read_successfully_waiting_for_pkg_add="Package %s read successfully - waiting for pkg_add(1)" msg_package_temp="Package Temp" +msg_package_was_added_successfully="Package %s was added successfully" msg_packages="packages" msg_page_of_npages="(Page %s of %s)" msg_palm_desc="Software support for the Palm(tm) series." @@ -258,6 +265,7 @@ msg_parallel_desc="Applications dealing msg_pear_desc="Software related to the Pear PHP framework." msg_perl5_desc="Utilities/modules for the PERL5 language." msg_permission_denied="%s: %s: Permission denied" +msg_pkg_add_apparently_did_not_like_the_package="pkg_add(1) apparently did not like the %s package." msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" @@ -301,6 +309,7 @@ msg_quick_start_how_to_use_this_menu_sys msg_reinstall="Reinstall" msg_reinstall_desc="Mark this package for reinstall" msg_release_name="Release Name" +msg_required_package_not_found="Warning: %s is a required package but was not found." msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe" msg_rescan_devices="Re-scan Devices" msg_reset="RESET!" @@ -334,6 +343,7 @@ msg_slovenia="Slovenia" msg_snapshots_server_japan="Snapshots Server Japan" msg_snapshots_server_sweden="Snapshots Server Sweden" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" +msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." msg_sorry_try_again="Sorry, try again." msg_south_africa="South Africa" msg_spain="Spain" @@ -358,8 +368,10 @@ msg_uk="UK" msg_ukraine="Ukraine" msg_ukrainian_desc="Ported software for the Ukrainian market." msg_unable_to_configure_device="Unable to configure the %s interface!\nThis installation method cannot be used." +msg_unable_to_fetch_package_from_selected_media="Unable to fetch package %s from selected media.\nNo package add will be done." msg_unable_to_get_file_from_selected_media="Unable to get %s file from selected media.\n\nThis may be because the packages collection is not available\non the distribution media you've chosen, most likely an FTP site\nwithout the packages collection mirrored. Please verify that\nyour media, or your path to the media, is correct and try again." msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized." +msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" msg_uninstall="Uninstall" Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 01:38:42 2013 (r252744) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 01:44:59 2013 (r252745) @@ -242,6 +242,44 @@ f_index_extract_pages() )" } +# f_index_search $var_to_get $name [$var_to_set] +# +# Search the package INDEX ($PACKAGE_INDEX by default if/when $var_to)get is +# NULL; but should not be missing) for $name, returning the first match. +# Matches are strict (not regular expressions) and must match the beginning +# portion of the package name to be considered a match. If $var_to_set is +# missing or NULL, output is sent to standard output. If a match is found, +# returns success; otherwise failure. +# +f_index_search() +{ + local __var_to_get="${1:-PACKAGE_INDEX}" __pkg_basename="$2" + local __var_to_set="$3" + + f_dprintf "f_index_search: Searching package data (in %s) for %s" \ + "$__var_to_get" "$__pkg_basename" + + local __pkg= + __pkg=$( debug= f_getvar "$__var_to_get" | + awk -F'|' -v basename="$__pkg_basename" ' + BEGIN { n = length(basename) } + substr($1, 0, n) == basename { print $1; exit } + ' ) + if [ ! "$__pkg" ]; then + f_dprintf "f_index_search: No packages matching %s found" \ + "$__pkg_basename" + return $FAILURE + fi + + f_dprintf "f_index_search: Found package %s" "$__pkg" + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__pkg" + else + echo "$__pkg" + fi + return $SUCCESS +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:38:42 2013 (r252744) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 01:44:59 2013 (r252745) @@ -32,6 +32,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/packages/categories.subr f_include $BSDCFG_SHARE/packages/index.subr f_include $BSDCFG_SHARE/strings.subr @@ -49,8 +51,14 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ GLOBALS # +# Package extensions to try +# +PACKAGE_EXTENSIONS=".tbz .tbz2 .tgz" + +# # Variables used to track runtime states # +PACKAGES_DETECTED= # Boolean (NULL/non-NULL); detected installed packages? PACKAGE_CATEGORIES= # List of package categories parsed from INDEX SELECTED_PACKAGES= # Packages selected by user in [X]dialog(1) interface @@ -629,7 +637,7 @@ f_package_review() f_str2varname "$package" varpkg f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue - # XXX Install package + f_package_add "$package" || continue f_package_deselect "$package" done for package in $SELECTED_PACKAGES; do @@ -812,6 +820,236 @@ f_package_config() done } +# f_package_add $package_name [$depended] +# +# Like f_package_extract(), but assumes current media device and chases deps. +# Note that $package_name should not contain the archive suffix (e.g., `.tbz'). +# If $depended is present and non-NULL, the package is treated as a dependency +# (in this function, dependencies are not handled any differently, but the +# f_package_extract() function is passed this value and it displays a different +# message when installing a dependency versus non-dependency). +# +f_package_add() +{ + local name="$1" depended="$2" status=$SUCCESS retval + + local alert=f_show_msg no_confirm= + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + if ! { [ "$name" ] || { f_getvar $VAR_PACKAGE name && [ "$name" ]; }; } + then + f_dprintf "packageAdd: %s" \ + "$msg_no_package_name_passed_in_package_variable" + return $FAILURE + fi + + { # Verify and initialize device media if-defined + f_media_verify && + f_device_init media && + f_index_initialize packages/INDEX + } || return $FAILURE + + # Now we have (indirectly via f_index_read()): + # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} + # PACKAGE_CATEGORIES _npkgs + + local varpkg + f_str2varname "$name" varpkg + + # Just as-in the user-interface (opposed to scripted-use), only allow + # packages with at least one category to be recognized. + # + local pkgcat= + if ! f_getvar _categories_$varpkg pkgcat || [ ! "$pkgcat" ]; then + # $pkg may be a partial name, search the index (this is slow) + f_index_search PACKAGE_INDEX $name name + if [ ! "$name" ]; then + f_show_msg \ + "$msg_sorry_package_was_not_found_in_the_index" \ + "$name" + return $FAILURE + fi + f_str2varname "$name" varpkg + fi + + # If invoked through the scripted interface, we likely have not yet + # detected the installed packages -- something we should do only once. + # + if [ ! "$PACKAGES_DETECTED" ]; then + f_package_detect_installed + export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] + fi + # Now we have: _mark_{varpkg}=X for all installed packages + + # + # Since we're maintaining data structures for installed packages, + # short-circuit the package dependency checks if the package is already + # installed. This prevents wasted cycles, minor delays between package + # extractions, and worst-case an infinite loop with a certain faulty + # INDEX file. + # + local mark= + f_getvar _mark_$varpkg mark && [ "$mark" = "X" ] && return $SUCCESS + + local dep vardep rundeps= + f_getvar _rundeps_$varpkg rundeps + for dep in $rundeps; do + f_str2varname "$dep" vardep + + # Skip dependency if already installed + mark= + f_getvar _mark_$vardep mark && [ "$mark" = "X" ] && continue + + # Just as-in the user-interface (opposed to scripted-use), only + # allow packages with at least one category to be recognized. + # + local depcat= + if ! f_getvar _categories_$vardep depcat || [ ! "$depcat" ] + then + $alert "$msg_required_package_not_found" "$dep" + [ "$no_confirm" ] && sleep 2 + fi + + f_package_add "$dep" + retval=$? + if [ $retval -ne $SUCCESS ]; then + status=$(( $status | $retval )) + + # XXX package could be on a future disc volume + # XXX (not supporting multiple disc volumes yet) + + $alert "$msg_loading_of_dependent_package_failed" \ + "$dep" + [ "$no_confirm" ] && sleep 2 + fi + done + [ $status -eq $SUCCESS ] || return $status + + # + # Done with the deps? Try to load the real m'coy. + # + + f_package_extract media "$name" "$depended" + retval=$? + if [ $retval -ne $SUCCESS ]; then + status=$(( $status | $retval )) + else + setvar _mark_$varpkg X + fi + + return $status +} + +# f_package_extract $device $name [$depended] +# +# Extract a package based on a namespec and media device. If $depended is +# present and non-NULL, the notification displayed while installing the package +# has "as a dependency" appended. +# +f_package_extract() +{ + local device="$1" name="$2" depended="$3" + + # Check to make sure it's not already there + local varpkg mark= + f_str2varname "$name" varpkg + f_getvar _mark_$varpkg mark + [ "$mark" = "X" ] && return $SUCCESS + + if ! f_device_init $device; then + f_show_msg \ + "$msg_unable_to_initialize_media_type_for_package_extract" + return $FAILURE + fi + + # If necessary, initialize the ldconfig hints + [ -f "/var/run/ld-elf.so.hints" ] || + f_quietly ldconfig /usr/lib /usr/lib/compat /usr/local/lib + + # Make a couple paranoid locations for temp + # files to live if user specified none + local tmpdir + f_getvar $VAR_PKG_TMPDIR:-/var/tmp tmpdir + f_quietly mkdir -p -m 1777 "$tmpdir" + + local path + case "$name" in + */*) path="$name" ;; + *) + case "$name" in + *-*|*_*) path="packages/All/$name" ;; + *) path="packages/Latest/$name" + esac + esac + + local fname=f_package_extract + + # We have a path, call the device strategy routine to get the file + local pkg_ext probe_only=1 found= + for pkg_ext in "" $PACKAGE_EXTENSIONS; do + if f_device_get $device "$path$pkg_ext" $probe_only; then + path="$path$pkg_ext" + f_dprintf "%s: found path=[%s] dev=[%s]" \ + $fname "$path" "$device" + found=1 + break + fi + done + + local alert=f_show_msg no_confirm= + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + if [ ! "$found" ]; then + f_dprintf "%s: No such %s file on %s device" \ + $fname "$path" "$device" + $alert "$msg_unable_to_fetch_package_from_selected_media" \ + "$name" + [ "$no_confirm" ] && sleep 2 + return $FAILURE + fi + + local devname= + f_struct device_$device get name devname + if [ "$depended" ]; then + f_show_info "$msg_adding_package_as_a_dependency_from_media" \ + "$name" "$devname" + else + f_show_info "$msg_adding_package_from_media" "$name" "$devname" + fi + + # Get package data and pipe into pkg_add(1) while providing feedback + { + if ! f_device_get $device "$path"; then + $alert "$msg_io_error_while_reading_in_the_package" \ + "$name" \ + >&$DIALOG_TERMINAL_PASSTHRU_FD 2> /dev/null + [ "$no_confirm" ] && sleep 2 + else + f_show_info \ + "$msg_package_read_successfully_waiting_for_pkg_add" \ + "$name" >&$DIALOG_TERMINAL_PASSTHRU_FD 2> /dev/null + fi + } | { + if f_debugging; then + /usr/sbin/pkg_add -v - + else + f_quietly /usr/sbin/pkg_add - + fi + } + if [ $? -ne $SUCCESS ]; then + $alert "$msg_pkg_add_apparently_did_not_like_the_package" \ + "$name" + [ "$no_confirm" ] && sleep 2 + else + f_show_info "$msg_package_was_added_successfully" "$name" + sleep 1 + fi + + return $SUCCESS +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:38:42 2013 (r252744) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:44:59 2013 (r252745) @@ -190,6 +190,7 @@ f_resword_new mediaSetHTTPProxy f_media_ # packages/packages.subr f_resword_new configPackages f_package_config +f_resword_new packageAdd f_package_add # variable.subr f_resword_new installVarDefaults f_variable_set_defaults From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:49:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9072ACFD; Fri, 5 Jul 2013 01:49:21 +0000 (UTC) (envelope-from dteske@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 80E6D1950; Fri, 5 Jul 2013 01:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651nLai031016; Fri, 5 Jul 2013 01:49:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651nKx8031013; Fri, 5 Jul 2013 01:49:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050149.r651nKx8031013@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 01:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252746 - in head/usr.sbin/bsdconfig: networking/share share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:49:21 -0000 Author: dteske Date: Fri Jul 5 01:49:20 2013 New Revision: 252746 URL: http://svnweb.freebsd.org/changeset/base/252746 Log: Add the beginnings of the old networking services functionality of sysinstall(8). The UI for this will come later while this exposes the functionality to the scripted interface. Tested successfully to first install the pcnfsd package from the `Latest' repository, and second to configure mountd_flags="-n" in rc.conf(5). Added: head/usr.sbin/bsdconfig/networking/share/services.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/networking/share/Makefile head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/networking/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/Makefile Fri Jul 5 01:44:59 2013 (r252745) +++ head/usr.sbin/bsdconfig/networking/share/Makefile Fri Jul 5 01:49:20 2013 (r252746) @@ -4,7 +4,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/networking FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ - netmask.subr resolv.subr routing.subr + netmask.subr resolv.subr routing.subr services.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/networking/share/services.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/networking/share/services.subr Fri Jul 5 01:49:20 2013 (r252746) @@ -0,0 +1,54 @@ +if [ ! "$_NETWORKING_SERVICES_SUBR" ]; then _NETWORKING_SERVICES_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." networking/services.subr +f_include $BSDCFG_SHARE/packages/packages.subr +f_include $BSDCFG_SHARE/sysrc.subr + +############################################################ FUNCTIONS + +# f_config_pcnfsd +# +# Load pcnfsd package and adjust mountd_flags in rc.conf(5). +# +f_config_pcnfsd() +{ + f_package_add "pcnfsd" || return $? + f_sysrc_set mountd_flags "-n" + return $SUCCESS +} + +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." networking/services.subr + +fi # ! $_NETWORKING_SERVICES_SUBR Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:44:59 2013 (r252745) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 01:49:20 2013 (r252746) @@ -35,6 +35,7 @@ f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/any.subr f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/services.subr f_include $BSDCFG_SHARE/packages/packages.subr f_include $BSDCFG_SHARE/variable.subr @@ -188,6 +189,9 @@ f_resword_new mediaSetHTTP f_media_set_h # media/httpproxy.subr f_resword_new mediaSetHTTPProxy f_media_set_http_proxy +# networking/services.subr +f_resword_new configPCNFSD f_config_pcnfsd + # packages/packages.subr f_resword_new configPackages f_package_config f_resword_new packageAdd f_package_add From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 01:53:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02473E66; Fri, 5 Jul 2013 01:53:52 +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 D70A9196C; Fri, 5 Jul 2013 01:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651rqjl033180; Fri, 5 Jul 2013 01:53:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651rqeB033174; Fri, 5 Jul 2013 01:53:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307050153.r651rqeB033174@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 5 Jul 2013 01:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252747 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 01:53:53 -0000 Author: np Date: Fri Jul 5 01:53:51 2013 New Revision: 252747 URL: http://svnweb.freebsd.org/changeset/base/252747 Log: - Show the reason why link is down if this information is available. - Display the temperature and PHY firmware version of the BT PHY. MFC after: 1 day Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Jul 5 01:49:20 2013 (r252746) +++ head/sys/dev/cxgbe/adapter.h Fri Jul 5 01:53:51 2013 (r252747) @@ -218,6 +218,7 @@ struct port_info { int qsize_rxq; int qsize_txq; + int linkdnrc; struct link_config link_cfg; struct port_stats stats; @@ -776,7 +777,7 @@ int t4_os_find_pci_capability(struct ada int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); int t4_register_an_handler(struct adapter *, an_handler_t); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 01:49:20 2013 (r252746) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 01:53:51 2013 (r252747) @@ -5351,11 +5351,18 @@ int t4_handle_fw_rpl(struct adapter *ada if (link_ok != lc->link_ok || speed != lc->speed || fc != lc->fc) { /* something changed */ + int reason; + + if (!link_ok && lc->link_ok) + reason = G_FW_PORT_CMD_LINKDNRC(stat); + else + reason = -1; + lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; lc->supported = ntohs(p->u.info.pcap); - t4_os_link_changed(adap, i, link_ok); + t4_os_link_changed(adap, i, link_ok, reason); } if (mod != pi->mod_type) { pi->mod_type = mod; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jul 5 01:49:20 2013 (r252746) +++ head/sys/dev/cxgbe/t4_main.c Fri Jul 5 01:53:51 2013 (r252747) @@ -373,6 +373,7 @@ static int t4_sysctls(struct adapter *); static int cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); +static int sysctl_btphy(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); @@ -679,6 +680,7 @@ t4_attach(device_t dev) } pi->xact_addr_filt = -1; + pi->linkdnrc = -1; pi->qsize_rxq = t4_qsize_rxq; pi->qsize_txq = t4_qsize_txq; @@ -2931,7 +2933,8 @@ cxgbe_uninit_synchronized(struct port_in pi->link_cfg.link_ok = 0; pi->link_cfg.speed = 0; - t4_os_link_changed(sc, pi->port_id, 0); + pi->linkdnrc = -1; + t4_os_link_changed(sc, pi->port_id, 0, -1); return (0); } @@ -4408,6 +4411,16 @@ cxgbe_sysctls(struct port_info *pi) oid = device_get_sysctl_tree(pi->dev); children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "linkdnrc", CTLFLAG_RD, + &pi->linkdnrc, 0, "reason why link is down"); + if (pi->port_type == FW_PORT_TYPE_BT_XAUI) { + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I", + "PHY temperature (in Celsius)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fw_version", + CTLTYPE_INT | CTLFLAG_RD, pi, 1, sysctl_btphy, "I", + "PHY firmware version"); + } SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nrxq", CTLFLAG_RD, &pi->nrxq, 0, "# of rx queues"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ntxq", CTLFLAG_RD, @@ -4645,6 +4658,31 @@ sysctl_bitfield(SYSCTL_HANDLER_ARGS) } static int +sysctl_btphy(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + int op = arg2; + struct adapter *sc = pi->adapter; + u_int v; + int rc; + + rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4btt"); + if (rc) + return (rc); + /* XXX: magic numbers */ + rc = -t4_mdio_rd(sc, sc->mbox, pi->mdio_addr, 0x1e, op ? 0x20 : 0xc820, + &v); + end_synchronized_op(sc, 0); + if (rc) + return (rc); + if (op == 0) + v /= 256; + + rc = sysctl_handle_int(oidp, &v, 0, req); + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; @@ -7191,16 +7229,20 @@ t4_os_portmod_changed(const struct adapt } void -t4_os_link_changed(struct adapter *sc, int idx, int link_stat) +t4_os_link_changed(struct adapter *sc, int idx, int link_stat, int reason) { struct port_info *pi = sc->port[idx]; struct ifnet *ifp = pi->ifp; if (link_stat) { + pi->linkdnrc = -1; ifp->if_baudrate = IF_Mbps(pi->link_cfg.speed); if_link_state_change(ifp, LINK_STATE_UP); - } else + } else { + if (reason >= 0) + pi->linkdnrc = reason; if_link_state_change(ifp, LINK_STATE_DOWN); + } } void From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 02:07:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BC1B36B; Fri, 5 Jul 2013 02:07:00 +0000 (UTC) (envelope-from rpaulo@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 3407819C3; Fri, 5 Jul 2013 02:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65270CF036854; Fri, 5 Jul 2013 02:07:00 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6526xZN036843; Fri, 5 Jul 2013 02:06:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307050206.r6526xZN036843@svn.freebsd.org> From: Rui Paulo Date: Fri, 5 Jul 2013 02:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252748 - in 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 02:07:00 -0000 Author: rpaulo Date: Fri Jul 5 02:06:59 2013 New Revision: 252748 URL: http://svnweb.freebsd.org/changeset/base/252748 Log: Merge r252230: Implement ifconfig_wlanX="HOSTAP". Not only this is a bit cleaner, it allows multiple instances of hostapd to be running on the system host, useful for simultaneous dual-band WiFi. This is similar to ifconfig_wlanX="WPA" but it uses /etc/hostapd-wlanX.conf. Compatibility with hostapd_enable=YES/NO was kept. Modified: stable/9/etc/network.subr stable/9/etc/rc.d/hostapd Directory Properties: stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Fri Jul 5 01:53:51 2013 (r252747) +++ stable/9/etc/network.subr Fri Jul 5 02:06:59 2013 (r252748) @@ -159,6 +159,9 @@ ifconfig_up() if wpaif $1; then /etc/rc.d/wpa_supplicant start $1 _cfg=0 # XXX: not sure this should count + elif hostapif $1; then + /etc/rc.d/hostapd start $1 + _cfg=0 fi if dhcpif $1; then @@ -186,6 +189,9 @@ ifconfig_down() if wpaif $1; then /etc/rc.d/wpa_supplicant stop $1 _cfg=0 + elif hostapif $1; then + /etc/rc.d/hostapd stop $1 + _cfg=0 fi if dhcpif $1; then @@ -264,6 +270,7 @@ ifconfig_getargs() [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ww][Pp][Aa]) ;; + [Hh][Oo][Ss][Tt][Aa][Pp]) ;; *) _args="$_args $_arg" ;; @@ -364,6 +371,24 @@ wpaif() return 1 } +# hostapif if +# Returns 0 if the interface is a HOSTAP interface and 1 otherwise. +hostapif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + for _arg in $_tmpargs; do + case $_arg in + [Hh][Oo][Ss][Tt][Aa][Pp]) + return 0 + ;; + esac + done + + return 1 +} + # afexists af # Returns 0 if the address family is enabled in the kernel # 1 otherwise. Modified: stable/9/etc/rc.d/hostapd ============================================================================== --- stable/9/etc/rc.d/hostapd Fri Jul 5 01:53:51 2013 (r252747) +++ stable/9/etc/rc.d/hostapd Fri Jul 5 02:06:59 2013 (r252748) @@ -10,11 +10,18 @@ . /etc/rc.subr name="hostapd" -rcvar="hostapd_enable" command="/usr/sbin/${name}" -conf_file="/etc/${name}.conf" -pidfile="/var/run/${name}.pid" +ifn="$2" +if [ -z "$ifn" ]; then + rcvar="hostapd_enable" + conf_file="/etc/${name}.conf" + pidfile="/var/run/${name}.pid" +else + rcvar= + conf_file="/etc/${name}-${ifn}.conf" + pidfile="/var/run/${name}-${ifn}.pid" +fi command_args="-P ${pidfile} -B ${conf_file}" required_files="${conf_file}" From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:01:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 899E1B04; Fri, 5 Jul 2013 03:01:38 +0000 (UTC) (envelope-from delphij@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 6CDA41C26; Fri, 5 Jul 2013 03:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6531cin054927; Fri, 5 Jul 2013 03:01:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6531aJf054912; Fri, 5 Jul 2013 03:01:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050301.r6531aJf054912@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:01: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: r252749 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:01:38 -0000 Author: delphij Date: Fri Jul 5 03:01:35 2013 New Revision: 252749 URL: http://svnweb.freebsd.org/changeset/base/252749 Log: MFC r251629: 3741 zfs needs better comments Embellish the comments in various components of ZFS. Move some comments around closer to what they describe. Specifically, answer the questions: - What are some of the edge cases of the dbuf state machine? - What does a txg quiesce do? - When does the DMU notify threads waiting on txg's that they may proceed? - How do the calculations for RAIDZ map allocations work? - What process do the RAIDZ I/O start and done callbacks follow? While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear() to match its comment which describes its return as a boolean. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.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/zfs_ctldir.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:01:35 2013 (r252749) @@ -4538,6 +4538,11 @@ zfs_get_holds(zfs_handle_t *zhp, nvlist_ return (err); } +/* + * Convert the zvol's volume size to an appropriate reservation. + * Note: If this routine is updated, it is necessary to update the ZFS test + * suite's shell version in reservation.kshlib. + */ uint64_t zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:01:35 2013 (r252749) @@ -289,7 +289,18 @@ typedef struct arc_stats { kstat_named_t arcstat_deleted; kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; + /* + * Number of buffers that could not be evicted because the hash lock + * was held by another thread. The lock may not necessarily be held + * by something using the same buffer, since hash locks are shared + * by multiple buffers. + */ kstat_named_t arcstat_mutex_miss; + /* + * Number of buffers skipped because they have I/O in progress, are + * indrect prefetch buffers that have not lived long enough, or are + * not from the spa we're trying to evict from. + */ kstat_named_t arcstat_evict_skip; kstat_named_t arcstat_evict_l2_cached; kstat_named_t arcstat_evict_l2_eligible; @@ -3247,6 +3258,10 @@ top: mutex_exit(hash_lock); + /* + * At this point, we have a level 1 cache miss. Try again in + * L2ARC if possible. + */ ASSERT3U(hdr->b_size, ==, size); DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp, uint64_t, size, zbookmark_t *, zb); @@ -3488,8 +3503,8 @@ arc_buf_evict(arc_buf_t *buf) } /* - * Release this buffer from the cache. This must be done - * after a read and prior to modifying the buffer contents. + * Release this buffer from the cache, making it an anonymous buffer. This + * must be done after a read and prior to modifying the buffer contents. * If the buffer has more than one reference, we must make * a new hdr for the buffer. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 03:01:35 2013 (r252749) @@ -641,6 +641,14 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (!havepzio) err = zio_wait(zio); } else { + /* + * Another reader came in while the dbuf was in flight + * between UNCACHED and CACHED. Either a writer will finish + * writing the buffer (sending the dbuf to CACHED) or the + * first reader's request will reach the read_done callback + * and send the dbuf to CACHED. Otherwise, a failure + * occurred and the dbuf went to UNCACHED. + */ mutex_exit(&db->db_mtx); if (prefetch) dmu_zfetch(&dn->dn_zfetch, db->db.db_offset, @@ -649,6 +657,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + /* Skip the wait per the caller's request. */ mutex_enter(&db->db_mtx); if ((flags & DB_RF_NEVERWAIT) == 0) { while (db->db_state == DB_READ || @@ -1264,7 +1273,8 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t } /* - * Return TRUE if this evicted the dbuf. + * Undirty a buffer in the transaction group referenced by the given + * transaction. Return whether this evicted the dbuf. */ static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx) @@ -2225,6 +2235,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t * ASSERT(db->db_level > 0); DBUF_VERIFY(db); + /* Read the block if it hasn't been read yet. */ if (db->db_buf == NULL) { mutex_exit(&db->db_mtx); (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED); @@ -2235,10 +2246,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t * DB_DNODE_ENTER(db); dn = DB_DNODE(db); + /* Indirect block size must match what the dnode thinks it is. */ ASSERT3U(db->db.db_size, ==, 1<dn_phys->dn_indblkshift); dbuf_check_blkptr(dn, db); DB_DNODE_EXIT(db); + /* Provide the pending dirty record to child dbufs */ db->db_data_pending = dr; mutex_exit(&db->db_mtx); @@ -2629,6 +2642,7 @@ dbuf_write_override_done(zio_t *zio) dbuf_write_done(zio, NULL, db); } +/* Issue I/O to commit a dirty buffer to disk. */ static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx) { @@ -2663,11 +2677,19 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ } if (parent != dn->dn_dbuf) { + /* Our parent is an indirect block. */ + /* We have a dirty parent that has been scheduled for write. */ ASSERT(parent && parent->db_data_pending); + /* Our parent's buffer is one level closer to the dnode. */ ASSERT(db->db_level == parent->db_level-1); + /* + * We're about to modify our parent's db_data by modifying + * our block pointer, so the parent must be released. + */ ASSERT(arc_released(parent->db_buf)); zio = parent->db_data_pending->dr_zio; } else { + /* Our parent is the dnode itself. */ ASSERT((db->db_level == dn->dn_phys->dn_nlevels-1 && db->db_blkid != DMU_SPILL_BLKID) || (db->db_blkid == DMU_SPILL_BLKID && db->db_level == 0)); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1839,7 +1839,7 @@ dmu_init(void) void dmu_fini(void) { - arc_fini(); + arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); dbuf_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1014,6 +1014,10 @@ dmu_tx_unassign(dmu_tx_t *tx) txg_rele_to_quiesce(&tx->tx_txgh); + /* + * Walk the transaction's hold list, removing the hold on the + * associated dnode, and notifying waiters if the refcount drops to 0. + */ for (txh = list_head(&tx->tx_holds); txh != tx->tx_needassign_txh; txh = list_next(&tx->tx_holds, txh)) { dnode_t *dn = txh->txh_dnode; @@ -1126,6 +1130,10 @@ dmu_tx_commit(dmu_tx_t *tx) ASSERT(tx->tx_txg != 0); + /* + * Go through the transaction's hold list and remove holds on + * associated dnodes, notifying waiters if no holds remain. + */ while (txh = list_head(&tx->tx_holds)) { dnode_t *dn = txh->txh_dnode; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:01:35 2013 (r252749) @@ -66,11 +66,11 @@ SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, "Number of bytes in a array_read at which we stop prefetching"); /* forward decls for static routines */ -static int dmu_zfetch_colinear(zfetch_t *, zstream_t *); +static boolean_t dmu_zfetch_colinear(zfetch_t *, zstream_t *); static void dmu_zfetch_dofetch(zfetch_t *, zstream_t *); static uint64_t dmu_zfetch_fetch(dnode_t *, uint64_t, uint64_t); static uint64_t dmu_zfetch_fetchsz(dnode_t *, uint64_t, uint64_t); -static int dmu_zfetch_find(zfetch_t *, zstream_t *, int); +static boolean_t dmu_zfetch_find(zfetch_t *, zstream_t *, int); static int dmu_zfetch_stream_insert(zfetch_t *, zstream_t *); static zstream_t *dmu_zfetch_stream_reclaim(zfetch_t *); static void dmu_zfetch_stream_remove(zfetch_t *, zstream_t *); @@ -122,9 +122,9 @@ kstat_t *zfetch_ksp; * last stream, then we are probably in a strided access pattern. So * combine the two sequential streams into a single strided stream. * - * If no co-linear streams are found, return NULL. + * Returns whether co-linear streams were found. */ -static int +static boolean_t dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh) { zstream_t *z_walk; @@ -344,7 +344,7 @@ dmu_zfetch_fetchsz(dnode_t *dn, uint64_t * for this block read. If so, it starts a prefetch for the stream it * located and returns true, otherwise it returns false */ -static int +static boolean_t dmu_zfetch_find(zfetch_t *zf, zstream_t *zh, int prefetched) { zstream_t *zs; @@ -669,7 +669,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset { zstream_t zst; zstream_t *newstream; - int fetched; + boolean_t fetched; int inserted; unsigned int blkshft; uint64_t blksz; @@ -695,7 +695,8 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset ZFETCHSTAT_BUMP(zfetchstat_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_misses); - if (fetched = dmu_zfetch_colinear(zf, &zst)) { + fetched = dmu_zfetch_colinear(zf, &zst); + if (fetched) { ZFETCHSTAT_BUMP(zfetchstat_colinear_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_colinear_misses); 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:01:35 2013 (r252749) @@ -27,6 +27,8 @@ */ /* + * SPA: Storage Pool Allocator + * * This file contains all the routines used when modifying on-disk SPA state. * This includes opening, importing, destroying, exporting a pool, and syncing a * pool. Modified: 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.h Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:01:35 2013 (r252749) @@ -411,6 +411,8 @@ void dmu_write_policy(objset_t *os, stru * object must be held in an assigned transaction before calling * dmu_buf_will_dirty. You may use dmu_buf_set_user() on the bonus * buffer as well. You must release your hold with dmu_buf_rele(). + * + * Returns ENOENT, EIO, or 0. */ int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **); int dmu_bonus_max(void); @@ -666,8 +668,14 @@ extern const dmu_object_byteswap_info_t * If doi is NULL, just indicates whether the object exists. */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dnode in hand. */ void dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dbuf in hand. */ void dmu_object_info_from_db(dmu_buf_t *db, dmu_object_info_t *doi); +/* + * Like dmu_object_info_from_db, but faster still when you only care about + * the size. This is specifically optimized for zfs_getattr(). + */ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize, u_longlong_t *nblk512); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:01:35 2013 (r252749) @@ -348,6 +348,12 @@ txg_rele_to_sync(txg_handle_t *th) th->th_cpu = NULL; /* defensive */ } +/* + * Blocks until all transactions in the group are committed. + * + * On return, the transaction group has reached a stable state in which it can + * then be passed off to the syncing context. + */ static void txg_quiesce(dsl_pool_t *dp, uint64_t txg) { @@ -397,6 +403,9 @@ txg_do_callbacks(void *arg) /* * Dispatch the commit callbacks registered on this txg to worker threads. + * + * If no callbacks are registered for a given TXG, nothing happens. + * This function creates a taskq for the associated pool, if needed. */ static void txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) @@ -407,7 +416,10 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u for (c = 0; c < max_ncpus; c++) { tx_cpu_t *tc = &tx->tx_cpu[c]; - /* No need to lock tx_cpu_t at this point */ + /* + * No need to lock tx_cpu_t at this point, since this can + * only be called once a txg has been synced. + */ int g = txg & TXG_MASK; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1044,6 +1044,7 @@ vdev_uberblock_sync(zio_t *zio, uberbloc zio_buf_free(ubbuf, VDEV_UBERBLOCK_SIZE(vd)); } +/* Sync the uberblocks to all vdevs in svd[] */ int vdev_uberblock_sync_list(vdev_t **svd, int svdcount, uberblock_t *ub, int flags) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:01:35 2013 (r252749) @@ -433,23 +433,50 @@ static const zio_vsd_ops_t vdev_raidz_vs vdev_raidz_cksum_report }; +/* + * Divides the IO evenly across all child vdevs; usually, dcols is + * the number of children in the target vdev. + */ static raidz_map_t * vdev_raidz_map_alloc(zio_t *zio, uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; + /* The starting RAIDZ (parent) vdev sector of the block. */ uint64_t b = zio->io_offset >> unit_shift; + /* The zio's size in units of the vdev's minimum sector size. */ uint64_t s = zio->io_size >> unit_shift; + /* The first column for this stripe. */ uint64_t f = b % dcols; + /* The starting byte offset on each child vdev. */ uint64_t o = (b / dcols) << unit_shift; uint64_t q, r, c, bc, col, acols, scols, coff, devidx, asize, tot; + /* + * "Quotient": The number of data sectors for this stripe on all but + * the "big column" child vdevs that also contain "remainder" data. + */ q = s / (dcols - nparity); + + /* + * "Remainder": The number of partial stripe data sectors in this I/O. + * This will add a sector to some, but not all, child vdevs. + */ r = s - q * (dcols - nparity); + + /* The number of "big columns" - those which contain remainder data. */ bc = (r == 0 ? 0 : r + nparity); + + /* + * The total number of data and parity sectors associated with + * this I/O. + */ tot = s + nparity * (q + (r == 0 ? 0 : 1)); + /* acols: The columns that will be accessed. */ + /* scols: The columns that will be accessed or skipped. */ if (q == 0) { + /* Our I/O request doesn't span all child vdevs. */ acols = bc; scols = MIN(dcols, roundup(bc, nparity + 1)); } else { @@ -1529,6 +1556,23 @@ vdev_raidz_child_done(zio_t *zio) rc->rc_skipped = 0; } +/* + * Start an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Generate the parity data + * 2. Create child zio write operations to each column's vdev, for both + * data and parity. + * 3. If the column skips any sectors for padding, create optional dummy + * write zio children for those areas to improve aggregation continuity. + * - For read operations: + * 1. Create child zio read operations to each data column's vdev to read + * the range of data required for zio. + * 2. If this is a scrub or resilver operation, or if any of the data + * vdevs have had errors, then create zio read operations to the parity + * columns' VDevs as well. + */ static int vdev_raidz_io_start(zio_t *zio) { @@ -1881,6 +1925,27 @@ done: return (ret); } +/* + * Complete an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Check for errors on the child IOs. + * 2. Return, setting an error code if too few child VDevs were written + * to reconstruct the data later. Note that partial writes are + * considered successful if they can be reconstructed at all. + * - For read operations: + * 1. Check for errors on the child IOs. + * 2. If data errors occurred: + * a. Try to reassemble the data from the parity available. + * b. If we haven't yet read the parity drives, read them now. + * c. If all parity drives have been read but the data still doesn't + * reassemble with a correct checksum, then try combinatorial + * reconstruction. + * d. If that doesn't work, return an error. + * 3. If there were unexpected errors or this is a resilver operation, + * rewrite the vdevs that had errors. + */ static void vdev_raidz_io_done(zio_t *zio) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:01:35 2013 (r252749) @@ -633,6 +633,11 @@ static struct vop_vector zfsctl_ops_root .vop_fid = zfsctl_common_fid, }; +/* + * Gets the full dataset name that corresponds to the given snapshot name + * Example: + * zfsctl_snapshot_zname("snap1") -> "mypool/myfs@snap1" + */ static int zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:02:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F353C52; Fri, 5 Jul 2013 03:02:22 +0000 (UTC) (envelope-from delphij@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 324B91C4B; Fri, 5 Jul 2013 03:02:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6532MGf055311; Fri, 5 Jul 2013 03:02:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6532J5H055296; Fri, 5 Jul 2013 03:02:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050302.r6532J5H055296@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252750 - in stable/8: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:02:22 -0000 Author: delphij Date: Fri Jul 5 03:02:19 2013 New Revision: 252750 URL: http://svnweb.freebsd.org/changeset/base/252750 Log: MFC r251629: 3741 zfs needs better comments Embellish the comments in various components of ZFS. Move some comments around closer to what they describe. Specifically, answer the questions: - What are some of the edge cases of the dbuf state machine? - What does a txg quiesce do? - When does the DMU notify threads waiting on txg's that they may proceed? - How do the calculations for RAIDZ map allocations work? - What process do the RAIDZ I/O start and done callbacks follow? While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear() to match its comment which describes its return as a boolean. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:02:19 2013 (r252750) @@ -4538,6 +4538,11 @@ zfs_get_holds(zfs_handle_t *zhp, nvlist_ return (err); } +/* + * Convert the zvol's volume size to an appropriate reservation. + * Note: If this routine is updated, it is necessary to update the ZFS test + * suite's shell version in reservation.kshlib. + */ uint64_t zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:02:19 2013 (r252750) @@ -287,7 +287,18 @@ typedef struct arc_stats { kstat_named_t arcstat_deleted; kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; + /* + * Number of buffers that could not be evicted because the hash lock + * was held by another thread. The lock may not necessarily be held + * by something using the same buffer, since hash locks are shared + * by multiple buffers. + */ kstat_named_t arcstat_mutex_miss; + /* + * Number of buffers skipped because they have I/O in progress, are + * indrect prefetch buffers that have not lived long enough, or are + * not from the spa we're trying to evict from. + */ kstat_named_t arcstat_evict_skip; kstat_named_t arcstat_evict_l2_cached; kstat_named_t arcstat_evict_l2_eligible; @@ -3211,6 +3222,10 @@ top: mutex_exit(hash_lock); + /* + * At this point, we have a level 1 cache miss. Try again in + * L2ARC if possible. + */ ASSERT3U(hdr->b_size, ==, size); DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp, uint64_t, size, zbookmark_t *, zb); @@ -3408,8 +3423,8 @@ arc_buf_evict(arc_buf_t *buf) } /* - * Release this buffer from the cache. This must be done - * after a read and prior to modifying the buffer contents. + * Release this buffer from the cache, making it an anonymous buffer. This + * must be done after a read and prior to modifying the buffer contents. * If the buffer has more than one reference, we must make * a new hdr for the buffer. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 03:02:19 2013 (r252750) @@ -638,6 +638,14 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (!havepzio) err = zio_wait(zio); } else { + /* + * Another reader came in while the dbuf was in flight + * between UNCACHED and CACHED. Either a writer will finish + * writing the buffer (sending the dbuf to CACHED) or the + * first reader's request will reach the read_done callback + * and send the dbuf to CACHED. Otherwise, a failure + * occurred and the dbuf went to UNCACHED. + */ mutex_exit(&db->db_mtx); if (prefetch) dmu_zfetch(&dn->dn_zfetch, db->db.db_offset, @@ -646,6 +654,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + /* Skip the wait per the caller's request. */ mutex_enter(&db->db_mtx); if ((flags & DB_RF_NEVERWAIT) == 0) { while (db->db_state == DB_READ || @@ -1261,7 +1270,8 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t } /* - * Return TRUE if this evicted the dbuf. + * Undirty a buffer in the transaction group referenced by the given + * transaction. Return whether this evicted the dbuf. */ static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx) @@ -2222,6 +2232,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t * ASSERT(db->db_level > 0); DBUF_VERIFY(db); + /* Read the block if it hasn't been read yet. */ if (db->db_buf == NULL) { mutex_exit(&db->db_mtx); (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED); @@ -2232,10 +2243,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t * DB_DNODE_ENTER(db); dn = DB_DNODE(db); + /* Indirect block size must match what the dnode thinks it is. */ ASSERT3U(db->db.db_size, ==, 1<dn_phys->dn_indblkshift); dbuf_check_blkptr(dn, db); DB_DNODE_EXIT(db); + /* Provide the pending dirty record to child dbufs */ db->db_data_pending = dr; mutex_exit(&db->db_mtx); @@ -2626,6 +2639,7 @@ dbuf_write_override_done(zio_t *zio) dbuf_write_done(zio, NULL, db); } +/* Issue I/O to commit a dirty buffer to disk. */ static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx) { @@ -2660,11 +2674,19 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ } if (parent != dn->dn_dbuf) { + /* Our parent is an indirect block. */ + /* We have a dirty parent that has been scheduled for write. */ ASSERT(parent && parent->db_data_pending); + /* Our parent's buffer is one level closer to the dnode. */ ASSERT(db->db_level == parent->db_level-1); + /* + * We're about to modify our parent's db_data by modifying + * our block pointer, so the parent must be released. + */ ASSERT(arc_released(parent->db_buf)); zio = parent->db_data_pending->dr_zio; } else { + /* Our parent is the dnode itself. */ ASSERT((db->db_level == dn->dn_phys->dn_nlevels-1 && db->db_blkid != DMU_SPILL_BLKID) || (db->db_blkid == DMU_SPILL_BLKID && db->db_level == 0)); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1837,7 +1837,7 @@ dmu_init(void) void dmu_fini(void) { - arc_fini(); + arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); dbuf_fini(); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1014,6 +1014,10 @@ dmu_tx_unassign(dmu_tx_t *tx) txg_rele_to_quiesce(&tx->tx_txgh); + /* + * Walk the transaction's hold list, removing the hold on the + * associated dnode, and notifying waiters if the refcount drops to 0. + */ for (txh = list_head(&tx->tx_holds); txh != tx->tx_needassign_txh; txh = list_next(&tx->tx_holds, txh)) { dnode_t *dn = txh->txh_dnode; @@ -1126,6 +1130,10 @@ dmu_tx_commit(dmu_tx_t *tx) ASSERT(tx->tx_txg != 0); + /* + * Go through the transaction's hold list and remove holds on + * associated dnodes, notifying waiters if no holds remain. + */ while (txh = list_head(&tx->tx_holds)) { dnode_t *dn = txh->txh_dnode; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:02:19 2013 (r252750) @@ -66,11 +66,11 @@ SYSCTL_QUAD(_vfs_zfs_zfetch, OID_AUTO, a "Number of bytes in a array_read at which we stop prefetching"); /* forward decls for static routines */ -static int dmu_zfetch_colinear(zfetch_t *, zstream_t *); +static boolean_t dmu_zfetch_colinear(zfetch_t *, zstream_t *); static void dmu_zfetch_dofetch(zfetch_t *, zstream_t *); static uint64_t dmu_zfetch_fetch(dnode_t *, uint64_t, uint64_t); static uint64_t dmu_zfetch_fetchsz(dnode_t *, uint64_t, uint64_t); -static int dmu_zfetch_find(zfetch_t *, zstream_t *, int); +static boolean_t dmu_zfetch_find(zfetch_t *, zstream_t *, int); static int dmu_zfetch_stream_insert(zfetch_t *, zstream_t *); static zstream_t *dmu_zfetch_stream_reclaim(zfetch_t *); static void dmu_zfetch_stream_remove(zfetch_t *, zstream_t *); @@ -122,9 +122,9 @@ kstat_t *zfetch_ksp; * last stream, then we are probably in a strided access pattern. So * combine the two sequential streams into a single strided stream. * - * If no co-linear streams are found, return NULL. + * Returns whether co-linear streams were found. */ -static int +static boolean_t dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh) { zstream_t *z_walk; @@ -344,7 +344,7 @@ dmu_zfetch_fetchsz(dnode_t *dn, uint64_t * for this block read. If so, it starts a prefetch for the stream it * located and returns true, otherwise it returns false */ -static int +static boolean_t dmu_zfetch_find(zfetch_t *zf, zstream_t *zh, int prefetched) { zstream_t *zs; @@ -669,7 +669,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset { zstream_t zst; zstream_t *newstream; - int fetched; + boolean_t fetched; int inserted; unsigned int blkshft; uint64_t blksz; @@ -695,7 +695,8 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset ZFETCHSTAT_BUMP(zfetchstat_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_misses); - if (fetched = dmu_zfetch_colinear(zf, &zst)) { + fetched = dmu_zfetch_colinear(zf, &zst); + if (fetched) { ZFETCHSTAT_BUMP(zfetchstat_colinear_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_colinear_misses); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:02:19 2013 (r252750) @@ -27,6 +27,8 @@ */ /* + * SPA: Storage Pool Allocator + * * This file contains all the routines used when modifying on-disk SPA state. * This includes opening, importing, destroying, exporting a pool, and syncing a * pool. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:02:19 2013 (r252750) @@ -411,6 +411,8 @@ void dmu_write_policy(objset_t *os, stru * object must be held in an assigned transaction before calling * dmu_buf_will_dirty. You may use dmu_buf_set_user() on the bonus * buffer as well. You must release your hold with dmu_buf_rele(). + * + * Returns ENOENT, EIO, or 0. */ int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **); int dmu_bonus_max(void); @@ -666,8 +668,14 @@ extern const dmu_object_byteswap_info_t * If doi is NULL, just indicates whether the object exists. */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dnode in hand. */ void dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dbuf in hand. */ void dmu_object_info_from_db(dmu_buf_t *db, dmu_object_info_t *doi); +/* + * Like dmu_object_info_from_db, but faster still when you only care about + * the size. This is specifically optimized for zfs_getattr(). + */ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize, u_longlong_t *nblk512); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:02:19 2013 (r252750) @@ -279,6 +279,12 @@ txg_rele_to_sync(txg_handle_t *th) th->th_cpu = NULL; /* defensive */ } +/* + * Blocks until all transactions in the group are committed. + * + * On return, the transaction group has reached a stable state in which it can + * then be passed off to the syncing context. + */ static void txg_quiesce(dsl_pool_t *dp, uint64_t txg) { @@ -328,6 +334,9 @@ txg_do_callbacks(void *arg) /* * Dispatch the commit callbacks registered on this txg to worker threads. + * + * If no callbacks are registered for a given TXG, nothing happens. + * This function creates a taskq for the associated pool, if needed. */ static void txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) @@ -338,7 +347,10 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u for (c = 0; c < max_ncpus; c++) { tx_cpu_t *tc = &tx->tx_cpu[c]; - /* No need to lock tx_cpu_t at this point */ + /* + * No need to lock tx_cpu_t at this point, since this can + * only be called once a txg has been synced. + */ int g = txg & TXG_MASK; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1044,6 +1044,7 @@ vdev_uberblock_sync(zio_t *zio, uberbloc zio_buf_free(ubbuf, VDEV_UBERBLOCK_SIZE(vd)); } +/* Sync the uberblocks to all vdevs in svd[] */ int vdev_uberblock_sync_list(vdev_t **svd, int svdcount, uberblock_t *ub, int flags) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:02:19 2013 (r252750) @@ -433,23 +433,50 @@ static const zio_vsd_ops_t vdev_raidz_vs vdev_raidz_cksum_report }; +/* + * Divides the IO evenly across all child vdevs; usually, dcols is + * the number of children in the target vdev. + */ static raidz_map_t * vdev_raidz_map_alloc(zio_t *zio, uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; + /* The starting RAIDZ (parent) vdev sector of the block. */ uint64_t b = zio->io_offset >> unit_shift; + /* The zio's size in units of the vdev's minimum sector size. */ uint64_t s = zio->io_size >> unit_shift; + /* The first column for this stripe. */ uint64_t f = b % dcols; + /* The starting byte offset on each child vdev. */ uint64_t o = (b / dcols) << unit_shift; uint64_t q, r, c, bc, col, acols, scols, coff, devidx, asize, tot; + /* + * "Quotient": The number of data sectors for this stripe on all but + * the "big column" child vdevs that also contain "remainder" data. + */ q = s / (dcols - nparity); + + /* + * "Remainder": The number of partial stripe data sectors in this I/O. + * This will add a sector to some, but not all, child vdevs. + */ r = s - q * (dcols - nparity); + + /* The number of "big columns" - those which contain remainder data. */ bc = (r == 0 ? 0 : r + nparity); + + /* + * The total number of data and parity sectors associated with + * this I/O. + */ tot = s + nparity * (q + (r == 0 ? 0 : 1)); + /* acols: The columns that will be accessed. */ + /* scols: The columns that will be accessed or skipped. */ if (q == 0) { + /* Our I/O request doesn't span all child vdevs. */ acols = bc; scols = MIN(dcols, roundup(bc, nparity + 1)); } else { @@ -1529,6 +1556,23 @@ vdev_raidz_child_done(zio_t *zio) rc->rc_skipped = 0; } +/* + * Start an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Generate the parity data + * 2. Create child zio write operations to each column's vdev, for both + * data and parity. + * 3. If the column skips any sectors for padding, create optional dummy + * write zio children for those areas to improve aggregation continuity. + * - For read operations: + * 1. Create child zio read operations to each data column's vdev to read + * the range of data required for zio. + * 2. If this is a scrub or resilver operation, or if any of the data + * vdevs have had errors, then create zio read operations to the parity + * columns' VDevs as well. + */ static int vdev_raidz_io_start(zio_t *zio) { @@ -1881,6 +1925,27 @@ done: return (ret); } +/* + * Complete an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Check for errors on the child IOs. + * 2. Return, setting an error code if too few child VDevs were written + * to reconstruct the data later. Note that partial writes are + * considered successful if they can be reconstructed at all. + * - For read operations: + * 1. Check for errors on the child IOs. + * 2. If data errors occurred: + * a. Try to reassemble the data from the parity available. + * b. If we haven't yet read the parity drives, read them now. + * c. If all parity drives have been read but the data still doesn't + * reassemble with a correct checksum, then try combinatorial + * reconstruction. + * d. If that doesn't work, return an error. + * 3. If there were unexpected errors or this is a resilver operation, + * rewrite the vdevs that had errors. + */ static void vdev_raidz_io_done(zio_t *zio) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:02:19 2013 (r252750) @@ -633,6 +633,11 @@ static struct vop_vector zfsctl_ops_root .vop_fid = zfsctl_common_fid, }; +/* + * Gets the full dataset name that corresponds to the given snapshot name + * Example: + * zfsctl_snapshot_zname("snap1") -> "mypool/myfs@snap1" + */ static int zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:06:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49A16DDF; Fri, 5 Jul 2013 03:06:07 +0000 (UTC) (envelope-from delphij@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 3AEFF1CA0; Fri, 5 Jul 2013 03:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65367fa055974; Fri, 5 Jul 2013 03:06:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65360gf055900; Fri, 5 Jul 2013 03:06:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050306.r65360gf055900@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:06: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: r252751 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:06:07 -0000 Author: delphij Date: Fri Jul 5 03:05:59 2013 New Revision: 252751 URL: http://svnweb.freebsd.org/changeset/base/252751 Log: MFC r251631: illumos #3742 zfs comments need cleaner, more consistent style - Make more of ZFS's comments use a natural English writing flow. - Break up long paragraphs, fix various typos and spelling errors. - Don't prefix a function description with its name when the function definition immediately follows. - Remove useless comments. - Add extra whitespace where it makes the comments more readable. New comments were separated from this change and added in r251629. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , George Wilson , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.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_prop.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_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.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_pool.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_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.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/zap_leaf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.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/zio_compress.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_queue.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.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_log.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_sa.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 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/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:05:59 2013 (r252751) @@ -58,11 +58,11 @@ * tight. * * 3. The Megiddo and Modha model assumes a fixed page size. All - * elements of the cache are therefor exactly the same size. So + * elements of the cache are therefore exactly the same size. So * when adjusting the cache size following a cache miss, its simply * a matter of choosing a single page to evict. In our model, we * have variable sized cache blocks (rangeing from 512 bytes to - * 128K bytes). We therefor choose a set of blocks to evict to make + * 128K bytes). We therefore choose a set of blocks to evict to make * space for a cache miss that approximates as closely as possible * the space used by the new block. * @@ -77,7 +77,7 @@ * ways: 1) via a hash table lookup using the DVA as a key, * or 2) via one of the ARC lists. The arc_read() interface * uses method 1, while the internal arc algorithms for - * adjusting the cache use method 2. We therefor provide two + * adjusting the cache use method 2. We therefore provide two * types of locks: 1) the hash table lock array, and 2) the * arc list locks. * @@ -438,7 +438,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT(stat) (arc_stats.stat.value.ui64) #define ARCSTAT_INCR(stat, val) \ - atomic_add_64(&arc_stats.stat.value.ui64, (val)); + atomic_add_64(&arc_stats.stat.value.ui64, (val)) #define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) @@ -672,9 +672,7 @@ uint64_t zfs_crc64_table[256]; #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) -/* - * L2ARC Performance Tunables - */ +/* L2ARC Performance Tunables */ uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */ uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ @@ -3900,7 +3898,7 @@ arc_tempreserve_space(uint64_t reserve, /* * Writes will, almost always, require additional memory allocations - * in order to compress/encrypt/etc the data. We therefor need to + * in order to compress/encrypt/etc the data. We therefore need to * make sure that there is sufficient available memory for this. */ if (error = arc_memory_throttle(reserve, anon_size, txg)) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:05:59 2013 (r252751) @@ -43,7 +43,7 @@ * dsl_scan_sync. This allows the delete operation to finish without traversing * all the dataset's blocks. * - * Note that while bt_begin and bt_end are only ever incremented in this code + * Note that while bt_begin and bt_end are only ever incremented in this code, * they are effectively reset to 0 every time the entire bptree is freed because * the bptree's object is destroyed and re-created. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1808,14 +1808,16 @@ dnode_willuse_space(dnode_t *dn, int64_t } /* - * This function scans a block at the indicated "level" looking for - * a hole or data (depending on 'flags'). If level > 0, then we are - * scanning an indirect block looking at its pointers. If level == 0, - * then we are looking at a block of dnodes. If we don't find what we - * are looking for in the block, we return ESRCH. Otherwise, return - * with *offset pointing to the beginning (if searching forwards) or - * end (if searching backwards) of the range covered by the block - * pointer we matched on (or dnode). + * Scans a block at the indicated "level" looking for a hole or data, + * depending on 'flags'. + * + * If level > 0, then we are scanning an indirect block looking at its + * pointers. If level == 0, then we are looking at a block of dnodes. + * + * If we don't find what we are looking for in the block, we return ESRCH. + * Otherwise, return with *offset pointing to the beginning (if searching + * forwards) or end (if searching backwards) of the range covered by the + * block pointer we matched on (or dnode). * * The basic search algorithm used below by dnode_next_offset() is to * use this function to search up the block tree (widen the search) until Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:05:59 2013 (r252751) @@ -302,7 +302,7 @@ free_children(dmu_buf_impl_t *db, uint64 } /* - * free_range: Traverse the indicated range of the provided file + * Traverse the indicated range of the provided file * and "free" all the blocks contained there. */ static void @@ -370,7 +370,7 @@ dnode_sync_free_range(dnode_t *dn, uint6 } /* - * Try to kick all the dnodes dbufs out of the cache... + * Try to kick all the dnode's dbufs out of the cache... */ void dnode_evict_dbufs(dnode_t *dn) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:05:59 2013 (r252751) @@ -379,7 +379,7 @@ dsl_prop_predict(dsl_dir_t *dd, const ch /* * Unregister this callback. Return 0 on success, ENOENT if ddname is - * invalid, ENOMSG if no matching callback registered. + * invalid, or ENOMSG if no matching callback registered. */ int dsl_prop_unregister(dsl_dataset_t *ds, const char *propname, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -111,6 +111,7 @@ * location. * * Byteswap implications: + * * Since the SA attributes are not entirely self describing we can't do * the normal byteswap processing. The special ZAP layout attribute and * attribute registration attributes define the byteswap function and the @@ -189,7 +190,6 @@ sa_attr_reg_t sa_legacy_attrs[] = { }; /* - * ZPL legacy layout * This is only used for objects of type DMU_OT_ZNODE */ sa_attr_type_t sa_legacy_zpl_layout[] = { @@ -199,7 +199,6 @@ sa_attr_type_t sa_legacy_zpl_layout[] = /* * Special dummy layout used for buffers with no attributes. */ - sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; static int sa_legacy_attr_count = 16; 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -4698,6 +4698,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui /* * Detach a device from a mirror or replacing vdev. + * * If 'replace_done' is specified, only detach if the parent * is a replacing vdev. */ @@ -5359,11 +5360,9 @@ spa_vdev_remove_from_namespace(spa_t *sp * the spa_vdev_config_[enter/exit] functions which allow us to * grab and release the spa_config_lock while still holding the namespace * lock. During each step the configuration is synced out. - */ - -/* - * Remove a device from the pool. Currently, this supports removing only hot - * spares, slogs, and level 2 ARC devices. + * + * Currently, this supports removing only hot spares, slogs, and level 2 ARC + * devices. */ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) @@ -5473,7 +5472,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Find any device that's done replacing, or a vdev marked 'unspare' that's - * current spared, so we can detach it. + * currently spared, so we can detach it. */ static vdev_t * spa_vdev_resilver_done_hunt(vdev_t *vd) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:05:59 2013 (r252751) @@ -315,6 +315,7 @@ spa_config_set(spa_t *spa, nvlist_t *con /* * Generate the pool's configuration based on the current in-core state. + * * We infer whether to generate a complete config or just one top-level config * based on whether vd is the root vdev. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1369,7 +1369,7 @@ zfs_panic_recover(const char *fmt, ...) /* * This is a stripped-down version of strtoull, suitable only for converting - * lowercase hexidecimal numbers that don't overflow. + * lowercase hexadecimal numbers that don't overflow. */ uint64_t zfs_strtonum(const char *str, char **nptr) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:05:59 2013 (r252751) @@ -63,16 +63,15 @@ enum ddt_class { */ typedef struct ddt_key { zio_cksum_t ddk_cksum; /* 256-bit block checksum */ - uint64_t ddk_prop; /* LSIZE, PSIZE, compression */ + /* + * Encoded with logical & physical size, and compression, as follows: + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * | 0 | 0 | 0 | comp | PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + */ + uint64_t ddk_prop; } ddt_key_t; -/* - * ddk_prop layout: - * - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | 0 | 0 | 0 | comp | PSIZE | LSIZE | - * +-------+-------+-------+-------+-------+-------+-------+-------+ - */ #define DDK_GET_LSIZE(ddk) \ BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1) #define DDK_SET_LSIZE(ddk, x) \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:05:59 2013 (r252751) @@ -145,9 +145,8 @@ typedef struct dnode_phys { typedef struct dnode { /* - * dn_struct_rwlock protects the structure of the dnode, - * including the number of levels of indirection (dn_nlevels), - * dn_maxblkid, and dn_next_* + * Protects the structure of the dnode, including the number of levels + * of indirection (dn_nlevels), dn_maxblkid, and dn_next_* */ krwlock_t dn_struct_rwlock; Modified: 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_pool.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:05:59 2013 (r252751) @@ -110,6 +110,7 @@ typedef struct dsl_pool { /* * Protects administrative changes (properties, namespace) + * * It is only held for write in syncing context. Therefore * syncing context does not need to ever have it for read, since * nobody else could possibly have it for write. Modified: 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/sa_impl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -150,6 +150,7 @@ struct sa_os { /* * header for all bonus and spill buffers. + * * The header has a fixed portion with a variable number * of "lengths" depending on the number of variable sized * attribues which are determined by the "layout number" @@ -158,29 +159,27 @@ struct sa_os { #define SA_MAGIC 0x2F505A /* ZFS SA */ typedef struct sa_hdr_phys { uint32_t sa_magic; - uint16_t sa_layout_info; /* Encoded with hdrsize and layout number */ + /* + * Encoded with hdrsize and layout number as follows: + * 16 10 0 + * +--------+-------+ + * | hdrsz |layout | + * +--------+-------+ + * + * Bits 0-10 are the layout number + * Bits 11-16 are the size of the header. + * The hdrsize is the number * 8 + * + * For example. + * hdrsz of 1 ==> 8 byte header + * 2 ==> 16 byte header + * + */ + uint16_t sa_layout_info; uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */ /* ... Data follows the lengths. */ } sa_hdr_phys_t; -/* - * sa_hdr_phys -> sa_layout_info - * - * 16 10 0 - * +--------+-------+ - * | hdrsz |layout | - * +--------+-------+ - * - * Bits 0-10 are the layout number - * Bits 11-16 are the size of the header. - * The hdrsize is the number * 8 - * - * For example. - * hdrsz of 1 ==> 8 byte header - * 2 ==> 16 byte header - * - */ - #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ Modified: 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/spa_impl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -242,7 +242,7 @@ struct spa { uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* - * spa_refcnt & spa_config_lock must be the last elements + * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. * In order for the MDB module to function correctly, the other * fields must remain in the same location. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:05:59 2013 (r252751) @@ -94,7 +94,6 @@ struct space_map_ops { * 63 62 60 59 50 49 0 * * - * * non-debug entry * * 1 47 1 15 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:05:59 2013 (r252751) @@ -26,8 +26,6 @@ #ifndef _SYS_UNIQUE_H #define _SYS_UNIQUE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus @@ -42,7 +40,7 @@ void unique_fini(void); /* * Return a new unique value (which will not be uniquified against until - * it is unique_insert()-ed. + * it is unique_insert()-ed). */ uint64_t unique_create(void); Modified: 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/vdev_impl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -247,12 +247,13 @@ typedef struct vdev_label { #define VDD_METASLAB 0x01 #define VDD_DTL 0x02 +/* Offset of embedded boot loader region on each label */ +#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) /* - * Size and offset of embedded boot loader region on each label. + * Size of embedded boot loader region on each label. * The total size of the first two labels plus the boot area is 4MB. */ -#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) -#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ +#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ /* * Size of label regions at the start and end of each leaf device. @@ -323,8 +324,9 @@ extern uint64_t vdev_get_min_asize(vdev_ extern void vdev_set_min_asize(vdev_t *vd); /* - * zdb uses this tunable, so it must be declared here to make lint happy. + * Global variables */ +/* zdb uses this tunable, so it must be declared here to make lint happy. */ extern int zfs_vdev_cache_size; #ifdef __cplusplus Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:05:59 2013 (r252751) @@ -86,18 +86,22 @@ extern "C" { #endif /* - * The matchtype specifies which entry will be accessed. - * MT_EXACT: only find an exact match (non-normalized) - * MT_FIRST: find the "first" normalized (case and Unicode - * form) match; the designated "first" match will not change as long - * as the set of entries with this normalization doesn't change - * MT_BEST: if there is an exact match, find that, otherwise find the - * first normalized match + * Specifies matching criteria for ZAP lookups. */ typedef enum matchtype { + /* Only find an exact match (non-normalized) */ MT_EXACT, + /* + * If there is an exact match, find that, otherwise find the + * first normalized match. + */ MT_BEST, + /* + * Find the "first" normalized (case and Unicode form) match; + * the designated "first" match will not change as long as the + * set of entries with this normalization doesn't change. + */ MT_FIRST } matchtype_t; @@ -174,16 +178,21 @@ int zap_destroy(objset_t *ds, uint64_t z * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer - * size, the call will succeed and return 0. * When converting to a - * larger integer size, the integers will be treated as unsigned (ie. no - * sign-extension will be performed). + * size, the call will succeed and return 0. + * + * When converting to a larger integer size, the integers will be treated as + * unsigned (ie. no sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. - * + */ +int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf); + +/* * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). @@ -191,8 +200,6 @@ int zap_destroy(objset_t *ds, uint64_t z * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ -int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, - uint64_t integer_size, uint64_t num_integers, void *buf); int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:05:59 2013 (r252751) @@ -101,6 +101,7 @@ typedef enum zap_chunk_type { */ typedef struct zap_leaf_phys { struct zap_leaf_header { + /* Public to ZAP */ uint64_t lh_block_type; /* ZBT_LEAF */ uint64_t lh_pad1; uint64_t lh_prefix; /* hash prefix of this leaf */ @@ -109,8 +110,7 @@ typedef struct zap_leaf_phys { uint16_t lh_nentries; /* number of entries */ uint16_t lh_prefix_len; /* num bits used to id this */ -/* above is accessable to zap, below is zap_leaf private */ - + /* Private to zap_leaf */ uint16_t lh_freelist; /* chunk head of free list */ uint8_t lh_flags; /* ZLF_* flags */ uint8_t lh_pad2[11]; @@ -161,13 +161,13 @@ typedef struct zap_leaf { typedef struct zap_entry_handle { - /* below is set by zap_leaf.c and is public to zap.c */ + /* Set by zap_leaf and public to ZAP */ uint64_t zeh_num_integers; uint64_t zeh_hash; uint32_t zeh_cd; uint8_t zeh_integer_size; - /* below is private to zap_leaf.c */ + /* Private to zap_leaf */ uint16_t zeh_fakechunk; uint16_t *zeh_chunkp; zap_leaf_t *zeh_leaf; @@ -202,7 +202,7 @@ extern int zap_entry_read_name(struct za /* * Replace the value of an existing entry. * - * zap_entry_update may fail if it runs out of space (ENOSPC). + * May fail if it runs out of space (ENOSPC). */ extern int zap_entry_update(zap_entry_handle_t *zeh, uint8_t integer_size, uint64_t num_integers, const void *buf); @@ -221,10 +221,7 @@ extern int zap_entry_create(zap_leaf_t * uint8_t integer_size, uint64_t num_integers, const void *buf, zap_entry_handle_t *zeh); -/* - * Return true if there are additional entries with the same normalized - * form. - */ +/* Determine whether there is another entry with the same normalized form. */ extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh, struct zap_name *zn, const char *name, struct zap *zap); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -45,7 +45,8 @@ struct znode_phys; #define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID /* - * ZFS ACLs are store in various forms. + * ZFS ACLs (Access Control Lists) are stored in various forms. + * * Files created with ACL version ZFS_ACL_VERSION_INITIAL * will all be created with fixed length ACEs of type * zfs_oldace_t. @@ -135,8 +136,8 @@ typedef struct acl_ops { size_t (*ace_size)(void *acep); /* how big is this ace */ size_t (*ace_abstract_size)(void); /* sizeof abstract entry */ int (*ace_mask_off)(void); /* off of access mask in ace */ + /* ptr to data if any */ int (*ace_data)(void *acep, void **datap); - /* ptr to data if any */ } acl_ops_t; /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:05:59 2013 (r252751) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -57,16 +55,14 @@ typedef struct rl { } rl_t; /* - * Lock a range (offset, length) as either shared (READER) - * or exclusive (WRITER or APPEND). APPEND is a special type that - * is converted to WRITER that specified to lock from the start of the - * end of file. zfs_range_lock() returns the range lock structure. + * Lock a range (offset, length) as either shared (RL_READER) + * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that + * is converted to RL_WRITER that specified to lock from the start of the + * end of file. Returns the range lock structure. */ rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); -/* - * Unlock range and destroy range lock structure. - */ +/* Unlock range and destroy range lock structure. */ void zfs_range_unlock(rl_t *rl); /* @@ -76,7 +72,8 @@ void zfs_range_unlock(rl_t *rl); void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); /* - * AVL comparison function used to compare range locks + * AVL comparison function used to order range locks + * Locks are ordered on the start offset of the range. */ int zfs_range_compare(const void *arg1, const void *arg2); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:05:59 2013 (r252751) @@ -135,8 +135,9 @@ extern "C" { #define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) -/* Path component length */ /* + * Path component length + * * The generic fs code uses MAXNAMELEN to represent * what the largest component length is. Unfortunately, * this length includes the terminating NULL. ZFS needs @@ -252,12 +253,7 @@ VTOZ(vnode_t *vp) #define VTOZ(VP) ((znode_t *)(VP)->v_data) #endif -/* - * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. - * ZFS_ENTER_NOERROR() is called when we can't return EIO. - * ZFS_EXIT() must be called before exitting the vop. - * ZFS_VERIFY_ZP() verifies the znode is valid. - */ +/* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ @@ -267,11 +263,14 @@ VTOZ(vnode_t *vp) } \ } +/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) +/* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +/* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ if ((zp)->z_sa_hdl == NULL) { \ ZFS_EXIT((zp)->z_zfsvfs); \ @@ -291,15 +290,14 @@ VTOZ(vnode_t *vp) #define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \ mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num))) -/* - * Macros to encode/decode ZFS stored time values from/to struct timespec - */ +/* Encode ZFS stored time values from a struct timespec */ #define ZFS_TIME_ENCODE(tp, stmp) \ { \ (stmp)[0] = (uint64_t)(tp)->tv_sec; \ (stmp)[1] = (uint64_t)(tp)->tv_nsec; \ } +/* Decode ZFS stored time values to a struct timespec */ #define ZFS_TIME_DECODE(tp, stmp) \ { \ (tp)->tv_sec = (time_t)(stmp)[0]; \ Modified: 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.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:05:59 2013 (r252751) @@ -242,6 +242,12 @@ typedef struct { * information needed for replaying the create. If the * file doesn't have any actual ACEs then the lr_aclcnt * would be zero. + * + * After lr_acl_flags, there are a lr_acl_bytes number of variable sized ace's. + * If create is also setting xvattr's, then acl data follows xvattr. + * If ACE FUIDs are needed then they will follow the xvattr_t. Following + * the FUIDs will be the domain table information. The FUIDs for the owner + * and group will be in lr_create. Name follows ACL data. */ typedef struct { lr_create_t lr_create; /* common create portion */ @@ -250,13 +256,6 @@ typedef struct { uint64_t lr_fuidcnt; /* number of real fuids */ uint64_t lr_acl_bytes; /* number of bytes in ACL */ uint64_t lr_acl_flags; /* ACL flags */ - /* lr_acl_bytes number of variable sized ace's follows */ - /* if create is also setting xvattr's, then acl data follows xvattr */ - /* if ACE FUIDs are needed then they will follow the xvattr_t */ - /* Following the FUIDs will be the domain table information. */ - /* The FUIDs for the owner and group will be in the lr_create */ - /* portion of the record. */ - /* name follows ACL data */ } lr_acl_create_t; typedef struct { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:05:59 2013 (r252751) @@ -36,11 +36,10 @@ extern "C" { #endif -/* - * Common signature for all zio compress/decompress functions. - */ +/* Common signature for all zio compress functions. */ typedef size_t zio_compress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); +/* Common signature for all zio decompress functions. */ typedef int zio_decompress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:05:59 2013 (r252751) @@ -570,8 +570,8 @@ txg_quiesce_thread(void *arg) /* * Delay this thread by 'ticks' if we are still in the open transaction - * group and there is already a waiting txg quiesing or quiesced. Abort - * the delay if this txg stalls or enters the quiesing state. + * group and there is already a waiting txg quiescing or quiesced. + * Abort the delay if this txg stalls or enters the quiescing state. */ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) @@ -579,7 +579,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, tx_state_t *tx = &dp->dp_tx; clock_t timeout = ddi_get_lbolt() + ticks; - /* don't delay if this txg could transition to quiesing immediately */ + /* don't delay if this txg could transition to quiescing immediately */ if (tx->tx_open_txg > txg || tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1) return; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:05:59 2013 (r252751) @@ -963,9 +963,11 @@ vdev_probe_done(zio_t *zio) } /* - * Determine whether this device is accessible by reading and writing - * to several known locations: the pad regions of each vdev label - * but the first (which we leave alone in case it contains a VTOC). + * Determine whether this device is accessible. + * + * Read and write to several known locations: the pad regions of each + * vdev label but the first, which we leave alone in case it contains + * a VTOC. */ zio_t * vdev_probe(vdev_t *vd, zio_t *zio) @@ -2191,10 +2193,12 @@ vdev_degrade(spa_t *spa, uint64_t guid, } /* - * Online the given vdev. If 'unspare' is set, it implies two things. First, - * any attached spare device should be detached when the device finishes - * resilvering. Second, the online should be treated like a 'test' online case, - * so no FMA events are generated if the device fails to open. + * Online the given vdev. + * + * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things. First, any attached + * spare device should be detached when the device finishes resilvering. + * Second, the online should be treated like a 'test' online case, so no FMA + * events are generated if the device fails to open. */ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:05:59 2013 (r252751) @@ -35,13 +35,14 @@ /* * These tunables are for performance analysis. */ + +/* The maximum number of I/Os concurrently pending to each device. */ +int zfs_vdev_max_pending = 10; + /* - * zfs_vdev_max_pending is the maximum number of i/os concurrently - * pending to each device. zfs_vdev_min_pending is the initial number - * of i/os pending to each device (before it starts ramping up to - * max_pending). + * The initial number of I/Os pending to each device, before it starts ramping + * up to zfs_vdev_max_pending. */ -int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:05:59 2013 (r252751) @@ -60,6 +60,7 @@ * o addition (+) is represented by a bitwise XOR * o subtraction (-) is therefore identical to addition: A + B = A - B * o multiplication of A by 2 is defined by the following bitwise expression: + * * (A * 2)_7 = A_6 * (A * 2)_6 = A_5 * (A * 2)_5 = A_4 @@ -118,7 +119,7 @@ typedef struct raidz_map { uint64_t rm_missingparity; /* Count of missing parity devices */ uint64_t rm_firstdatacol; /* First data column/parity count */ uint64_t rm_nskip; /* Skipped sectors for padding */ - uint64_t rm_skipstart; /* Column index of padding start */ + uint64_t rm_skipstart; /* Column index of padding start */ void *rm_datacopy; /* rm_asize-buffer of copied data */ uintptr_t rm_reports; /* # of referencing checksum reports */ uint8_t rm_freed; /* map no longer has referencing ZIO */ @@ -158,10 +159,7 @@ typedef struct raidz_map { */ int vdev_raidz_default_to_general; -/* - * These two tables represent powers and logs of 2 in the Galois field defined - * above. These values were computed by repeatedly multiplying by 2 as above. - */ +/* Powers of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_pow2[256] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, @@ -196,6 +194,7 @@ static const uint8_t vdev_raidz_pow2[256 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 }; +/* Logs of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_log2[256] = { 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1359,7 +1359,8 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; - } if (masks.deny1) { + } + if (masks.deny1) { zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; @@ -1767,7 +1768,7 @@ zfs_acl_ids_overquota(zfsvfs_t *zfsvfs, } /* - * Retrieve a files ACL + * Retrieve a file's ACL */ int zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -1922,7 +1923,7 @@ zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_ } /* - * Set a files ACL + * Set a file's ACL */ int zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -2355,6 +2356,7 @@ slow: /* * Determine whether Access should be granted/denied. + * * The least priv subsytem is always consulted as a basic privilege * can define any form of access. */ @@ -2560,7 +2562,6 @@ zfs_delete_final_check(znode_t *zp, znod * Determine whether Access should be granted/deny, without * consulting least priv subsystem. * - * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1234,6 +1234,7 @@ zfsctl_shares_readdir(ap) /* * pvp is the '.zfs' directory (zfsctl_node_t). + * * Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t). * * This function is the callback to create a GFS vnode for '.zfs/snapshot' Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:05:59 2013 (r252751) @@ -335,9 +335,7 @@ zfs_is_bootfs(const char *name) } /* - * zfs_earlier_version - * - * Return non-zero if the spa version is less than requested version. + * Return non-zero if the spa version is less than requested version. */ static int zfs_earlier_version(const char *name, int version) @@ -355,8 +353,6 @@ zfs_earlier_version(const char *name, in } /* - * zpl_earlier_version - * * Return TRUE if the ZPL version is less than requested version. */ static boolean_t @@ -3000,10 +2996,10 @@ zfs_create_cb(objset_t *os, void *arg, c /* * inputs: - * createprops list of properties requested by creator - * default_zplver zpl version to use if unspecified in createprops - * fuids_ok fuids allowed in this version of the spa? * os parent objset pointer (NULL if root fs) + * fuids_ok fuids allowed in this version of the spa? + * sa_ok SAs allowed in this version of the spa? + * createprops list of properties requested by creator * * outputs: * zplprops values for the zplprops we attach to the master node object Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:05:59 2013 (r252751) @@ -216,9 +216,8 @@ zfs_log_fuid_domains(zfs_fuid_info_t *fu } /* - * zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, - * TX_MKDIR_ATTR and TX_MKXATTR - * transactions. + * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and + * TK_MKXATTR transactions. * * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID * domain information appended prior to the name. In this case the @@ -345,7 +344,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. + * Handles both TX_REMOVE and TX_RMDIR transactions. */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -369,7 +368,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_link() handles TX_LINK transactions. + * Handles TX_LINK transactions. */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -392,7 +391,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *t } /* - * zfs_log_symlink() handles TX_SYMLINK transactions. + * Handles TX_SYMLINK transactions. */ void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -424,7 +423,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_rename() handles TX_RENAME transactions. + * Handles TX_RENAME transactions. */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -450,7 +449,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_write() handles TX_WRITE transactions. + * Handles TX_WRITE transactions. */ ssize_t zfs_immediate_write_sz = 32768; @@ -529,7 +528,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * } /* - * zfs_log_truncate() handles TX_TRUNCATE transactions. + * Handles TX_TRUNCATE transactions. */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -552,7 +551,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ } /* - * zfs_log_setattr() handles TX_SETATTR transactions. + * Handles TX_SETATTR transactions. */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -614,7 +613,7 @@ zfs_log_setattr(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_acl() handles TX_ACL transactions. + * Handles TX_ACL transactions. */ void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:05:59 2013 (r252751) @@ -28,7 +28,7 @@ /* * This file contains the code to implement file range locking in - * ZFS, although there isn't much specific to ZFS (all that comes to mind + * ZFS, although there isn't much specific to ZFS (all that comes to mind is * support for growing the blocksize). * * Interface Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -187,7 +187,7 @@ zfs_sa_set_scanstamp(znode_t *zp, xvattr /* * I'm not convinced we should do any of this upgrade. * since the SA code can read both old/new znode formats - * with probably little to know performance difference. + * with probably little to no performance difference. * * All new files will be created with the new format. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1341,13 +1341,12 @@ zfs_parse_bootfs(char *bpath, char *outp } /* - * zfs_check_global_label: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:06:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8371AFAC; Fri, 5 Jul 2013 03:06:44 +0000 (UTC) (envelope-from delphij@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 71C7B1CB4; Fri, 5 Jul 2013 03:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6536i89056140; Fri, 5 Jul 2013 03:06:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6536b50056092; Fri, 5 Jul 2013 03:06:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050306.r6536b50056092@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252752 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:06:44 -0000 Author: delphij Date: Fri Jul 5 03:06:36 2013 New Revision: 252752 URL: http://svnweb.freebsd.org/changeset/base/252752 Log: MFC r251631: illumos #3742 zfs comments need cleaner, more consistent style - Make more of ZFS's comments use a natural English writing flow. - Break up long paragraphs, fix various typos and spelling errors. - Don't prefix a function description with its name when the function definition immediately follows. - Remove useless comments. - Add extra whitespace where it makes the comments more readable. New comments were separated from this change and added in r251629. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , George Wilson , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:06:36 2013 (r252752) @@ -57,11 +57,11 @@ * tight. * * 3. The Megiddo and Modha model assumes a fixed page size. All - * elements of the cache are therefor exactly the same size. So + * elements of the cache are therefore exactly the same size. So * when adjusting the cache size following a cache miss, its simply * a matter of choosing a single page to evict. In our model, we * have variable sized cache blocks (rangeing from 512 bytes to - * 128K bytes). We therefor choose a set of blocks to evict to make + * 128K bytes). We therefore choose a set of blocks to evict to make * space for a cache miss that approximates as closely as possible * the space used by the new block. * @@ -76,7 +76,7 @@ * ways: 1) via a hash table lookup using the DVA as a key, * or 2) via one of the ARC lists. The arc_read() interface * uses method 1, while the internal arc algorithms for - * adjusting the cache use method 2. We therefor provide two + * adjusting the cache use method 2. We therefore provide two * types of locks: 1) the hash table lock array, and 2) the * arc list locks. * @@ -428,7 +428,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT(stat) (arc_stats.stat.value.ui64) #define ARCSTAT_INCR(stat, val) \ - atomic_add_64(&arc_stats.stat.value.ui64, (val)); + atomic_add_64(&arc_stats.stat.value.ui64, (val)) #define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) @@ -654,9 +654,7 @@ uint64_t zfs_crc64_table[256]; #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) -/* - * L2ARC Performance Tunables - */ +/* L2ARC Performance Tunables */ uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */ uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ @@ -3817,7 +3815,7 @@ arc_tempreserve_space(uint64_t reserve, /* * Writes will, almost always, require additional memory allocations - * in order to compress/encrypt/etc the data. We therefor need to + * in order to compress/encrypt/etc the data. We therefore need to * make sure that there is sufficient available memory for this. */ if (error = arc_memory_throttle(reserve, anon_size, txg)) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:06:36 2013 (r252752) @@ -43,7 +43,7 @@ * dsl_scan_sync. This allows the delete operation to finish without traversing * all the dataset's blocks. * - * Note that while bt_begin and bt_end are only ever incremented in this code + * Note that while bt_begin and bt_end are only ever incremented in this code, * they are effectively reset to 0 every time the entire bptree is freed because * the bptree's object is destroyed and re-created. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1808,14 +1808,16 @@ dnode_willuse_space(dnode_t *dn, int64_t } /* - * This function scans a block at the indicated "level" looking for - * a hole or data (depending on 'flags'). If level > 0, then we are - * scanning an indirect block looking at its pointers. If level == 0, - * then we are looking at a block of dnodes. If we don't find what we - * are looking for in the block, we return ESRCH. Otherwise, return - * with *offset pointing to the beginning (if searching forwards) or - * end (if searching backwards) of the range covered by the block - * pointer we matched on (or dnode). + * Scans a block at the indicated "level" looking for a hole or data, + * depending on 'flags'. + * + * If level > 0, then we are scanning an indirect block looking at its + * pointers. If level == 0, then we are looking at a block of dnodes. + * + * If we don't find what we are looking for in the block, we return ESRCH. + * Otherwise, return with *offset pointing to the beginning (if searching + * forwards) or end (if searching backwards) of the range covered by the + * block pointer we matched on (or dnode). * * The basic search algorithm used below by dnode_next_offset() is to * use this function to search up the block tree (widen the search) until Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:06:36 2013 (r252752) @@ -302,7 +302,7 @@ free_children(dmu_buf_impl_t *db, uint64 } /* - * free_range: Traverse the indicated range of the provided file + * Traverse the indicated range of the provided file * and "free" all the blocks contained there. */ static void @@ -370,7 +370,7 @@ dnode_sync_free_range(dnode_t *dn, uint6 } /* - * Try to kick all the dnodes dbufs out of the cache... + * Try to kick all the dnode's dbufs out of the cache... */ void dnode_evict_dbufs(dnode_t *dn) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:06:36 2013 (r252752) @@ -379,7 +379,7 @@ dsl_prop_predict(dsl_dir_t *dd, const ch /* * Unregister this callback. Return 0 on success, ENOENT if ddname is - * invalid, ENOMSG if no matching callback registered. + * invalid, or ENOMSG if no matching callback registered. */ int dsl_prop_unregister(dsl_dataset_t *ds, const char *propname, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -111,6 +111,7 @@ * location. * * Byteswap implications: + * * Since the SA attributes are not entirely self describing we can't do * the normal byteswap processing. The special ZAP layout attribute and * attribute registration attributes define the byteswap function and the @@ -189,7 +190,6 @@ sa_attr_reg_t sa_legacy_attrs[] = { }; /* - * ZPL legacy layout * This is only used for objects of type DMU_OT_ZNODE */ sa_attr_type_t sa_legacy_zpl_layout[] = { @@ -199,7 +199,6 @@ sa_attr_type_t sa_legacy_zpl_layout[] = /* * Special dummy layout used for buffers with no attributes. */ - sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; static int sa_legacy_attr_count = 16; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -4698,6 +4698,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui /* * Detach a device from a mirror or replacing vdev. + * * If 'replace_done' is specified, only detach if the parent * is a replacing vdev. */ @@ -5359,11 +5360,9 @@ spa_vdev_remove_from_namespace(spa_t *sp * the spa_vdev_config_[enter/exit] functions which allow us to * grab and release the spa_config_lock while still holding the namespace * lock. During each step the configuration is synced out. - */ - -/* - * Remove a device from the pool. Currently, this supports removing only hot - * spares, slogs, and level 2 ARC devices. + * + * Currently, this supports removing only hot spares, slogs, and level 2 ARC + * devices. */ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) @@ -5473,7 +5472,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Find any device that's done replacing, or a vdev marked 'unspare' that's - * current spared, so we can detach it. + * currently spared, so we can detach it. */ static vdev_t * spa_vdev_resilver_done_hunt(vdev_t *vd) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:06:36 2013 (r252752) @@ -307,6 +307,7 @@ spa_config_set(spa_t *spa, nvlist_t *con /* * Generate the pool's configuration based on the current in-core state. + * * We infer whether to generate a complete config or just one top-level config * based on whether vd is the root vdev. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1369,7 +1369,7 @@ zfs_panic_recover(const char *fmt, ...) /* * This is a stripped-down version of strtoull, suitable only for converting - * lowercase hexidecimal numbers that don't overflow. + * lowercase hexadecimal numbers that don't overflow. */ uint64_t zfs_strtonum(const char *str, char **nptr) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:06:36 2013 (r252752) @@ -63,16 +63,15 @@ enum ddt_class { */ typedef struct ddt_key { zio_cksum_t ddk_cksum; /* 256-bit block checksum */ - uint64_t ddk_prop; /* LSIZE, PSIZE, compression */ + /* + * Encoded with logical & physical size, and compression, as follows: + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * | 0 | 0 | 0 | comp | PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + */ + uint64_t ddk_prop; } ddt_key_t; -/* - * ddk_prop layout: - * - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | 0 | 0 | 0 | comp | PSIZE | LSIZE | - * +-------+-------+-------+-------+-------+-------+-------+-------+ - */ #define DDK_GET_LSIZE(ddk) \ BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1) #define DDK_SET_LSIZE(ddk, x) \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:06:36 2013 (r252752) @@ -145,9 +145,8 @@ typedef struct dnode_phys { typedef struct dnode { /* - * dn_struct_rwlock protects the structure of the dnode, - * including the number of levels of indirection (dn_nlevels), - * dn_maxblkid, and dn_next_* + * Protects the structure of the dnode, including the number of levels + * of indirection (dn_nlevels), dn_maxblkid, and dn_next_* */ krwlock_t dn_struct_rwlock; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:06:36 2013 (r252752) @@ -110,6 +110,7 @@ typedef struct dsl_pool { /* * Protects administrative changes (properties, namespace) + * * It is only held for write in syncing context. Therefore * syncing context does not need to ever have it for read, since * nobody else could possibly have it for write. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -150,6 +150,7 @@ struct sa_os { /* * header for all bonus and spill buffers. + * * The header has a fixed portion with a variable number * of "lengths" depending on the number of variable sized * attribues which are determined by the "layout number" @@ -158,29 +159,27 @@ struct sa_os { #define SA_MAGIC 0x2F505A /* ZFS SA */ typedef struct sa_hdr_phys { uint32_t sa_magic; - uint16_t sa_layout_info; /* Encoded with hdrsize and layout number */ + /* + * Encoded with hdrsize and layout number as follows: + * 16 10 0 + * +--------+-------+ + * | hdrsz |layout | + * +--------+-------+ + * + * Bits 0-10 are the layout number + * Bits 11-16 are the size of the header. + * The hdrsize is the number * 8 + * + * For example. + * hdrsz of 1 ==> 8 byte header + * 2 ==> 16 byte header + * + */ + uint16_t sa_layout_info; uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */ /* ... Data follows the lengths. */ } sa_hdr_phys_t; -/* - * sa_hdr_phys -> sa_layout_info - * - * 16 10 0 - * +--------+-------+ - * | hdrsz |layout | - * +--------+-------+ - * - * Bits 0-10 are the layout number - * Bits 11-16 are the size of the header. - * The hdrsize is the number * 8 - * - * For example. - * hdrsz of 1 ==> 8 byte header - * 2 ==> 16 byte header - * - */ - #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -242,7 +242,7 @@ struct spa { uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* - * spa_refcnt & spa_config_lock must be the last elements + * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. * In order for the MDB module to function correctly, the other * fields must remain in the same location. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:06:36 2013 (r252752) @@ -94,7 +94,6 @@ struct space_map_ops { * 63 62 60 59 50 49 0 * * - * * non-debug entry * * 1 47 1 15 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:06:36 2013 (r252752) @@ -26,8 +26,6 @@ #ifndef _SYS_UNIQUE_H #define _SYS_UNIQUE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus @@ -42,7 +40,7 @@ void unique_fini(void); /* * Return a new unique value (which will not be uniquified against until - * it is unique_insert()-ed. + * it is unique_insert()-ed). */ uint64_t unique_create(void); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -247,12 +247,13 @@ typedef struct vdev_label { #define VDD_METASLAB 0x01 #define VDD_DTL 0x02 +/* Offset of embedded boot loader region on each label */ +#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) /* - * Size and offset of embedded boot loader region on each label. + * Size of embedded boot loader region on each label. * The total size of the first two labels plus the boot area is 4MB. */ -#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) -#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ +#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ /* * Size of label regions at the start and end of each leaf device. @@ -323,8 +324,9 @@ extern uint64_t vdev_get_min_asize(vdev_ extern void vdev_set_min_asize(vdev_t *vd); /* - * zdb uses this tunable, so it must be declared here to make lint happy. + * Global variables */ +/* zdb uses this tunable, so it must be declared here to make lint happy. */ extern int zfs_vdev_cache_size; #ifdef __cplusplus Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:06:36 2013 (r252752) @@ -86,18 +86,22 @@ extern "C" { #endif /* - * The matchtype specifies which entry will be accessed. - * MT_EXACT: only find an exact match (non-normalized) - * MT_FIRST: find the "first" normalized (case and Unicode - * form) match; the designated "first" match will not change as long - * as the set of entries with this normalization doesn't change - * MT_BEST: if there is an exact match, find that, otherwise find the - * first normalized match + * Specifies matching criteria for ZAP lookups. */ typedef enum matchtype { + /* Only find an exact match (non-normalized) */ MT_EXACT, + /* + * If there is an exact match, find that, otherwise find the + * first normalized match. + */ MT_BEST, + /* + * Find the "first" normalized (case and Unicode form) match; + * the designated "first" match will not change as long as the + * set of entries with this normalization doesn't change. + */ MT_FIRST } matchtype_t; @@ -174,16 +178,21 @@ int zap_destroy(objset_t *ds, uint64_t z * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer - * size, the call will succeed and return 0. * When converting to a - * larger integer size, the integers will be treated as unsigned (ie. no - * sign-extension will be performed). + * size, the call will succeed and return 0. + * + * When converting to a larger integer size, the integers will be treated as + * unsigned (ie. no sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. - * + */ +int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf); + +/* * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). @@ -191,8 +200,6 @@ int zap_destroy(objset_t *ds, uint64_t z * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ -int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, - uint64_t integer_size, uint64_t num_integers, void *buf); int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:06:36 2013 (r252752) @@ -101,6 +101,7 @@ typedef enum zap_chunk_type { */ typedef struct zap_leaf_phys { struct zap_leaf_header { + /* Public to ZAP */ uint64_t lh_block_type; /* ZBT_LEAF */ uint64_t lh_pad1; uint64_t lh_prefix; /* hash prefix of this leaf */ @@ -109,8 +110,7 @@ typedef struct zap_leaf_phys { uint16_t lh_nentries; /* number of entries */ uint16_t lh_prefix_len; /* num bits used to id this */ -/* above is accessable to zap, below is zap_leaf private */ - + /* Private to zap_leaf */ uint16_t lh_freelist; /* chunk head of free list */ uint8_t lh_flags; /* ZLF_* flags */ uint8_t lh_pad2[11]; @@ -161,13 +161,13 @@ typedef struct zap_leaf { typedef struct zap_entry_handle { - /* below is set by zap_leaf.c and is public to zap.c */ + /* Set by zap_leaf and public to ZAP */ uint64_t zeh_num_integers; uint64_t zeh_hash; uint32_t zeh_cd; uint8_t zeh_integer_size; - /* below is private to zap_leaf.c */ + /* Private to zap_leaf */ uint16_t zeh_fakechunk; uint16_t *zeh_chunkp; zap_leaf_t *zeh_leaf; @@ -202,7 +202,7 @@ extern int zap_entry_read_name(struct za /* * Replace the value of an existing entry. * - * zap_entry_update may fail if it runs out of space (ENOSPC). + * May fail if it runs out of space (ENOSPC). */ extern int zap_entry_update(zap_entry_handle_t *zeh, uint8_t integer_size, uint64_t num_integers, const void *buf); @@ -221,10 +221,7 @@ extern int zap_entry_create(zap_leaf_t * uint8_t integer_size, uint64_t num_integers, const void *buf, zap_entry_handle_t *zeh); -/* - * Return true if there are additional entries with the same normalized - * form. - */ +/* Determine whether there is another entry with the same normalized form. */ extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh, struct zap_name *zn, const char *name, struct zap *zap); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -45,7 +45,8 @@ struct znode_phys; #define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID /* - * ZFS ACLs are store in various forms. + * ZFS ACLs (Access Control Lists) are stored in various forms. + * * Files created with ACL version ZFS_ACL_VERSION_INITIAL * will all be created with fixed length ACEs of type * zfs_oldace_t. @@ -135,8 +136,8 @@ typedef struct acl_ops { size_t (*ace_size)(void *acep); /* how big is this ace */ size_t (*ace_abstract_size)(void); /* sizeof abstract entry */ int (*ace_mask_off)(void); /* off of access mask in ace */ + /* ptr to data if any */ int (*ace_data)(void *acep, void **datap); - /* ptr to data if any */ } acl_ops_t; /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:06:36 2013 (r252752) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -57,16 +55,14 @@ typedef struct rl { } rl_t; /* - * Lock a range (offset, length) as either shared (READER) - * or exclusive (WRITER or APPEND). APPEND is a special type that - * is converted to WRITER that specified to lock from the start of the - * end of file. zfs_range_lock() returns the range lock structure. + * Lock a range (offset, length) as either shared (RL_READER) + * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that + * is converted to RL_WRITER that specified to lock from the start of the + * end of file. Returns the range lock structure. */ rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); -/* - * Unlock range and destroy range lock structure. - */ +/* Unlock range and destroy range lock structure. */ void zfs_range_unlock(rl_t *rl); /* @@ -76,7 +72,8 @@ void zfs_range_unlock(rl_t *rl); void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); /* - * AVL comparison function used to compare range locks + * AVL comparison function used to order range locks + * Locks are ordered on the start offset of the range. */ int zfs_range_compare(const void *arg1, const void *arg2); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:06:36 2013 (r252752) @@ -135,8 +135,9 @@ extern "C" { #define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) -/* Path component length */ /* + * Path component length + * * The generic fs code uses MAXNAMELEN to represent * what the largest component length is. Unfortunately, * this length includes the terminating NULL. ZFS needs @@ -252,12 +253,7 @@ VTOZ(vnode_t *vp) #define VTOZ(VP) ((znode_t *)(VP)->v_data) #endif -/* - * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. - * ZFS_ENTER_NOERROR() is called when we can't return EIO. - * ZFS_EXIT() must be called before exitting the vop. - * ZFS_VERIFY_ZP() verifies the znode is valid. - */ +/* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ @@ -267,11 +263,14 @@ VTOZ(vnode_t *vp) } \ } +/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) +/* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +/* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ if ((zp)->z_sa_hdl == NULL) { \ ZFS_EXIT((zp)->z_zfsvfs); \ @@ -291,15 +290,14 @@ VTOZ(vnode_t *vp) #define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \ mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num))) -/* - * Macros to encode/decode ZFS stored time values from/to struct timespec - */ +/* Encode ZFS stored time values from a struct timespec */ #define ZFS_TIME_ENCODE(tp, stmp) \ { \ (stmp)[0] = (uint64_t)(tp)->tv_sec; \ (stmp)[1] = (uint64_t)(tp)->tv_nsec; \ } +/* Decode ZFS stored time values to a struct timespec */ #define ZFS_TIME_DECODE(tp, stmp) \ { \ (tp)->tv_sec = (time_t)(stmp)[0]; \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:06:36 2013 (r252752) @@ -242,6 +242,12 @@ typedef struct { * information needed for replaying the create. If the * file doesn't have any actual ACEs then the lr_aclcnt * would be zero. + * + * After lr_acl_flags, there are a lr_acl_bytes number of variable sized ace's. + * If create is also setting xvattr's, then acl data follows xvattr. + * If ACE FUIDs are needed then they will follow the xvattr_t. Following + * the FUIDs will be the domain table information. The FUIDs for the owner + * and group will be in lr_create. Name follows ACL data. */ typedef struct { lr_create_t lr_create; /* common create portion */ @@ -250,13 +256,6 @@ typedef struct { uint64_t lr_fuidcnt; /* number of real fuids */ uint64_t lr_acl_bytes; /* number of bytes in ACL */ uint64_t lr_acl_flags; /* ACL flags */ - /* lr_acl_bytes number of variable sized ace's follows */ - /* if create is also setting xvattr's, then acl data follows xvattr */ - /* if ACE FUIDs are needed then they will follow the xvattr_t */ - /* Following the FUIDs will be the domain table information. */ - /* The FUIDs for the owner and group will be in the lr_create */ - /* portion of the record. */ - /* name follows ACL data */ } lr_acl_create_t; typedef struct { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:06:36 2013 (r252752) @@ -36,11 +36,10 @@ extern "C" { #endif -/* - * Common signature for all zio compress/decompress functions. - */ +/* Common signature for all zio compress functions. */ typedef size_t zio_compress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); +/* Common signature for all zio decompress functions. */ typedef int zio_decompress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:06:36 2013 (r252752) @@ -501,8 +501,8 @@ txg_quiesce_thread(void *arg) /* * Delay this thread by 'ticks' if we are still in the open transaction - * group and there is already a waiting txg quiesing or quiesced. Abort - * the delay if this txg stalls or enters the quiesing state. + * group and there is already a waiting txg quiescing or quiesced. + * Abort the delay if this txg stalls or enters the quiescing state. */ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) @@ -510,7 +510,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, tx_state_t *tx = &dp->dp_tx; clock_t timeout = ddi_get_lbolt() + ticks; - /* don't delay if this txg could transition to quiesing immediately */ + /* don't delay if this txg could transition to quiescing immediately */ if (tx->tx_open_txg > txg || tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1) return; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:06:36 2013 (r252752) @@ -963,9 +963,11 @@ vdev_probe_done(zio_t *zio) } /* - * Determine whether this device is accessible by reading and writing - * to several known locations: the pad regions of each vdev label - * but the first (which we leave alone in case it contains a VTOC). + * Determine whether this device is accessible. + * + * Read and write to several known locations: the pad regions of each + * vdev label but the first, which we leave alone in case it contains + * a VTOC. */ zio_t * vdev_probe(vdev_t *vd, zio_t *zio) @@ -2191,10 +2193,12 @@ vdev_degrade(spa_t *spa, uint64_t guid, } /* - * Online the given vdev. If 'unspare' is set, it implies two things. First, - * any attached spare device should be detached when the device finishes - * resilvering. Second, the online should be treated like a 'test' online case, - * so no FMA events are generated if the device fails to open. + * Online the given vdev. + * + * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things. First, any attached + * spare device should be detached when the device finishes resilvering. + * Second, the online should be treated like a 'test' online case, so no FMA + * events are generated if the device fails to open. */ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:06:36 2013 (r252752) @@ -35,13 +35,14 @@ /* * These tunables are for performance analysis. */ + +/* The maximum number of I/Os concurrently pending to each device. */ +int zfs_vdev_max_pending = 10; + /* - * zfs_vdev_max_pending is the maximum number of i/os concurrently - * pending to each device. zfs_vdev_min_pending is the initial number - * of i/os pending to each device (before it starts ramping up to - * max_pending). + * The initial number of I/Os pending to each device, before it starts ramping + * up to zfs_vdev_max_pending. */ -int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:06:36 2013 (r252752) @@ -60,6 +60,7 @@ * o addition (+) is represented by a bitwise XOR * o subtraction (-) is therefore identical to addition: A + B = A - B * o multiplication of A by 2 is defined by the following bitwise expression: + * * (A * 2)_7 = A_6 * (A * 2)_6 = A_5 * (A * 2)_5 = A_4 @@ -118,7 +119,7 @@ typedef struct raidz_map { uint64_t rm_missingparity; /* Count of missing parity devices */ uint64_t rm_firstdatacol; /* First data column/parity count */ uint64_t rm_nskip; /* Skipped sectors for padding */ - uint64_t rm_skipstart; /* Column index of padding start */ + uint64_t rm_skipstart; /* Column index of padding start */ void *rm_datacopy; /* rm_asize-buffer of copied data */ uintptr_t rm_reports; /* # of referencing checksum reports */ uint8_t rm_freed; /* map no longer has referencing ZIO */ @@ -158,10 +159,7 @@ typedef struct raidz_map { */ int vdev_raidz_default_to_general; -/* - * These two tables represent powers and logs of 2 in the Galois field defined - * above. These values were computed by repeatedly multiplying by 2 as above. - */ +/* Powers of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_pow2[256] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, @@ -196,6 +194,7 @@ static const uint8_t vdev_raidz_pow2[256 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 }; +/* Logs of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_log2[256] = { 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1359,7 +1359,8 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; - } if (masks.deny1) { + } + if (masks.deny1) { zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; @@ -1767,7 +1768,7 @@ zfs_acl_ids_overquota(zfsvfs_t *zfsvfs, } /* - * Retrieve a files ACL + * Retrieve a file's ACL */ int zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -1922,7 +1923,7 @@ zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_ } /* - * Set a files ACL + * Set a file's ACL */ int zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -2355,6 +2356,7 @@ slow: /* * Determine whether Access should be granted/denied. + * * The least priv subsytem is always consulted as a basic privilege * can define any form of access. */ @@ -2560,7 +2562,6 @@ zfs_delete_final_check(znode_t *zp, znod * Determine whether Access should be granted/deny, without * consulting least priv subsystem. * - * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1234,6 +1234,7 @@ zfsctl_shares_readdir(ap) /* * pvp is the '.zfs' directory (zfsctl_node_t). + * * Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t). * * This function is the callback to create a GFS vnode for '.zfs/snapshot' Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:06:36 2013 (r252752) @@ -335,9 +335,7 @@ zfs_is_bootfs(const char *name) } /* - * zfs_earlier_version - * - * Return non-zero if the spa version is less than requested version. + * Return non-zero if the spa version is less than requested version. */ static int zfs_earlier_version(const char *name, int version) @@ -355,8 +353,6 @@ zfs_earlier_version(const char *name, in } /* - * zpl_earlier_version - * * Return TRUE if the ZPL version is less than requested version. */ static boolean_t @@ -3000,10 +2996,10 @@ zfs_create_cb(objset_t *os, void *arg, c /* * inputs: - * createprops list of properties requested by creator - * default_zplver zpl version to use if unspecified in createprops - * fuids_ok fuids allowed in this version of the spa? * os parent objset pointer (NULL if root fs) + * fuids_ok fuids allowed in this version of the spa? + * sa_ok SAs allowed in this version of the spa? + * createprops list of properties requested by creator * * outputs: * zplprops values for the zplprops we attach to the master node object Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:06:36 2013 (r252752) @@ -216,9 +216,8 @@ zfs_log_fuid_domains(zfs_fuid_info_t *fu } /* - * zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, - * TX_MKDIR_ATTR and TX_MKXATTR - * transactions. + * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and + * TK_MKXATTR transactions. * * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID * domain information appended prior to the name. In this case the @@ -345,7 +344,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. + * Handles both TX_REMOVE and TX_RMDIR transactions. */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -369,7 +368,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_link() handles TX_LINK transactions. + * Handles TX_LINK transactions. */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -392,7 +391,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *t } /* - * zfs_log_symlink() handles TX_SYMLINK transactions. + * Handles TX_SYMLINK transactions. */ void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -424,7 +423,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_rename() handles TX_RENAME transactions. + * Handles TX_RENAME transactions. */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -450,7 +449,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_write() handles TX_WRITE transactions. + * Handles TX_WRITE transactions. */ ssize_t zfs_immediate_write_sz = 32768; @@ -529,7 +528,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * } /* - * zfs_log_truncate() handles TX_TRUNCATE transactions. + * Handles TX_TRUNCATE transactions. */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -552,7 +551,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ } /* - * zfs_log_setattr() handles TX_SETATTR transactions. + * Handles TX_SETATTR transactions. */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -614,7 +613,7 @@ zfs_log_setattr(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_acl() handles TX_ACL transactions. + * Handles TX_ACL transactions. */ void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:06:36 2013 (r252752) @@ -28,7 +28,7 @@ /* * This file contains the code to implement file range locking in - * ZFS, although there isn't much specific to ZFS (all that comes to mind + * ZFS, although there isn't much specific to ZFS (all that comes to mind is * support for growing the blocksize). * * Interface Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -187,7 +187,7 @@ zfs_sa_set_scanstamp(znode_t *zp, xvattr /* * I'm not convinced we should do any of this upgrade. * since the SA code can read both old/new znode formats - * with probably little to know performance difference. + * with probably little to no performance difference. * * All new files will be created with the new format. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1340,13 +1340,12 @@ zfs_parse_bootfs(char *bpath, char *outp } /* - * zfs_check_global_label: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:12:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B62C1B5; Fri, 5 Jul 2013 03:12:30 +0000 (UTC) (envelope-from dteske@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 0D28B1CEA; Fri, 5 Jul 2013 03:12:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653CTcp058697; Fri, 5 Jul 2013 03:12:29 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653CTNe058696; Fri, 5 Jul 2013 03:12:29 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050312.r653CTNe058696@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 03:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252753 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:12:30 -0000 Author: dteske Date: Fri Jul 5 03:12:29 2013 New Revision: 252753 URL: http://svnweb.freebsd.org/changeset/base/252753 Log: Fix a typo in a comment. Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 03:06:36 2013 (r252752) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Fri Jul 5 03:12:29 2013 (r252753) @@ -244,7 +244,7 @@ f_index_extract_pages() # f_index_search $var_to_get $name [$var_to_set] # -# Search the package INDEX ($PACKAGE_INDEX by default if/when $var_to)get is +# Search the package INDEX ($PACKAGE_INDEX by default if/when $var_to_get is # NULL; but should not be missing) for $name, returning the first match. # Matches are strict (not regular expressions) and must match the beginning # portion of the package name to be considered a match. If $var_to_set is From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:38:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C7F29D4; Fri, 5 Jul 2013 03:38:07 +0000 (UTC) (envelope-from delphij@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 0E8441E40; Fri, 5 Jul 2013 03:38:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653c68g065007; Fri, 5 Jul 2013 03:38:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653c6Pt065004; Fri, 5 Jul 2013 03:38:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050338.r653c6Pt065004@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:38:06 +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: r252754 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:38:07 -0000 Author: delphij Date: Fri Jul 5 03:38:06 2013 New Revision: 252754 URL: http://svnweb.freebsd.org/changeset/base/252754 Log: MFC r251632: illumos #3743 zfs needs a refcount audit Audit zap cursor usage and correct missing calls to zap_cursor_fini(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to close a cursor prior to returning. Submitted by: gibbs Audit holders of dmu_bufs and correct missing calls to dmu_buf_rele(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to release a dmu_buf prior to returning. Submitted by: will Reviewed by: Matthew Ahrens , Eric Schrock , George Wilson , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.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/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:38:06 2013 (r252754) @@ -361,8 +361,10 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) + if (doi.doi_type != DMU_OT_DSL_DATASET) { + dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); + } ds = dmu_buf_get_user(dbuf); if (ds == NULL) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:06 2013 (r252754) @@ -183,8 +183,10 @@ process_error_log(spa_t *spa, uint64_t o if (copyout(&zb, (char *)addr + (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) + sizeof (zbookmark_t)) != 0) { + zap_cursor_fini(&zc); return (SET_ERROR(EFAULT)); + } *count -= 1; } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:06 2013 (r252754) @@ -295,7 +295,8 @@ zap_table_load(zap_t *zap, zap_table_phy err = dmu_buf_hold(zap->zap_objset, zap->zap_object, (tbl->zt_nextblk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); - dmu_buf_rele(db, FTAG); + if (err == 0) + dmu_buf_rele(db, FTAG); } return (err); } @@ -992,18 +993,21 @@ zap_join(objset_t *os, uint64_t fromobj, zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &za.za_first_integer, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1014,18 +1018,21 @@ zap_join_key(objset_t *os, uint64_t from zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &value, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1036,24 +1043,27 @@ zap_join_increment(objset_t *os, uint64_ zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { uint64_t delta = 0; - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_lookup(os, intoobj, za.za_name, 8, 1, &delta); if (err != 0 && err != ENOENT) - return (err); + break; delta += za.za_first_integer; err = zap_update(os, intoobj, za.za_name, 8, 1, &delta, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:38:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10E29B02; Fri, 5 Jul 2013 03:38:55 +0000 (UTC) (envelope-from delphij@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 E6EE71E49; Fri, 5 Jul 2013 03:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653cstB065126; Fri, 5 Jul 2013 03:38:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653csJ2065123; Fri, 5 Jul 2013 03:38:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050338.r653csJ2065123@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252755 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:38:55 -0000 Author: delphij Date: Fri Jul 5 03:38:53 2013 New Revision: 252755 URL: http://svnweb.freebsd.org/changeset/base/252755 Log: MFC r251632: illumos #3743 zfs needs a refcount audit Audit zap cursor usage and correct missing calls to zap_cursor_fini(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to close a cursor prior to returning. Submitted by: gibbs Audit holders of dmu_bufs and correct missing calls to dmu_buf_rele(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to release a dmu_buf prior to returning. Submitted by: will Reviewed by: Matthew Ahrens , Eric Schrock , George Wilson , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:38:53 2013 (r252755) @@ -361,8 +361,10 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) + if (doi.doi_type != DMU_OT_DSL_DATASET) { + dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); + } ds = dmu_buf_get_user(dbuf); if (ds == NULL) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:53 2013 (r252755) @@ -183,8 +183,10 @@ process_error_log(spa_t *spa, uint64_t o if (copyout(&zb, (char *)addr + (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) + sizeof (zbookmark_t)) != 0) { + zap_cursor_fini(&zc); return (SET_ERROR(EFAULT)); + } *count -= 1; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:53 2013 (r252755) @@ -295,7 +295,8 @@ zap_table_load(zap_t *zap, zap_table_phy err = dmu_buf_hold(zap->zap_objset, zap->zap_object, (tbl->zt_nextblk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); - dmu_buf_rele(db, FTAG); + if (err == 0) + dmu_buf_rele(db, FTAG); } return (err); } @@ -992,18 +993,21 @@ zap_join(objset_t *os, uint64_t fromobj, zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &za.za_first_integer, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1014,18 +1018,21 @@ zap_join_key(objset_t *os, uint64_t from zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &value, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1036,24 +1043,27 @@ zap_join_increment(objset_t *os, uint64_ zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { uint64_t delta = 0; - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_lookup(os, intoobj, za.za_name, 8, 1, &delta); if (err != 0 && err != ENOENT) - return (err); + break; delta += za.za_first_integer; err = zap_update(os, intoobj, za.za_name, 8, 1, &delta, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:44:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50FB8C66; Fri, 5 Jul 2013 03:44:09 +0000 (UTC) (envelope-from delphij@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 336321E6E; Fri, 5 Jul 2013 03:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653i9bB067428; Fri, 5 Jul 2013 03:44:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653i891067425; Fri, 5 Jul 2013 03:44:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050344.r653i891067425@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:44:08 +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: r252756 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:44:09 -0000 Author: delphij Date: Fri Jul 5 03:44:08 2013 New Revision: 252756 URL: http://svnweb.freebsd.org/changeset/base/252756 Log: MFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting snapshots Propagate errors from zfs_unmount_snap() up to its callers wherever feasible. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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/dsl_userhold.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:44:08 2013 (r252756) @@ -433,7 +433,7 @@ dsl_dataset_user_release_tmp(dsl_pool_t dsl_dataset_name(ds, name); dsl_dataset_rele(ds, FTAG); dsl_pool_config_exit(dp, FTAG); - zfs_unmount_snap(name); + (void) zfs_unmount_snap(name); } else { dsl_pool_config_exit(dp, FTAG); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:08 2013 (r252756) @@ -360,7 +360,7 @@ extern int zfs_secpolicy_rename_perms(co const char *to, cred_t *cr); extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); extern int zfs_busy(void); -extern void zfs_unmount_snap(const char *); +extern int zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:08 2013 (r252756) @@ -3405,28 +3405,31 @@ zfs_ioc_log_history(const char *unused, * * This function is best-effort. Callers must deal gracefully if it * remains mounted (or is remounted after this call). + * + * Returns 0 if the argument is not a snapshot, or it is not currently a + * filesystem, or we were able to unmount it. Returns error code otherwise. */ -void +int zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; + int err; if (strchr(snapname, '@') == NULL) - return; + return (0); vfsp = zfs_get_vfs(snapname); if (vfsp == NULL) - return; + return (0); zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - if (vn_vfswlock(vfsp->vfs_vnodecovered) != 0) { - VFS_RELE(vfsp); - return; - } + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); + if (err != 0) + return (SET_ERROR(err)); /* * Always force the unmount for snapshots. @@ -3436,17 +3439,17 @@ zfs_unmount_snap(const char *snapname) (void) dounmount(vfsp, MS_FORCE, kcred); #else mtx_lock(&Giant); /* dounmount() */ - dounmount(vfsp, MS_FORCE, curthread); + (void) dounmount(vfsp, MS_FORCE, curthread); mtx_unlock(&Giant); /* dounmount() */ #endif + return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - zfs_unmount_snap(snapname); - return (0); + return (zfs_unmount_snap(snapname)); } /* @@ -3469,7 +3472,7 @@ zfs_destroy_unmount_origin(const char *f char originname[MAXNAMELEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - zfs_unmount_snap(originname); + (void) zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3487,7 +3490,7 @@ zfs_destroy_unmount_origin(const char *f static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { - int poollen; + int error, poollen; nvlist_t *snaps; nvpair_t *pair; boolean_t defer; @@ -3508,7 +3511,9 @@ zfs_ioc_destroy_snaps(const char *poolna (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - zfs_unmount_snap(name); + error = zfs_unmount_snap(name); + if (error != 0) + return (error); (void) zvol_remove_minor(name); } @@ -3527,8 +3532,12 @@ static int zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (strchr(zc->zc_name, '@') && zc->zc_objset_type == DMU_OST_ZFS) - zfs_unmount_snap(zc->zc_name); + + if (zc->zc_objset_type == DMU_OST_ZFS) { + err = zfs_unmount_snap(zc->zc_name); + if (err != 0) + return (err); + } if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3574,8 +3583,7 @@ recursive_unmount(const char *fsname, vo char fullname[MAXNAMELEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - zfs_unmount_snap(fullname); - return (0); + return (zfs_unmount_snap(fullname)); } /* @@ -5071,14 +5079,18 @@ static int zfs_ioc_release(const char *pool, nvlist_t *holds, nvlist_t *errlist) { nvpair_t *pair; + int err; /* * The release may cause the snapshot to be destroyed; make sure it * is not mounted. */ for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(holds, pair)) - zfs_unmount_snap(nvpair_name(pair)); + pair = nvlist_next_nvpair(holds, pair)) { + err = zfs_unmount_snap(nvpair_name(pair)); + if (err != 0) + return (err); + } return (dsl_dataset_user_release(holds, errlist)); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:44:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A2D82D99; Fri, 5 Jul 2013 03:44:50 +0000 (UTC) (envelope-from delphij@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 859AA1E78; Fri, 5 Jul 2013 03:44:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653ioa8067536; Fri, 5 Jul 2013 03:44:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653in9E067531; Fri, 5 Jul 2013 03:44:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050344.r653in9E067531@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252757 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:44:50 -0000 Author: delphij Date: Fri Jul 5 03:44:49 2013 New Revision: 252757 URL: http://svnweb.freebsd.org/changeset/base/252757 Log: MFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting snapshots Propagate errors from zfs_unmount_snap() up to its callers wherever feasible. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:44:49 2013 (r252757) @@ -433,7 +433,7 @@ dsl_dataset_user_release_tmp(dsl_pool_t dsl_dataset_name(ds, name); dsl_dataset_rele(ds, FTAG); dsl_pool_config_exit(dp, FTAG); - zfs_unmount_snap(name); + (void) zfs_unmount_snap(name); } else { dsl_pool_config_exit(dp, FTAG); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:49 2013 (r252757) @@ -360,7 +360,7 @@ extern int zfs_secpolicy_rename_perms(co const char *to, cred_t *cr); extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); extern int zfs_busy(void); -extern void zfs_unmount_snap(const char *); +extern int zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:49 2013 (r252757) @@ -3405,28 +3405,31 @@ zfs_ioc_log_history(const char *unused, * * This function is best-effort. Callers must deal gracefully if it * remains mounted (or is remounted after this call). + * + * Returns 0 if the argument is not a snapshot, or it is not currently a + * filesystem, or we were able to unmount it. Returns error code otherwise. */ -void +int zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; + int err; if (strchr(snapname, '@') == NULL) - return; + return (0); vfsp = zfs_get_vfs(snapname); if (vfsp == NULL) - return; + return (0); zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - if (vn_vfswlock(vfsp->vfs_vnodecovered) != 0) { - VFS_RELE(vfsp); - return; - } + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); + if (err != 0) + return (SET_ERROR(err)); /* * Always force the unmount for snapshots. @@ -3436,17 +3439,17 @@ zfs_unmount_snap(const char *snapname) (void) dounmount(vfsp, MS_FORCE, kcred); #else mtx_lock(&Giant); /* dounmount() */ - dounmount(vfsp, MS_FORCE, curthread); + (void) dounmount(vfsp, MS_FORCE, curthread); mtx_unlock(&Giant); /* dounmount() */ #endif + return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - zfs_unmount_snap(snapname); - return (0); + return (zfs_unmount_snap(snapname)); } /* @@ -3469,7 +3472,7 @@ zfs_destroy_unmount_origin(const char *f char originname[MAXNAMELEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - zfs_unmount_snap(originname); + (void) zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3487,7 +3490,7 @@ zfs_destroy_unmount_origin(const char *f static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { - int poollen; + int error, poollen; nvlist_t *snaps; nvpair_t *pair; boolean_t defer; @@ -3508,7 +3511,9 @@ zfs_ioc_destroy_snaps(const char *poolna (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - zfs_unmount_snap(name); + error = zfs_unmount_snap(name); + if (error != 0) + return (error); (void) zvol_remove_minor(name); } @@ -3527,8 +3532,12 @@ static int zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (strchr(zc->zc_name, '@') && zc->zc_objset_type == DMU_OST_ZFS) - zfs_unmount_snap(zc->zc_name); + + if (zc->zc_objset_type == DMU_OST_ZFS) { + err = zfs_unmount_snap(zc->zc_name); + if (err != 0) + return (err); + } if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3574,8 +3583,7 @@ recursive_unmount(const char *fsname, vo char fullname[MAXNAMELEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - zfs_unmount_snap(fullname); - return (0); + return (zfs_unmount_snap(fullname)); } /* @@ -5071,14 +5079,18 @@ static int zfs_ioc_release(const char *pool, nvlist_t *holds, nvlist_t *errlist) { nvpair_t *pair; + int err; /* * The release may cause the snapshot to be destroyed; make sure it * is not mounted. */ for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(holds, pair)) - zfs_unmount_snap(nvpair_name(pair)); + pair = nvlist_next_nvpair(holds, pair)) { + err = zfs_unmount_snap(nvpair_name(pair)); + if (err != 0) + return (err); + } return (dsl_dataset_user_release(holds, errlist)); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:49:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35411EEF; Fri, 5 Jul 2013 03:49:53 +0000 (UTC) (envelope-from delphij@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 1656A1E95; Fri, 5 Jul 2013 03:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653nqDm068170; Fri, 5 Jul 2013 03:49:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653nqW9068168; Fri, 5 Jul 2013 03:49:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050349.r653nqW9068168@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:49:52 +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: r252758 - in stable/9/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:49:53 -0000 Author: delphij Date: Fri Jul 5 03:49:52 2013 New Revision: 252758 URL: http://svnweb.freebsd.org/changeset/base/252758 Log: MFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: (change 644608) This allows specifying a mountpoint using the latter form and having its value checked and used as it would be using the former form. As a consequence of this change: 1. The mountpoint property is set in the fsprops nvlist prior to creating the pool, rather than being set after creating the pool. To me, this is the proper approach, since it avoids creating the pool if the mountpoint setting would cause the command to fail. 2. The mountpoint property, unlike all others, can be specified more than once. Only the last setting takes effect. This is to avoid breaking potential existing users that specify -m more than once. Submitted by: will cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fix "zpool create -R -m ". Ever since change 644608, this has been broken. The problem is that some old code in libzfs_pool.c would force a pool's mountpoint to "/" when creating a pool with an altroot. That probably implemented some old policy decision regarding altroots, but it conflicts with the current manpage. It also had no effect until 644608, because the zpool command would _always_ change the pool's mountpoint after creating it. The solution is to delete the old code from libzfs_pool.c. Submitted by: asomers Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:44:49 2013 (r252757) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:49:52 2013 (r252758) @@ -804,6 +804,7 @@ zpool_do_create(int argc, char **argv) goto errout; break; case 'm': + /* Equivalent to -O mountpoint=optarg */ mountpoint = optarg; break; case 'o': @@ -842,8 +843,18 @@ zpool_do_create(int argc, char **argv) *propval = '\0'; propval++; - if (add_prop_list(optarg, propval, &fsprops, B_FALSE)) + /* + * Mountpoints are checked and then added later. + * Uniquely among properties, they can be specified + * more than once, to avoid conflict with -m. + */ + if (0 == strcmp(optarg, + zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) { + mountpoint = propval; + } else if (add_prop_list(optarg, propval, &fsprops, + B_FALSE)) { goto errout; + } break; case ':': (void) fprintf(stderr, gettext("missing argument for " @@ -960,6 +971,18 @@ zpool_do_create(int argc, char **argv) } } + /* + * Now that the mountpoint's validity has been checked, ensure that + * the property is set appropriately prior to creating the pool. + */ + if (mountpoint != NULL) { + ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), + mountpoint, &fsprops, B_FALSE); + if (ret != 0) + goto errout; + } + + ret = 1; if (dryrun) { /* * For a dry run invocation, print out a basic message and run @@ -994,21 +1017,19 @@ zpool_do_create(int argc, char **argv) if (nvlist_exists(props, propname)) continue; - if (add_prop_list(propname, ZFS_FEATURE_ENABLED, - &props, B_TRUE) != 0) + ret = add_prop_list(propname, + ZFS_FEATURE_ENABLED, &props, B_TRUE); + if (ret != 0) goto errout; } } + + ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { zfs_handle_t *pool = zfs_open(g_zfs, poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { - if (mountpoint != NULL) - verify(zfs_prop_set(pool, - zfs_prop_to_name( - ZFS_PROP_MOUNTPOINT), - mountpoint) == 0); if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); zfs_close(pool); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:44:49 2013 (r252757) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:49:52 2013 (r252758) @@ -1112,7 +1112,6 @@ zpool_create(libzfs_handle_t *hdl, const nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; - char *altroot; int ret = -1; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, @@ -1211,21 +1210,6 @@ zpool_create(libzfs_handle_t *hdl, const } } - /* - * If this is an alternate root pool, then we automatically set the - * mountpoint of the root dataset to be '/'. - */ - if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), - &altroot) == 0) { - zfs_handle_t *zhp; - - verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL); - verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), - "/") == 0); - - zfs_close(zhp); - } - create_failed: zcmd_free_nvlists(&zc); nvlist_free(zc_props); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:50:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4BB0C7E; Fri, 5 Jul 2013 03:50:12 +0000 (UTC) (envelope-from delphij@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 2D95D1E97; Fri, 5 Jul 2013 03:50:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653oCkw068325; Fri, 5 Jul 2013 03:50:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653oB7P068321; Fri, 5 Jul 2013 03:50:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050350.r653oB7P068321@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252759 - in stable/8/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:50:12 -0000 Author: delphij Date: Fri Jul 5 03:50:11 2013 New Revision: 252759 URL: http://svnweb.freebsd.org/changeset/base/252759 Log: MFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: (change 644608) This allows specifying a mountpoint using the latter form and having its value checked and used as it would be using the former form. As a consequence of this change: 1. The mountpoint property is set in the fsprops nvlist prior to creating the pool, rather than being set after creating the pool. To me, this is the proper approach, since it avoids creating the pool if the mountpoint setting would cause the command to fail. 2. The mountpoint property, unlike all others, can be specified more than once. Only the last setting takes effect. This is to avoid breaking potential existing users that specify -m more than once. Submitted by: will cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fix "zpool create -R -m ". Ever since change 644608, this has been broken. The problem is that some old code in libzfs_pool.c would force a pool's mountpoint to "/" when creating a pool with an altroot. That probably implemented some old policy decision regarding altroots, but it conflicts with the current manpage. It also had no effect until 644608, because the zpool command would _always_ change the pool's mountpoint after creating it. The solution is to delete the old code from libzfs_pool.c. Submitted by: asomers Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:49:52 2013 (r252758) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:50:11 2013 (r252759) @@ -804,6 +804,7 @@ zpool_do_create(int argc, char **argv) goto errout; break; case 'm': + /* Equivalent to -O mountpoint=optarg */ mountpoint = optarg; break; case 'o': @@ -842,8 +843,18 @@ zpool_do_create(int argc, char **argv) *propval = '\0'; propval++; - if (add_prop_list(optarg, propval, &fsprops, B_FALSE)) + /* + * Mountpoints are checked and then added later. + * Uniquely among properties, they can be specified + * more than once, to avoid conflict with -m. + */ + if (0 == strcmp(optarg, + zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) { + mountpoint = propval; + } else if (add_prop_list(optarg, propval, &fsprops, + B_FALSE)) { goto errout; + } break; case ':': (void) fprintf(stderr, gettext("missing argument for " @@ -970,6 +981,18 @@ zpool_do_create(int argc, char **argv) } } + /* + * Now that the mountpoint's validity has been checked, ensure that + * the property is set appropriately prior to creating the pool. + */ + if (mountpoint != NULL) { + ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), + mountpoint, &fsprops, B_FALSE); + if (ret != 0) + goto errout; + } + + ret = 1; if (dryrun) { /* * For a dry run invocation, print out a basic message and run @@ -1004,21 +1027,19 @@ zpool_do_create(int argc, char **argv) if (nvlist_exists(props, propname)) continue; - if (add_prop_list(propname, ZFS_FEATURE_ENABLED, - &props, B_TRUE) != 0) + ret = add_prop_list(propname, + ZFS_FEATURE_ENABLED, &props, B_TRUE); + if (ret != 0) goto errout; } } + + ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { zfs_handle_t *pool = zfs_open(g_zfs, poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { - if (mountpoint != NULL) - verify(zfs_prop_set(pool, - zfs_prop_to_name( - ZFS_PROP_MOUNTPOINT), - mountpoint) == 0); if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); zfs_close(pool); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:49:52 2013 (r252758) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:50:11 2013 (r252759) @@ -1112,7 +1112,6 @@ zpool_create(libzfs_handle_t *hdl, const nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; - char *altroot; int ret = -1; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, @@ -1211,21 +1210,6 @@ zpool_create(libzfs_handle_t *hdl, const } } - /* - * If this is an alternate root pool, then we automatically set the - * mountpoint of the root dataset to be '/'. - */ - if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), - &altroot) == 0) { - zfs_handle_t *zhp; - - verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL); - verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), - "/") == 0); - - zfs_close(zhp); - } - create_failed: zcmd_free_nvlists(&zc); nvlist_free(zc_props); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:54:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABF891EB; Fri, 5 Jul 2013 03:54:14 +0000 (UTC) (envelope-from delphij@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 83AEC1EB3; Fri, 5 Jul 2013 03:54:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653sERX070383; Fri, 5 Jul 2013 03:54:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653sEZx070378; Fri, 5 Jul 2013 03:54:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050354.r653sEZx070378@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:54:14 +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: r252760 - in stable/9: cddl/contrib/opensolaris/cmd/ztest 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:54:14 -0000 Author: delphij Date: Fri Jul 5 03:54:13 2013 New Revision: 252760 URL: http://svnweb.freebsd.org/changeset/base/252760 Log: MFC r251635: illumos #3747 txg commit callbacks don't work sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c: Fix commit callbacks by moving them to the task's list. Previously, list_move_tail() returned without doing anything because the task list was passed as the source rather than destination. cddl/contrib/opensolaris/cmd/ztest/ztest.c: Check the commit callback threshold correctly. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:50:11 2013 (r252759) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:54:13 2013 (r252760) @@ -4509,7 +4509,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *z */ tmp_cb = list_head(&zcl.zcl_callbacks); if (tmp_cb != NULL && - tmp_cb->zcd_txg > txg - ZTEST_COMMIT_CALLBACK_THRESH) { + (txg - ZTEST_COMMIT_CALLBACK_THRESH) > tmp_cb->zcd_txg) { fatal(0, "Commit callback threshold exceeded, oldest txg: %" PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:50:11 2013 (r252759) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:54:13 2013 (r252760) @@ -439,7 +439,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u list_create(cb_list, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); - list_move_tail(&tc->tc_callbacks[g], cb_list); + list_move_tail(cb_list, &tc->tc_callbacks[g]); (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) txg_do_callbacks, cb_list, TQ_SLEEP); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 03:55:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2A24631A; Fri, 5 Jul 2013 03:55:14 +0000 (UTC) (envelope-from delphij@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 021561EB9; Fri, 5 Jul 2013 03:55:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653tDGP070614; Fri, 5 Jul 2013 03:55:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653tDWg070612; Fri, 5 Jul 2013 03:55:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050355.r653tDWg070612@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252761 - in stable/8: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 03:55:14 -0000 Author: delphij Date: Fri Jul 5 03:55:13 2013 New Revision: 252761 URL: http://svnweb.freebsd.org/changeset/base/252761 Log: MFC r251635: illumos #3747 txg commit callbacks don't work sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c: Fix commit callbacks by moving them to the task's list. Previously, list_move_tail() returned without doing anything because the task list was passed as the source rather than destination. cddl/contrib/opensolaris/cmd/ztest/ztest.c: Check the commit callback threshold correctly. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:54:13 2013 (r252760) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:55:13 2013 (r252761) @@ -4509,7 +4509,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *z */ tmp_cb = list_head(&zcl.zcl_callbacks); if (tmp_cb != NULL && - tmp_cb->zcd_txg > txg - ZTEST_COMMIT_CALLBACK_THRESH) { + (txg - ZTEST_COMMIT_CALLBACK_THRESH) > tmp_cb->zcd_txg) { fatal(0, "Commit callback threshold exceeded, oldest txg: %" PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:54:13 2013 (r252760) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:55:13 2013 (r252761) @@ -370,7 +370,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u list_create(cb_list, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); - list_move_tail(&tc->tc_callbacks[g], cb_list); + list_move_tail(cb_list, &tc->tc_callbacks[g]); (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) txg_do_callbacks, cb_list, TQ_SLEEP); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:01:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2305C48A; Fri, 5 Jul 2013 04:01:27 +0000 (UTC) (envelope-from delphij@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 13D921EE4; Fri, 5 Jul 2013 04:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6541QYT073191; Fri, 5 Jul 2013 04:01:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6541PLE073186; Fri, 5 Jul 2013 04:01:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050401.r6541PLE073186@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:01:25 +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: r252762 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fm/fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:01:27 -0000 Author: delphij Date: Fri Jul 5 04:01:25 2013 New Revision: 252762 URL: http://svnweb.freebsd.org/changeset/base/252762 Log: MFC r251636: illumos #3749 zfs event processing should work on R/O root filesystems This log is a modified version of the original one written by gibbs@, to account for changes made during the illumos RTI process. Allow ZFS asynchronous event handling to proceed even if the root file system is mounted read-only. This restriction appears to have been put in place to avoid errors with updating the configuration cache file. However: o The majority of asynchronous event handling does not involve configuration cache file updates. o The configuration cache file need not be on the root file system, so the check was not complete. o Other classes of errors (e.g. file system full) can also prevent a successful update yet do not prevent asynchronous event processing. o Configurations such as NanoBSD never have a read-write root, so ZFS event processing is permanently disabled in these systems. o Failure to handle asynchronous events promptly can extend the window of time that a pool is in a critical state. At worst, a missed configuration cache update will force the operator to perform a manual "zfs import" (note -f is not required) to inform the system about a newly created pool. To minimize the likelihood of this rare occurrence, configuration cache write failures now emit FMA events (via devctl) so the operator can take corrective action, and the write is retried every 5 minutes. The retry interval, in seconds, is tunable via the sysctl "vfs.zfs.ccw_retry_interval". As a side effect of reporting configuration cache events, other sysevents, such as re-silver start/stop, are now also reported via devctl. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: o As is done in zfs_fm.c, provide a manual declaration for devctl_notify(). Both declarations could be combined into spa_impl.h, but the declaration is fault management related, not spa specific. sys/fm/fs/zfs.h would be ideal if it weren't so public and reserved for FMA string definitions. I'm open to suggestions on how to improve this nit while minimizing our divergence from Solaris. o Use devctl_notify() to implement sysevent support in spa_event_notify(). The subsystem is EC_ZFS so that these events can never collide with those emitted in zfs_fm.c. o Add the sysctl "vfs.zfs.ccw_retry_interval". The value defaults to 5 minutes and is used to rate limit, on a per-pool basis, configuration cache file write attempts. o Modify spa_async_dispatch to honor configuration cache write limiting. If other events are pending, a configuration cache write will be attempted at the same time, so the rate limiting only applies when the asynchronous dispatch system is otherwise idle. Async events should be rare (e.g. device arrival/departure) and configuration cache writes rarer, so a more complicated system to strictly honor the retry limit seems unwarranted. o Remove check in spa_async_dispatch() for the root file system being read-write. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: Instead of silently ignoring configuration cache write failures, report them via a new FMA event as well as to the console. The current zfs_ereport_post() doesn't allow arbitrary name=value pairs to be appended to the report, so the configuration cache file name is only available on the console output. This limitation should be addressed in a future update. Note: This error report is only posted once per incident, to avoid spamming. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h: Add a hrtime_t to the spa data structure to track the time (via gethrtime()) of the last configuration cache file write failure. This is referenced in spa_async_dispatch() to effect the rate limiting. sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h: Add FM_EREPORT_ZFS_CONFIG_CACHE_WRITE as an ereport class. Submitted by: gibbs Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: 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/sys/spa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h 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 Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:01:25 2013 (r252762) @@ -88,6 +88,12 @@ TUNABLE_INT("vfs.zfs.check_hostid", &che SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, "Check hostid on import?"); +/* + * The interval, in seconds, at which failed configuration cache file writes + * should be retried. + */ +static int zfs_ccw_retry_interval = 300; + typedef enum zti_modes { zti_mode_fixed, /* value is # of threads (min 1) */ zti_mode_online_percent, /* value is % of online CPUs */ @@ -5852,13 +5858,34 @@ spa_async_resume(spa_t *spa) mutex_exit(&spa->spa_async_lock); } +static boolean_t +spa_async_tasks_pending(spa_t *spa) +{ + uint_t non_config_tasks; + uint_t config_task; + boolean_t config_task_suspended; + + non_config_tasks = spa->spa_async_tasks & ~SPA_ASYNC_CONFIG_UPDATE; + config_task = spa->spa_async_tasks & SPA_ASYNC_CONFIG_UPDATE; + if (spa->spa_ccw_fail_time == 0) { + config_task_suspended = B_FALSE; + } else { + config_task_suspended = + (gethrtime() - spa->spa_ccw_fail_time) < + (zfs_ccw_retry_interval * NANOSEC); + } + + return (non_config_tasks || (config_task && !config_task_suspended)); +} + static void spa_async_dispatch(spa_t *spa) { mutex_enter(&spa->spa_async_lock); - if (spa->spa_async_tasks && !spa->spa_async_suspended && + if (spa_async_tasks_pending(spa) && + !spa->spa_async_suspended && spa->spa_async_thread == NULL && - rootdir != NULL && !vn_is_readonly(rootdir)) + rootdir != NULL) spa->spa_async_thread = thread_create(NULL, 0, spa_async_thread, spa, 0, &p0, TS_RUN, maxclsyspri); mutex_exit(&spa->spa_async_lock); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 04:01:25 2013 (r252762) @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -139,7 +140,7 @@ out: kobj_close_file(file); } -static void +static int spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) { size_t buflen; @@ -147,13 +148,14 @@ spa_config_write(spa_config_dirent_t *dp vnode_t *vp; int oflags = FWRITE | FTRUNC | FCREAT | FOFFMAX; char *temp; + int err; /* * If the nvlist is empty (NULL), then remove the old cachefile. */ if (nvl == NULL) { - (void) vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); - return; + err = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); + return (err); } /* @@ -174,12 +176,14 @@ spa_config_write(spa_config_dirent_t *dp */ (void) snprintf(temp, MAXPATHLEN, "%s.tmp", dp->scd_path); - if (vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0) == 0) { - if (vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, NULL) == 0 && - VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) { - (void) vn_rename(temp, dp->scd_path, UIO_SYSSPACE); - } + err = vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0); + if (err == 0) { + err = vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, + 0, RLIM64_INFINITY, kcred, NULL); + if (err == 0) + err = VOP_FSYNC(vp, FSYNC, kcred, NULL); + if (err == 0) + err = vn_rename(temp, dp->scd_path, UIO_SYSSPACE); (void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL); } @@ -187,6 +191,7 @@ spa_config_write(spa_config_dirent_t *dp kmem_free(buf, buflen); kmem_free(temp, MAXPATHLEN); + return (err); } /* @@ -198,6 +203,8 @@ spa_config_sync(spa_t *target, boolean_t { spa_config_dirent_t *dp, *tdp; nvlist_t *nvl; + boolean_t ccw_failure; + int error; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -209,6 +216,7 @@ spa_config_sync(spa_t *target, boolean_t * cachefile is changed, the new one is pushed onto this list, allowing * us to update previous cachefiles that no longer contain this pool. */ + ccw_failure = B_FALSE; for (dp = list_head(&target->spa_config_list); dp != NULL; dp = list_next(&target->spa_config_list, dp)) { spa_t *spa = NULL; @@ -249,10 +257,32 @@ spa_config_sync(spa_t *target, boolean_t mutex_exit(&spa->spa_props_lock); } - spa_config_write(dp, nvl); + error = spa_config_write(dp, nvl); + if (error != 0) + ccw_failure = B_TRUE; nvlist_free(nvl); } + if (ccw_failure) { + /* + * Keep trying so that configuration data is + * written if/when any temporary filesystem + * resource issues are resolved. + */ + if (target->spa_ccw_fail_time == 0) { + zfs_ereport_post(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE, + target, NULL, NULL, 0, 0); + } + target->spa_ccw_fail_time = gethrtime(); + spa_async_request(target, SPA_ASYNC_CONFIG_UPDATE); + } else { + /* + * Do not rate limit future attempts to update + * the config cache. + */ + target->spa_ccw_fail_time = 0; + } + /* * Remove any config entries older than the current one. */ Modified: 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/spa_impl.h Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:01:25 2013 (r252762) @@ -241,6 +241,7 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */ /* * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:01:25 2013 (r252762) @@ -46,6 +46,7 @@ extern "C" { #define FM_EREPORT_ZFS_IO_FAILURE "io_failure" #define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure" #define FM_EREPORT_ZFS_LOG_REPLAY "log_replay" +#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write" #define FM_EREPORT_PAYLOAD_ZFS_POOL "pool" #define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode" From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:02:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E52B5B5; Fri, 5 Jul 2013 04:02:16 +0000 (UTC) (envelope-from delphij@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 4F1E71EEC; Fri, 5 Jul 2013 04:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6542GtH073384; Fri, 5 Jul 2013 04:02:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6542FrE073379; Fri, 5 Jul 2013 04:02:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050402.r6542FrE073379@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252763 - in stable/8/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fm/fs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:02:16 -0000 Author: delphij Date: Fri Jul 5 04:02:15 2013 New Revision: 252763 URL: http://svnweb.freebsd.org/changeset/base/252763 Log: MFC r251636: illumos #3749 zfs event processing should work on R/O root filesystems This log is a modified version of the original one written by gibbs@, to account for changes made during the illumos RTI process. Allow ZFS asynchronous event handling to proceed even if the root file system is mounted read-only. This restriction appears to have been put in place to avoid errors with updating the configuration cache file. However: o The majority of asynchronous event handling does not involve configuration cache file updates. o The configuration cache file need not be on the root file system, so the check was not complete. o Other classes of errors (e.g. file system full) can also prevent a successful update yet do not prevent asynchronous event processing. o Configurations such as NanoBSD never have a read-write root, so ZFS event processing is permanently disabled in these systems. o Failure to handle asynchronous events promptly can extend the window of time that a pool is in a critical state. At worst, a missed configuration cache update will force the operator to perform a manual "zfs import" (note -f is not required) to inform the system about a newly created pool. To minimize the likelihood of this rare occurrence, configuration cache write failures now emit FMA events (via devctl) so the operator can take corrective action, and the write is retried every 5 minutes. The retry interval, in seconds, is tunable via the sysctl "vfs.zfs.ccw_retry_interval". As a side effect of reporting configuration cache events, other sysevents, such as re-silver start/stop, are now also reported via devctl. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: o As is done in zfs_fm.c, provide a manual declaration for devctl_notify(). Both declarations could be combined into spa_impl.h, but the declaration is fault management related, not spa specific. sys/fm/fs/zfs.h would be ideal if it weren't so public and reserved for FMA string definitions. I'm open to suggestions on how to improve this nit while minimizing our divergence from Solaris. o Use devctl_notify() to implement sysevent support in spa_event_notify(). The subsystem is EC_ZFS so that these events can never collide with those emitted in zfs_fm.c. o Add the sysctl "vfs.zfs.ccw_retry_interval". The value defaults to 5 minutes and is used to rate limit, on a per-pool basis, configuration cache file write attempts. o Modify spa_async_dispatch to honor configuration cache write limiting. If other events are pending, a configuration cache write will be attempted at the same time, so the rate limiting only applies when the asynchronous dispatch system is otherwise idle. Async events should be rare (e.g. device arrival/departure) and configuration cache writes rarer, so a more complicated system to strictly honor the retry limit seems unwarranted. o Remove check in spa_async_dispatch() for the root file system being read-write. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: Instead of silently ignoring configuration cache write failures, report them via a new FMA event as well as to the console. The current zfs_ereport_post() doesn't allow arbitrary name=value pairs to be appended to the report, so the configuration cache file name is only available on the console output. This limitation should be addressed in a future update. Note: This error report is only posted once per incident, to avoid spamming. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h: Add a hrtime_t to the spa data structure to track the time (via gethrtime()) of the last configuration cache file write failure. This is referenced in spa_async_dispatch() to effect the rate limiting. sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h: Add FM_EREPORT_ZFS_CONFIG_CACHE_WRITE as an ereport class. Submitted by: gibbs Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:02:15 2013 (r252763) @@ -88,6 +88,12 @@ TUNABLE_INT("vfs.zfs.check_hostid", &che SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, "Check hostid on import?"); +/* + * The interval, in seconds, at which failed configuration cache file writes + * should be retried. + */ +static int zfs_ccw_retry_interval = 300; + typedef enum zti_modes { zti_mode_fixed, /* value is # of threads (min 1) */ zti_mode_online_percent, /* value is % of online CPUs */ @@ -5852,13 +5858,34 @@ spa_async_resume(spa_t *spa) mutex_exit(&spa->spa_async_lock); } +static boolean_t +spa_async_tasks_pending(spa_t *spa) +{ + uint_t non_config_tasks; + uint_t config_task; + boolean_t config_task_suspended; + + non_config_tasks = spa->spa_async_tasks & ~SPA_ASYNC_CONFIG_UPDATE; + config_task = spa->spa_async_tasks & SPA_ASYNC_CONFIG_UPDATE; + if (spa->spa_ccw_fail_time == 0) { + config_task_suspended = B_FALSE; + } else { + config_task_suspended = + (gethrtime() - spa->spa_ccw_fail_time) < + (zfs_ccw_retry_interval * NANOSEC); + } + + return (non_config_tasks || (config_task && !config_task_suspended)); +} + static void spa_async_dispatch(spa_t *spa) { mutex_enter(&spa->spa_async_lock); - if (spa->spa_async_tasks && !spa->spa_async_suspended && + if (spa_async_tasks_pending(spa) && + !spa->spa_async_suspended && spa->spa_async_thread == NULL && - rootdir != NULL && !vn_is_readonly(rootdir)) + rootdir != NULL) spa->spa_async_thread = thread_create(NULL, 0, spa_async_thread, spa, 0, &p0, TS_RUN, maxclsyspri); mutex_exit(&spa->spa_async_lock); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 04:02:15 2013 (r252763) @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -139,7 +140,7 @@ out: kobj_close_file(file); } -static void +static int spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) { size_t buflen; @@ -147,13 +148,14 @@ spa_config_write(spa_config_dirent_t *dp vnode_t *vp; int oflags = FWRITE | FTRUNC | FCREAT | FOFFMAX; char *temp; + int err; /* * If the nvlist is empty (NULL), then remove the old cachefile. */ if (nvl == NULL) { - (void) vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); - return; + err = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); + return (err); } /* @@ -174,12 +176,14 @@ spa_config_write(spa_config_dirent_t *dp */ (void) snprintf(temp, MAXPATHLEN, "%s.tmp", dp->scd_path); - if (vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0) == 0) { - if (vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, NULL) == 0 && - VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) { - (void) vn_rename(temp, dp->scd_path, UIO_SYSSPACE); - } + err = vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0); + if (err == 0) { + err = vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, + 0, RLIM64_INFINITY, kcred, NULL); + if (err == 0) + err = VOP_FSYNC(vp, FSYNC, kcred, NULL); + if (err == 0) + err = vn_rename(temp, dp->scd_path, UIO_SYSSPACE); (void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL); } @@ -187,6 +191,7 @@ spa_config_write(spa_config_dirent_t *dp kmem_free(buf, buflen); kmem_free(temp, MAXPATHLEN); + return (err); } /* @@ -198,6 +203,8 @@ spa_config_sync(spa_t *target, boolean_t { spa_config_dirent_t *dp, *tdp; nvlist_t *nvl; + boolean_t ccw_failure; + int error; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -209,6 +216,7 @@ spa_config_sync(spa_t *target, boolean_t * cachefile is changed, the new one is pushed onto this list, allowing * us to update previous cachefiles that no longer contain this pool. */ + ccw_failure = B_FALSE; for (dp = list_head(&target->spa_config_list); dp != NULL; dp = list_next(&target->spa_config_list, dp)) { spa_t *spa = NULL; @@ -241,10 +249,32 @@ spa_config_sync(spa_t *target, boolean_t mutex_exit(&spa->spa_props_lock); } - spa_config_write(dp, nvl); + error = spa_config_write(dp, nvl); + if (error != 0) + ccw_failure = B_TRUE; nvlist_free(nvl); } + if (ccw_failure) { + /* + * Keep trying so that configuration data is + * written if/when any temporary filesystem + * resource issues are resolved. + */ + if (target->spa_ccw_fail_time == 0) { + zfs_ereport_post(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE, + target, NULL, NULL, 0, 0); + } + target->spa_ccw_fail_time = gethrtime(); + spa_async_request(target, SPA_ASYNC_CONFIG_UPDATE); + } else { + /* + * Do not rate limit future attempts to update + * the config cache. + */ + target->spa_ccw_fail_time = 0; + } + /* * Remove any config entries older than the current one. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:02:15 2013 (r252763) @@ -241,6 +241,7 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */ /* * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:02:15 2013 (r252763) @@ -46,6 +46,7 @@ extern "C" { #define FM_EREPORT_ZFS_IO_FAILURE "io_failure" #define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure" #define FM_EREPORT_ZFS_LOG_REPLAY "log_replay" +#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write" #define FM_EREPORT_PAYLOAD_ZFS_POOL "pool" #define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode" From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:08:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42D7F748; Fri, 5 Jul 2013 04:08:48 +0000 (UTC) (envelope-from delphij@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 3282B1F21; Fri, 5 Jul 2013 04:08:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6548mgd074539; Fri, 5 Jul 2013 04:08:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6548k0K074526; Fri, 5 Jul 2013 04:08:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050408.r6548k0K074526@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:08:46 +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: r252764 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/ope... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:08:48 -0000 Author: delphij Date: Fri Jul 5 04:08:45 2013 New Revision: 252764 URL: http://svnweb.freebsd.org/changeset/base/252764 Log: MFC r251646 + r252219: MFV r251644: Poor ZFS send / receive performance due to snapshot hold / release processing (by smh@) Illumos ZFS issues: 3740 Poor ZFS send / receive performance due to snapshot hold / release processing MFV r252215: Restore a previous behavior before r251646, where when destructing ZFS snapshot, the ioctl would return ENOENT when it hit any of them in the errlist (the new behavior was only return ENOENT when all returns error). Illumos ZFS issues: 3829 fix for 3740 changed behavior of zfs destroy/hold/release ioctl Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.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_userhold.c 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_userhold.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: 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/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:08:45 2013 (r252764) @@ -28,6 +28,7 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -5222,8 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a continue; } if (holding) { - if (zfs_hold(zhp, delim+1, tag, recursive, - B_FALSE, -1) != 0) + if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) Modified: stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -153,7 +154,7 @@ import_pool(const char *target, boolean_ g_importargs.poolname = g_pool; pools = zpool_search_import(g_zfs, &g_importargs); - if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) { + if (nvlist_empty(pools)) { if (!g_importargs.can_be_active) { g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:08:45 2013 (r252764) @@ -23,6 +23,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -4713,7 +4714,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, error = user_release_one(fullname, tag); if (error) - fatal(0, "user_release_one(%s)", fullname, tag); + fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error); VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:08:45 2013 (r252764) @@ -27,6 +27,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #ifndef _LIBZFS_H @@ -611,7 +612,8 @@ extern int zfs_send(zfs_handle_t *, cons extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, - boolean_t, boolean_t, int); + boolean_t, int); +extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *); extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t); extern int zfs_get_holds(zfs_handle_t *, nvlist_t **); extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,12 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -3158,18 +3159,14 @@ static int zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) { struct destroydata *dd = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, dd->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) verify(nvlist_add_boolean(dd->nvl, name) == 0); - zfs_close(szhp); - } rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd); zfs_close(zhp); @@ -3189,7 +3186,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, cha verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0); (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd); - if (nvlist_next_nvpair(dd.nvl, NULL) == NULL) { + if (nvlist_empty(dd.nvl)) { ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT, dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"), zhp->zfs_name, snapname); @@ -3214,7 +3211,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h if (ret == 0) return (0); - if (nvlist_next_nvpair(errlist, NULL) == NULL) { + if (nvlist_empty(errlist)) { char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot destroy snapshots")); @@ -4162,24 +4159,21 @@ struct holdarg { const char *snapname; const char *tag; boolean_t recursive; + int error; }; static int zfs_hold_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) fnvlist_add_string(ha->nvl, name, ha->tag); - zfs_close(szhp); - } if (ha->recursive) rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha); @@ -4189,14 +4183,10 @@ zfs_hold_one(zfs_handle_t *zhp, void *ar int zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag, - boolean_t recursive, boolean_t enoent_ok, int cleanup_fd) + boolean_t recursive, int cleanup_fd) { int ret; struct holdarg ha; - nvlist_t *errors; - libzfs_handle_t *hdl = zhp->zfs_hdl; - char errbuf[1024]; - nvpair_t *elem; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; @@ -4204,26 +4194,44 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { + char errbuf[1024]; + fnvlist_free(ha.nvl); ret = ENOENT; - if (!enoent_ok) { - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, - "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); - } + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(zhp->zfs_hdl, ret, errbuf); return (ret); } - ret = lzc_hold(ha.nvl, cleanup_fd, &errors); + ret = zfs_hold_nvl(zhp, cleanup_fd, ha.nvl); fnvlist_free(ha.nvl); - if (ret == 0) + return (ret); +} + +int +zfs_hold_nvl(zfs_handle_t *zhp, int cleanup_fd, nvlist_t *holds) +{ + int ret; + nvlist_t *errors; + libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; + nvpair_t *elem; + + errors = NULL; + ret = lzc_hold(holds, cleanup_fd, &errors); + + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot hold")); @@ -4263,10 +4271,6 @@ zfs_hold(zfs_handle_t *zhp, const char * case EEXIST: (void) zfs_error(hdl, EZFS_REFTAG_HOLD, errbuf); break; - case ENOENT: - if (enoent_ok) - return (ENOENT); - /* FALLTHROUGH */ default: (void) zfs_standard_error(hdl, fnvpair_value_int32(elem), errbuf); @@ -4277,30 +4281,26 @@ zfs_hold(zfs_handle_t *zhp, const char * return (ret); } -struct releasearg { - nvlist_t *nvl; - const char *snapname; - const char *tag; - boolean_t recursive; -}; - static int zfs_release_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; + nvlist_t *existing_holds; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { - nvlist_t *holds = fnvlist_alloc(); - fnvlist_add_boolean(holds, ha->tag); - fnvlist_add_nvlist(ha->nvl, name, holds); - zfs_close(szhp); + if (lzc_get_holds(name, &existing_holds) != 0) { + ha->error = ENOENT; + } else if (!nvlist_exists(existing_holds, ha->tag)) { + ha->error = ESRCH; + } else { + nvlist_t *torelease = fnvlist_alloc(); + fnvlist_add_boolean(torelease, ha->tag); + fnvlist_add_nvlist(ha->nvl, name, torelease); + fnvlist_free(torelease); } if (ha->recursive) @@ -4315,7 +4315,7 @@ zfs_release(zfs_handle_t *zhp, const cha { int ret; struct holdarg ha; - nvlist_t *errors; + nvlist_t *errors = NULL; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; char errbuf[1024]; @@ -4324,26 +4324,34 @@ zfs_release(zfs_handle_t *zhp, const cha ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; + ha.error = 0; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { fnvlist_free(ha.nvl); - ret = ENOENT; + ret = ha.error; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s@%s'"), zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (ret == ESRCH) { + (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf); + } else { + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); - if (ret == 0) + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:08:45 2013 (r252764) @@ -25,6 +25,7 @@ * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -802,6 +803,7 @@ typedef struct send_dump_data { int outfd; boolean_t err; nvlist_t *fss; + nvlist_t *snapholds; avl_tree_t *fsavl; snapfilter_cb_t *filter_cb; void *filter_cb_arg; @@ -952,41 +954,19 @@ dump_ioctl(zfs_handle_t *zhp, const char return (0); } -static int -hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd) +static void +gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd) { - zfs_handle_t *pzhp; - int error = 0; - char *thissnap; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); - if (sdd->dryrun) - return (0); - /* - * zfs_send() only opens a cleanup_fd for sends that need it, + * zfs_send() only sets snapholds for sends that need them, * e.g. replication and doall. */ - if (sdd->cleanup_fd == -1) - return (0); - - thissnap = strchr(zhp->zfs_name, '@') + 1; - *(thissnap - 1) = '\0'; - pzhp = zfs_open(zhp->zfs_hdl, zhp->zfs_name, ZFS_TYPE_DATASET); - *(thissnap - 1) = '@'; - - /* - * It's OK if the parent no longer exists. The send code will - * handle that error. - */ - if (pzhp) { - error = zfs_hold(pzhp, thissnap, sdd->holdtag, - B_FALSE, B_TRUE, sdd->cleanup_fd); - zfs_close(pzhp); - } + if (sdd->snapholds == NULL) + return; - return (error); + fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag); } static void * @@ -1042,28 +1022,23 @@ dump_snapshot(zfs_handle_t *zhp, void *a send_dump_data_t *sdd = arg; progress_arg_t pa = { 0 }; pthread_t tid; - char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; isfromsnap = (sdd->fromsnap != NULL && strcmp(sdd->fromsnap, thissnap) == 0); if (!sdd->seenfrom && isfromsnap) { - err = hold_for_send(zhp, sdd); - if (err == 0) { - sdd->seenfrom = B_TRUE; - (void) strcpy(sdd->prevsnap, thissnap); - sdd->prevsnap_obj = zfs_prop_get_int(zhp, - ZFS_PROP_OBJSETID); - } else if (err == ENOENT) { - err = 0; - } + gather_holds(zhp, sdd); + sdd->seenfrom = B_TRUE; + (void) strcpy(sdd->prevsnap, thissnap); + sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zfs_close(zhp); - return (err); + return (0); } if (sdd->seento || !sdd->seenfrom) { @@ -1114,14 +1089,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a return (0); } - err = hold_for_send(zhp, sdd); - if (err) { - if (err == ENOENT) - err = 0; - zfs_close(zhp); - return (err); - } - + gather_holds(zhp, sdd); fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); @@ -1389,7 +1357,7 @@ zfs_send(zfs_handle_t *zhp, const char * avl_tree_t *fsavl = NULL; static uint64_t holdseq; int spa_version; - pthread_t tid; + pthread_t tid = 0; int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; @@ -1462,11 +1430,8 @@ zfs_send(zfs_handle_t *zhp, const char * *debugnvp = hdrnv; else nvlist_free(hdrnv); - if (err) { - fsavl_destroy(fsavl); - nvlist_free(fss); + if (err) goto stderr_out; - } } if (!flags->dryrun) { @@ -1490,8 +1455,6 @@ zfs_send(zfs_handle_t *zhp, const char * } free(packbuf); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1502,8 +1465,6 @@ zfs_send(zfs_handle_t *zhp, const char * drr.drr_u.drr_end.drr_checksum = zc; err = write(outfd, &drr, sizeof (drr)); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1515,7 +1476,7 @@ zfs_send(zfs_handle_t *zhp, const char * /* dump each stream */ sdd.fromsnap = fromsnap; sdd.tosnap = tosnap; - if (flags->dedup) + if (tid != 0) sdd.outfd = pipefd[0]; else sdd.outfd = outfd; @@ -1552,36 +1513,71 @@ zfs_send(zfs_handle_t *zhp, const char * err = errno; goto stderr_out; } + sdd.snapholds = fnvlist_alloc(); } else { sdd.cleanup_fd = -1; + sdd.snapholds = NULL; } - if (flags->verbose) { + if (flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output - * before generating any data. Then do a non-verbose real - * run to generate the streams. + * or to gather snapshot hold's before generating any data, + * then do a non-verbose real run to generate the streams. */ sdd.dryrun = B_TRUE; err = dump_filesystems(zhp, &sdd); - sdd.dryrun = flags->dryrun; - sdd.verbose = B_FALSE; - if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", - (longlong_t)sdd.size); - } else { - char buf[16]; - zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, - "total estimated size is %s\n"), buf); + + if (err != 0) + goto stderr_out; + + if (flags->verbose) { + if (flags->parsable) { + (void) fprintf(stderr, "size\t%llu\n", + (longlong_t)sdd.size); + } else { + char buf[16]; + zfs_nicenum(sdd.size, buf, sizeof (buf)); + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } + } + + /* Ensure no snaps found is treated as an error. */ + if (!sdd.seento) { + err = ENOENT; + goto err_out; } + + /* Skip the second run if dryrun was requested. */ + if (flags->dryrun) + goto err_out; + + if (sdd.snapholds != NULL) { + err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds); + if (err != 0) + goto stderr_out; + + fnvlist_free(sdd.snapholds); + sdd.snapholds = NULL; + } + + sdd.dryrun = B_FALSE; + sdd.verbose = B_FALSE; } + err = dump_filesystems(zhp, &sdd); fsavl_destroy(fsavl); nvlist_free(fss); - if (flags->dedup) { - (void) close(pipefd[0]); + /* Ensure no snaps found is treated as an error. */ + if (err == 0 && !sdd.seento) + err = ENOENT; + + if (tid != 0) { + if (err != 0) + (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); + (void) close(pipefd[0]); } if (sdd.cleanup_fd != -1) { @@ -1609,9 +1605,13 @@ zfs_send(zfs_handle_t *zhp, const char * stderr_out: err = zfs_standard_error(zhp->zfs_hdl, err, errbuf); err_out: + fsavl_destroy(fsavl); + nvlist_free(fss); + fnvlist_free(sdd.snapholds); + if (sdd.cleanup_fd != -1) VERIFY(0 == close(sdd.cleanup_fd)); - if (flags->dedup) { + if (tid != 0) { (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); (void) close(pipefd[0]); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -333,7 +334,6 @@ lzc_destroy_snaps(nvlist_t *snaps, boole nvlist_free(args); return (error); - } int @@ -393,11 +393,17 @@ lzc_exists(const char *dataset) * uncleanly, the holds will be released when the pool is next opened * or imported. * - * The return value will be 0 if all holds were created. Otherwise the return - * value will be the errno of a (unspecified) hold that failed, no holds will - * be created, and the errlist will have an entry for each hold that - * failed (name = snapshot). The value in the errlist will be the error - * code (int32). + * Holds for snapshots which don't exist will be skipped and have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if all holds, for snapshots that existed, + * were succesfully created. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed and no holds will be created. + * + * In all cases the errlist will have an entry for each hold that failed + * (name = snapshot), with its value being the error code (int32). */ int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) @@ -434,11 +440,17 @@ lzc_hold(nvlist_t *holds, int cleanup_fd * The snapshots must all be in the same pool. * The value is a nvlist whose keys are the holds to remove. * - * The return value will be 0 if all holds were removed. - * Otherwise the return value will be the errno of a (unspecified) release - * that failed, no holds will be released, and the errlist will have an - * entry for each snapshot that has failed releases (name = snapshot). - * The value in the errlist will be the error code (int32) of a failed release. + * Holds which failed to release because they didn't exist will have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if the nvl holds was empty or all holds that + * existed, were successfully removed. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed to release and no holds will be released. + * + * In all cases the errlist will have an entry for each hold that failed to + * to release. */ int lzc_release(nvlist_t *holds, nvlist_t **errlist) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -127,6 +128,7 @@ dsl_destroy_snapshot_check(void *arg, dm pair = nvlist_next_nvpair(dsda->dsda_errlist, NULL); if (pair != NULL) return (fnvpair_value_int32(pair)); + return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -856,23 +857,34 @@ dsl_pool_clean_tmp_userrefs(dsl_pool_t * zap_cursor_t zc; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj = dp->dp_tmp_userrefs_obj; + nvlist_t *holds; if (zapobj == 0) return; ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); + holds = fnvlist_alloc(); + for (zap_cursor_init(&zc, mos, zapobj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { char *htag; - uint64_t dsobj; + nvlist_t *tags; htag = strchr(za.za_name, '-'); *htag = '\0'; ++htag; - dsobj = strtonum(za.za_name, NULL); - dsl_dataset_user_release_tmp(dp, dsobj, htag); + if (nvlist_lookup_nvlist(holds, za.za_name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(holds, za.za_name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } + dsl_dataset_user_release_tmp(dp, holds); + fnvlist_free(holds); zap_cursor_fini(&zc); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -37,6 +38,7 @@ typedef struct dsl_dataset_user_hold_arg { nvlist_t *dduha_holds; + nvlist_t *dduha_chkholds; nvlist_t *dduha_errlist; minor_t dduha_minor; } dsl_dataset_user_hold_arg_t; @@ -53,25 +55,24 @@ dsl_dataset_user_hold_check_one(dsl_data objset_t *mos = dp->dp_meta_objset; int error = 0; + ASSERT(dsl_pool_config_held(dp)); + if (strlen(htag) > MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* Tempholds have a more restricted length */ if (temphold && strlen(htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* tags must be unique (if ds already exists) */ - if (ds != NULL) { - mutex_enter(&ds->ds_lock); - if (ds->ds_phys->ds_userrefs_obj != 0) { - uint64_t value; - error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, - htag, 8, 1, &value); - if (error == 0) - error = SET_ERROR(EEXIST); - else if (error == ENOENT) - error = 0; - } - mutex_exit(&ds->ds_lock); + if (ds != NULL && ds->ds_phys->ds_userrefs_obj != 0) { + uint64_t value; + + error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, + htag, 8, 1, &value); + if (error == 0) + error = SET_ERROR(EEXIST); + else if (error == ENOENT) + error = 0; } return (error); @@ -82,52 +83,63 @@ dsl_dataset_user_hold_check(void *arg, d { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; - int rv = 0; if (spa_version(dp->dp_spa) < SPA_VERSION_USERREFS) return (SET_ERROR(ENOTSUP)); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { - int error = 0; + if (!dmu_tx_is_syncing(tx)) + return (0); + + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); + pair != NULL; pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { dsl_dataset_t *ds; - char *htag; + int error = 0; + char *htag, *name; /* must be a snapshot */ - if (strchr(nvpair_name(pair), '@') == NULL) + name = nvpair_name(pair); + if (strchr(name, '@') == NULL) error = SET_ERROR(EINVAL); if (error == 0) error = nvpair_value_string(pair, &htag); - if (error == 0) { - error = dsl_dataset_hold(dp, - nvpair_name(pair), FTAG, &ds); - } + + if (error == 0) + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { error = dsl_dataset_user_hold_check_one(ds, htag, dduha->dduha_minor != 0, tx); dsl_dataset_rele(ds, FTAG); } - if (error != 0) { - rv = error; - fnvlist_add_int32(dduha->dduha_errlist, - nvpair_name(pair), error); + if (error == 0) { + fnvlist_add_string(dduha->dduha_chkholds, name, htag); + } else { + /* + * We register ENOENT errors so they can be correctly + * reported if needed, such as when all holds fail. + */ + fnvlist_add_int32(dduha->dduha_errlist, name, error); + if (error != ENOENT) + return (error); } } - return (rv); + + return (0); } -void -dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, - minor_t minor, uint64_t now, dmu_tx_t *tx) + +static void +dsl_dataset_user_hold_sync_one_impl(nvlist_t *tmpholds, dsl_dataset_t *ds, + const char *htag, minor_t minor, uint64_t now, dmu_tx_t *tx) { dsl_pool_t *dp = ds->ds_dir->dd_pool; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj; - mutex_enter(&ds->ds_lock); + ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); + if (ds->ds_phys->ds_userrefs_obj == 0) { /* * This is the first user hold for this dataset. Create @@ -140,14 +152,26 @@ dsl_dataset_user_hold_sync_one(dsl_datas zapobj = ds->ds_phys->ds_userrefs_obj; } ds->ds_userrefs++; - mutex_exit(&ds->ds_lock); VERIFY0(zap_add(mos, zapobj, htag, 8, 1, &now, tx)); if (minor != 0) { + char name[MAXNAMELEN]; + nvlist_t *tags; + VERIFY0(dsl_pool_user_hold(dp, ds->ds_object, htag, now, tx)); - dsl_register_onexit_hold_cleanup(ds, htag, minor); + (void) snprintf(name, sizeof (name), "%llx", + (u_longlong_t)ds->ds_object); + + if (nvlist_lookup_nvlist(tmpholds, name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(tmpholds, name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } spa_history_log_internal_ds(ds, "hold", tx, @@ -155,140 +179,292 @@ dsl_dataset_user_hold_sync_one(dsl_datas htag, minor != 0, ds->ds_userrefs); } +typedef struct zfs_hold_cleanup_arg { + char zhca_spaname[MAXNAMELEN]; + uint64_t zhca_spa_load_guid; + nvlist_t *zhca_holds; +} zfs_hold_cleanup_arg_t; + +static void +dsl_dataset_user_release_onexit(void *arg) +{ + zfs_hold_cleanup_arg_t *ca = arg; + spa_t *spa; + int error; + + error = spa_open(ca->zhca_spaname, &spa, FTAG); + if (error != 0) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded", + ca->zhca_spaname); + return; + } + if (spa_load_guid(spa) != ca->zhca_spa_load_guid) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded (guid doesn't match)", + ca->zhca_spaname); + spa_close(spa, FTAG); + return; + } + + (void) dsl_dataset_user_release_tmp(spa_get_dsl(spa), ca->zhca_holds); + fnvlist_free(ca->zhca_holds); + kmem_free(ca, sizeof (zfs_hold_cleanup_arg_t)); + spa_close(spa, FTAG); +} + +static void +dsl_onexit_hold_cleanup(spa_t *spa, nvlist_t *holds, minor_t minor) +{ + zfs_hold_cleanup_arg_t *ca; + + if (minor == 0 || nvlist_empty(holds)) { + fnvlist_free(holds); + return; + } + + ASSERT(spa != NULL); + ca = kmem_alloc(sizeof (*ca), KM_SLEEP); + + (void) strlcpy(ca->zhca_spaname, spa_name(spa), + sizeof (ca->zhca_spaname)); + ca->zhca_spa_load_guid = spa_load_guid(spa); + ca->zhca_holds = holds; + VERIFY0(zfs_onexit_add_cb(minor, + dsl_dataset_user_release_onexit, ca, NULL)); +} + +void +dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, + minor_t minor, uint64_t now, dmu_tx_t *tx) +{ + nvlist_t *tmpholds; + + if (minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, htag, minor, now, tx); + dsl_onexit_hold_cleanup(dsl_dataset_get_spa(ds), tmpholds, minor); +} + static void dsl_dataset_user_hold_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; + nvlist_t *tmpholds; uint64_t now = gethrestime_sec(); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { + if (dduha->dduha_minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_chkholds, NULL); + pair != NULL; + pair = nvlist_next_nvpair(dduha->dduha_chkholds, pair)) { dsl_dataset_t *ds; + VERIFY0(dsl_dataset_hold(dp, nvpair_name(pair), FTAG, &ds)); - dsl_dataset_user_hold_sync_one(ds, fnvpair_value_string(pair), - dduha->dduha_minor, now, tx); + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, + fnvpair_value_string(pair), dduha->dduha_minor, now, tx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:11:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F105890; Fri, 5 Jul 2013 04:11:37 +0000 (UTC) (envelope-from delphij@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 4F3301F36; Fri, 5 Jul 2013 04:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654Bb2f076747; Fri, 5 Jul 2013 04:11:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654BZID076733; Fri, 5 Jul 2013 04:11:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050411.r654BZID076733@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252765 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/ope... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:11:37 -0000 Author: delphij Date: Fri Jul 5 04:11:34 2013 New Revision: 252765 URL: http://svnweb.freebsd.org/changeset/base/252765 Log: MFC r251646 + r252219: MFV r251644: Poor ZFS send / receive performance due to snapshot hold / release processing (by smh@) Illumos ZFS issues: 3740 Poor ZFS send / receive performance due to snapshot hold / release processing MFV r252215: Restore a previous behavior before r251646, where when destructing ZFS snapshot, the ioctl would return ENOENT when it hit any of them in the errlist (the new behavior was only return ENOENT when all returns error). Illumos ZFS issues: 3829 fix for 3740 changed behavior of zfs destroy/hold/release ioctl Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_userhold.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:11:34 2013 (r252765) @@ -28,6 +28,7 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -5222,8 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a continue; } if (holding) { - if (zfs_hold(zhp, delim+1, tag, recursive, - B_FALSE, -1) != 0) + if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) Modified: stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -153,7 +154,7 @@ import_pool(const char *target, boolean_ g_importargs.poolname = g_pool; pools = zpool_search_import(g_zfs, &g_importargs); - if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) { + if (nvlist_empty(pools)) { if (!g_importargs.can_be_active) { g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:11:34 2013 (r252765) @@ -23,6 +23,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -4713,7 +4714,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, error = user_release_one(fullname, tag); if (error) - fatal(0, "user_release_one(%s)", fullname, tag); + fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error); VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:11:34 2013 (r252765) @@ -27,6 +27,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #ifndef _LIBZFS_H @@ -611,7 +612,8 @@ extern int zfs_send(zfs_handle_t *, cons extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, - boolean_t, boolean_t, int); + boolean_t, int); +extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *); extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t); extern int zfs_get_holds(zfs_handle_t *, nvlist_t **); extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,12 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -3158,18 +3159,14 @@ static int zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) { struct destroydata *dd = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, dd->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) verify(nvlist_add_boolean(dd->nvl, name) == 0); - zfs_close(szhp); - } rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd); zfs_close(zhp); @@ -3189,7 +3186,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, cha verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0); (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd); - if (nvlist_next_nvpair(dd.nvl, NULL) == NULL) { + if (nvlist_empty(dd.nvl)) { ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT, dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"), zhp->zfs_name, snapname); @@ -3214,7 +3211,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h if (ret == 0) return (0); - if (nvlist_next_nvpair(errlist, NULL) == NULL) { + if (nvlist_empty(errlist)) { char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot destroy snapshots")); @@ -4162,24 +4159,21 @@ struct holdarg { const char *snapname; const char *tag; boolean_t recursive; + int error; }; static int zfs_hold_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) fnvlist_add_string(ha->nvl, name, ha->tag); - zfs_close(szhp); - } if (ha->recursive) rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha); @@ -4189,14 +4183,10 @@ zfs_hold_one(zfs_handle_t *zhp, void *ar int zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag, - boolean_t recursive, boolean_t enoent_ok, int cleanup_fd) + boolean_t recursive, int cleanup_fd) { int ret; struct holdarg ha; - nvlist_t *errors; - libzfs_handle_t *hdl = zhp->zfs_hdl; - char errbuf[1024]; - nvpair_t *elem; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; @@ -4204,26 +4194,44 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { + char errbuf[1024]; + fnvlist_free(ha.nvl); ret = ENOENT; - if (!enoent_ok) { - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, - "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); - } + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(zhp->zfs_hdl, ret, errbuf); return (ret); } - ret = lzc_hold(ha.nvl, cleanup_fd, &errors); + ret = zfs_hold_nvl(zhp, cleanup_fd, ha.nvl); fnvlist_free(ha.nvl); - if (ret == 0) + return (ret); +} + +int +zfs_hold_nvl(zfs_handle_t *zhp, int cleanup_fd, nvlist_t *holds) +{ + int ret; + nvlist_t *errors; + libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; + nvpair_t *elem; + + errors = NULL; + ret = lzc_hold(holds, cleanup_fd, &errors); + + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot hold")); @@ -4263,10 +4271,6 @@ zfs_hold(zfs_handle_t *zhp, const char * case EEXIST: (void) zfs_error(hdl, EZFS_REFTAG_HOLD, errbuf); break; - case ENOENT: - if (enoent_ok) - return (ENOENT); - /* FALLTHROUGH */ default: (void) zfs_standard_error(hdl, fnvpair_value_int32(elem), errbuf); @@ -4277,30 +4281,26 @@ zfs_hold(zfs_handle_t *zhp, const char * return (ret); } -struct releasearg { - nvlist_t *nvl; - const char *snapname; - const char *tag; - boolean_t recursive; -}; - static int zfs_release_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; + nvlist_t *existing_holds; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { - nvlist_t *holds = fnvlist_alloc(); - fnvlist_add_boolean(holds, ha->tag); - fnvlist_add_nvlist(ha->nvl, name, holds); - zfs_close(szhp); + if (lzc_get_holds(name, &existing_holds) != 0) { + ha->error = ENOENT; + } else if (!nvlist_exists(existing_holds, ha->tag)) { + ha->error = ESRCH; + } else { + nvlist_t *torelease = fnvlist_alloc(); + fnvlist_add_boolean(torelease, ha->tag); + fnvlist_add_nvlist(ha->nvl, name, torelease); + fnvlist_free(torelease); } if (ha->recursive) @@ -4315,7 +4315,7 @@ zfs_release(zfs_handle_t *zhp, const cha { int ret; struct holdarg ha; - nvlist_t *errors; + nvlist_t *errors = NULL; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; char errbuf[1024]; @@ -4324,26 +4324,34 @@ zfs_release(zfs_handle_t *zhp, const cha ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; + ha.error = 0; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { fnvlist_free(ha.nvl); - ret = ENOENT; + ret = ha.error; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s@%s'"), zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (ret == ESRCH) { + (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf); + } else { + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); - if (ret == 0) + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:11:34 2013 (r252765) @@ -25,6 +25,7 @@ * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -802,6 +803,7 @@ typedef struct send_dump_data { int outfd; boolean_t err; nvlist_t *fss; + nvlist_t *snapholds; avl_tree_t *fsavl; snapfilter_cb_t *filter_cb; void *filter_cb_arg; @@ -952,41 +954,19 @@ dump_ioctl(zfs_handle_t *zhp, const char return (0); } -static int -hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd) +static void +gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd) { - zfs_handle_t *pzhp; - int error = 0; - char *thissnap; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); - if (sdd->dryrun) - return (0); - /* - * zfs_send() only opens a cleanup_fd for sends that need it, + * zfs_send() only sets snapholds for sends that need them, * e.g. replication and doall. */ - if (sdd->cleanup_fd == -1) - return (0); - - thissnap = strchr(zhp->zfs_name, '@') + 1; - *(thissnap - 1) = '\0'; - pzhp = zfs_open(zhp->zfs_hdl, zhp->zfs_name, ZFS_TYPE_DATASET); - *(thissnap - 1) = '@'; - - /* - * It's OK if the parent no longer exists. The send code will - * handle that error. - */ - if (pzhp) { - error = zfs_hold(pzhp, thissnap, sdd->holdtag, - B_FALSE, B_TRUE, sdd->cleanup_fd); - zfs_close(pzhp); - } + if (sdd->snapholds == NULL) + return; - return (error); + fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag); } static void * @@ -1042,28 +1022,23 @@ dump_snapshot(zfs_handle_t *zhp, void *a send_dump_data_t *sdd = arg; progress_arg_t pa = { 0 }; pthread_t tid; - char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; isfromsnap = (sdd->fromsnap != NULL && strcmp(sdd->fromsnap, thissnap) == 0); if (!sdd->seenfrom && isfromsnap) { - err = hold_for_send(zhp, sdd); - if (err == 0) { - sdd->seenfrom = B_TRUE; - (void) strcpy(sdd->prevsnap, thissnap); - sdd->prevsnap_obj = zfs_prop_get_int(zhp, - ZFS_PROP_OBJSETID); - } else if (err == ENOENT) { - err = 0; - } + gather_holds(zhp, sdd); + sdd->seenfrom = B_TRUE; + (void) strcpy(sdd->prevsnap, thissnap); + sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zfs_close(zhp); - return (err); + return (0); } if (sdd->seento || !sdd->seenfrom) { @@ -1114,14 +1089,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a return (0); } - err = hold_for_send(zhp, sdd); - if (err) { - if (err == ENOENT) - err = 0; - zfs_close(zhp); - return (err); - } - + gather_holds(zhp, sdd); fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); @@ -1389,7 +1357,7 @@ zfs_send(zfs_handle_t *zhp, const char * avl_tree_t *fsavl = NULL; static uint64_t holdseq; int spa_version; - pthread_t tid; + pthread_t tid = 0; int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; @@ -1462,11 +1430,8 @@ zfs_send(zfs_handle_t *zhp, const char * *debugnvp = hdrnv; else nvlist_free(hdrnv); - if (err) { - fsavl_destroy(fsavl); - nvlist_free(fss); + if (err) goto stderr_out; - } } if (!flags->dryrun) { @@ -1490,8 +1455,6 @@ zfs_send(zfs_handle_t *zhp, const char * } free(packbuf); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1502,8 +1465,6 @@ zfs_send(zfs_handle_t *zhp, const char * drr.drr_u.drr_end.drr_checksum = zc; err = write(outfd, &drr, sizeof (drr)); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1515,7 +1476,7 @@ zfs_send(zfs_handle_t *zhp, const char * /* dump each stream */ sdd.fromsnap = fromsnap; sdd.tosnap = tosnap; - if (flags->dedup) + if (tid != 0) sdd.outfd = pipefd[0]; else sdd.outfd = outfd; @@ -1552,36 +1513,71 @@ zfs_send(zfs_handle_t *zhp, const char * err = errno; goto stderr_out; } + sdd.snapholds = fnvlist_alloc(); } else { sdd.cleanup_fd = -1; + sdd.snapholds = NULL; } - if (flags->verbose) { + if (flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output - * before generating any data. Then do a non-verbose real - * run to generate the streams. + * or to gather snapshot hold's before generating any data, + * then do a non-verbose real run to generate the streams. */ sdd.dryrun = B_TRUE; err = dump_filesystems(zhp, &sdd); - sdd.dryrun = flags->dryrun; - sdd.verbose = B_FALSE; - if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", - (longlong_t)sdd.size); - } else { - char buf[16]; - zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, - "total estimated size is %s\n"), buf); + + if (err != 0) + goto stderr_out; + + if (flags->verbose) { + if (flags->parsable) { + (void) fprintf(stderr, "size\t%llu\n", + (longlong_t)sdd.size); + } else { + char buf[16]; + zfs_nicenum(sdd.size, buf, sizeof (buf)); + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } + } + + /* Ensure no snaps found is treated as an error. */ + if (!sdd.seento) { + err = ENOENT; + goto err_out; } + + /* Skip the second run if dryrun was requested. */ + if (flags->dryrun) + goto err_out; + + if (sdd.snapholds != NULL) { + err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds); + if (err != 0) + goto stderr_out; + + fnvlist_free(sdd.snapholds); + sdd.snapholds = NULL; + } + + sdd.dryrun = B_FALSE; + sdd.verbose = B_FALSE; } + err = dump_filesystems(zhp, &sdd); fsavl_destroy(fsavl); nvlist_free(fss); - if (flags->dedup) { - (void) close(pipefd[0]); + /* Ensure no snaps found is treated as an error. */ + if (err == 0 && !sdd.seento) + err = ENOENT; + + if (tid != 0) { + if (err != 0) + (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); + (void) close(pipefd[0]); } if (sdd.cleanup_fd != -1) { @@ -1609,9 +1605,13 @@ zfs_send(zfs_handle_t *zhp, const char * stderr_out: err = zfs_standard_error(zhp->zfs_hdl, err, errbuf); err_out: + fsavl_destroy(fsavl); + nvlist_free(fss); + fnvlist_free(sdd.snapholds); + if (sdd.cleanup_fd != -1) VERIFY(0 == close(sdd.cleanup_fd)); - if (flags->dedup) { + if (tid != 0) { (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); (void) close(pipefd[0]); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -333,7 +334,6 @@ lzc_destroy_snaps(nvlist_t *snaps, boole nvlist_free(args); return (error); - } int @@ -393,11 +393,17 @@ lzc_exists(const char *dataset) * uncleanly, the holds will be released when the pool is next opened * or imported. * - * The return value will be 0 if all holds were created. Otherwise the return - * value will be the errno of a (unspecified) hold that failed, no holds will - * be created, and the errlist will have an entry for each hold that - * failed (name = snapshot). The value in the errlist will be the error - * code (int32). + * Holds for snapshots which don't exist will be skipped and have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if all holds, for snapshots that existed, + * were succesfully created. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed and no holds will be created. + * + * In all cases the errlist will have an entry for each hold that failed + * (name = snapshot), with its value being the error code (int32). */ int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) @@ -434,11 +440,17 @@ lzc_hold(nvlist_t *holds, int cleanup_fd * The snapshots must all be in the same pool. * The value is a nvlist whose keys are the holds to remove. * - * The return value will be 0 if all holds were removed. - * Otherwise the return value will be the errno of a (unspecified) release - * that failed, no holds will be released, and the errlist will have an - * entry for each snapshot that has failed releases (name = snapshot). - * The value in the errlist will be the error code (int32) of a failed release. + * Holds which failed to release because they didn't exist will have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if the nvl holds was empty or all holds that + * existed, were successfully removed. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed to release and no holds will be released. + * + * In all cases the errlist will have an entry for each hold that failed to + * to release. */ int lzc_release(nvlist_t *holds, nvlist_t **errlist) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -127,6 +128,7 @@ dsl_destroy_snapshot_check(void *arg, dm pair = nvlist_next_nvpair(dsda->dsda_errlist, NULL); if (pair != NULL) return (fnvpair_value_int32(pair)); + return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -856,23 +857,34 @@ dsl_pool_clean_tmp_userrefs(dsl_pool_t * zap_cursor_t zc; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj = dp->dp_tmp_userrefs_obj; + nvlist_t *holds; if (zapobj == 0) return; ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); + holds = fnvlist_alloc(); + for (zap_cursor_init(&zc, mos, zapobj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { char *htag; - uint64_t dsobj; + nvlist_t *tags; htag = strchr(za.za_name, '-'); *htag = '\0'; ++htag; - dsobj = strtonum(za.za_name, NULL); - dsl_dataset_user_release_tmp(dp, dsobj, htag); + if (nvlist_lookup_nvlist(holds, za.za_name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(holds, za.za_name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } + dsl_dataset_user_release_tmp(dp, holds); + fnvlist_free(holds); zap_cursor_fini(&zc); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -37,6 +38,7 @@ typedef struct dsl_dataset_user_hold_arg { nvlist_t *dduha_holds; + nvlist_t *dduha_chkholds; nvlist_t *dduha_errlist; minor_t dduha_minor; } dsl_dataset_user_hold_arg_t; @@ -53,25 +55,24 @@ dsl_dataset_user_hold_check_one(dsl_data objset_t *mos = dp->dp_meta_objset; int error = 0; + ASSERT(dsl_pool_config_held(dp)); + if (strlen(htag) > MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* Tempholds have a more restricted length */ if (temphold && strlen(htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* tags must be unique (if ds already exists) */ - if (ds != NULL) { - mutex_enter(&ds->ds_lock); - if (ds->ds_phys->ds_userrefs_obj != 0) { - uint64_t value; - error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, - htag, 8, 1, &value); - if (error == 0) - error = SET_ERROR(EEXIST); - else if (error == ENOENT) - error = 0; - } - mutex_exit(&ds->ds_lock); + if (ds != NULL && ds->ds_phys->ds_userrefs_obj != 0) { + uint64_t value; + + error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, + htag, 8, 1, &value); + if (error == 0) + error = SET_ERROR(EEXIST); + else if (error == ENOENT) + error = 0; } return (error); @@ -82,52 +83,63 @@ dsl_dataset_user_hold_check(void *arg, d { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; - int rv = 0; if (spa_version(dp->dp_spa) < SPA_VERSION_USERREFS) return (SET_ERROR(ENOTSUP)); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { - int error = 0; + if (!dmu_tx_is_syncing(tx)) + return (0); + + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); + pair != NULL; pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { dsl_dataset_t *ds; - char *htag; + int error = 0; + char *htag, *name; /* must be a snapshot */ - if (strchr(nvpair_name(pair), '@') == NULL) + name = nvpair_name(pair); + if (strchr(name, '@') == NULL) error = SET_ERROR(EINVAL); if (error == 0) error = nvpair_value_string(pair, &htag); - if (error == 0) { - error = dsl_dataset_hold(dp, - nvpair_name(pair), FTAG, &ds); - } + + if (error == 0) + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { error = dsl_dataset_user_hold_check_one(ds, htag, dduha->dduha_minor != 0, tx); dsl_dataset_rele(ds, FTAG); } - if (error != 0) { - rv = error; - fnvlist_add_int32(dduha->dduha_errlist, - nvpair_name(pair), error); + if (error == 0) { + fnvlist_add_string(dduha->dduha_chkholds, name, htag); + } else { + /* + * We register ENOENT errors so they can be correctly + * reported if needed, such as when all holds fail. + */ + fnvlist_add_int32(dduha->dduha_errlist, name, error); + if (error != ENOENT) + return (error); } } - return (rv); + + return (0); } -void -dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, - minor_t minor, uint64_t now, dmu_tx_t *tx) + +static void +dsl_dataset_user_hold_sync_one_impl(nvlist_t *tmpholds, dsl_dataset_t *ds, + const char *htag, minor_t minor, uint64_t now, dmu_tx_t *tx) { dsl_pool_t *dp = ds->ds_dir->dd_pool; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj; - mutex_enter(&ds->ds_lock); + ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); + if (ds->ds_phys->ds_userrefs_obj == 0) { /* * This is the first user hold for this dataset. Create @@ -140,14 +152,26 @@ dsl_dataset_user_hold_sync_one(dsl_datas zapobj = ds->ds_phys->ds_userrefs_obj; } ds->ds_userrefs++; - mutex_exit(&ds->ds_lock); VERIFY0(zap_add(mos, zapobj, htag, 8, 1, &now, tx)); if (minor != 0) { + char name[MAXNAMELEN]; + nvlist_t *tags; + VERIFY0(dsl_pool_user_hold(dp, ds->ds_object, htag, now, tx)); - dsl_register_onexit_hold_cleanup(ds, htag, minor); + (void) snprintf(name, sizeof (name), "%llx", + (u_longlong_t)ds->ds_object); + + if (nvlist_lookup_nvlist(tmpholds, name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(tmpholds, name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } spa_history_log_internal_ds(ds, "hold", tx, @@ -155,140 +179,292 @@ dsl_dataset_user_hold_sync_one(dsl_datas htag, minor != 0, ds->ds_userrefs); } +typedef struct zfs_hold_cleanup_arg { + char zhca_spaname[MAXNAMELEN]; + uint64_t zhca_spa_load_guid; + nvlist_t *zhca_holds; +} zfs_hold_cleanup_arg_t; + +static void +dsl_dataset_user_release_onexit(void *arg) +{ + zfs_hold_cleanup_arg_t *ca = arg; + spa_t *spa; + int error; + + error = spa_open(ca->zhca_spaname, &spa, FTAG); + if (error != 0) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded", + ca->zhca_spaname); + return; + } + if (spa_load_guid(spa) != ca->zhca_spa_load_guid) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded (guid doesn't match)", + ca->zhca_spaname); + spa_close(spa, FTAG); + return; + } + + (void) dsl_dataset_user_release_tmp(spa_get_dsl(spa), ca->zhca_holds); + fnvlist_free(ca->zhca_holds); + kmem_free(ca, sizeof (zfs_hold_cleanup_arg_t)); + spa_close(spa, FTAG); +} + +static void +dsl_onexit_hold_cleanup(spa_t *spa, nvlist_t *holds, minor_t minor) +{ + zfs_hold_cleanup_arg_t *ca; + + if (minor == 0 || nvlist_empty(holds)) { + fnvlist_free(holds); + return; + } + + ASSERT(spa != NULL); + ca = kmem_alloc(sizeof (*ca), KM_SLEEP); + + (void) strlcpy(ca->zhca_spaname, spa_name(spa), + sizeof (ca->zhca_spaname)); + ca->zhca_spa_load_guid = spa_load_guid(spa); + ca->zhca_holds = holds; + VERIFY0(zfs_onexit_add_cb(minor, + dsl_dataset_user_release_onexit, ca, NULL)); +} + +void +dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, + minor_t minor, uint64_t now, dmu_tx_t *tx) +{ + nvlist_t *tmpholds; + + if (minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, htag, minor, now, tx); + dsl_onexit_hold_cleanup(dsl_dataset_get_spa(ds), tmpholds, minor); +} + static void dsl_dataset_user_hold_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; + nvlist_t *tmpholds; uint64_t now = gethrestime_sec(); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { + if (dduha->dduha_minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_chkholds, NULL); + pair != NULL; + pair = nvlist_next_nvpair(dduha->dduha_chkholds, pair)) { dsl_dataset_t *ds; + VERIFY0(dsl_dataset_hold(dp, nvpair_name(pair), FTAG, &ds)); - dsl_dataset_user_hold_sync_one(ds, fnvpair_value_string(pair), - dduha->dduha_minor, now, tx); + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, + fnvpair_value_string(pair), dduha->dduha_minor, now, tx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:16:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE110A2D; Fri, 5 Jul 2013 04:16:03 +0000 (UTC) (envelope-from delphij@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 AEE551F67; Fri, 5 Jul 2013 04:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654G3iR077321; Fri, 5 Jul 2013 04:16:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654G3BX077320; Fri, 5 Jul 2013 04:16:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050416.r654G3BX077320@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:16: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: r252766 - stable/9/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:16:03 -0000 Author: delphij Date: Fri Jul 5 04:16:03 2013 New Revision: 252766 URL: http://svnweb.freebsd.org/changeset/base/252766 Log: MFC r252218: Diff reduction against Illumos, no real change to code itself. This marks vendor branch revision 252213 as merged, the actual code was committed in r245479. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:11:34 2013 (r252765) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:03 2013 (r252766) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:16:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B67EB65; Fri, 5 Jul 2013 04:16:53 +0000 (UTC) (envelope-from delphij@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 5D63B1F6F; Fri, 5 Jul 2013 04:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654GrB1077439; Fri, 5 Jul 2013 04:16:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654GrL1077438; Fri, 5 Jul 2013 04:16:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050416.r654GrL1077438@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252767 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:16:53 -0000 Author: delphij Date: Fri Jul 5 04:16:52 2013 New Revision: 252767 URL: http://svnweb.freebsd.org/changeset/base/252767 Log: MFC r252218: Diff reduction against Illumos, no real change to code itself. This marks vendor branch revision 252213 as merged, the actual code was committed in r245479. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:03 2013 (r252766) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:52 2013 (r252767) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:22:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3AC3CDD; Fri, 5 Jul 2013 04:22:40 +0000 (UTC) (envelope-from delphij@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 A68641F9A; Fri, 5 Jul 2013 04:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654Me9Z079804; Fri, 5 Jul 2013 04:22:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654MeGJ079803; Fri, 5 Jul 2013 04:22:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050422.r654MeGJ079803@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:22: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: r252768 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:22:40 -0000 Author: delphij Date: Fri Jul 5 04:22:40 2013 New Revision: 252768 URL: http://svnweb.freebsd.org/changeset/base/252768 Log: MFC r252360: Don't attempt to do DHCP on certain interfaces, similar to what's done for ipv6_autoconfif() in r212577. Modified: stable/9/etc/network.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Fri Jul 5 04:16:52 2013 (r252767) +++ stable/9/etc/network.subr Fri Jul 5 04:22:40 2013 (r252768) @@ -306,6 +306,15 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + case $1 in + lo[0-9]*|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) + return 1 + ;; + esac if noafif $1; then return 1 fi @@ -491,7 +500,7 @@ ipv6_autoconfif() _if=$1 case $_if in - lo0|\ + lo[0-9]*|\ stf[0-9]*|\ faith[0-9]*|\ lp[0-9]*|\ From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 04:24:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 607DDE20; Fri, 5 Jul 2013 04:24:22 +0000 (UTC) (envelope-from delphij@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 5310B1FAA; Fri, 5 Jul 2013 04:24:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654OMOH080066; Fri, 5 Jul 2013 04:24:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654OMKj080065; Fri, 5 Jul 2013 04:24:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050424.r654OMKj080065@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:24: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: r252769 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 04:24:22 -0000 Author: delphij Date: Fri Jul 5 04:24:21 2013 New Revision: 252769 URL: http://svnweb.freebsd.org/changeset/base/252769 Log: MFC r252523: When listing with -f, skip all memory disks that are not vnode-backed. Noticed by: kevlo Modified: stable/9/sbin/mdconfig/mdconfig.c Directory Properties: stable/9/sbin/mdconfig/ (props changed) Modified: stable/9/sbin/mdconfig/mdconfig.c ============================================================================== --- stable/9/sbin/mdconfig/mdconfig.c Fri Jul 5 04:22:40 2013 (r252768) +++ stable/9/sbin/mdconfig/mdconfig.c Fri Jul 5 04:24:21 2013 (r252769) @@ -429,7 +429,8 @@ md_list(const char *units, int opt, cons continue; else ffound = 1; - } + } else if (fflag != NULL) + continue; if (nflag && strncmp(pp->lg_name, MD_NAME, 2) == 0) printf("%s", pp->lg_name + 2); else From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 06:20:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 46F7AD03; Fri, 5 Jul 2013 06:20:02 +0000 (UTC) (envelope-from dteske@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 203531291; Fri, 5 Jul 2013 06:20:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r656K2JD012809; Fri, 5 Jul 2013 06:20:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r656K2Ic012808; Fri, 5 Jul 2013 06:20:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050620.r656K2Ic012808@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 06:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252771 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 06:20:02 -0000 Author: dteske Date: Fri Jul 5 06:20:01 2013 New Revision: 252771 URL: http://svnweb.freebsd.org/changeset/base/252771 Log: Minor debugging changes/additions. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 05:47:10 2013 (r252770) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:20:01 2013 (r252771) @@ -135,6 +135,7 @@ f_package_select() [ "$package" = "$pkgsel" ] && return done SELECTED_PACKAGES="$SELECTED_PACKAGES $package" + f_dprintf "Added %s to selection list" "$package" done SELECTED_PACKAGES="${SELECTED_PACKAGES# }" # Trim leading space } @@ -157,6 +158,7 @@ f_package_deselect() new_list="$new_list${new_list:+ }$pkgsel" done SELECTED_PACKAGES="$new_list" + f_dprintf "Removed %s from selection list" "$package" done } @@ -584,8 +586,8 @@ f_package_review() local menu_list # Calculated below local hline="$hline_alnum_arrows_punc_tab_enter" - f_dprintf "f_package_review: SELECTED_PACKAGES=[%s]" \ - "$SELECTED_PACKAGES" + local fname=f_package_review + f_dprintf "%s: SELECTED_PACKAGES=[%s]" $fname "$SELECTED_PACKAGES" prompt=$( printf "$msg_reviewing_selected_packages" "$_All_nselected" ) @@ -635,24 +637,27 @@ f_package_review() for package in $SELECTED_PACKAGES; do mark= f_str2varname "$package" varpkg - f_getvar _mark_$varpkg mark + debug= f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue + f_dprintf "%s: Installing %s package" $fname "$package" f_package_add "$package" || continue f_package_deselect "$package" done for package in $SELECTED_PACKAGES; do mark= f_str2varname "$package" varpkg - f_getvar _mark_$varpkg mark + debug= f_getvar _mark_$varpkg mark [ "$mark" = "R" ] || continue + f_dprintf "%s: Reinstalling %s package" $fname "$package" # XXX Re-install package f_package_deselect "$package" done for package in $SELECTED_PACKAGES; do mark= f_str2varname "$package" varpkg - f_getvar _mark_$varpkg mark + debug= f_getvar _mark_$varpkg mark [ "$mark" = "U" ] || continue + f_dprintf "%s: Uninstalling %s package" $fname "$package" # XXX Uninstall package f_package_deselect "$package" done @@ -951,6 +956,10 @@ f_package_extract() { local device="$1" name="$2" depended="$3" + local fname=f_package_extract + f_dprintf "%s: device=[%s] name=[%s] depended=[%s]" \ + $fname "$device" "$name" "$depended" + # Check to make sure it's not already there local varpkg mark= f_str2varname "$name" varpkg @@ -983,8 +992,6 @@ f_package_extract() esac esac - local fname=f_package_extract - # We have a path, call the device strategy routine to get the file local pkg_ext probe_only=1 found= for pkg_ext in "" $PACKAGE_EXTENSIONS; do From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 06:22:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB924E62; Fri, 5 Jul 2013 06:22:25 +0000 (UTC) (envelope-from dteske@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 DE77B12A9; Fri, 5 Jul 2013 06:22:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r656MPZ1014771; Fri, 5 Jul 2013 06:22:25 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r656MPqn014770; Fri, 5 Jul 2013 06:22:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050622.r656MPqn014770@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 06:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252772 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 06:22:26 -0000 Author: dteske Date: Fri Jul 5 06:22:25 2013 New Revision: 252772 URL: http://svnweb.freebsd.org/changeset/base/252772 Log: Don't deselect a package right after installing it (this went unnoticed because [currently] we exit after performing requests actions -- if we ever change this to returning to the package selection screen, this would have made an impact). Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:20:01 2013 (r252771) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:22:25 2013 (r252772) @@ -641,7 +641,6 @@ f_package_review() [ "$mark" = "I" ] || continue f_dprintf "%s: Installing %s package" $fname "$package" f_package_add "$package" || continue - f_package_deselect "$package" done for package in $SELECTED_PACKAGES; do mark= @@ -650,7 +649,6 @@ f_package_review() [ "$mark" = "R" ] || continue f_dprintf "%s: Reinstalling %s package" $fname "$package" # XXX Re-install package - f_package_deselect "$package" done for package in $SELECTED_PACKAGES; do mark= From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 06:24:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3796DDC; Fri, 5 Jul 2013 06:24:19 +0000 (UTC) (envelope-from dteske@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 2A61F12FE; Fri, 5 Jul 2013 06:24:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r656OJRS015084; Fri, 5 Jul 2013 06:24:19 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r656OJVa015083; Fri, 5 Jul 2013 06:24:19 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050624.r656OJVa015083@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 06:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252773 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 06:24:19 -0000 Author: dteske Date: Fri Jul 5 06:24:18 2013 New Revision: 252773 URL: http://svnweb.freebsd.org/changeset/base/252773 Log: Prevent f_package_add() from re-performing f_package_detect_installed() even though f_package_config() may have already detected the installed packages. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:22:25 2013 (r252772) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:24:18 2013 (r252773) @@ -681,6 +681,7 @@ f_package_config() # Detect installed packages (updates marks/SELECTED_PACKAGES) f_package_detect_installed + export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] local retval category varcat defaultitem category_defaultitem="" while :; do From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 06:46:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3376FEF8; Fri, 5 Jul 2013 06:46:12 +0000 (UTC) (envelope-from dteske@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 261E216FC; Fri, 5 Jul 2013 06:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r656kCZM021388; Fri, 5 Jul 2013 06:46:12 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r656kCbu021387; Fri, 5 Jul 2013 06:46:12 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050646.r656kCbu021387@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 06:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252774 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 06:46:12 -0000 Author: dteske Date: Fri Jul 5 06:46:11 2013 New Revision: 252774 URL: http://svnweb.freebsd.org/changeset/base/252774 Log: Add minor debugging. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:24:18 2013 (r252773) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:46:11 2013 (r252774) @@ -881,6 +881,7 @@ f_package_add() # detected the installed packages -- something we should do only once. # if [ ! "$PACKAGES_DETECTED" ]; then + f_dprintf "f_package_add: Detecting installed packages" f_package_detect_installed export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] fi From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 06:52:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7A20234; Fri, 5 Jul 2013 06:52:08 +0000 (UTC) (envelope-from dteske@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 8842A1740; Fri, 5 Jul 2013 06:52:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r656q874023753; Fri, 5 Jul 2013 06:52:08 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r656q7Lj023750; Fri, 5 Jul 2013 06:52:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307050652.r656q7Lj023750@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 06:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252775 - in head/usr.sbin/bsdconfig: include share share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 06:52:08 -0000 Author: dteske Date: Fri Jul 5 06:52:07 2013 New Revision: 252775 URL: http://svnweb.freebsd.org/changeset/base/252775 Log: Add the necessary code to uninstall packages (re-install still pending). Both scripted access (packageDelete) and UI access have been tested successfully with a variation of different situations including: + Uninstall a package which no other installed package depends + Uninstall multiple packages which no other installed packages depend + Uninstall multiple packages which depend on each other + Similar to above but when ordered removal requires tracing dependencies + Purposefully do things like uninstall a package that is not installed + Try to uninstall a package which other installed packages still depend + Try to uninstall multiple packages which other installed packages depend + And many more. Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Fri Jul 5 06:46:11 2013 (r252774) +++ head/usr.sbin/bsdconfig/include/messages.subr Fri Jul 5 06:52:07 2013 (r252775) @@ -255,6 +255,9 @@ msg_ok="OK" msg_options="Options" msg_options_editor="Options Editor" msg_other="other" +msg_pkg_delete_failed="Warning: pkg_delete of %s failed.\n Run with debugging for details." +msg_package_is_needed_by_other_installed_packages="Warning: Package %s is needed by\n %d other installed package%s." +msg_package_not_installed_cannot_delete="Warning: package %s not installed\n No package can be deleted." msg_package_read_successfully_waiting_for_pkg_add="Package %s read successfully - waiting for pkg_add(1)" msg_package_temp="Package Temp" msg_package_was_added_successfully="Package %s was added successfully" @@ -376,6 +379,7 @@ msg_unable_to_make_directory_mountpoint= msg_unable_to_open="Unable to open %s" msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" +msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg_delete(1)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:46:11 2013 (r252774) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 06:52:07 2013 (r252775) @@ -656,7 +656,7 @@ f_package_review() debug= f_getvar _mark_$varpkg mark [ "$mark" = "U" ] || continue f_dprintf "%s: Uninstalling %s package" $fname "$package" - # XXX Uninstall package + f_package_delete "$package" || continue f_package_deselect "$package" done @@ -1057,6 +1057,135 @@ f_package_extract() return $SUCCESS } +# f_package_delete $name +# +# Delete package by full $name (lacks archive suffix; e.g., `.tbz'). +# +f_package_delete() +{ + local name="$1" + local fname=f_package_delete + + if ! { [ "$name" ] || { f_getvar $VAR_PACKAGE name && [ "$name" ]; }; } + then + f_dprintf "packageDelete: %s" \ + "$msg_no_package_name_passed_in_package_variable" + return $FAILURE + fi + + f_dprintf "%s: name=[%s]" $fname "$name" + + [ "$name" ] || return $FAILURE + + { # Verify and initialize device media if-defined + f_media_verify && + f_device_init media && + f_index_initialize packages/INDEX + } || return $FAILURE + + # Now we have (indirectly via f_index_read()): + # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} + # PACKAGE_CATEGORIES _npkgs + + local varpkg + f_str2varname "$name" varpkg + + # Just as-in the user-interface (opposed to scripted-use), only allow + # packages with at least one category to be recognized. + # + local pkgcat= + if ! f_getvar _categories_$varpkg pkgcat || [ ! "$pkgcat" ]; then + # $pkg may be a partial name, search the index (this is slow) + f_index_search PACKAGE_INDEX "$name" name + if [ ! "$name" ]; then + f_show_msg \ + "$msg_sorry_package_was_not_found_in_the_index" \ + "$name" + return $FAILURE + fi + f_str2varname "$name" varpkg + fi + + # If invoked through the scripted interface, we likely have not yet + # detected the installed packages -- something we should do only once. + # + if [ ! "$PACKAGES_DETECTED" ]; then + f_dprintf "%s: Detecting installed packages" $fname + f_package_detect_installed + export PACKAGES_DETECTED=1 # exported for awk(1) ENVIRON[] + fi + # Now we have: _mark_{varpkg}=X for all installed packages + + # + # Return failure if the package is not already installed. + # + local pkgmark= + f_getvar _mark_$varpkg pkgmark + if ! [ "$pkgmark" -a ! "${pkgmark#[XUR]}" ]; then + f_show_msg "$msg_package_not_installed_cannot_delete" "$name" + return $FAILURE + fi + + # + # Check for dependencies + # + local pkgsel depc=0 udeps= + for pkgsel in $SELECTED_PACKAGES; do + local mark= + f_str2varname $pkgsel varpkg + debug= f_getvar _mark_$varpkg mark + [ "$mark" -a ! "${mark#[XUR]}" ] || continue + local dep rundeps= + debug= f_getvar _rundeps_$varpkg rundeps + for dep in $rundeps; do + if [ "$dep" = "$name" ]; then + # Maybe this package is marked for deletion too + if [ "$mark" = "U" ]; then + udeps="$udeps $pkgsel" + else + depc=$(( $depc + 1 )) + fi + break + fi + done + done + if [ $depc -gt 0 ]; then + local grammatical_s= + [ $depc -gt 1 ] && grammatical_s=s + f_show_msg \ + "$msg_package_is_needed_by_other_installed_packages" \ + "$name" "$depc" "$grammatical_s" + return $FAILURE + fi + + # + # Chase dependencies that are marked for uninstallation + # + for pkgsel in $udeps; do + f_dprintf "%s: Uninstalling dependecy %s (marked for delete)" \ + $fname "$pkgsel" + f_package_delete "$pkgsel" + done + + # + # OK to perform the delete (no other packages depend on it)... + # + f_show_info "$msg_uninstalling_package_waiting_for_pkg_delete" "$name" + if f_debugging; then + pkg_delete -v "$name" + else + f_quietly pkg_delete "$name" + fi + if [ $? -ne $SUCCESS ]; then + f_show_msg "$msg_pkg_delete_failed" "$name" + return $FAILURE + else + f_dprintf "%s: pkg_delete(1) of %s successful" $fname "$name" + f_str2varname "$name" varpkg + setvar _mark_$varpkg "" + fi +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 06:46:11 2013 (r252774) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 06:52:07 2013 (r252775) @@ -195,6 +195,7 @@ f_resword_new configPCNFSD f_config_pcnf # packages/packages.subr f_resword_new configPackages f_package_config f_resword_new packageAdd f_package_add +f_resword_new packageDelete f_package_delete # variable.subr f_resword_new installVarDefaults f_variable_set_defaults From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 08:16:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 66AEE373; Fri, 5 Jul 2013 08:16:41 +0000 (UTC) (envelope-from marck@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 58C131A00; Fri, 5 Jul 2013 08:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r658GfmD047981; Fri, 5 Jul 2013 08:16:41 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r658GeNL047974; Fri, 5 Jul 2013 08:16:40 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201307050816.r658GeNL047974@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 5 Jul 2013 08: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: r252776 - in stable/9: . sbin/hastctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 08:16:41 -0000 Author: marck (doc committer) Date: Fri Jul 5 08:16:40 2013 New Revision: 252776 URL: http://svnweb.freebsd.org/changeset/base/252776 Log: Finish MFC of r248291,249741: Change 'status' command to produce one-line easy-parseable output. Approved by: trociny Modified: stable/9/UPDATING stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c Directory Properties: stable/9/sbin/hastctl/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/UPDATING Fri Jul 5 08:16:40 2013 (r252776) @@ -11,6 +11,10 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130705: + hastctl(8)'s `status' command output changed to terse one-liner format. + Scripts using this should switch to `list' command or be rewritten. + 20130618: Fix a bug that allowed a tracing process (e.g. gdb) to write to a memory-mapped file in the traced process's address space Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/sbin/hastctl/hastctl.8 Fri Jul 5 08:16:40 2013 (r252776) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2013 +.Dd July 5, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -145,18 +145,10 @@ GEOM provider will not be created on secondary node. .El .It Cm list -.It Cm status Present verbose status of the configured resources. -For now, list and status commands are equivalent. -In the near future the output of -.Nm -status command will change to more terse format. -If you use ` -.Nm -status' for parsing in your scripts, switch to ` -.Nm -list'. - +.It Cm status +Present terse (and more easy machine-parseable) status of the configured +resources. .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/sbin/hastctl/hastctl.c Fri Jul 5 08:16:40 2013 (r252776) @@ -291,7 +291,7 @@ control_set_role(struct nv *nv, const ch } static int -control_status(struct nv *nv) +control_list(struct nv *nv) { unsigned int ii; const char *str; @@ -355,6 +355,43 @@ control_status(struct nv *nv) return (ret); } +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, hprinted, ret; + + hprinted = 0; + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, "resource%u", ii); + if (str == NULL) + break; + if (!hprinted) { + printf("Name\tStatus\t Role\t\tComponents\n"); + hprinted = 1; + } + printf("%s\t", str); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf("ERR%d\n", error); + continue; + } + str = nv_get_string(nv, "status%u", ii); + printf("%-9s", (str != NULL) ? str : "-"); + printf("%-15s", nv_get_string(nv, "role%u", ii)); + printf("%s\t", + nv_get_string(nv, "localpath%u", ii)); + printf("%s\n", + nv_get_string(nv, "remoteaddr%u", ii)); + } + return (ret); +} + int main(int argc, char *argv[]) { @@ -523,6 +560,8 @@ main(int argc, char *argv[]) error = control_set_role(nv, argv[0]); break; case CMD_LIST: + error = control_list(nv); + break; case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 08:17:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B11A4CE; Fri, 5 Jul 2013 08:17:49 +0000 (UTC) (envelope-from marck@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 5D38A1A1F; Fri, 5 Jul 2013 08:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r658HnAk048160; Fri, 5 Jul 2013 08:17:49 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r658Hm0c048157; Fri, 5 Jul 2013 08:17:48 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201307050817.r658Hm0c048157@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 5 Jul 2013 08:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252777 - in stable/8: . sbin/hastctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 08:17:49 -0000 Author: marck (doc committer) Date: Fri Jul 5 08:17:48 2013 New Revision: 252777 URL: http://svnweb.freebsd.org/changeset/base/252777 Log: Finish MFC of r248291,249741: Change 'status' command to produce one-line easy-parseable output. Approved by: trociny Modified: stable/8/UPDATING stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/UPDATING Fri Jul 5 08:17:48 2013 (r252777) @@ -15,6 +15,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130705: + hastctl(8)'s `status' command output changed to terse one-liner format. + Scripts using this should switch to `list' command or be rewritten. + 20130624: Added ZFS TRIM support which is enabled by default. To disable ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf. Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/sbin/hastctl/hastctl.8 Fri Jul 5 08:17:48 2013 (r252777) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2013 +.Dd July 5, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -145,18 +145,10 @@ GEOM provider will not be created on secondary node. .El .It Cm list -.It Cm status Present verbose status of the configured resources. -For now, list and status commands are equivalent. -In the near future the output of -.Nm -status command will change to more terse format. -If you use ` -.Nm -status' for parsing in your scripts, switch to ` -.Nm -list'. - +.It Cm status +Present terse (and more easy machine-parseable) status of the configured +resources. .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/sbin/hastctl/hastctl.c Fri Jul 5 08:17:48 2013 (r252777) @@ -291,7 +291,7 @@ control_set_role(struct nv *nv, const ch } static int -control_status(struct nv *nv) +control_list(struct nv *nv) { unsigned int ii; const char *str; @@ -355,6 +355,43 @@ control_status(struct nv *nv) return (ret); } +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, hprinted, ret; + + hprinted = 0; + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, "resource%u", ii); + if (str == NULL) + break; + if (!hprinted) { + printf("Name\tStatus\t Role\t\tComponents\n"); + hprinted = 1; + } + printf("%s\t", str); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf("ERR%d\n", error); + continue; + } + str = nv_get_string(nv, "status%u", ii); + printf("%-9s", (str != NULL) ? str : "-"); + printf("%-15s", nv_get_string(nv, "role%u", ii)); + printf("%s\t", + nv_get_string(nv, "localpath%u", ii)); + printf("%s\n", + nv_get_string(nv, "remoteaddr%u", ii)); + } + return (ret); +} + int main(int argc, char *argv[]) { @@ -523,6 +560,8 @@ main(int argc, char *argv[]) error = control_set_role(nv, argv[0]); break; case CMD_LIST: + error = control_list(nv); + break; case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 08:59:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E2876F79; Fri, 5 Jul 2013 08:59:22 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id AA5A61D3D; Fri, 5 Jul 2013 08:59:22 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id AB9B54E8C; Fri, 5 Jul 2013 08:59:21 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 5A3192F1B4; Fri, 5 Jul 2013 10:59:21 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Tim Kientzle Subject: Re: svn commit: r252375 - head/lib/libfetch References: <201306291551.r5TFpRc6022283@svn.freebsd.org> Date: Fri, 05 Jul 2013 10:59:21 +0200 In-Reply-To: <201306291551.r5TFpRc6022283@svn.freebsd.org> (Tim Kientzle's message of "Sat, 29 Jun 2013 15:51:27 +0000 (UTC)") Message-ID: <86hag99yc6.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 08:59:23 -0000 Tim Kientzle writes: > Log: > Fix -Wunsequenced warning. >=20=20=20 > Submitted by: dt71@gmx.com Neither approved by nor even discussed with the author and maintainer. (not saying it's wrong, but...) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 09:36:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C02056EA; Fri, 5 Jul 2013 09:36:12 +0000 (UTC) (envelope-from achim@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 B0A2A1EF1; Fri, 5 Jul 2013 09:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r659aCWU071335; Fri, 5 Jul 2013 09:36:12 GMT (envelope-from achim@svn.freebsd.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r659aAZM071318; Fri, 5 Jul 2013 09:36:10 GMT (envelope-from achim@svn.freebsd.org) Message-Id: <201307050936.r659aAZM071318@svn.freebsd.org> From: Achim Leubner Date: Fri, 5 Jul 2013 09:36:10 +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: r252778 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/aacraid sys/i386/conf sys/ia64/conf sys/modules sys/modules/aacraid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 09:36:12 -0000 Author: achim Date: Fri Jul 5 09:36:09 2013 New Revision: 252778 URL: http://svnweb.freebsd.org/changeset/base/252778 Log: MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Approved by: emaste (co-mentor) Added: stable/9/share/man/man4/aacraid.4 - copied, changed from r250963, head/share/man/man4/aacraid.4 stable/9/sys/dev/aacraid/ - copied from r250963, head/sys/dev/aacraid/ stable/9/sys/modules/aacraid/ - copied from r250963, head/sys/modules/aacraid/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/GENERIC stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files stable/9/sys/conf/options stable/9/sys/dev/aacraid/aacraid.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/NOTES stable/9/sys/ia64/conf/GENERIC stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/share/man/man4/Makefile Fri Jul 5 09:36:09 2013 (r252778) @@ -2,6 +2,7 @@ # $FreeBSD$ MAN= aac.4 \ + aacraid.4 \ acpi.4 \ ${_acpi_asus.4} \ ${_acpi_dock.4} \ Copied and modified: stable/9/share/man/man4/aacraid.4 (from r250963, head/share/man/man4/aacraid.4) ============================================================================== --- head/share/man/man4/aacraid.4 Fri May 24 09:22:43 2013 (r250963, copy source) +++ stable/9/share/man/man4/aacraid.4 Fri Jul 5 09:36:09 2013 (r252778) @@ -53,10 +53,10 @@ The driver provides support for the Adaptec by PMC RAID controllers, including Series 6/7/8 and upcoming families. .Pp -The RAID containers are handled via the +The RAID containers are handled via the .Nm aacraidp0 bus. -The physical buses are represented by the +The physical buses are represented by the .Nm aacraidp? devices (beginning with aacraidp1). These devices enable the SCSI pass-thru interface and allows devices connected @@ -135,5 +135,4 @@ and are also queued for retrieval by a m .An Scott Long .Aq scottl@FreeBSD.org .Sh BUGS -.Pp The controller is not actually paused on suspend/resume. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/amd64/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -145,6 +145,7 @@ device tws # LSI 3ware 9750 SATA+SAS 6 # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/amd64/conf/NOTES Fri Jul 5 09:36:09 2013 (r252778) @@ -407,6 +407,10 @@ device aac device aacp # SCSI Passthrough interface (optional, CAM required) # +# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families +device aacraid # Container interface, CAM required + +# # Highpoint RocketRAID 27xx. device hpt27xx Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/conf/files Fri Jul 5 09:36:09 2013 (r252778) @@ -440,6 +440,11 @@ dev/aac/aac_debug.c optional aac dev/aac/aac_disk.c optional aac dev/aac/aac_linux.c optional aac compat_linux dev/aac/aac_pci.c optional aac pci +dev/aacraid/aacraid.c optional aacraid +dev/aacraid/aacraid_cam.c optional aacraid scbus +dev/aacraid/aacraid_debug.c optional aacraid +dev/aacraid/aacraid_linux.c optional aacraid compat_linux +dev/aacraid/aacraid_pci.c optional aacraid pci dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/conf/options Fri Jul 5 09:36:09 2013 (r252778) @@ -31,6 +31,7 @@ # opt_.h AAC_DEBUG opt_aac.h +AACRAID_DEBUG opt_aacraid.h AHC_ALLOW_MEMIO opt_aic7xxx.h AHC_TMODE_ENABLE opt_aic7xxx.h AHC_DUMP_EEPROM opt_aic7xxx.h Modified: stable/9/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Fri May 24 09:22:43 2013 (r250963) +++ stable/9/sys/dev/aacraid/aacraid.c Fri Jul 5 09:36:09 2013 (r252778) @@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc srb_sg_address = (u_int64_t)sgp->SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { -#ifdef __amd64__ +#ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; srb_sg_bytecount = sgp->SgByteCount; @@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc cm->cm_flags |= AAC_CMD_DATAOUT; if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { - if ((error = copyin( -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyin((void *)(uintptr_t)srb_sg_address, cm->cm_data, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() alloc. mem.? */ @@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc /* copy data */ if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) { - if ((error = copyout(cm->cm_data, -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyout(cm->cm_data, + (void *)(uintptr_t)srb_sg_address, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() allocated mem.? */ Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/i386/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -151,6 +151,7 @@ device tws # LSI 3ware 9750 SATA+SAS 6 # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/i386/conf/NOTES Fri Jul 5 09:36:09 2013 (r252778) @@ -719,6 +719,10 @@ hint.stg.0.port="11" device aac device aacp # SCSI Passthrough interface (optional, CAM required) +# +# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families +device aacraid # Container interface, CAM required + # The 'asr' driver provides support for current DPT/Adaptec SCSI RAID # controllers (SmartRAID V and VI and later). # These controllers require the CAM infrastructure. Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/ia64/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -105,6 +105,7 @@ device ctl # CAM Target Layer # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mlx # Mylex DAC960 family Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/modules/Makefile Fri Jul 5 09:36:09 2013 (r252778) @@ -9,6 +9,7 @@ SUBDIR= \ ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ + ${_aacraid} \ accf_data \ accf_dns \ accf_http \ @@ -532,6 +533,7 @@ _zfs= zfs .endif .if ${MACHINE} == "i386" _aac= aac +_aacraid= aacraid _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) _aesni= aesni @@ -613,6 +615,7 @@ _snc= snc .if ${MACHINE_CPUARCH} == "amd64" _aac= aac +_aacraid= aacraid _aout= aout _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -736,6 +739,7 @@ _zfs= zfs .if ${MACHINE_CPUARCH} == "ia64" _aac= aac +_aacraid= aacraid _aic= aic _an= an _arcnet= arcnet From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 10:08:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3701B4D; Fri, 5 Jul 2013 10:08:50 +0000 (UTC) (envelope-from tuexen@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 C55131034; Fri, 5 Jul 2013 10:08:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65A8o8Y080530; Fri, 5 Jul 2013 10:08:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65A8n8B080521; Fri, 5 Jul 2013 10:08:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307051008.r65A8n8B080521@svn.freebsd.org> From: Michael Tuexen Date: Fri, 5 Jul 2013 10:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252779 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 10:08:50 -0000 Author: tuexen Date: Fri Jul 5 10:08:49 2013 New Revision: 252779 URL: http://svnweb.freebsd.org/changeset/base/252779 Log: Fix a bug were only 2048 streams where usable even though more than 2048 streams were negotiated on the wire. While there, remove the hard coded limit of 2048 streams. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Fri Jul 5 09:36:09 2013 (r252778) +++ head/sys/netinet/sctp_constants.h Fri Jul 5 10:08:49 2013 (r252779) @@ -521,9 +521,6 @@ __FBSDID("$FreeBSD$"); /* How long a cookie lives in milli-seconds */ #define SCTP_DEFAULT_COOKIE_LIFE 60000 -/* resource limit of streams */ -#define MAX_SCTP_STREAMS 2048 - /* Maximum the mapping array will grow to (TSN mapping array) */ #define SCTP_MAPPING_ARRAY 512 @@ -658,6 +655,7 @@ __FBSDID("$FreeBSD$"); /* How many streams I request initally by default */ #define SCTP_OSTREAM_INITIAL 10 +#define SCTP_ISTREAM_INITIAL 2048 /* * How many smallest_mtu's need to increase before a window update sack is Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Jul 5 09:36:09 2013 (r252778) +++ head/sys/netinet/sctp_input.c Fri Jul 5 10:08:49 2013 (r252779) @@ -389,9 +389,10 @@ sctp_process_init(struct sctp_init_chunk } SCTP_FREE(asoc->strmin, SCTP_M_STRMI); } - asoc->streamincnt = ntohs(init->num_outbound_streams); - if (asoc->streamincnt > MAX_SCTP_STREAMS) { - asoc->streamincnt = MAX_SCTP_STREAMS; + if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) { + asoc->streamincnt = ntohs(init->num_outbound_streams); + } else { + asoc->streamincnt = asoc->max_inbound_streams; } SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt * sizeof(struct sctp_stream_in), SCTP_M_STRMI); @@ -403,11 +404,6 @@ sctp_process_init(struct sctp_init_chunk for (i = 0; i < asoc->streamincnt; i++) { asoc->strmin[i].stream_no = i; asoc->strmin[i].last_sequence_delivered = 0xffff; - /* - * U-stream ranges will be set when the cookie is unpacked. - * Or for the INIT sender they are un set (if pr-sctp not - * supported) when the INIT-ACK arrives. - */ TAILQ_INIT(&asoc->strmin[i].inqueue); asoc->strmin[i].delivery_started = 0; } Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Jul 5 09:36:09 2013 (r252778) +++ head/sys/netinet/sctp_pcb.c Fri Jul 5 10:08:49 2013 (r252779) @@ -2503,9 +2503,6 @@ sctp_inpcb_alloc(struct socket *so, uint m->initial_rto = SCTP_BASE_SYSCTL(sctp_rto_initial_default); m->initial_init_rto_max = SCTP_BASE_SYSCTL(sctp_init_rto_max_default); m->sctp_sack_freq = SCTP_BASE_SYSCTL(sctp_sack_freq_default); - - m->max_open_streams_intome = MAX_SCTP_STREAMS; - m->max_init_times = SCTP_BASE_SYSCTL(sctp_init_rtx_max_default); m->max_send_times = SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default); m->def_net_failure = SCTP_BASE_SYSCTL(sctp_path_rtx_max_default); @@ -2517,6 +2514,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); + m->max_open_streams_intome = SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Jul 5 09:36:09 2013 (r252778) +++ head/sys/netinet/sctp_sysctl.c Fri Jul 5 10:08:49 2013 (r252779) @@ -81,6 +81,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; SCTP_BASE_SYSCTL(sctp_path_pf_threshold) = SCTPCTL_PATH_PF_THRESHOLD_DEFAULT; SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; /* EY */ @@ -623,6 +624,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); /* EY */ @@ -965,6 +967,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_INCOMING_STREAMS_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Fri Jul 5 09:36:09 2013 (r252778) +++ head/sys/netinet/sctp_sysctl.h Fri Jul 5 10:08:49 2013 (r252779) @@ -72,6 +72,7 @@ struct sctp_sysctl { uint32_t sctp_path_rtx_max_default; uint32_t sctp_path_pf_threshold; uint32_t sctp_add_more_threshold; + uint32_t sctp_nr_incoming_streams_default; uint32_t sctp_nr_outgoing_streams_default; uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; @@ -322,6 +323,12 @@ struct sctp_sysctl { #define SCTPCTL_ADD_MORE_ON_OUTPUT_MAX 0xFFFFFFFF #define SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT SCTP_DEFAULT_ADD_MORE +/* incoming_streams: Default number of incoming streams */ +#define SCTPCTL_INCOMING_STREAMS_DESC "Default number of incoming streams" +#define SCTPCTL_INCOMING_STREAMS_MIN 1 +#define SCTPCTL_INCOMING_STREAMS_MAX 65535 +#define SCTPCTL_INCOMING_STREAMS_DEFAULT SCTP_ISTREAM_INITIAL + /* outgoing_streams: Default number of outgoing streams */ #define SCTPCTL_OUTGOING_STREAMS_DESC "Default number of outgoing streams" #define SCTPCTL_OUTGOING_STREAMS_MIN 1 From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 13:37:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85797EC8; Fri, 5 Jul 2013 13:37:58 +0000 (UTC) (envelope-from ray@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 7821A1DE2; Fri, 5 Jul 2013 13:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Dbwtf041799; Fri, 5 Jul 2013 13:37:58 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65DbwZB041798; Fri, 5 Jul 2013 13:37:58 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201307051337.r65DbwZB041798@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 5 Jul 2013 13:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252780 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 13:37:58 -0000 Author: ray Date: Fri Jul 5 13:37:57 2013 New Revision: 252780 URL: http://svnweb.freebsd.org/changeset/base/252780 Log: o Make fields names short. o Slim down reg fields comments. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Fri Jul 5 10:08:49 2013 (r252779) +++ head/sys/arm/arm/generic_timer.c Fri Jul 5 13:37:57 2013 (r252780) @@ -60,28 +60,21 @@ __FBSDID("$FreeBSD$"); #include #include -#define GENERIC_TIMER_CTRL_ENABLE (1 << 0) -#define GENERIC_TIMER_CTRL_INT_MASK (1 << 1) -#define GENERIC_TIMER_CTRL_INT_STAT (1 << 2) -#define GENERIC_TIMER_REG_CTRL 0 -#define GENERIC_TIMER_REG_TVAL 1 - -#define GENERIC_TIMER_CNTKCTL_PL0PTEN (1 << 9) /* Physical timer registers - access from PL0 */ -#define GENERIC_TIMER_CNTKCTL_PL0VTEN (1 << 8) /* Virtual timer registers - access from PL0 */ -#define GENERIC_TIMER_CNTKCTL_EVNTI (1 << 4) /* Virtual counter - event bits */ -#define GENERIC_TIMER_CNTKCTL_EVNTDIR (1 << 3) /* Virtual counter - event transition */ -#define GENERIC_TIMER_CNTKCTL_EVNTEN (1 << 2) /* Enables events from - the virtual counter */ -#define GENERIC_TIMER_CNTKCTL_PL0VCTEN (1 << 1) /* CNTVCT and CNTFRQ - access from PL0 */ -#define GENERIC_TIMER_CNTKCTL_PL0PCTEN (1 << 0) /* CNTPCT and CNTFRQ - access from PL0 */ +#define GT_CTRL_ENABLE (1 << 0) +#define GT_CTRL_INT_MASK (1 << 1) +#define GT_CTRL_INT_STAT (1 << 2) +#define GT_REG_CTRL 0 +#define GT_REG_TVAL 1 + +#define GT_CNTKCTL_PL0PTEN (1 << 9) /* PL0 Physical timer reg access */ +#define GT_CNTKCTL_PL0VTEN (1 << 8) /* PL0 Virtual timer reg access */ +#define GT_CNTKCTL_EVNTI (1 << 4) /* Virtual counter event bits */ +#define GT_CNTKCTL_EVNTDIR (1 << 3) /* Virtual counter event transition */ +#define GT_CNTKCTL_EVNTEN (1 << 2) /* Enables virtual counter events */ +#define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ +#define GT_CNTKCTL_PL0PCTEN (1 << 0) /* PL0 CNTPCT and CNTFRQ access */ -#define GENERIC_TIMER_CNTPSIRQ 29 +#define GT_CNTPSIRQ 29 struct arm_tmr_softc { struct resource *irq_res; @@ -182,11 +175,8 @@ disable_user_access(void) uint32_t cntkctl; __asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); - cntkctl &= ~(GENERIC_TIMER_CNTKCTL_PL0PTEN | - GENERIC_TIMER_CNTKCTL_PL0VTEN | - GENERIC_TIMER_CNTKCTL_EVNTEN | - GENERIC_TIMER_CNTKCTL_PL0VCTEN | - GENERIC_TIMER_CNTKCTL_PL0PCTEN); + cntkctl &= ~(GT_CNTKCTL_PL0PTEN | GT_CNTKCTL_PL0VTEN | + GT_CNTKCTL_EVNTEN | GT_CNTKCTL_PL0VCTEN | GT_CNTKCTL_PL0PCTEN); __asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); isb(); } @@ -209,8 +199,8 @@ arm_tmr_start(struct eventtimer *et, sbi if (first != 0) { counts = ((uint32_t)et->et_frequency * first) >> 32; ctrl = get_ctrl(); - ctrl &= ~GENERIC_TIMER_CTRL_INT_MASK; - ctrl |= GENERIC_TIMER_CTRL_ENABLE; + ctrl &= ~GT_CTRL_INT_MASK; + ctrl |= GT_CTRL_ENABLE; set_tval(counts); set_ctrl(ctrl); return (0); @@ -226,7 +216,7 @@ arm_tmr_stop(struct eventtimer *et) int ctrl; ctrl = get_ctrl(); - ctrl &= GENERIC_TIMER_CTRL_ENABLE; + ctrl &= GT_CTRL_ENABLE; set_ctrl(ctrl); return (0); @@ -240,8 +230,8 @@ arm_tmr_intr(void *arg) sc = (struct arm_tmr_softc *)arg; ctrl = get_ctrl(); - if (ctrl & GENERIC_TIMER_CTRL_INT_STAT) { - ctrl |= GENERIC_TIMER_CTRL_INT_MASK; + if (ctrl & GT_CTRL_INT_STAT) { + ctrl |= GT_CTRL_INT_MASK; set_ctrl(ctrl); } @@ -289,7 +279,7 @@ arm_tmr_attach(device_t dev) rid = 0; sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - GENERIC_TIMER_CNTPSIRQ, GENERIC_TIMER_CNTPSIRQ, + GT_CNTPSIRQ, GT_CNTPSIRQ, 1, RF_SHAREABLE | RF_ACTIVE); arm_tmr_sc = sc; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 13:48:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F58D23B; Fri, 5 Jul 2013 13:48:34 +0000 (UTC) (envelope-from andre@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 0ECFE1E41; Fri, 5 Jul 2013 13:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65DmXaW044900; Fri, 5 Jul 2013 13:48:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65DmWA9044893; Fri, 5 Jul 2013 13:48:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051348.r65DmWA9044893@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 13:48: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: r252781 - in stable/9/sys: dev/xen/netfront net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 13:48:34 -0000 Author: andre Date: Fri Jul 5 13:48:32 2013 New Revision: 252781 URL: http://svnweb.freebsd.org/changeset/base/252781 Log: MFC r291296, r291297, r291393: Allow drivers to specify a maximum TSP length in bytes if they are limited in the amount of data they can handle at once. Apply this to the netfront driver. Spare fields in struct tcpcb and struct ifnet are used to keep the structure sizes the same. Modified: stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/net/if.c stable/9/sys/net/if_var.h stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 5 13:48:32 2013 (r252781) @@ -134,6 +134,7 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) +#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2123,6 +2124,7 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; + ifp->if_hw_tsomax = NF_TSO_MAXBURST; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/net/if.c Fri Jul 5 13:48:32 2013 (r252781) @@ -74,18 +74,18 @@ #include #if defined(INET) || defined(INET6) -/*XXX*/ #include #include +#include #include +#ifdef INET +#include +#endif /* INET */ #ifdef INET6 #include #include -#endif -#endif -#ifdef INET -#include -#endif +#endif /* INET6 */ +#endif /* INET || INET6 */ #include @@ -669,6 +669,15 @@ if_attach_internal(struct ifnet *ifp, in TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); /* Reliably crash if used uninitialized. */ ifp->if_broadcastaddr = NULL; + +#if defined(INET) || defined(INET6) + /* Initialize to max value. */ + if (ifp->if_hw_tsomax == 0) + ifp->if_hw_tsomax = IP_MAXPACKET; + KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && + ifp->if_hw_tsomax >= IP_MAXPACKET / 8, + ("%s: tsomax outside of range", __func__)); +#endif } #ifdef VIMAGE else { Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/net/if_var.h Fri Jul 5 13:48:32 2013 (r252781) @@ -205,7 +205,11 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - int if_ispare[4]; + u_int if_hw_tsomax; /* tso burst length limit, the minmum + * is (IP_MAXPACKET / 8). + * XXXAO: Have to find a better place + * for it eventually. */ + int if_ispare[3]; void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 13:48:32 2013 (r252781) @@ -3393,7 +3393,7 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt */ void tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer, - struct hc_metrics_lite *metricptr, int *mtuflags) + struct hc_metrics_lite *metricptr, struct tcp_ifcap *cap) { int mss = 0; u_long maxmtu = 0; @@ -3420,7 +3420,7 @@ tcp_mss_update(struct tcpcb *tp, int off /* Initialize. */ #ifdef INET6 if (isipv6) { - maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags); + maxmtu = tcp_maxmtu6(&inp->inp_inc, cap); tp->t_maxopd = tp->t_maxseg = V_tcp_v6mssdflt; } #endif @@ -3429,7 +3429,7 @@ tcp_mss_update(struct tcpcb *tp, int off #endif #ifdef INET { - maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags); + maxmtu = tcp_maxmtu(&inp->inp_inc, cap); tp->t_maxopd = tp->t_maxseg = V_tcp_mssdflt; } #endif @@ -3571,11 +3571,12 @@ tcp_mss(struct tcpcb *tp, int offer) struct inpcb *inp; struct socket *so; struct hc_metrics_lite metrics; - int mtuflags = 0; + struct tcp_ifcap cap; KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); - - tcp_mss_update(tp, offer, -1, &metrics, &mtuflags); + + bzero(&cap, sizeof(cap)); + tcp_mss_update(tp, offer, -1, &metrics, &cap); mss = tp->t_maxseg; inp = tp->t_inpcb; @@ -3620,8 +3621,10 @@ tcp_mss(struct tcpcb *tp, int offer) SOCKBUF_UNLOCK(&so->so_rcv); /* Check the interface for TSO capabilities. */ - if (mtuflags & CSUM_TSO) + if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; + tp->t_tsomax = cap.tsomax; + } } /* Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 13:48:32 2013 (r252781) @@ -752,12 +752,13 @@ send: ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to IP_MAXPACKET minus IP, + * Limit a burst to t_tsomax minus IP, * TCP and options length to keep ip->ip_len - * from overflowing. + * from overflowing or exceeding the maximum + * length allowed by the network interface. */ - if (len > IP_MAXPACKET - hdrlen) { - len = IP_MAXPACKET - hdrlen; + if (len > tp->t_tsomax - hdrlen) { + len = tp->t_tsomax - hdrlen; sendalot = 1; } Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_subr.c Fri Jul 5 13:48:32 2013 (r252781) @@ -1714,7 +1714,7 @@ tcp_mtudisc(struct inpcb *inp, int mtuof * tcp_mss_update to get the peer/interface MTU. */ u_long -tcp_maxmtu(struct in_conninfo *inc, int *flags) +tcp_maxmtu(struct in_conninfo *inc, struct tcp_ifcap *cap) { struct route sro; struct sockaddr_in *dst; @@ -1739,10 +1739,11 @@ tcp_maxmtu(struct in_conninfo *inc, int maxmtu = min(sro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); /* Report additional interface capabilities. */ - if (flags != NULL) { + if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO4 && ifp->if_hwassist & CSUM_TSO) - *flags |= CSUM_TSO; + cap->ifcap |= CSUM_TSO; + cap->tsomax = ifp->if_hw_tsomax; } RTFREE(sro.ro_rt); } @@ -1752,7 +1753,7 @@ tcp_maxmtu(struct in_conninfo *inc, int #ifdef INET6 u_long -tcp_maxmtu6(struct in_conninfo *inc, int *flags) +tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap *cap) { struct route_in6 sro6; struct ifnet *ifp; @@ -1776,10 +1777,11 @@ tcp_maxmtu6(struct in_conninfo *inc, int IN6_LINKMTU(sro6.ro_rt->rt_ifp)); /* Report additional interface capabilities. */ - if (flags != NULL) { + if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO6 && ifp->if_hwassist & CSUM_TSO) - *flags |= CSUM_TSO; + cap->ifcap |= CSUM_TSO; + cap->tsomax = ifp->if_hw_tsomax; } RTFREE(sro6.ro_rt); } Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 13:48:32 2013 (r252781) @@ -208,7 +208,9 @@ struct tcpcb { u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ + u_int t_tsomax; /* tso burst length limit */ + + uint32_t t_ispare[7]; /* 5 UTO, 2 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; @@ -324,6 +326,15 @@ struct hc_metrics_lite { /* must stay in u_long rmx_recvpipe; /* inbound delay-bandwidth product */ }; +/* + * Used by tcp_maxmtu() to communicate interface specific features + * and limits at the time of connection setup. + */ +struct tcp_ifcap { + int ifcap; + u_int tsomax; +}; + #ifndef _NETINET_IN_PCB_H_ struct in_conninfo; #endif /* _NETINET_IN_PCB_H_ */ @@ -673,10 +684,10 @@ void tcp_reass_flush(struct tcpcb *); void tcp_reass_destroy(void); #endif void tcp_input(struct mbuf *, int); -u_long tcp_maxmtu(struct in_conninfo *, int *); -u_long tcp_maxmtu6(struct in_conninfo *, int *); +u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); +u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, - int *); + struct tcp_ifcap *); void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:08:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9D3FD70F; Fri, 5 Jul 2013 14:08:36 +0000 (UTC) (envelope-from andre@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 764551F02; Fri, 5 Jul 2013 14:08:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65E8a3j051047; Fri, 5 Jul 2013 14:08:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65E8aOM051046; Fri, 5 Jul 2013 14:08:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051408.r65E8aOM051046@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14: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: r252782 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:08:36 -0000 Author: andre Date: Fri Jul 5 14:08:36 2013 New Revision: 252782 URL: http://svnweb.freebsd.org/changeset/base/252782 Log: MFC r242306, r250365: Add logging for socket attach failures in sonewconn() during accept(2). Include the pointer to the PCB so it can be attributed to a particular application by corresponding it to "netstat -A" output. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 13:48:32 2013 (r252781) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:08:36 2013 (r252782) @@ -135,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -447,16 +448,24 @@ sonewconn(struct socket *head, int conns over = (head->so_qlen > 3 * head->so_qlimit / 2); ACCEPT_UNLOCK(); #ifdef REGRESSION - if (regression_sonewconn_earlytest && over) + if (regression_sonewconn_earlytest && over) { #else - if (over) + if (over) { #endif + log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " + "%i already in queue awaiting acceptance\n", + __func__, head->so_pcb, head->so_qlen); return (NULL); + } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", __func__, __LINE__, head)); so = soalloc(head->so_vnet); - if (so == NULL) + if (so == NULL) { + log(LOG_DEBUG, "%s: pcb %p: New socket allocation failure: " + "limit reached or out of memory\n", + __func__, head->so_pcb); return (NULL); + } if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; @@ -473,9 +482,16 @@ sonewconn(struct socket *head, int conns knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); VNET_SO_ASSERT(head); - if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || - (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { + if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat)) { + sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: soreserve() failed\n", + __func__, head->so_pcb); + return (NULL); + } + if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: pru_attach() failed\n", + __func__, head->so_pcb); return (NULL); } so->so_rcv.sb_lowat = head->so_rcv.sb_lowat; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:12:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B85BA24; Fri, 5 Jul 2013 14:12:27 +0000 (UTC) (envelope-from andre@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 43E0A1F39; Fri, 5 Jul 2013 14:12:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65ECRhN053427; Fri, 5 Jul 2013 14:12:27 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65ECRRM053426; Fri, 5 Jul 2013 14:12:27 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051412.r65ECRRM053426@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:12: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: r252783 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:12:27 -0000 Author: andre Date: Fri Jul 5 14:12:26 2013 New Revision: 252783 URL: http://svnweb.freebsd.org/changeset/base/252783 Log: MFC r243627, r243638: Fix a race on listen socket teardown where while draining the accept queues a new socket/connection may be added to the queue due to a race on the ACCEPT_LOCK. The submitted patch is slightly changed in comments, teardown and locking order and extended with KASSERT's. Submitted by: Vijay Singh Found by: His team. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:08:36 2013 (r252782) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:12:26 2013 (r252783) @@ -502,6 +502,16 @@ sonewconn(struct socket *head, int conns so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; so->so_state |= connstatus; ACCEPT_LOCK(); + /* + * The accept socket may be tearing down but we just + * won a race on the ACCEPT_LOCK. + */ + if (!(head->so_options & SO_ACCEPTCONN)) { + SOCK_LOCK(so); + so->so_head = NULL; + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ + return (NULL); + } if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); so->so_qstate |= SQ_COMP; @@ -727,9 +737,14 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + ACCEPT_LOCK(); if (so->so_options & SO_ACCEPTCONN) { struct socket *sp; - ACCEPT_LOCK(); + /* + * Prevent new additions to the accept queues due + * to ACCEPT_LOCK races while we are draining them. + */ + so->so_options &= ~SO_ACCEPTCONN; while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { TAILQ_REMOVE(&so->so_incomp, sp, so_list); so->so_incqlen--; @@ -748,13 +763,15 @@ drop: soabort(sp); ACCEPT_LOCK(); } - ACCEPT_UNLOCK(); + KASSERT((TAILQ_EMPTY(&so->so_comp)), + ("%s: so_comp populated", __func__)); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), + ("%s: so_incomp populated", __func__)); } - ACCEPT_LOCK(); SOCK_LOCK(so); KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; - sorele(so); + sorele(so); /* NB: Returns with ACCEPT_UNLOCK(). */ CURVNET_RESTORE(); return (error); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:16:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0056BF7; Fri, 5 Jul 2013 14:16:04 +0000 (UTC) (envelope-from jilles@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 92A2B1F66; Fri, 5 Jul 2013 14:16:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EG4d7053987; Fri, 5 Jul 2013 14:16:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EG4S0053985; Fri, 5 Jul 2013 14:16:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307051416.r65EG4S0053985@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 5 Jul 2013 14:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252784 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:16:04 -0000 Author: jilles Date: Fri Jul 5 14:16:04 2013 New Revision: 252784 URL: http://svnweb.freebsd.org/changeset/base/252784 Log: stdlib.h: Add correct POSIX version for POSIX extensions to C. Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Fri Jul 5 14:12:26 2013 (r252783) +++ head/include/stdlib.h Fri Jul 5 14:16:04 2013 (r252784) @@ -161,14 +161,16 @@ _Noreturn void quick_exit(int); #endif /* __ISO_C_VISIBLE >= 2011 */ /* - * Extensions made by POSIX relative to C. We don't know yet which edition - * of POSIX made these extensions, so assume they've always been there until - * research can be done. + * Extensions made by POSIX relative to C. */ -#if __POSIX_VISIBLE /* >= ??? */ -int posix_memalign(void **, size_t, size_t); /* (ADV) */ -int rand_r(unsigned *); /* (TSF) */ +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE char *realpath(const char * __restrict, char * __restrict); +#endif +#if __POSIX_VISIBLE >= 199506 +int rand_r(unsigned *); /* (TSF) */ +#endif +#if __POSIX_VISIBLE >= 200112 +int posix_memalign(void **, size_t, size_t); /* (ADV) */ int setenv(const char *, const char *, int); int unsetenv(const char *); #endif From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:18:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2BC7EC7; Fri, 5 Jul 2013 14:18:09 +0000 (UTC) (envelope-from andre@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 C95011F73; Fri, 5 Jul 2013 14:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EI9lZ054260; Fri, 5 Jul 2013 14:18:09 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EI9Qs054259; Fri, 5 Jul 2013 14:18:09 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051418.r65EI9Qs054259@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:18: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: r252785 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:18:10 -0000 Author: andre Date: Fri Jul 5 14:18:09 2013 New Revision: 252785 URL: http://svnweb.freebsd.org/changeset/base/252785 Log: MFC r242309: Fix a couple of soreceive_stream() issues. Submitted by: trociny Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:16:04 2013 (r252784) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:18:09 2013 (r252785) @@ -1948,6 +1948,7 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. + * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. */ int soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, @@ -2036,7 +2037,7 @@ restart: /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_lowat)) + (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_hiwat)) goto deliver; /* @@ -2062,7 +2063,11 @@ deliver: if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { - for (*mp0 = m = sb->sb_mb; + if (*mp0 == NULL) + *mp0 = sb->sb_mb; + else + m_cat(*mp0, sb->sb_mb); + for (m = sb->sb_mb; m != NULL && m->m_len <= len; m = m->m_next) { len -= m->m_len; @@ -2070,10 +2075,11 @@ deliver: sbfree(sb, m); n = m; } + n->m_next = NULL; sb->sb_mb = m; + sb->sb_lastrecord = sb->sb_mb; if (sb->sb_mb == NULL) SB_EMPTY_FIXUP(sb); - n->m_next = NULL; } /* Copy the remainder. */ if (len > 0) { @@ -2084,9 +2090,9 @@ deliver: if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else - uio->uio_resid -= m->m_len; + uio->uio_resid -= len; if (*mp0 != NULL) - n->m_next = m; + m_cat(*mp0, m); else *mp0 = m; if (*mp0 == NULL) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:24:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2FFED110; Fri, 5 Jul 2013 14:24:38 +0000 (UTC) (envelope-from andre@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 225C41FAC; Fri, 5 Jul 2013 14:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EOcoR056663; Fri, 5 Jul 2013 14:24:38 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EOco3056662; Fri, 5 Jul 2013 14:24:38 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051424.r65EOco3056662@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:24:38 +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: r252786 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:24:38 -0000 Author: andre Date: Fri Jul 5 14:24:37 2013 New Revision: 252786 URL: http://svnweb.freebsd.org/changeset/base/252786 Log: MFC r249809: When doing RFC3042 limited transmit on the first on second duplicate ACK make sure we actually have new data to send. This prevents us from sending unneccessary pure ACKs. Reported by: Matt Miller Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:18:09 2013 (r252785) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:24:37 2013 (r252786) @@ -2532,6 +2532,7 @@ tcp_do_segment(struct mbuf *m, struct tc u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; + int avail; KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, @@ -2553,7 +2554,17 @@ tcp_do_segment(struct mbuf *m, struct tc */ break; } - (void) tcp_output(tp); + /* + * Only call tcp_output when there + * is new data available to be sent. + * Otherwise we would send pure ACKs. + */ + SOCKBUF_LOCK(&so->so_snd); + avail = so->so_snd.sb_cc - + (tp->snd_nxt - tp->snd_una); + SOCKBUF_UNLOCK(&so->so_snd); + if (avail > 0) + (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { KASSERT((tp->t_dupacks == 2 && From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:30:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B05F0407; Fri, 5 Jul 2013 14:30:54 +0000 (UTC) (envelope-from andre@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 A2D161FF1; Fri, 5 Jul 2013 14:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EUsYf059155; Fri, 5 Jul 2013 14:30:54 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EUs2S059154; Fri, 5 Jul 2013 14:30:54 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051430.r65EUs2S059154@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:30: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: r252787 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:30:54 -0000 Author: andre Date: Fri Jul 5 14:30:54 2013 New Revision: 252787 URL: http://svnweb.freebsd.org/changeset/base/252787 Log: MFC r249317: Fix a race condition on tcp listen socket teardown with pending connections in the accept queue and contiguous new incoming SYNs. Compared to the original submitters patch I've moved the test next to the SYN handling to have it together in a logical unit and reworded the comment explaining the issue. Submitted by: Matt Miller Submitted by: Juan Mojica Reviewed by: Matt Miller (changes) Tested by: pho Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:24:37 2013 (r252786) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:30:54 2013 (r252787) @@ -1375,6 +1375,15 @@ relocked: */ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return; + } else if (tp->t_state == TCPS_LISTEN) { + /* + * When a listen socket is torn down the SO_ACCEPTCONN + * flag is removed first while connections are drained + * from the accept queue in a unlock/lock cycle of the + * ACCEPT_LOCK, opening a race condition allowing a SYN + * attempt go through unhandled. + */ + goto dropunlock; } #ifdef TCP_SIGNATURE From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:39:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E12B91F; Fri, 5 Jul 2013 14:39:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id D7CBA1060; Fri, 5 Jul 2013 14:39:54 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::55fe:86b3:1ee:6af5] (unknown [IPv6:2001:7b8:3a7:0:55fe:86b3:1ee:6af5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0A4E95C43; Fri, 5 Jul 2013 16:39:53 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252375 - head/lib/libfetch From: Dimitry Andric In-Reply-To: <86hag99yc6.fsf@nine.des.no> Date: Fri, 5 Jul 2013 16:39:51 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <838BA1C8-4950-42EE-92D5-A26A67EA7DF3@FreeBSD.org> References: <201306291551.r5TFpRc6022283@svn.freebsd.org> <86hag99yc6.fsf@nine.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:39:55 -0000 On Jul 5, 2013, at 10:59, Dag-Erling Sm=F8rgrav wrote: > Tim Kientzle writes: >> Log: >> Fix -Wunsequenced warning. >>=20 >> Submitted by: dt71@gmx.com >=20 > Neither approved by nor even discussed with the author and maintainer. >=20 > (not saying it's wrong, but...) Actually the warning (from clang trunk) was technically wrong, as a function call is a sequence point. I reported that upstream, and it got fixed in the mean time. That said, the construction still looked a little dodgy, and if the function call ever gets changed into a macro invocation, there could be trouble. :-) -Dimitry From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:50:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1874ECC3; Fri, 5 Jul 2013 14:50:08 +0000 (UTC) (envelope-from andre@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 F028810B1; Fri, 5 Jul 2013 14:50:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Eo7HL063632; Fri, 5 Jul 2013 14:50:07 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Eo79t063625; Fri, 5 Jul 2013 14:50:07 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051450.r65Eo79t063625@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:50:06 +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: r252788 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:50:08 -0000 Author: andre Date: Fri Jul 5 14:50:06 2013 New Revision: 252788 URL: http://svnweb.freebsd.org/changeset/base/252788 Log: MFC r226447: Remove the ss_fltsz and ss_fltsz_local sysctl's which have long been superseded by the RFC3390 initial CWND sizing. Also remove the remnants of TCP_METRICS_CWND which used the TCP hostcache to set the initial CWND in a non-RFC compliant way. MFC r242249: Adjust the initial default CWND upon connection establishment to the new and increased values specified by RFC5681 Section 3.1. The even larger initial CWND per RFC3390, if enabled, is not affected. MFC r242250: When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to reduce the initial CWND to one segment. This reduction got lost some time ago due to a change in initialization ordering. Additionally in tcp_timer_rexmt() avoid entering fast recovery when we're still in TCPS_SYN_SENT state. MFC r242255: Allow arbitrary MSS sizes and don't mind about the cluster size anymore. We've got more cluster sizes for quite some time now and the orginally imposed limits and the previously codified thoughts on efficiency gains are no longer true. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_timer.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:50:06 2013 (r252788) @@ -304,9 +304,6 @@ cc_conn_init(struct tcpcb *tp) struct hc_metrics_lite metrics; struct inpcb *inp = tp->t_inpcb; int rtt; -#ifdef INET6 - int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; -#endif INP_WLOCK_ASSERT(tp->t_inpcb); @@ -340,49 +337,29 @@ cc_conn_init(struct tcpcb *tp) } /* - * Set the slow-start flight size depending on whether this - * is a local network or not. + * Set the initial slow-start flight size. * - * Extend this so we cache the cwnd too and retrieve it here. - * Make cwnd even bigger than RFC3390 suggests but only if we - * have previous experience with the remote host. Be careful - * not make cwnd bigger than remote receive window or our own - * send socket buffer. Maybe put some additional upper bound - * on the retrieved cwnd. Should do incremental updates to - * hostcache when cwnd collapses so next connection doesn't - * overloads the path again. + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. * - * XXXAO: Initializing the CWND from the hostcache is broken - * and in its current form not RFC conformant. It is disabled - * until fixed or removed entirely. - * - * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. - * We currently check only in syncache_socket for that. - */ -/* #define TCP_METRICS_CWND */ -#ifdef TCP_METRICS_CWND - if (metrics.rmx_cwnd) - tp->snd_cwnd = max(tp->t_maxseg, min(metrics.rmx_cwnd / 2, - min(tp->snd_wnd, so->so_snd.sb_hiwat))); - else -#endif - if (V_tcp_do_rfc3390) + * If a SYN or SYN/ACK was lost and retransmitted, we have to + * reduce the initial CWND to one segment as congestion is likely + * requiring us to be cautious. + */ + if (tp->snd_cwnd == 1) + tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); -#ifdef INET6 - else if (isipv6 && in6_localaddr(&inp->in6p_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif -#if defined(INET) && defined(INET6) - else if (!isipv6 && in_localaddr(inp->inp_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif -#ifdef INET - else if (in_localaddr(inp->inp_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif - else - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz; + else { + /* Per RFC5681 Section 3.1 */ + if (tp->t_maxseg > 2190) + tp->snd_cwnd = 2 * tp->t_maxseg; + else if (tp->t_maxseg > 1095) + tp->snd_cwnd = 3 * tp->t_maxseg; + else + tp->snd_cwnd = 4 * tp->t_maxseg; + } if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); @@ -3389,10 +3366,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt /* * Determine a reasonable value for maxseg size. * If the route is known, check route for mtu. - * If none, use an mss that can be handled on the outgoing - * interface without forcing IP to fragment; if bigger than - * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES - * to utilize large mbufs. If no route is found, route has no mtu, + * If none, use an mss that can be handled on the outgoing interface + * without forcing IP to fragment. If no route is found, route has no mtu, * or the destination isn't local, use a default, hopefully conservative * size (usually 512 or the default IP max size, but no more than the mtu * of the interface), as we can't discover anything about intervening @@ -3573,13 +3548,6 @@ tcp_mss_update(struct tcpcb *tp, int off (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)) mss -= TCPOLEN_TSTAMP_APPA; -#if (MCLBYTES & (MCLBYTES - 1)) == 0 - if (mss > MCLBYTES) - mss &= ~(MCLBYTES-1); -#else - if (mss > MCLBYTES) - mss = mss / MCLBYTES * MCLBYTES; -#endif tp->t_maxseg = mss; } Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 14:50:06 2013 (r252788) @@ -92,16 +92,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(path_mtu_discovery), 1, "Enable Path MTU Discovery"); -VNET_DEFINE(int, ss_fltsz) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, - &VNET_NAME(ss_fltsz), 1, - "Slow start flight size"); - -VNET_DEFINE(int, ss_fltsz_local) = 4; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, - CTLFLAG_RW, &VNET_NAME(ss_fltsz_local), 1, - "Slow start flight size for local networks"); - VNET_DEFINE(int, tcp_do_tso) = 1; #define V_tcp_do_tso VNET(tcp_do_tso) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_RW, Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:50:06 2013 (r252788) @@ -852,11 +852,12 @@ syncache_socket(struct syncache *sc, str tcp_mss(tp, sc->sc_peer_mss); /* - * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. + * If the SYN,ACK was retransmitted, indicate that CWND to be + * limited to one segment in cc_conn_init(). * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits. */ if (sc->sc_rxmits > 1) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = 1; #ifdef TCP_OFFLOAD /* Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_timer.c Fri Jul 5 14:50:06 2013 (r252788) @@ -545,7 +545,13 @@ tcp_timer_rexmt(void * xtp) } INP_INFO_RUNLOCK(&V_tcbinfo); headlocked = 0; - if (tp->t_rxtshift == 1) { + if (tp->t_state == TCPS_SYN_SENT) { + /* + * If the SYN was retransmitted, indicate CWND to be + * limited to 1 segment in cc_conn_init(). + */ + tp->snd_cwnd = 1; + } else if (tp->t_rxtshift == 1) { /* * first retransmit; record ssthresh and cwnd so they can * be recovered if this turns out to be a "bad" retransmit. Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:50:06 2013 (r252788) @@ -623,8 +623,6 @@ VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); VNET_DECLARE(int, path_mtu_discovery); -VNET_DECLARE(int, ss_fltsz); -VNET_DECLARE(int, ss_fltsz_local); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); #define V_tcb VNET(tcb) @@ -635,8 +633,6 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_path_mtu_discovery VNET(path_mtu_discovery) -#define V_ss_fltsz VNET(ss_fltsz) -#define V_ss_fltsz_local VNET(ss_fltsz_local) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 14:58:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18E79FD9; Fri, 5 Jul 2013 14:58:25 +0000 (UTC) (envelope-from andre@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 0AD3610FD; Fri, 5 Jul 2013 14:58:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EwOV2066271; Fri, 5 Jul 2013 14:58:24 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EwObo066269; Fri, 5 Jul 2013 14:58:24 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051458.r65EwObo066269@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:58:24 +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: r252789 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 14:58:25 -0000 Author: andre Date: Fri Jul 5 14:58:24 2013 New Revision: 252789 URL: http://svnweb.freebsd.org/changeset/base/252789 Log: MFC r242266: Increase the initial CWND to 10 segments as defined in IETF TCPM draft-ietf-tcpm-initcwnd-05. It explains why the increased initial window improves the overall performance of many web services without risking congestion collapse. As long as it remains a draft it is placed under a sysctl marking it as experimental: net.inet.tcp.experimental.initcwnd10 = 1 When it becomes an official RFC soon the sysctl will be changed to the RFC number and moved to net.inet.tcp. This implementation differs from the RFC draft in that it is a bit more conservative in the case of packet loss on SYN or SYN|ACK because we haven't reduced the default RTO to 1 second yet. Also the restart window isn't yet increased as allowed. Both will be adjusted with upcoming changes. Is is enabled by default. In Linux it is enabled since kernel 3.0. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:50:06 2013 (r252788) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:58:24 2013 (r252789) @@ -158,6 +158,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, + "Experimental TCP extensions"); + +VNET_DEFINE(int, tcp_do_initcwnd10) = 1; +SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, + &VNET_NAME(tcp_do_initcwnd10), 0, + "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)"); + VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, @@ -341,6 +349,7 @@ cc_conn_init(struct tcpcb *tp) * * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. + * Draft-ietf-tcpm-initcwnd-05 increases it to ten segments. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely @@ -348,6 +357,9 @@ cc_conn_init(struct tcpcb *tp) */ if (tp->snd_cwnd == 1) tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_initcwnd10) + tp->snd_cwnd = min(10 * tp->t_maxseg, + max(2 * tp->t_maxseg, 14600)); else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:50:06 2013 (r252788) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:58:24 2013 (r252789) @@ -622,6 +622,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX * VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_initcwnd10); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); @@ -632,6 +633,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 15:18:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5FEC80E; Fri, 5 Jul 2013 15:18:55 +0000 (UTC) (envelope-from andre@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 D7CF511EB; Fri, 5 Jul 2013 15:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FItj8072933; Fri, 5 Jul 2013 15:18:55 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FIt53072930; Fri, 5 Jul 2013 15:18:55 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051518.r65FIt53072930@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:18:55 +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: r252790 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:18:56 -0000 Author: andre Date: Fri Jul 5 15:18:54 2013 New Revision: 252790 URL: http://svnweb.freebsd.org/changeset/base/252790 Log: MFC r242253: Simplify implementation of net.inet.tcp.reass.maxsegments and net.inet.tcp.reass.cursegments. MFC r242254: Change the syncache count reporting the current number of entries from an unprotected u_int that reports garbage on SMP to a function based sysctl obtaining the current value from UMA. Also read back the actual cache_limit after page size rounding by UMA. PR: kern/165879 MFC r244680: Fix sysctl_handle_int() usage. Either arg1 or arg2 should be supplied, and arg2 doesn't pass size of arg1. MFC r246208: uma_zone_set_max() directly returns the rounded effective zone limit. Use the return value directly instead of doing a second uma_zone_set_max() step. Modified: stable/9/sys/netinet/tcp_reass.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_syncache.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_reass.c ============================================================================== --- stable/9/sys/netinet/tcp_reass.c Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_reass.c Fri Jul 5 15:18:54 2013 (r252790) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS); static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, @@ -82,16 +81,12 @@ static SYSCTL_NODE(_net_inet_tcp, OID_AU static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, - CTLTYPE_INT | CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, + &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_qsize) = 0; -#define V_tcp_reass_qsize VNET(tcp_reass_qsize) SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, - CTLTYPE_INT | CTLFLAG_RD, - &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", + (CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; @@ -109,8 +104,10 @@ static void tcp_reass_zone_change(void *tag) { + /* Set the zone limit and read back the effective value. */ V_tcp_reass_maxseg = nmbclusters / 16; - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); } void @@ -122,7 +119,9 @@ tcp_reass_init(void) &V_tcp_reass_maxseg); V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + /* Set the zone limit and read back the effective value. */ + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -156,17 +155,12 @@ tcp_reass_flush(struct tcpcb *tp) } static int -tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS) -{ - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) { - V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); + int qsize; + + qsize = uma_zone_get_cur(V_tcp_reass_zone); + return (sysctl_handle_int(oidp, &qsize, 0, req)); } int Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 15:18:54 2013 (r252790) @@ -123,6 +123,7 @@ struct syncache *syncache_lookup(struct static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); +static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout); static void syncache_timer(void *); @@ -158,8 +159,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, &VNET_NAME(tcp_syncache.cache_limit), 0, "Overall entry limit for syncache"); -SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_RD, - &VNET_NAME(tcp_syncache.cache_count), 0, +SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD), + NULL, 0, &syncache_sysctl_count, "IU", "Current number of entries in syncache"); SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN, @@ -225,7 +226,6 @@ syncache_init(void) { int i; - V_tcp_syncache.cache_count = 0; V_tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE; V_tcp_syncache.bucket_limit = TCP_SYNCACHE_BUCKETLIMIT; V_tcp_syncache.rexmt_limit = SYNCACHE_MAXREXMTS; @@ -268,7 +268,8 @@ syncache_init(void) /* Create the syncache entry zone. */ V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit); + V_tcp_syncache.cache_limit = uma_zone_set_max(V_tcp_syncache.zone, + V_tcp_syncache.cache_limit); } #ifdef VIMAGE @@ -296,8 +297,8 @@ syncache_destroy(void) mtx_destroy(&sch->sch_mtx); } - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", - __func__, V_tcp_syncache.cache_count)); + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0, + ("%s: cache_count not 0", __func__)); /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); @@ -305,6 +306,15 @@ syncache_destroy(void) } #endif +static int +syncache_sysctl_count(SYSCTL_HANDLER_ARGS) +{ + int count; + + count = uma_zone_get_cur(V_tcp_syncache.zone); + return (sysctl_handle_int(oidp, &count, 0, req)); +} + /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. @@ -347,7 +357,6 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); - V_tcp_syncache.cache_count++; TCPSTAT_INC(tcps_sc_added); } @@ -373,7 +382,6 @@ syncache_drop(struct syncache *sc, struc #endif syncache_free(sc); - V_tcp_syncache.cache_count--; } /* @@ -958,7 +966,6 @@ syncache_expand(struct in_conninfo *inc, tod->tod_syncache_removed(tod, sc->sc_todctx); } #endif - V_tcp_syncache.cache_count--; SCH_UNLOCK(sch); } Modified: stable/9/sys/netinet/tcp_syncache.h ============================================================================== --- stable/9/sys/netinet/tcp_syncache.h Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_syncache.h Fri Jul 5 15:18:54 2013 (r252790) @@ -113,7 +113,6 @@ struct tcp_syncache { u_int hashsize; u_int hashmask; u_int bucket_limit; - u_int cache_count; /* XXX: unprotected */ u_int cache_limit; u_int rexmt_limit; u_int hash_secret; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 15:26:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 231E5A10; Fri, 5 Jul 2013 15:26:13 +0000 (UTC) (envelope-from andre@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 151661230; Fri, 5 Jul 2013 15:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FQC6V075489; Fri, 5 Jul 2013 15:26:12 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FQCQp075488; Fri, 5 Jul 2013 15:26:12 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051526.r65FQCQp075488@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:26: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: r252791 - stable/9/usr.bin/fetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:26:13 -0000 Author: andre Date: Fri Jul 5 15:26:12 2013 New Revision: 252791 URL: http://svnweb.freebsd.org/changeset/base/252791 Log: MFC r243147: Change fetch(1) to: o Report the instantaneous bandwidth instead of an average since the beginning of the download. o At the finish of the download report the average bandwidth and also the total time it took instead of 00m00s. Reviewed by: des MFC r244058: Fix bandwidth reporting when doing a restarted download with "-r". The offset is already accounted for in xs->lastrcvd and doesn't have to be subtracted again. Reported by: Florian Smeets Submitted by: Mateusz Guzik Tested by: Florian Smeets Modified: stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Fri Jul 5 15:18:54 2013 (r252790) +++ stable/9/usr.bin/fetch/fetch.c Fri Jul 5 15:26:12 2013 (r252791) @@ -115,11 +115,13 @@ sig_handler(int sig) struct xferstat { char name[64]; - struct timeval start; - struct timeval last; - off_t size; - off_t offset; - off_t rcvd; + struct timeval start; /* start of transfer */ + struct timeval last; /* time of last update */ + struct timeval last2; /* time of previous last update */ + off_t size; /* size of file per HTTP hdr */ + off_t offset; /* starting offset in file */ + off_t rcvd; /* bytes already received */ + off_t lastrcvd; /* bytes received since last update */ }; /* @@ -139,9 +141,12 @@ stat_eta(struct xferstat *xs) if (eta > 3600) snprintf(str, sizeof str, "%02ldh%02ldm", eta / 3600, (eta % 3600) / 60); - else + else if (eta > 0) snprintf(str, sizeof str, "%02ldm%02lds", eta / 60, eta % 60); + else + snprintf(str, sizeof str, "%02ldm%02lds", + elapsed / 60, elapsed % 60); return (str); } @@ -173,11 +178,12 @@ stat_bps(struct xferstat *xs) double delta, bps; delta = (xs->last.tv_sec + (xs->last.tv_usec / 1.e6)) - - (xs->start.tv_sec + (xs->start.tv_usec / 1.e6)); + - (xs->last2.tv_sec + (xs->last2.tv_usec / 1.e6)); + if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); @@ -200,6 +206,7 @@ stat_display(struct xferstat *xs, int fo gettimeofday(&now, NULL); if (!force && now.tv_sec <= xs->last.tv_sec) return; + xs->last2 = xs->last; xs->last = now; fprintf(stderr, "\r%-46.46s", xs->name); @@ -214,10 +221,16 @@ stat_display(struct xferstat *xs, int fo (int)((100.0 * xs->rcvd) / xs->size), stat_bytes(xs->size)); } + if (force == 2) { + xs->lastrcvd = xs->offset; + xs->last2 = xs->start; + } fprintf(stderr, " %s", stat_bps(xs)); - if (xs->size > 0 && xs->rcvd > 0 && - xs->last.tv_sec >= xs->start.tv_sec + 10) + if ((xs->size > 0 && xs->rcvd > 0 && + xs->last.tv_sec >= xs->start.tv_sec + 3) || + force == 2) fprintf(stderr, " %s", stat_eta(xs)); + xs->lastrcvd = xs->rcvd; } /* @@ -232,6 +245,7 @@ stat_start(struct xferstat *xs, const ch xs->size = size; xs->offset = offset; xs->rcvd = offset; + xs->lastrcvd = offset; if (v_tty && v_level > 0) stat_display(xs, 1); else if (v_level > 0) @@ -257,7 +271,7 @@ stat_end(struct xferstat *xs) { gettimeofday(&xs->last, NULL); if (v_tty && v_level > 0) { - stat_display(xs, 1); + stat_display(xs, 2); putc('\n', stderr); } else if (v_level > 0) { fprintf(stderr, " %s %s\n", From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 15:30:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0841BB72; Fri, 5 Jul 2013 15:30:03 +0000 (UTC) (envelope-from andre@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 DF372124F; Fri, 5 Jul 2013 15:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FU2sR076017; Fri, 5 Jul 2013 15:30:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FU2So076016; Fri, 5 Jul 2013 15:30:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051530.r65FU2So076016@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:30:02 +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: r252792 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:30:03 -0000 Author: andre Date: Fri Jul 5 15:30:02 2013 New Revision: 252792 URL: http://svnweb.freebsd.org/changeset/base/252792 Log: MFC r244039: Remove outdated reference to tcp inflight tuning. Modified: stable/9/share/man/man7/tuning.7 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/tuning.7 ============================================================================== --- stable/9/share/man/man7/tuning.7 Fri Jul 5 15:26:12 2013 (r252791) +++ stable/9/share/man/man7/tuning.7 Fri Jul 5 15:30:02 2013 (r252792) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2010 +.Dd December 8, 2012 .Dt TUNING 7 .Os .Sh NAME @@ -666,52 +666,6 @@ the sysctl rather than disable delayed acks. .Pp The -.Va net.inet.tcp.inflight.enable -sysctl turns on bandwidth delay product limiting for all TCP connections. -The system will attempt to calculate the bandwidth delay product for each -connection and limit the amount of data queued to the network to just the -amount required to maintain optimum throughput. -This feature is useful -if you are serving data over modems, GigE, or high speed WAN links (or -any other link with a high bandwidth*delay product), especially if you are -also using window scaling or have configured a large send window. -If you enable this option, you should also be sure to set -.Va net.inet.tcp.inflight.debug -to 0 (disable debugging), and for production use setting -.Va net.inet.tcp.inflight.min -to at least 6144 may be beneficial. -Note however, that setting high -minimums may effectively disable bandwidth limiting depending on the link. -The limiting feature reduces the amount of data built up in intermediate -router and switch packet queues as well as reduces the amount of data built -up in the local host's interface queue. -With fewer packets queued up, -interactive connections, especially over slow modems, will also be able -to operate with lower round trip times. -However, note that this feature -only affects data transmission (uploading / server-side). -It does not -affect data reception (downloading). -.Pp -Adjusting -.Va net.inet.tcp.inflight.stab -is not recommended. -This parameter defaults to 20, representing 2 maximal packets added -to the bandwidth delay product window calculation. -The additional -window is required to stabilize the algorithm and improve responsiveness -to changing conditions, but it can also result in higher ping times -over slow links (though still much lower than you would get without -the inflight algorithm). -In such cases you may -wish to try reducing this parameter to 15, 10, or 5, and you may also -have to reduce -.Va net.inet.tcp.inflight.min -(for example, to 3500) to get the desired effect. -Reducing these parameters -should be done as a last resort only. -.Pp -The .Va net.inet.ip.portrange.* sysctls control the port number ranges automatically bound to TCP and UDP sockets. From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 15:47:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAD6137D; Fri, 5 Jul 2013 15:47:59 +0000 (UTC) (envelope-from andre@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 DBD221353; Fri, 5 Jul 2013 15:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Flx3J081511; Fri, 5 Jul 2013 15:47:59 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FlxFF081510; Fri, 5 Jul 2013 15:47:59 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051547.r65FlxFF081510@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252793 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:48:00 -0000 Author: andre Date: Fri Jul 5 15:47:59 2013 New Revision: 252793 URL: http://svnweb.freebsd.org/changeset/base/252793 Log: MFC r242251, r242311: Defer sending an independent window update if a delayed ACK is pending saving a packet. The window update then gets piggy-backed on the next already scheduled ACK. MFC r242252: Prevent a flurry of forced window updates when an application is doing small reads on a (partially) filled receive socket buffer. Normally one would a send a window update every time the available space in the socket buffer increases by two times MSS. This leads to a flurry of window updates that do not provide any meaningful new information to the sender. There still is available space in the window and the sender can continue sending data. All window updates then get carried by the regular ACKs. Only when the socket buffer was (almost) full and the window closed accordingly a window updates delivery new information and allows the sender to start sending more data again. Send window updates only every two MSS when the socket buffer has less than 1/8 space available, or the available space in the socket buffer increased by 1/4 its full capacity, or the socket buffer is very small. The next regular data ACK will carry and report the exact window size again. Reported by: sbruno Tested by: darrenr Tested by: Darren Baginski PR: kern/116335 Modified: stable/9/sys/netinet/tcp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 15:30:02 2013 (r252792) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 15:47:59 2013 (r252793) @@ -540,19 +540,39 @@ after_sack_rexmit: } /* - * Compare available window to amount of window - * known to peer (as advertised window less - * next expected input). If the difference is at least two - * max size segments, or at least 50% of the maximum possible - * window, then want to send a window update to peer. - * Skip this if the connection is in T/TCP half-open state. - * Don't send pure window updates when the peer has closed - * the connection and won't ever send more data. + * Sending of standalone window updates. + * + * Window updates are important when we close our window due to a + * full socket buffer and are opening it again after the application + * reads data from it. Once the window has opened again and the + * remote end starts to send again the ACK clock takes over and + * provides the most current window information. + * + * We must avoid the silly window syndrome whereas every read + * from the receive buffer, no matter how small, causes a window + * update to be sent. We also should avoid sending a flurry of + * window updates when the socket buffer had queued a lot of data + * and the application is doing small reads. + * + * Prevent a flurry of pointless window updates by only sending + * an update when we can increase the advertized window by more + * than 1/4th of the socket buffer capacity. When the buffer is + * getting full or is very small be more aggressive and send an + * update whenever we can increase by two mss sized segments. + * In all other situations the ACK's to new incoming data will + * carry further window increases. + * + * Don't send an independent window update if a delayed + * ACK is pending (it will get piggy-backed on it) or the + * remote side already has done a half-close and won't send + * more data. Skip this if the connection is in T/TCP + * half-open state. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && + !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* - * "adv" is the amount we can increase the window, + * "adv" is the amount we could increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ @@ -572,9 +592,11 @@ after_sack_rexmit: */ if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; - if (adv >= (long) (2 * tp->t_maxseg)) - goto send; - if (2 * adv >= (long) so->so_rcv.sb_hiwat) + + if (adv >= (long)(2 * tp->t_maxseg) && + (adv >= (long)(so->so_rcv.sb_hiwat / 4) || + recwin <= (long)(so->so_rcv.sb_hiwat / 8) || + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) goto send; } dontupdate: From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 15:57:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0E64691; Fri, 5 Jul 2013 15:57:36 +0000 (UTC) (envelope-from andre@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 8304013B0; Fri, 5 Jul 2013 15:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Fvama084323; Fri, 5 Jul 2013 15:57:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Fvaix084322; Fri, 5 Jul 2013 15:57:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051557.r65Fvaix084322@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:57: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: r252794 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 15:57:36 -0000 Author: andre Date: Fri Jul 5 15:57:36 2013 New Revision: 252794 URL: http://svnweb.freebsd.org/changeset/base/252794 Log: MFC r242257: Remove bogus 'else' in #ifdef that prevented the rttvar from being reset tcp_timer_rexmt() on retransmit for IPv6 sessions. MFC r242260: When retransmitting SYN in TCPS_SYN_SENT state use TCPTV_RTOBASE, the default retransmit timeout, as base to calculate the backoff time until next try instead of the TCP_REXMTVAL() macro which only works correctly when we already have measured an actual RTT+RTTVAR. MFC r242263, r242264: Add SACK_PERMIT to the list of TCP options that are switched off after retransmitting a SYN three times. MFC r242267: If the user has closed the socket then drop a persisting connection after a much reduced timeout. Typically web servers close their sockets quickly under the assumption that the TCP connections goes away as well. That is not entirely true however. If the peer closed the window we're going to wait for a long time with lots of data in the send buffer. Modified: stable/9/sys/netinet/tcp_timer.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Fri Jul 5 15:47:59 2013 (r252793) +++ stable/9/sys/netinet/tcp_timer.c Fri Jul 5 15:57:36 2013 (r252794) @@ -453,6 +453,16 @@ tcp_timer_persist(void *xtp) tp = tcp_drop(tp, ETIMEDOUT); goto out; } + /* + * If the user has closed the socket then drop a persisting + * connection after a much reduced timeout. + */ + if (tp->t_state > TCPS_CLOSE_WAIT && + (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { + TCPSTAT_INC(tcps_persistdrop); + tp = tcp_drop(tp, ETIMEDOUT); + goto out; + } tcp_setpersist(tp); tp->t_flags |= TF_FORCEDATA; (void) tcp_output(tp); @@ -578,13 +588,13 @@ tcp_timer_rexmt(void * xtp) tp->t_flags &= ~TF_PREVVALID; TCPSTAT_INC(tcps_rexmttimeo); if (tp->t_state == TCPS_SYN_SENT) - rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we haven't got any response to + * Disable RFC1323 and SACK if we haven't got any response to * our third SYN to work-around some broken terminal servers * (most of which have hopefully been retired) that have bad VJ * header compression code which trashes TCP segments containing @@ -592,7 +602,7 @@ tcp_timer_rexmt(void * xtp) */ if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) - tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP); + tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); /* * If we backed off this far, our srtt estimate is probably bogus. * Clobber it so we'll take the next rtt measurement as our srtt; @@ -603,7 +613,6 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) in6_losing(tp->t_inpcb); - else #endif tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); tp->t_srtt = 0; From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:00:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BCD27EA; Fri, 5 Jul 2013 16:00:05 +0000 (UTC) (envelope-from dteske@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 6E9421447; Fri, 5 Jul 2013 16:00:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65G0592084832; Fri, 5 Jul 2013 16:00:05 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65G01HZ084770; Fri, 5 Jul 2013 16:00:01 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051600.r65G01HZ084770@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 16:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252795 - in head/usr.sbin/bsdconfig: networking/share password password/share share share/media startup/share usermgmt usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:00:05 -0000 Author: dteske Date: Fri Jul 5 16:00:01 2013 New Revision: 252795 URL: http://svnweb.freebsd.org/changeset/base/252795 Log: Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The main difference between these two functions: Usage: f_show_msg() $format_string [ $format_args ... ] Usage: f_dialog_msgbox() $text [ $hline ] The former lends itself well to displaying the $msg_* i18n text, prompts, etc. While the latter is better for text you do not control (error strings captured as a response from external commands) -- or if you have to control the hline. Modified: head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/network.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/media/usb.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -124,7 +124,7 @@ f_dialog_menu_netdev() done ) if [ ! "$interfaces" ]; then - f_dialog_msgbox "$msg_no_network_interfaces" + f_show_msg "$msg_no_network_interfaces" return $FAILURE fi Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -371,9 +371,9 @@ f_dialog_input_nameserver() local retval=$? case $retval in 1) f_die 1 "$msg_internal_error_nsindex_value" "$nsindex" ;; - 2) f_dialog_msgbox "$msg_resolv_conf_changed_while_editing" + 2) f_show_msg "$msg_resolv_conf_changed_while_editing" return $retval ;; - 3) f_dialog_msgbox "$msg_resolv_conf_entry_no_longer_exists" + 3) f_show_msg "$msg_resolv_conf_entry_no_longer_exists" return $retval ;; esac Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/password/password Fri Jul 5 16:00:01 2013 (r252795) @@ -75,7 +75,7 @@ f_mustberoot_init if f_dialog_input_password; then err=$( echo "$pw_password" | pw usermod $USER_ROOT -h 0 2>&1 ) || f_die $? "%s" "$err" - f_dialog_msgbox "$msg_password_changed" + f_show_msg "$msg_password_changed" fi return $SUCCESS Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/password/share/password.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -100,13 +100,13 @@ f_dialog_input_password() # Check for NULL entry if ! [ "$_password1" -o "$_password2" ]; then - f_dialog_msgbox "$msg_password_is_empty" + f_show_msg "$msg_password_is_empty" continue fi # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_dialog_msgbox "$msg_passwords_do_not_match" + f_show_msg "$msg_passwords_do_not_match" continue fi Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -61,7 +61,7 @@ f_media_set_cdrom() ndevs=$( set -- $devs; echo $# ) if [ ${ndevs:=0} -eq 0 ]; then - f_interactive && f_dialog_msgbox "$msg_no_cd_dvd_devices_found" + f_interactive && f_show_msg "$msg_no_cd_dvd_devices_found" return $FAILURE elif [ $ndevs -gt 1 ]; then local title="$msg_choose_a_cd_dvd_type" Modified: head/usr.sbin/bsdconfig/share/media/dos.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/dos.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/dos.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -59,7 +59,7 @@ f_media_set_dos() ndevs=$( set -- $devs; echo $# ) if [ ${ndevs:=0} -eq 0 ]; then - f_dialog_msgbox "$msg_no_dos_primary_partitions_found" + f_show_msg "$msg_no_dos_primary_partitions_found" return $FAILURE elif [ $ndevs -gt 1 ]; then local title="$msg_choose_a_dos_partition" Modified: head/usr.sbin/bsdconfig/share/media/floppy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/floppy.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/floppy.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -60,7 +60,7 @@ f_media_set_floppy() ndevs=$( set -- $devs; echo $# ) if [ ${ndevs:=0} -eq 0 ]; then - f_interactive && f_dialog_msgbox "$msg_no_floppy_devices_found" + f_interactive && f_show_msg "$msg_no_floppy_devices_found" return $FAILURE elif [ $ndevs -gt 1 ]; then local title="$msg_choose_a_floppy_drive" Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -630,8 +630,7 @@ f_media_init_ftp() ! f_getvar $VAR_FTP_PATH cp || [ ! "$cp" ] then - f_dialog_msgbox \ - "$msg_unable_to_get_proper_ftp_path" + f_show_msg "$msg_unable_to_get_proper_ftp_path" f_device_network_down $dev return $FAILURE fi @@ -642,7 +641,7 @@ f_media_init_ftp() f_getvar $VAR_FTP_HOST ftp_host && f_getvar $VAR_FTP_DIR ftp_dir }; then - f_dialog_msgbox "$msg_missing_ftp_host_or_directory" + f_show_msg "$msg_missing_ftp_host_or_directory" f_device_network_down $dev return $FAILURE fi Modified: head/usr.sbin/bsdconfig/share/media/network.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/network.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/network.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -110,7 +110,7 @@ f_media_init_network() local rp f_getvar $VAR_GATEWAY rp if [ ! "$rp" ]; then - f_dialog_msgbox "$msg_no_gateway_has_been_set" + f_show_msg "$msg_no_gateway_has_been_set" else # # Explicitly flush all routes to get back to a @@ -121,7 +121,7 @@ f_media_init_network() f_quietly route -n flush f_dprintf "Adding default route to %s." "$rp" if ! f_quietly route -n add default "$rp"; then - f_dialog_msgbox \ + f_show_msg \ "$msg_failed_to_add_default_route" return $FAILURE fi Modified: head/usr.sbin/bsdconfig/share/media/nfs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/nfs.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/nfs.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -82,7 +82,7 @@ f_media_set_nfs() case "$nfs" in *:*) : valid NFS path ;; *) - f_dialog_msgbox "$msg_invalid_nfs_path_specification" + f_show_msg "$msg_invalid_nfs_path_specification" return $FAILURE esac Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -456,20 +456,20 @@ f_dialog_validate_tcpip() local ipnum masknum if [ ! "$hostname" ]; then - f_dialog_msgbox "$msg_must_specify_a_host_name_of_some_sort" + f_show_msg "$msg_must_specify_a_host_name_of_some_sort" elif ! f_validate_hostname "$hostname"; then - f_dialog_msgbox "$msg_invalid_hostname_value" + f_show_msg "$msg_invalid_hostname_value" elif [ "$netmask" ] && ! f_validate_netmask "$netmask"; then - f_dialog_msgbox "$msg_invalid_netmask_value" + f_show_msg "$msg_invalid_netmask_value" elif [ "$nameserver" ] && - ! f_validate_ipaddr "$nameserver" && - ! f_validate_ipaddr6 "$nameserver"; then - f_dialog_msgbox "$msg_invalid_name_server_ip_address_specified" + ! f_validate_ipaddr "$nameserver" && + ! f_validate_ipaddr6 "$nameserver"; then + f_show_msg "$msg_invalid_name_server_ip_address_specified" elif [ "$ipaddr" ] && ! f_validate_ipaddr "$ipaddr" "$netmask"; then - f_dialog_msgbox "$msg_invalid_ipv4_address" + f_show_msg "$msg_invalid_ipv4_address" elif [ "$gateway" -a "$gateway" != "NO" ] && - ! f_validate_gateway "$gateway" "$ipaddr" "$netmask"; then - f_dialog_msgbox "$msg_invalid_gateway_ipv4_address_specified" + ! f_validate_gateway "$gateway" "$ipaddr" "$netmask"; then + f_show_msg "$msg_invalid_gateway_ipv4_address_specified" else return $SUCCESS fi @@ -1264,7 +1264,7 @@ f_device_dialog_tcp() if f_netinteractive || f_interactive || [ ! "$_hostname" ] then [ ! "$_hostname" ] && f_interactive && - f_dialog_msgbox "$msg_hostname_variable_not_set" + f_show_msg "$msg_hostname_variable_not_set" local title=" $msg_network_configuration " local hline="$hline_alnum_arrows_punc_tab_enter" @@ -1593,7 +1593,7 @@ f_device_select_tcp() fi done - f_interactive && f_dialog_msgbox "$msg_no_network_devices" + f_interactive && f_show_msg "$msg_no_network_devices" return $FAILURE fi # $network_dev @@ -1616,7 +1616,7 @@ f_device_select_tcp() local retval=$SUCCESS if [ ${cnt:=0} -eq 0 ]; then - f_dialog_msgbox "$msg_no_network_devices" + f_show_msg "$msg_no_network_devices" retval=$FAILURE elif [ $cnt -eq 1 ]; then f_device_dialog_tcp $dev Modified: head/usr.sbin/bsdconfig/share/media/usb.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/usb.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/media/usb.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -60,7 +60,7 @@ f_media_set_usb() ndevs=$( set -- $devs; echo $# ) if [ ${ndevs:=0} -eq 0 ]; then - f_dialog_msgbox "$msg_no_usb_devices_found" + f_show_msg "$msg_no_usb_devices_found" return $FAILURE elif [ $ndevs -gt 1 ]; then local title="$msg_choose_a_usb_drive" Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -330,7 +330,7 @@ f_authenticate_some_user() unset user_pass # scrub memory if [ ! "$user" ]; then nfailures=$(( $nfailures + 1 )) - f_dialog_msgbox "$msg_no_username" + f_show_msg "$msg_no_username" continue fi if [ ! "$SECURE_ALLOW_ROOT" ]; then Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -469,14 +469,14 @@ f_dialog_input_rcvar() # Check for invalid entry (1of2) if ! echo "$_input" | grep -q "^[[:alpha:]_]"; then - f_dialog_msgbox "$msg_rcvar_must_start_with" + f_show_msg "$msg_rcvar_must_start_with" continue fi # Check for invalid entry (2of2) if ! echo "$_input" | grep -q "^[[:alpha:]_][[:alnum:]_]*$" then - f_dialog_msgbox "$msg_rcvar_contains_invalid_chars" + f_show_msg "$msg_rcvar_contains_invalid_chars" continue fi Modified: head/usr.sbin/bsdconfig/usermgmt/groupinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupinput Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/usermgmt/groupinput Fri Jul 5 16:00:01 2013 (r252795) @@ -66,7 +66,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_group_deleted" + f_show_msg "$msg_group_deleted" ;; Add) local cmd="pw groupadd -n '$group_name'" @@ -85,7 +85,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_group_added" + f_show_msg "$msg_group_added" ;; Edit/View) local cmd="pw groupmod -n '$group_name'" @@ -104,7 +104,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_group_updated" + f_show_msg "$msg_group_updated" ;; esac Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -138,13 +138,13 @@ f_dialog_input_group_name() # Check for NULL entry if [ ! "$_input" ]; then - f_dialog_msgbox "$msg_group_is_empty" + f_show_msg "$msg_group_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_dialog_msgbox "$msg_group_must_start_with_letter" + f_show_msg "$msg_group_must_start_with_letter" continue fi @@ -231,7 +231,7 @@ f_dialog_input_group_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_dialog_msgbox "$msg_group_passwords_do_not_match" + f_show_msg "$msg_group_passwords_do_not_match" continue fi Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Jul 5 16:00:01 2013 (r252795) @@ -242,13 +242,13 @@ f_dialog_input_name() # Check for NULL entry if [ ! "$_input" ]; then - f_dialog_msgbox "$msg_login_is_empty" + f_show_msg "$msg_login_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_dialog_msgbox "$msg_login_must_start_with_letter" + f_show_msg "$msg_login_must_start_with_letter" continue fi @@ -328,7 +328,7 @@ f_dialog_input_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_dialog_msgbox "$msg_passwords_do_not_match" + f_show_msg "$msg_passwords_do_not_match" continue fi @@ -584,7 +584,7 @@ f_dialog_input_expire_password() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_dialog_msgbox "$msg_invalid_number_of_days" + f_show_msg "$msg_invalid_number_of_days" continue fi @@ -610,8 +610,7 @@ f_dialog_input_expire_password() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_dialog_msgbox \ - "$msg_invalid_number_of_seconds" + f_show_msg "$msg_invalid_number_of_seconds" continue fi @@ -769,7 +768,7 @@ f_dialog_input_expire_account() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_dialog_msgbox "$msg_invalid_number_of_days" + f_show_msg "$msg_invalid_number_of_days" continue fi @@ -795,8 +794,7 @@ f_dialog_input_expire_account() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_dialog_msgbox \ - "$msg_invalid_number_of_seconds" + f_show_msg "$msg_invalid_number_of_seconds" continue fi Modified: head/usr.sbin/bsdconfig/usermgmt/userinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/userinput Fri Jul 5 15:57:36 2013 (r252794) +++ head/usr.sbin/bsdconfig/usermgmt/userinput Fri Jul 5 16:00:01 2013 (r252795) @@ -84,7 +84,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_login_deleted" + f_show_msg "$msg_login_deleted" if [ "$pw_group_delete" = "$msg_yes" ] && f_quietly pw groupshow -g "$pw_gid" @@ -122,7 +122,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_login_added" + f_show_msg "$msg_login_added" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" 2>&1 ) @@ -168,7 +168,7 @@ save_changes() f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_dialog_msgbox "$msg_login_updated" + f_show_msg "$msg_login_updated" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" ) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:03:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57802A18; Fri, 5 Jul 2013 16:03:20 +0000 (UTC) (envelope-from andre@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 47E25147E; Fri, 5 Jul 2013 16:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65G3KHQ086966; Fri, 5 Jul 2013 16:03:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65G3Ku1086965; Fri, 5 Jul 2013 16:03:20 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051603.r65G3Ku1086965@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 16:03: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: r252796 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:03:20 -0000 Author: andre Date: Fri Jul 5 16:03:19 2013 New Revision: 252796 URL: http://svnweb.freebsd.org/changeset/base/252796 Log: MFC r242256: Improve m_cat() by being able to also merge contents from M_EXT mbuf's by doing proper testing with M_WRITABLE(). In m_collapse() replace an incomplete manual check for M_RDONLY with the M_WRITABLE() macro that also tests for shared buffers and other cases that make a particular mbuf immutable. Modified: stable/9/sys/kern/uipc_mbuf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_mbuf.c ============================================================================== --- stable/9/sys/kern/uipc_mbuf.c Fri Jul 5 16:00:01 2013 (r252795) +++ stable/9/sys/kern/uipc_mbuf.c Fri Jul 5 16:03:19 2013 (r252796) @@ -911,8 +911,8 @@ m_cat(struct mbuf *m, struct mbuf *n) while (m->m_next) m = m->m_next; while (n) { - if (m->m_flags & M_EXT || - m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) { + if (!M_WRITABLE(m) || + M_TRAILINGSPACE(m) < n->m_len) { /* just join the two chains */ m->m_next = n; return; @@ -1584,7 +1584,7 @@ again: n = m->m_next; if (n == NULL) break; - if ((m->m_flags & M_RDONLY) == 0 && + if (M_WRITABLE(m) && n->m_len < M_TRAILINGSPACE(m)) { bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, n->m_len); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:08:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6E67BD5; Fri, 5 Jul 2013 16:08:13 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id EFD0815D5; Fri, 5 Jul 2013 16:08:12 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlUGAMPu1lFR8Z+L/2dsb2JhbABagwkywQeBABd0giMBAQUnLyMQCxQECRYPCQMCAQIBJx4GDQEHAQGIDwi5BI9aEQeDbQOQCYEthzyQHIMTOg Received: from 139.159-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.159.139]) by relay.skynet.be with ESMTP; 05 Jul 2013 18:06:43 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r65G6gV7003640; Fri, 5 Jul 2013 18:06:42 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Message-ID: <51D6EF0D.3050506@FreeBSD.org> Date: Fri, 05 Jul 2013 18:06:37 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130701 Thunderbird/17.0.7 MIME-Version: 1.0 To: "Simon J. Gerraty" Subject: Re: svn commit: r251422 - in head: contrib/bmake usr.bin/bmake References: <201306051612.r55GCpPG050941@svn.freebsd.org> <51C8967F.2060905@FreeBSD.org> In-Reply-To: <51C8967F.2060905@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2VVTBMJRSHSAICIPQPDED" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:08:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VVTBMJRSHSAICIPQPDED Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-06-24 20:57, Tijl Coosemans wrote: > On 2013-06-05 18:12, Simon J. Gerraty wrote: >> Author: sjg >> Date: Wed Jun 5 16:12:50 2013 >> New Revision: 251422 >> URL: http://svnweb.freebsd.org/changeset/base/251422 >> >> Log: >> Update to bmake-20130604 to fix file descriptor leak. >> >> Modified: head/contrib/bmake/job.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/contrib/bmake/job.c Wed Jun 5 15:52:24 2013 (r251421) >> +++ head/contrib/bmake/job.c Wed Jun 5 16:12:50 2013 (r251422) >> @@ -1,4 +1,4 @@ >> -/* $NetBSD: job.c,v 1.172 2013/03/05 22:01:43 christos Exp $ */ >> +/* $NetBSD: job.c,v 1.173 2013/06/05 03:59:43 sjg Exp $ */ >> =20 >> /* >> * Copyright (c) 1988, 1989, 1990 The Regents of the University of Ca= lifornia. >> @@ -70,14 +70,14 @@ >> */ >> =20 >> #ifndef MAKE_NATIVE >> -static char rcsid[] =3D "$NetBSD: job.c,v 1.172 2013/03/05 22:01:43 c= hristos Exp $"; >> +static char rcsid[] =3D "$NetBSD: job.c,v 1.173 2013/06/05 03:59:43 s= jg Exp $"; >> #else >> #include >> #ifndef lint >> #if 0 >> static char sccsid[] =3D "@(#)job.c 8.2 (Berkeley) 3/19/94"; >> #else >> -__RCSID("$NetBSD: job.c,v 1.172 2013/03/05 22:01:43 christos Exp $");= >> +__RCSID("$NetBSD: job.c,v 1.173 2013/06/05 03:59:43 sjg Exp $"); >> #endif >> #endif /* not lint */ >> #endif >> @@ -414,6 +414,15 @@ JobCreatePipe(Job *job, int minfd) >> if (pipe(job->jobPipe) =3D=3D -1) >> Punt("Cannot create pipe: %s", strerror(errno)); >> =20 >> + for (i =3D 0; i < 2; i++) { >> + /* Avoid using low numbered fds */ >> + fd =3D fcntl(job->jobPipe[i], F_DUPFD, minfd); >> + if (fd !=3D -1) { >> + close(job->jobPipe[i]); >> + job->jobPipe[i] =3D fd; >> + } >> + } >> + =20 >> /* Set close-on-exec flag for both */ >> (void)fcntl(job->jobPipe[0], F_SETFD, 1); >> (void)fcntl(job->jobPipe[1], F_SETFD, 1); >=20 > I've been noticing that bmake doesn't run parallel jobs as like fmake. > I've attached a Makefile that I think shows what's going wrong. >=20 > If you run "make -j4" it outputs the following: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- all --- > -j 4 -i -J 15,16 > 4 > -j 4 -i > 4 > --- sub_2 --- > -j 4 -i -J 15,16 > 4 > -j 4 -i > 4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 > Bmake outputs the target name in -j mode (e.g. "--- all ---"), but > there's no "--- sub_1 ---" and "--- sub_3 ---" which suggests -j isn't > working there. The -J flag also doesn't appear in .MAKEFLAGS in those > targets. >=20 > I suspect the descriptors for the job server have to remain open so > submakes can pick them up. At least, when I comment out the two fcntl > calls above (and two more below), I do get the output I expect: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- all --- > -j 4 -J 15,16 > 4 > --- sub_1 --- > -j 4 -J 15,16 > 4 > --- sub_2 --- > -j 4 -J 15,16 > 4 > --- sub_3 --- > -j 4 -J 15,16 > 4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 >> @@ -426,15 +435,6 @@ JobCreatePipe(Job *job, int minfd) >> */ >> fcntl(job->jobPipe[0], F_SETFL,=20 >> fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK); >> - >> - for (i =3D 0; i < 2; i++) { >> - /* Avoid using low numbered fds */ >> - fd =3D fcntl(job->jobPipe[i], F_DUPFD, minfd); >> - if (fd !=3D -1) { >> - close(job->jobPipe[i]); >> - job->jobPipe[i] =3D fd; >> - } >> - } >> } >> =20 >> /*- >> @@ -2828,6 +2828,8 @@ Job_ServerStart(int max_tokens, int jp_0 >> /* Pipe passed in from parent */ >> tokenWaitJob.inPipe =3D jp_0; >> tokenWaitJob.outPipe =3D jp_1; >> + (void)fcntl(jp_0, F_SETFD, 1); >> + (void)fcntl(jp_1, F_SETFD, 1); >=20 > These two fcntl calls have to be commented out too. When those four lines are commented out buildworld with four jobs runs 10% faster. Now that I've taken a closer look at the code it seems bmake requires targets that run make to be marked with .MAKE. Several targets in Makefile and Makefile.inc1 already have this, but some don't, such as bootstrap-tools. Can this be added there? ------enig2VVTBMJRSHSAICIPQPDED Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHW7xIACgkQfoCS2CCgtitdMwD/eBS2UgwGm2AEexZWdQaExWHO GLcYSeiesB3OeHmlbokA/jce+G1c32CWRUq3oHeT4pS1myBWROR182OkX8iiMBP1 =3O1T -----END PGP SIGNATURE----- ------enig2VVTBMJRSHSAICIPQPDED-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:21:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EBC24EF4; Fri, 5 Jul 2013 16:21:44 +0000 (UTC) (envelope-from dteske@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 DE8571650; Fri, 5 Jul 2013 16:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65GLiP8092852; Fri, 5 Jul 2013 16:21:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65GLiNl092851; Fri, 5 Jul 2013 16:21:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051621.r65GLiNl092851@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 16:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252797 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:21:45 -0000 Author: dteske Date: Fri Jul 5 16:21:44 2013 New Revision: 252797 URL: http://svnweb.freebsd.org/changeset/base/252797 Log: Do not inherit $SYSRC_VERBOSE from operating environment. The concern is that when a user (such as myself) which has SYSRC_VERBOSE=1 in his/her ~/.bash_profile or such that when they are told to execute a command like: hostname `sysrc -n hostname` NOTE: To activate a recently configured hostname. If $SYSRC_VERBOSE is set, then POLA is violated because the output of sysrc is indirectly influenced (making for an inconsistent experience). Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Fri Jul 5 16:03:19 2013 (r252796) +++ head/usr.sbin/sysrc/sysrc Fri Jul 5 16:21:44 2013 (r252797) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2012 Devin Teske +# Copyright (c) 2010-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,13 +32,6 @@ BSDCFG_SHARE="/usr/share/bsdconfig" [ "$_COMMON_SUBR" ] || . $BSDCFG_SHARE/common.subr || exit 1 [ "$_SYSRC_SUBR" ] || f_include $BSDCFG_SHARE/sysrc.subr -############################################################ CONFIGURATION - -# -# Default verbosity. -# -: ${SYSRC_VERBOSE:=} - ############################################################ GLOBALS # @@ -55,6 +48,7 @@ SHOW_EQUALS= SHOW_FILE= SHOW_NAME=1 SHOW_VALUE=1 +SYSRC_VERBOSE= ############################################################ FUNCTIONS From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:45:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE8575A8; Fri, 5 Jul 2013 16:45:25 +0000 (UTC) (envelope-from dteske@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 A11AA1711; Fri, 5 Jul 2013 16:45:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65GjPSs099218; Fri, 5 Jul 2013 16:45:25 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65GjPHq099217; Fri, 5 Jul 2013 16:45:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051645.r65GjPHq099217@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 16:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252798 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:45:25 -0000 Author: dteske Date: Fri Jul 5 16:45:25 2013 New Revision: 252798 URL: http://svnweb.freebsd.org/changeset/base/252798 Log: Update sysrc(8) manual to coincide with r252797: Do not inherit $SYSRC_VERBOSE from operating environment. The concern is that when a user (such as myself) which has SYSRC_VERBOSE=1 in his/her ~/.bash_profile or such that when they are told to execute a command like: hostname `sysrc -n hostname` NOTE: To activate a recently configured hostname. If $SYSRC_VERBOSE is set, then POLA is violated because the output of sysrc is indirectly influenced (making for an inconsistent experience). Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:21:44 2013 (r252797) +++ head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:45:25 2013 (r252798) @@ -99,10 +99,9 @@ Show only variable values, not their nam Show only variable names, not their values. .It Fl q Quiet. -Ignore previous +Ignore previous occurrences of .Fl v -and/or -.Ev SYSRC_VERBOSE . +flag. .It Fl R Ar dir Operate within the root directory .Pq Sq Ar dir @@ -175,7 +174,7 @@ be called repeatedly). .Sh ENVIRONMENT The following environment variables are referenced by .Nm : -.Bl -tag -width ".Ev SYSRC_VERBOSE" +.Bl -tag -width ".Ev RC_DEFAULTS" .It Ev RC_CONFS Override default .Ql rc_conf_files @@ -184,9 +183,6 @@ Override default Location of .Ql /etc/defaults/rc.conf file. -.It Ev SYSRC_VERBOSE -Default verbosity. -Set to non-NULL to enable. .El .Sh DEPENDENCIES The following standard commands are required by From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:47:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7B8E712; Fri, 5 Jul 2013 16:47:30 +0000 (UTC) (envelope-from dteske@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 A9A8C172C; Fri, 5 Jul 2013 16:47:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65GlUgb099479; Fri, 5 Jul 2013 16:47:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65GlU6I099478; Fri, 5 Jul 2013 16:47:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051647.r65GlU6I099478@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 16:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252799 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:47:30 -0000 Author: dteske Date: Fri Jul 5 16:47:30 2013 New Revision: 252799 URL: http://svnweb.freebsd.org/changeset/base/252799 Log: Update copyright/date on the back of r252798. Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:45:25 2013 (r252798) +++ head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:47:30 2013 (r252799) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012 Devin Teske +.\" Copyright (c) 2011-2013 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 24, 2012 +.Dd Jul 5, 2013 .Dt SYSRC 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 16:49:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBEDC855; Fri, 5 Jul 2013 16:49:06 +0000 (UTC) (envelope-from dteske@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 943FD1737; Fri, 5 Jul 2013 16:49:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Gn6Vg099712; Fri, 5 Jul 2013 16:49:06 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Gn6eO099711; Fri, 5 Jul 2013 16:49:06 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051649.r65Gn6eO099711@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 16:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252800 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 16:49:06 -0000 Author: dteske Date: Fri Jul 5 16:49:06 2013 New Revision: 252800 URL: http://svnweb.freebsd.org/changeset/base/252800 Log: Update release info. Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:47:30 2013 (r252799) +++ head/usr.sbin/sysrc/sysrc.8 Fri Jul 5 16:49:06 2013 (r252800) @@ -288,7 +288,7 @@ This will be corrected by a future enhan A .Nm utility first appeared in -.Fx 10.0 . +.Fx 9.2 . .Sh AUTHORS .An Devin Teske Aq dteske@FreeBSD.org .Sh THANKS TO From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:21:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 054EEEF3; Fri, 5 Jul 2013 17:21:41 +0000 (UTC) (envelope-from dteske@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 D231718A7; Fri, 5 Jul 2013 17:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HLerr010868; Fri, 5 Jul 2013 17:21:40 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HLem6010867; Fri, 5 Jul 2013 17:21:40 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051721.r65HLem6010867@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252801 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:21:41 -0000 Author: dteske Date: Fri Jul 5 17:21:40 2013 New Revision: 252801 URL: http://svnweb.freebsd.org/changeset/base/252801 Log: Whitespace. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 16:49:06 2013 (r252800) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:21:40 2013 (r252801) @@ -56,7 +56,7 @@ .\" security .\" ttys .\" [dot] -.\" +.\" .\" $FreeBSD$ .\" .Dd Jan 5, 2013 From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:22:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1A509C; Fri, 5 Jul 2013 17:22:10 +0000 (UTC) (envelope-from dteske@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 B3AD418AD; Fri, 5 Jul 2013 17:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HMAG4011022; Fri, 5 Jul 2013 17:22:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HMAtR011020; Fri, 5 Jul 2013 17:22:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051722.r65HMAtR011020@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252802 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:22:10 -0000 Author: dteske Date: Fri Jul 5 17:22:10 2013 New Revision: 252802 URL: http://svnweb.freebsd.org/changeset/base/252802 Log: Fix a typo. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:21:40 2013 (r252801) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:22:10 2013 (r252802) @@ -141,7 +141,7 @@ language file .Pq printed on stdout visualizing the .Nm -menu, include, and shortcut structure and relationships. See +menu, include, and shortcut structure relationships. See .Dq bsdconfig dot -h for more details. .It Cm groupadd From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:23:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B97CC1F9; Fri, 5 Jul 2013 17:23:00 +0000 (UTC) (envelope-from dteske@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 92A8018B7; Fri, 5 Jul 2013 17:23:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HN082011149; Fri, 5 Jul 2013 17:23:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HN0qX011144; Fri, 5 Jul 2013 17:23:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051723.r65HN0qX011144@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252803 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:23:00 -0000 Author: dteske Date: Fri Jul 5 17:23:00 2013 New Revision: 252803 URL: http://svnweb.freebsd.org/changeset/base/252803 Log: Update date on the back of r252802. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:22:10 2013 (r252802) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:23:00 2013 (r252803) @@ -59,7 +59,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 5, 2013 +.Dd Jun 5, 2013 .Dt BSDCONFIG 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:27:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 83EA5366; Fri, 5 Jul 2013 17:27:56 +0000 (UTC) (envelope-from dteske@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 5C77918D7; Fri, 5 Jul 2013 17:27:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HRuZI011728; Fri, 5 Jul 2013 17:27:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HRui4011727; Fri, 5 Jul 2013 17:27:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051727.r65HRui4011727@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252804 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:27:56 -0000 Author: dteske Date: Fri Jul 5 17:27:55 2013 New Revision: 252804 URL: http://svnweb.freebsd.org/changeset/base/252804 Log: mdoc: begin sentences on a new line. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:23:00 2013 (r252803) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:27:55 2013 (r252804) @@ -80,8 +80,9 @@ is used to set up many system configurat well as changing configuration settings of existing systems. .Pp .Nm -takes a command as an argument. If invoked with no arguments, it will bring up -a master menu listing the available commands. +takes a command as an argument. +If invoked with no arguments, it will bring up a master menu listing the +available commands. .Pp The following options are available: .Bl -tag -width indent+ @@ -115,8 +116,8 @@ The following commands .Pq sorted alphabetically are currently included in the base .Nm -program, with more to be added soon. Other commands can be added, as detailed -below in the +program, with more to be added soon. +Other commands can be added, as detailed below in the .Cm ADDING COMMANDS section, and once added, will appear in the master menu as well as in the .Cm -h @@ -127,7 +128,8 @@ Utilities to customize the behavior of t .It Cm defaultrouter Shortcut to the Default Router/Gateway menu under networking. .It Cm diskmgmt -Manage disk partitions and/or labels. Executes +Manage disk partitions and/or labels. +Executes .Xr sade 8 . .It Cm docsinstall Executes the @@ -141,7 +143,8 @@ language file .Pq printed on stdout visualizing the .Nm -menu, include, and shortcut structure relationships. See +menu, include, and shortcut structure relationships. +See .Dq bsdconfig dot -h for more details. .It Cm groupadd @@ -210,8 +213,8 @@ In the absence of language-specific tran .Pq en_US.ISO8859-1 files will be used. .Sh ADDING COMMANDS -To be documented later. Document menu_selection="command|*" syntax of INDEX -files. +To be documented later. +Document menu_selection="command|*" syntax of INDEX files. .Sh ENVIRONMENT VARIABLES The following environment variables affect the execution of .Nm : @@ -219,7 +222,8 @@ The following environment variables affe .It Ev LANG If LANG is set, messages and index information will be read from files named messages.$LANG and INDEX.$LANG and fall back to files named messages and INDEX if -messages.$LANG and INDEX.$LANG do not exist. LANG takes precedence over LC_ALL. +messages.$LANG and INDEX.$LANG do not exist. +LANG takes precedence over LC_ALL. .It Ev LC_ALL If LC_ALL is set, messages and index information will be read from files named messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and INDEX if From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:31:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 383125DB; Fri, 5 Jul 2013 17:31:06 +0000 (UTC) (envelope-from dteske@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 10BFE18F9; Fri, 5 Jul 2013 17:31:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HV5fg013855; Fri, 5 Jul 2013 17:31:05 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HV5Jx013854; Fri, 5 Jul 2013 17:31:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051731.r65HV5Jx013854@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252805 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:31:06 -0000 Author: dteske Date: Fri Jul 5 17:31:05 2013 New Revision: 252805 URL: http://svnweb.freebsd.org/changeset/base/252805 Log: Don't refer to a port manual. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:27:55 2013 (r252804) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:31:05 2013 (r252805) @@ -235,7 +235,6 @@ customized as needed. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr host-setup 8 , .Xr sade 8 .Sh HISTORY .Nm From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:35:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BED8875A; Fri, 5 Jul 2013 17:35:13 +0000 (UTC) (envelope-from dteske@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 B16C21924; Fri, 5 Jul 2013 17:35:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HZDIe014439; Fri, 5 Jul 2013 17:35:13 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HZD2d014438; Fri, 5 Jul 2013 17:35:13 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051735.r65HZD2d014438@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252806 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:35:13 -0000 Author: dteske Date: Fri Jul 5 17:35:13 2013 New Revision: 252806 URL: http://svnweb.freebsd.org/changeset/base/252806 Log: Since r251908, bsdconfig(8) has no direct ties to sade(8) (instead uses `bsdinstall partedit'). Update references (s/sade/bsdinstall/) and change the BUGS section to be based on reality. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:31:05 2013 (r252805) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:35:13 2013 (r252806) @@ -235,7 +235,7 @@ customized as needed. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr sade 8 +.Xr bsdinstall 8 .Sh HISTORY .Nm first appeared in @@ -244,4 +244,6 @@ first appeared in .An Ron McDowell Aq rcm@FuzzWad.ORG .An Devin Teske Aq devinteske@hotmail.com .Sh BUGS -Undoubtedly. +The docsinstall and diskmgmt modules call bsdinstall. +Bugs found in these modules should be considered those of bsdinstall, not +.Nm . From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:38:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2FE9F996; Fri, 5 Jul 2013 17:38:55 +0000 (UTC) (envelope-from dteske@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 225EE193E; Fri, 5 Jul 2013 17:38:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HctC0015162; Fri, 5 Jul 2013 17:38:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Hct00015161; Fri, 5 Jul 2013 17:38:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051738.r65Hct00015161@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252807 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:38:55 -0000 Author: dteske Date: Fri Jul 5 17:38:54 2013 New Revision: 252807 URL: http://svnweb.freebsd.org/changeset/base/252807 Log: Update e-mails. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:35:13 2013 (r252806) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:38:54 2013 (r252807) @@ -241,8 +241,8 @@ customized as needed. first appeared in .Fx 10.0 . .Sh AUTHORS -.An Ron McDowell Aq rcm@FuzzWad.ORG -.An Devin Teske Aq devinteske@hotmail.com +.An Ron McDowell Aq rcm@FuzzWad.org +.An Devin Teske Aq dteske@FreeBSD.org .Sh BUGS The docsinstall and diskmgmt modules call bsdinstall. Bugs found in these modules should be considered those of bsdinstall, not From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:44:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D40D0B29; Fri, 5 Jul 2013 17:44:53 +0000 (UTC) (envelope-from dteske@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 C6BCD1970; Fri, 5 Jul 2013 17:44:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Hirme017516; Fri, 5 Jul 2013 17:44:53 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Hirlc017515; Fri, 5 Jul 2013 17:44:53 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051744.r65Hirlc017515@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252808 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:44:53 -0000 Author: dteske Date: Fri Jul 5 17:44:53 2013 New Revision: 252808 URL: http://svnweb.freebsd.org/changeset/base/252808 Log: Rest in peace Ron (Ron McDowell Jul.12, 1955 - Aug.26, 2012). I'll carry-on from here. Thank you so much for your hard work. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:38:54 2013 (r252807) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:44:53 2013 (r252808) @@ -241,7 +241,7 @@ customized as needed. first appeared in .Fx 10.0 . .Sh AUTHORS -.An Ron McDowell Aq rcm@FuzzWad.org +.An Ron McDowell .An Devin Teske Aq dteske@FreeBSD.org .Sh BUGS The docsinstall and diskmgmt modules call bsdinstall. From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:45:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B5DEFD2A; Fri, 5 Jul 2013 17:45:54 +0000 (UTC) (envelope-from dteske@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 8EDF9197E; Fri, 5 Jul 2013 17:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HjsYD017770; Fri, 5 Jul 2013 17:45:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HjskV017769; Fri, 5 Jul 2013 17:45:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051745.r65HjskV017769@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252809 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:45:54 -0000 Author: dteske Date: Fri Jul 5 17:45:54 2013 New Revision: 252809 URL: http://svnweb.freebsd.org/changeset/base/252809 Log: Update HISTORY. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:44:53 2013 (r252808) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:45:54 2013 (r252809) @@ -239,7 +239,7 @@ customized as needed. .Sh HISTORY .Nm first appeared in -.Fx 10.0 . +.Fx 9.2 . .Sh AUTHORS .An Ron McDowell .An Devin Teske Aq dteske@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:54:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43E4EF0D; Fri, 5 Jul 2013 17:54:09 +0000 (UTC) (envelope-from dteske@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 372AF19BD; Fri, 5 Jul 2013 17:54:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Hs95Y020365; Fri, 5 Jul 2013 17:54:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Hs9um020364; Fri, 5 Jul 2013 17:54:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051754.r65Hs9um020364@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252810 - head/usr.sbin/bsdconfig/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:54:09 -0000 Author: dteske Date: Fri Jul 5 17:54:08 2013 New Revision: 252810 URL: http://svnweb.freebsd.org/changeset/base/252810 Log: Add example shell script for creating a local INDEX file that can be accessed quickly for browsing a list of available packages. Added: head/usr.sbin/bsdconfig/examples/browse_packages.sh (contents, props changed) Added: head/usr.sbin/bsdconfig/examples/browse_packages.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/examples/browse_packages.sh Fri Jul 5 17:54:08 2013 (r252810) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from FTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _ftpPath=ftp://ftp-archive.freebsd.org + mediaSetFTP + mediaOpen + f_show_info "Downloading packages/INDEX from %s" "$_ftpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + mediaClose +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:56:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DE3A01C0; Fri, 5 Jul 2013 17:56:15 +0000 (UTC) (envelope-from dteske@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 CFD4919CD; Fri, 5 Jul 2013 17:56:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HuFIg020797; Fri, 5 Jul 2013 17:56:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HuFNj020796; Fri, 5 Jul 2013 17:56:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051756.r65HuFNj020796@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 17:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252811 - head/usr.sbin/bsdconfig/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:56:15 -0000 Author: dteske Date: Fri Jul 5 17:56:15 2013 New Revision: 252811 URL: http://svnweb.freebsd.org/changeset/base/252811 Log: Change default FTP server (s/ftp-archive/ftp/). Modified: head/usr.sbin/bsdconfig/examples/browse_packages.sh Modified: head/usr.sbin/bsdconfig/examples/browse_packages.sh ============================================================================== --- head/usr.sbin/bsdconfig/examples/browse_packages.sh Fri Jul 5 17:54:08 2013 (r252810) +++ head/usr.sbin/bsdconfig/examples/browse_packages.sh Fri Jul 5 17:56:15 2013 (r252811) @@ -13,7 +13,8 @@ nonInteractive=1 TMPDIR=/tmp if [ ! -e "$TMPDIR/packages/INDEX" ]; then [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 - _ftpPath=ftp://ftp-archive.freebsd.org + _ftpPath=ftp://ftp.freebsd.org + # For older releases, use ftp://ftp-archive.freebsd.org mediaSetFTP mediaOpen f_show_info "Downloading packages/INDEX from %s" "$_ftpPath" From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 17:57:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35708313; Fri, 5 Jul 2013 17:57:26 +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 0D46019DB; Fri, 5 Jul 2013 17:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HvPKN020958; Fri, 5 Jul 2013 17:57:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HvP90020957; Fri, 5 Jul 2013 17:57:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051757.r65HvP90020957@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 17:57:25 +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: r252812 - stable/9/tools/build/options X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 17:57:26 -0000 Author: emaste Date: Fri Jul 5 17:57:25 2013 New Revision: 252812 URL: http://svnweb.freebsd.org/changeset/base/252812 Log: MFC r251601, r251685: Handle options that override other options Modified: stable/9/tools/build/options/makeman Directory Properties: stable/9/tools/build/options/ (props changed) Modified: stable/9/tools/build/options/makeman ============================================================================== --- stable/9/tools/build/options/makeman Fri Jul 5 17:56:15 2013 (r252811) +++ stable/9/tools/build/options/makeman Fri Jul 5 17:57:25 2013 (r252812) @@ -198,7 +198,12 @@ that can be used for source builds. .Bl -tag -width indent EOF show settings SRCCONF=/dev/null | sort > $t/config_default - show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL + # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the + # actual config that results from enabling every WITH_ option. This + # can be reverted if/when we no longer have options that disable + # others. + show with SRCCONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf + show settings SRCCONF=$t/src.conf | sort > $t/config_WITH_ALL show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL show_options | @@ -229,6 +234,18 @@ EOF exit 1 fi + show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt} + comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | + comm -13 $t/deps - > $t/deps2 + + # Work around BIND_UTILS=no being the default when every WITH_ + # option is enabled. + if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then + sort $t/deps $t/deps2 > $t/_deps + mv $t/_deps $t/deps + :> $t/deps2 + fi + if [ -s $t/deps ] ; then echo 'When set, it also enforces the following options:' echo '.Pp' @@ -240,10 +257,6 @@ EOF echo '.El' fi - show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt} - comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | - comm -13 $t/deps - > $t/deps2 - if [ -s $t/deps2 ] ; then if [ -s $t/deps ] ; then echo '.Pp' From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:03:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5A3148C; Fri, 5 Jul 2013 18:03:00 +0000 (UTC) (envelope-from dteske@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 A8E011A03; Fri, 5 Jul 2013 18:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65I306g023566; Fri, 5 Jul 2013 18:03:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65I30xO023565; Fri, 5 Jul 2013 18:03:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051803.r65I30xO023565@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 18:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252813 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:03:00 -0000 Author: dteske Date: Fri Jul 5 18:03:00 2013 New Revision: 252813 URL: http://svnweb.freebsd.org/changeset/base/252813 Log: Document new `-d' and `-D file' debugging options. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 17:57:25 2013 (r252812) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:03:00 2013 (r252813) @@ -86,6 +86,12 @@ available commands. .Pp The following options are available: .Bl -tag -width indent+ +.It Fl d +Provide lots of debugging info on standard-out when running. +.It Fl D Ar file +Send debugging info to file. +If file begins with a plus-sign debug info is sent to both standard-out and +file (minus the leading plus). .It Fl f Ar file Load .Ar file From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:27:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 34216A82; Fri, 5 Jul 2013 18:27:41 +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 23ABD1B36; Fri, 5 Jul 2013 18:27:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IRe3o030218; Fri, 5 Jul 2013 18:27:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IRdIu030207; Fri, 5 Jul 2013 18:27:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307051827.r65IRdIu030207@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 5 Jul 2013 18:27:39 +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: r252814 - in stable/9/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware dev/cxgbe/tom modules/cxgb modules/cxgbe modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:27:41 -0000 Author: np Date: Fri Jul 5 18:27:38 2013 New Revision: 252814 URL: http://svnweb.freebsd.org/changeset/base/252814 Log: - MFC r252661, r252705, r252711, r252715, r252716, r252724, r252728, r252747. - Connect t3_tom and t4_tom to the build (r252555 enables them). r252661: - Include the T5 firmware with the driver. - Update the T4 firmware to the latest. - Minor reorganization and updates to the version macros, etc. r252705: - Read all TP parameters in one place. - Read the filter mode, calculate various shifts, and use them properly during active open (in select_ntuple). r252711: The T5 allows the driver to specify the ISS. Do so; use the ISS picked by the kernel. r252715: Ring the egress queue's doorbell as soon as there are 8 or more descriptors ready to be processed. r252716: Pay attention to TCP_NODELAY when it's set/unset after the connection is established. r252724: On-the-fly changes to the interrupt coalescing timer should apply to the TOE rx queues too. r252728: - Make note of interface MTU change if the rx queues exist, and not just when the interface is up. - Add a tunable to control the TOE's rx coalesce feature (enabled by default as it always has been). Consider the interface MTU or the coalesce size when deciding which cluster zone to use to fill the offload rx queue's free list. The tunable is: dev.{t4nex,t5nex}..toe.rx_coalesce r252747: - Show the reason why link is down if this information is available. - Display the temperature and PHY firmware version of the BT PHY. Added: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu stable/9/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu stable/9/sys/dev/cxgbe/firmware/t5fw_cfg.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg.txt stable/9/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt stable/9/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt stable/9/sys/modules/cxgbe/t5_firmware/ - copied from r252661, head/sys/modules/cxgbe/t5_firmware/ Deleted: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu Modified: stable/9/sys/conf/files stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/common/t4_msg.h stable/9/sys/dev/cxgbe/common/t4_regs_values.h stable/9/sys/dev/cxgbe/firmware/t4fw_cfg.txt stable/9/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/dev/cxgbe/tom/t4_connect.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/cxgbe/tom/t4_tom.c stable/9/sys/dev/cxgbe/tom/t4_tom.h stable/9/sys/modules/cxgb/Makefile stable/9/sys/modules/cxgbe/Makefile stable/9/sys/modules/cxgbe/t4_firmware/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/conf/files Fri Jul 5 18:27:38 2013 (r252814) @@ -965,10 +965,34 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" +t5fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "t5fw_cfg.c" +t5fw_cfg.fwo optional cxgbe \ + dependency "t5fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw_cfg.fwo" +t5fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t5fw_cfg.fw" +t5fw.fwo optional cxgbe \ + dependency "t5fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw.fwo" +t5fw.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "t5fw.fw" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/adapter.h Fri Jul 5 18:27:38 2013 (r252814) @@ -132,7 +132,6 @@ enum { #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif - OFLD_BUF_SIZE = MJUM16BYTES, /* size of fl buffer for TOE rxq */ CTRL_EQ_QSIZE = 128, @@ -219,6 +218,7 @@ struct port_info { int qsize_rxq; int qsize_txq; + int linkdnrc; struct link_config link_cfg; struct port_stats stats; @@ -562,7 +562,6 @@ struct adapter { struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; - uint32_t filter_mode; #ifdef TCP_OFFLOAD void *tom_softc; /* (struct tom_data *) */ @@ -778,7 +777,7 @@ int t4_os_find_pci_capability(struct ada int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); int t4_register_an_handler(struct adapter *, an_handler_t); Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/common.h Fri Jul 5 18:27:38 2013 (r252814) @@ -67,16 +67,6 @@ enum { PAUSE_AUTONEG = 1 << 2 }; -#define FW_VERSION_MAJOR_T4 1 -#define FW_VERSION_MINOR_T4 8 -#define FW_VERSION_MICRO_T4 4 -#define FW_VERSION_BUILD_T4 0 - -#define FW_VERSION_MAJOR_T5 0 -#define FW_VERSION_MINOR_T5 5 -#define FW_VERSION_MICRO_T5 18 -#define FW_VERSION_BUILD_T5 0 - struct memwin { uint32_t base; uint32_t aperture; @@ -229,6 +219,12 @@ struct tp_params { unsigned int dack_re; /* DACK timer resolution */ unsigned int la_mask; /* what events are recorded by TP LA */ unsigned short tx_modq[NCHAN]; /* channel to modulation queue map */ + uint32_t vlan_pri_map; + uint32_t ingress_config; + int8_t vlan_shift; + int8_t vnic_shift; + int8_t port_shift; + int8_t protocol_shift; }; struct vpd_params { @@ -431,6 +427,8 @@ int t4_get_tp_version(struct adapter *ad int t4_check_fw_version(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); int t4_prep_adapter(struct adapter *adapter); +int t4_init_tp_params(struct adapter *adap); +int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct port_info *p, int mbox, int pf, int vf); int t4_reinit_adapter(struct adapter *adap); void t4_fatal_err(struct adapter *adapter); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 18:27:38 2013 (r252814) @@ -975,14 +975,14 @@ int t4_check_fw_version(struct adapter * switch (chip_id(adapter)) { case CHELSIO_T4: - exp_major = FW_VERSION_MAJOR_T4; - exp_minor = FW_VERSION_MINOR_T4; - exp_micro = FW_VERSION_MICRO_T4; + exp_major = T4FW_VERSION_MAJOR; + exp_minor = T4FW_VERSION_MINOR; + exp_micro = T4FW_VERSION_MICRO; break; case CHELSIO_T5: - exp_major = FW_VERSION_MAJOR_T5; - exp_minor = FW_VERSION_MINOR_T5; - exp_micro = FW_VERSION_MICRO_T5; + exp_major = T5FW_VERSION_MAJOR; + exp_minor = T5FW_VERSION_MINOR; + exp_micro = T5FW_VERSION_MICRO; break; default: CH_ERR(adapter, "Unsupported chip type, %x\n", @@ -1128,7 +1128,19 @@ int t4_load_fw(struct adapter *adap, con const u32 *p = (const u32 *)fw_data; const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - + unsigned int fw_start_sec; + unsigned int fw_start; + unsigned int fw_size; + + if (ntohl(hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP) { + fw_start_sec = FLASH_FWBOOTSTRAP_START_SEC; + fw_start = FLASH_FWBOOTSTRAP_START; + fw_size = FLASH_FWBOOTSTRAP_MAX_SIZE; + } else { + fw_start_sec = FLASH_FW_START_SEC; + fw_start = FLASH_FW_START; + fw_size = FLASH_FW_MAX_SIZE; + } if (!size) { CH_ERR(adap, "FW image has no data\n"); return -EINVAL; @@ -1141,9 +1153,8 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FLASH_FW_MAX_SIZE) { - CH_ERR(adap, "FW image too large, max is %u bytes\n", - FLASH_FW_MAX_SIZE); + if (size > fw_size) { + CH_ERR(adap, "FW image too large, max is %u bytes\n", fw_size); return -EFBIG; } if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || @@ -1164,8 +1175,7 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, - FLASH_FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, fw_start_sec, fw_start_sec + i - 1); if (ret) goto out; @@ -1176,11 +1186,11 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); + ret = t4_write_flash(adap, fw_start, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FLASH_FW_START; + addr = fw_start; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; @@ -1190,7 +1200,7 @@ int t4_load_fw(struct adapter *adap, con } ret = t4_write_flash(adap, - FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + fw_start + offsetof(struct fw_hdr, fw_ver), sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) @@ -4622,14 +4632,17 @@ int t4_fw_upgrade(struct adapter *adap, const u8 *fw_data, unsigned int size, int force) { const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; + unsigned int bootstrap = ntohl(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; int reset, ret; - ret = t4_fw_halt(adap, mbox, force); - if (ret < 0 && !force) - return ret; + if (!bootstrap) { + ret = t4_fw_halt(adap, mbox, force); + if (ret < 0 && !force) + return ret; + } ret = t4_load_fw(adap, fw_data, size); - if (ret < 0) + if (ret < 0 || bootstrap) return ret; /* @@ -5338,11 +5351,18 @@ int t4_handle_fw_rpl(struct adapter *ada if (link_ok != lc->link_ok || speed != lc->speed || fc != lc->fc) { /* something changed */ + int reason; + + if (!link_ok && lc->link_ok) + reason = G_FW_PORT_CMD_LINKDNRC(stat); + else + reason = -1; + lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; lc->supported = ntohs(p->u.info.pcap); - t4_os_link_changed(adap, i, link_ok); + t4_os_link_changed(adap, i, link_ok, reason); } if (mod != pi->mod_type) { pi->mod_type = mod; @@ -5508,6 +5528,91 @@ int __devinit t4_prep_adapter(struct ada return 0; } +/** + * t4_init_tp_params - initialize adap->params.tp + * @adap: the adapter + * + * Initialize various fields of the adapter's TP Parameters structure. + */ +int __devinit t4_init_tp_params(struct adapter *adap) +{ + int chan; + u32 v; + + v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); + adap->params.tp.tre = G_TIMERRESOLUTION(v); + adap->params.tp.dack_re = G_DELAYEDACKRESOLUTION(v); + + /* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ + for (chan = 0; chan < NCHAN; chan++) + adap->params.tp.tx_modq[chan] = chan; + + /* + * Cache the adapter's Compressed Filter Mode and global Incress + * Configuration. + */ + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.vlan_pri_map, 1, + A_TP_VLAN_PRI_MAP); + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.ingress_config, 1, + A_TP_INGRESS_CONFIG); + + /* + * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field + * shift positions of several elements of the Compressed Filter Tuple + * for this adapter which we need frequently ... + */ + adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); + adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); + adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); + adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); + + /* + * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID + * represents the presense of an Outer VLAN instead of a VNIC ID. + */ + if ((adap->params.tp.ingress_config & F_VNIC) == 0) + adap->params.tp.vnic_shift = -1; + + return 0; +} + +/** + * t4_filter_field_shift - calculate filter field shift + * @adap: the adapter + * @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits) + * + * Return the shift position of a filter field within the Compressed + * Filter Tuple. The filter field is specified via its selection bit + * within TP_VLAN_PRI_MAL (filter mode). E.g. F_VLAN. + */ +int t4_filter_field_shift(const struct adapter *adap, int filter_sel) +{ + unsigned int filter_mode = adap->params.tp.vlan_pri_map; + unsigned int sel; + int field_shift; + + if ((filter_mode & filter_sel) == 0) + return -1; + + for (sel = 1, field_shift = 0; sel < filter_sel; sel <<= 1) { + switch (filter_mode & sel) { + case F_FCOE: field_shift += W_FT_FCOE; break; + case F_PORT: field_shift += W_FT_PORT; break; + case F_VNIC_ID: field_shift += W_FT_VNIC_ID; break; + case F_VLAN: field_shift += W_FT_VLAN; break; + case F_TOS: field_shift += W_FT_TOS; break; + case F_PROTOCOL: field_shift += W_FT_PROTOCOL; break; + case F_ETHERTYPE: field_shift += W_FT_ETHERTYPE; break; + case F_MACMATCH: field_shift += W_FT_MACMATCH; break; + case F_MPSHITTYPE: field_shift += W_FT_MPSHITTYPE; break; + case F_FRAGMENTATION: field_shift += W_FT_FRAGMENTATION; break; + } + } + return field_shift; +} + int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf) { u8 addr[6]; Modified: stable/9/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_hw.h Fri Jul 5 18:27:38 2013 (r252814) @@ -230,7 +230,15 @@ enum { FLASH_FW_NSECS = 16, FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC), FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS), - + + /* + * Location of bootstrap firmware image in FLASH. + */ + FLASH_FWBOOTSTRAP_START_SEC = 27, + FLASH_FWBOOTSTRAP_NSECS = 1, + FLASH_FWBOOTSTRAP_START = FLASH_START(FLASH_FWBOOTSTRAP_START_SEC), + FLASH_FWBOOTSTRAP_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FWBOOTSTRAP_NSECS), + /* * iSCSI persistent/crash information. */ @@ -248,19 +256,13 @@ enum { FLASH_FCOE_CRASH_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FCOE_CRASH_NSECS), /* - * Location of Firmware Configuration File in FLASH. Since the FPGA - * "FLASH" is smaller we need to store the Configuration File in a - * different location -- which will overlap the end of the firmware - * image if firmware ever gets that large ... + * Location of Firmware Configuration File in FLASH. */ FLASH_CFG_START_SEC = 31, FLASH_CFG_NSECS = 1, FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC), FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS), - FLASH_FPGA_CFG_START_SEC = 15, - FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC), - /* * Sectors 32-63 are reserved for FLASH failover. */ Modified: stable/9/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_msg.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_msg.h Fri Jul 5 18:27:38 2013 (r252814) @@ -678,6 +678,15 @@ struct cpl_pass_accept_rpl { __be64 opt0; }; +struct cpl_t5_pass_accept_rpl { + WR_HDR; + union opcode_tid ot; + __be32 opt2; + __be64 opt0; + __be32 iss; + __be32 rsvd; +}; + struct cpl_act_open_req { WR_HDR; union opcode_tid ot; @@ -702,7 +711,7 @@ struct cpl_t5_act_open_req { __be32 local_ip; __be32 peer_ip; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; @@ -731,7 +740,7 @@ struct cpl_t5_act_open_req6 { __be64 peer_ip_hi; __be64 peer_ip_lo; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; Modified: stable/9/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_regs_values.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_regs_values.h Fri Jul 5 18:27:38 2013 (r252814) @@ -189,4 +189,57 @@ #define X_MBOWNER_FW 1 #define X_MBOWNER_PL 2 +/* + * PCI-E definitions. + * ================== + */ + +#define X_WINDOW_SHIFT 10 +#define X_PCIEOFST_SHIFT 10 + +/* + * TP definitions. + * =============== + */ + +/* + * TP_VLAN_PRI_MAP controls which subset of fields will be present in the + * Compressed Filter Tuple for LE filters. Each bit set in TP_VLAN_PRI_MAP + * selects for a particular field being present. These fields, when present + * in the Compressed Filter Tuple, have the following widths in bits. + */ +#define W_FT_FCOE 1 +#define W_FT_PORT 3 +#define W_FT_VNIC_ID 17 +#define W_FT_VLAN 17 +#define W_FT_TOS 8 +#define W_FT_PROTOCOL 8 +#define W_FT_ETHERTYPE 16 +#define W_FT_MACMATCH 9 +#define W_FT_MPSHITTYPE 3 +#define W_FT_FRAGMENTATION 1 + +/* + * Some of the Compressed Filter Tuple fields have internal structure. These + * bit shifts/masks describe those structures. All shifts are relative to the + * base position of the fields within the Compressed Filter Tuple + */ +#define S_FT_VLAN_VLD 16 +#define V_FT_VLAN_VLD(x) ((x) << S_FT_VLAN_VLD) +#define F_FT_VLAN_VLD V_FT_VLAN_VLD(1U) + +#define S_FT_VNID_ID_VF 0 +#define M_FT_VNID_ID_VF 0x7fU +#define V_FT_VNID_ID_VF(x) ((x) << S_FT_VNID_ID_VF) +#define G_FT_VNID_ID_VF(x) (((x) >> S_FT_VNID_ID_VF) & M_FT_VNID_ID_VF) + +#define S_FT_VNID_ID_PF 7 +#define M_FT_VNID_ID_PF 0x7U +#define V_FT_VNID_ID_PF(x) ((x) << S_FT_VNID_ID_PF) +#define G_FT_VNID_ID_PF(x) (((x) >> S_FT_VNID_ID_PF) & M_FT_VNID_ID_PF) + +#define S_FT_VNID_ID_VLD 16 +#define V_FT_VNID_ID_VLD(x) ((x) << S_FT_VNID_ID_VLD) +#define F_FT_VNID_ID_VLD(x) V_FT_VNID_ID_VLD(1U) + #endif /* __T4_REGS_VALUES_H__ */ Copied: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu (from r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu Fri Jul 5 18:27:38 2013 (r252814, copy of r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu) @@ -0,0 +1,8417 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +begin-base64 644 t4fw +AAADpgEICwAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA4sDmgOhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IEZyaSBNYXkgMjQgMTM6 +NDA6MTQgUERUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA4LjBiLjAwAAAAAAAAAPj2L99g +AMAA4QAwuHj///8f/OFAgAAAAeEAe3AAABAAH//8EOEBlHAgAAAA4QGcBOEAeQAAAgBA4QB5gAAG +AEAAAgAKAAYACuEAeQQACgAAgAABAuEAezzhAHtE4QB75OIAAAAAAQAA4QB7kCAAAAAAAIAA4QB7 +AAAAQAHhAHucAABAAERERELgAAAA4wAEY0REREDjAAgAIAACXAAAAAAf/5BQAAAAAB//kFQAAAAA +H/+QWAAAAAAf/5BcH//AAAAAAAAAAAAAwAAS/88T/8+EIAQzAZMgEf/OEv/OkhAR/84S/86SEBH/ +zgH0MRH/zSIK/5IQAOQxAAUxAQIAEv/KAucxAhYAEf/JgRABAV/AIQIRAckREf/GEv/GkhAR/8YS +/8aSEGAADxH/wRL/xZIQEf/BEv/EkhCBEBH/w8AgkhES/8KSEsAgkhMS/8GSEIIQAvJQZS/3Ef+/ +xy+SEBH/vpIQEv++E/++kyDAMpMhE/+9kyKCIhL/vBP/vJMgIyIhFP+7BDMByTgT/7qDMAODFAgz +ERT/uKQzkyET/6yTImAACMIwkyET/6mTIhL/s5AgkCGQIpAjkCSQJZAmkCeQKJApkCqQK5AskC2Q +LpAvICYQICYRgiIS/6bAMC03MC03NC03OC03PCM9AXIz7QACABL/o8AwLzcALzcQLzcgLzcwIz0B +cjPtAAIAEv+ZwDAoNzAoNzQoNzgoNzwjPQFyM+0DAgAS/5YjCgAnNwAnNxAnNyAnNzAjPQFyM+0D +AgAS/5AV/5EW/5HAMNcgBWYBYAASBDYFAAIA0w/TDwUzDG47FAdHFAcEQ3Yx5gQ2BQUzDG877QAC +ABL/hRX/gyMKAAInAgcEQwQ+BQUzDAdHFG878AMCABL/f8kugyCEIYUivCJ0Ow6GULRVljC0M3Qz +9GP/5gBlP+JlX98S/3PAMgMuBQMCABL/asAwKDdAKDdEKDdIKDdMIz0BcjPtAwIAAAIAEv9tLScA +wBEBSTEASDEBAgDAABT/aQTSMRX/aJRQFP9oBNMxFf9olFAU/2cE1DEV/2eUUBT/ZwTVMRX/ZpRQ +EP9mAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+I8OMACfgf/4jwH/+I8OMAEugf +/4jwH/+I8OMAEugf/4jwH/+KcOMAEugf/4pwH/+QUOMAFGgf/5BQH/+snOMAGkgf/6ycH/+snOMA +NpQf/8AAH//9DeMANpQgAAAAIAABauMAc6QgAAF4IAABfOMAdRAgAAF8IAABheMAdRQgAAGYIAAB +nOMAdSAgAAGcIAABpeMAdSQgAAG4IAABvOMAdTAgAAG8IAABxeMAdTQgAAHYIAAB2OMAdUAgAAHc +IAAB4uMAdUAgAAH4IAAB+OMAdUggAAH8IAAB/OMAdUggAAIYIAACGOMAdUggAAIcIAACHOMAdUgg +AAI4IAACOOMAdUggAAI8IAACPOMAdUggAAJYIAACWOMAdUggAAJcIAACYuMAdUggAAJ4IAACeOMA +dVAgAAJ8IAACguMAdVAgAAKYIAGsnuMAdVggAoAAIAKTNOMCH2AgApM0IAKTNOMCMpQgApM4IAYK +IOMCMpggBgogIAYO0OMFqYAgBoAAIAaNEOMFrjAgBo0QIAduWuMFu0AgB25gIAdvLOMGnJAgCMAA +IAjAAOMGnVwgCMAAIAjAAOMGnVwgCMAAIAk2z+MGnVwAAAAAAAAAAAAAAAAgAA/2IAAP6CAAFAEg +AA/oIAATbSAAD+ggABCdIAATBSAAEoogAA/oIAASOSAAEeogABF9IAAP1SAAEScgAA/oIAAP6CAA +D+ggABC9AAAAAP///////w/8///w////APwgAJtzIACcsyAAnOMgAJypIACcaSAAnF8gAJwkIACc +GiAAnBAgAJvAIACc4SAAm7YgAJucAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAAIAAAAEAAAAEAAAAEAAAAACAAAABAAAABAAAABAAAA +BAAAABAAAABAAAABAAAA/xgwYGAAAAD/AAECAgAAACAG8tUgBvGCIAbzwyAG85ogBvNxIAbzSCAG +8ycgBvL+ECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQAAggBw0rIAcNKyAHDLkgBwyAIAcL +vyAHC6UgBwulIAcNKyAHDSsgBwulIAcLiyAHC4sgBw0rIAcNKyAHC1IgBw0rIAcNKyAHDSsgBw0r +IAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcLZyACivgA +AAABIAKK/AAAAAIgAo2oAAAA/yACiTgAAAD/IAKJOAAAAAAgAo2oAAAAACACijAAAAABIAKKOAAA +AAQgAopAAAAACCACikwAAAAQIAKKVAAAACAgAopcAAAAQCACimQAAACAIAKKeAAAAQAgAoqMAAAC +ACACiqQAAAQAIAKKuAAACAAgAorIAAAQACACitQAACAAIAKK6AAAQAAgAoocAAAAECACiiQAAAAR +IAKJnAAAAQAgAomoAAAAgCACibgAAABAIAKJyAAAACAgAonYAAAAECACiegAAAAIIAKJ9AAAAAQg +AooAAAAAAiACigwAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA +AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRY +VQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpo +AABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsA +AosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgB1wIIAdb5iAHXAMgB1wDIAdb5iAH +W+YgB1wIIAdcCCAHW+YgB1wIIAdb5iAHXAggB1wDIAdb5iAHW+YgB1vmIAdb5iAHW+YgB1wIIAdb +5iAHW+YgB1vmIAdb5iAHW+YAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7 +OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIAREDCABeJAgAER4IAFPmCABdBAgAW1sIAEwMCADcNgf +/+tIH//nECAAnXQf/9rEIABsICAAXqAAAAAAAAAAACABURggAIq4AAAAAAAAAAAf/9TcH//GCB// +w+gf/8GYIABaGCAAUiwgAE9gIACUPB//34QgBeNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAACABfqggAV9oIACmKCAApVgf//B4H//QBB//y0AgAIgkIASacCABErQgAPMU +IADeSCAA2DQgAMngIAC8pCAAqOAgBEe8IAOP3CABBjwgA6/IIAGkJCAAa+AAAAAAIACmhCAFAwQg +AJroIAFXaCAAApgAAAAAAAAAAAAAAAAf//OwIACmSCADkowAAAAAAAAAACADD+AgACXsIAAcACAA +JSwAAAAAIAAyQCAALuwgACu4AAAAACAAQ4AgAQnwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAIABAiCAEQ6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQjggAxaE +IABBQAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgLAAAAIAKQiAgAAAAgApCUCAAAACACkKAK +AAAAIAKQrAwAAAAgApC4EgAAACACkMgNAAAAIAKQ3A4AAAAgApDsEwAAACACkPwKAAAAIAKREA4A +AAAgApEcGAAAACACkSwNAAAAIAKRSA4AAAAgApFYEAAAACACkWgSAAAAIAKRfA4AAAAgApGQEAAA +ACACkaARAAAAIAKRtAoAAAAgApHICwAAACACkdQNAAAAIAKR4BQAAAAgApHwCgAAACACkggPAAAA +IAKSFAYAAAAgApIkBgAAACACkiwGAAAAIAKSNAYAAAAgApI8BgAAACACkkQJAAAAIAKSTAYAAAAg +ApJYBAAAACACkmAGAAAAIAKSaAsAAAAgApJwCwAAACACknwEAAAAIAKSYAQAAAAgApKICQAAACAC +kpAJAAAAIAKSnAAAAAAAAAAADQAAACACkqgKAAAAIAKSuAYAAAAgApLEAgAAACACkswDAAAAIAKQ +hAEAAAAgApLQAAAAAAAAAADXaqR46Me3ViQgcNvBvc7u9XwPr0eHxiqoMEYT/UaVAWmAmNiLRPev +//9bsYlc175rkBEi/Zhxk6Z5Q45JtAgh9h4lYsBAs0AmXlpR6bbHqtYvEF0CRBRT2KHmgefT+8gh +4c3mwzcH1vTVDYdFWhTtqePpBfzvo/hnbwLZjSpMiv/6OUKHcfaBbZ1hIv3lOAykvupES97Pqfa7 +S2C+v7xwKJt+xuqhJ/rU7zCFBIgdBdnU0Dnm25nlH6J8+MSsVmX0KSJEQyr/l6uUI6f8k6A5ZVtZ +w48MzJL/7/R9hYRd0W+ofk/+LObgowFDFE4IEaH3U36CvTryNSrX0rvrhtORBwwRFgcMERYHDBEW +BwwRFgUJDhQFCQ4UBQkOFAUJDhQECxAXBAsQFwQLEBcECxAXBgoPFQYKDxUGCg8VBgoPFR//wAAA +BAAgIAYO0CAGEkAEQQAIBAEACB//qSCBAAAAMAAAAB//nQClAAAAwAAAAMAEAAAf/N4AIAYPEB// +nRADgAAAAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+EIAYAAAAqAAAAH//P +MCADybQCAAAAgBAAAEFAAABBQAEAgwAAAf//v/8f/5WMIAKLgAQAAAiBgAAADAAAAB//m4AgCN6Q +H/+QoP//AAD//wD/IAjewCAI3yAgCN8AH/+RQAAADnAf/5qgH/+fnB/84gAf/58QH/+flB/84ODg +//4AH/+V+A////8f/5Z8H/+cKB//mzQf/5ugAAAM4AAA/4AgCQPwH/+blAAAC4jhAC4A4QGSAB// +nGQf/5sk4AAAoOEAMLgAAIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+s +XB//rFQf/OAIH/+sWB//rHQf/6xsH/+scB//rIwf/6yEH/+siB//qSAgBg8QH/zeAAEAAAAf/5qg +H/+ZpCAGDtAEAAAIBQAAAIP/AACBAAAAABAAACoAAAAgAAYoIAKK2B//iDAf/4QgH/+dEGdFIwHv +zauJmLrc/hAyVHYf/4AAIAjEUAAAPyggCMOgIAjEQCAIxHAgCMKwIAKQhM////8gCMLgIAjDMCAI +w2AQAAAAIAjDwD////8CAAAAQAAAACAIxAD//3//H/+dACAAIRwgCMcACAAAAAD///8gCMdg9/// +/yAIzcAgAB0A//7//yAI1FAAIAAAAABAAAwAAAAgCNSAAAD//wAAgAANAAAAIAAj4P/7//8P9oAA +AAP//wAAJ/8gCNcAAAEAAAAEAAAfgAA/IAAyQCAAOnAgAC7sIAAruCAI16Af/5oYIAjYACAJELAg +CNgwIAjYsCAI2SAgCNmQIAjZwAQBAAjgAAAAH/+atCAI2fAgCNlQUwAAAFIAAAAwAAAAUQAAAB/8 +4gCBgAAAH/+VjIIAAAAABgAAAABIAB//n6Af/5+cH/+QoAAADIgAAA2MIAA0eB//mUwgCNowIAja +kCAI2mAgCNsQH/+axCADLejg//4AIAkF0B//mbAgCNxAFAAAAIAAAACAAAACeAAAAIAAAAaAALAA +AAAKAADjMJL///AAgACxAOEBmgAAAgAAIAjcAB//l7wAAH5AH/+RNCgAAAAmAAAAH/+RUAYAAAAF +gAAAH/+Y1CsAAAAgAFVQNQAAAAOAAAADAAAAH/+Y2Af///8AP///gEAAAAgP//8f////IAAAAB// +mpg9AAAAH/+WNAcAAACBBAEAgQQAAAAAOpjDAAAAGAAAAB//kZAAAA//AEMAAB//mmQAAAgABAAA +AB//q9Af/6lA4QB6AB//lfQf/5mAH/+bAB//mZwgCRYQAAMHgCAJFoAf/5iEAEAAAAAACQAAADAC +//z4f8AAAACj/7sAo/+6AOADAACD/7YAD////w//+AD/AAAAIAkWwCAI3iAgCN5QIAkXUAAPAAAA +CgAA//8ADx//mYgD/8AAg//AACAJF9AgCRhAH/+bGB//qbD/YPAAH/+pkB//kGAEgAAIH/+AUABE +AAD/H///AMAAAAAAgQAf/OIMDwAAAP//AAAf/5q4H/+fmB/84ggf/5YwH/+AYCAGDOAAADAAAAAn +EB//2dgf/5lw3q2+7zQAAAA/AAAAAACJBgCZAAAf/6j4EAAHAu4AAAABwIAAH/+nyJkAAAAf/6m0 +AIgACIKAAAEf/6lIH/+oVAMVAAADEQAAAA8D/yAI47AgCOPgIAjkICAJIFAgCSEgIAjkQCAA0OQg +CSCQIAkg0CAI5HAgCOSgKQAAACAA2dTw8PDw/wD/AKqqqqrMzMzMH/+rwAAAGyAf/6nIIADpGAAP +QkAgA7W4H/+bIAAJAAAAgAAAIAELzAAJAAgf/6i8H/+pBAAACAYAAIjMAACJFH8AAADwAAAAIAki +sCAJIeAgCSKAH/+XlB/84HQABAP/CgAAAB//p+Qf/6ikH/+ZoIP/twCD/7YgIAjqIDMAAADhAAAA +H/+oxB//mdAf/6kMA//gAAA/9pAAABpkA//wAAAQAAEAABpsGgAAAB//mQQgCOpgIAFHLB//qQgA +D///AADerR//qMAf/5qQH/+ZrCAGCiAf/5kMH/+bCCAAcEAgAAXoH/+XaB//lcAgCSPwH/+edCAJ +JEDABAAAIAKMECAAcOAf/5ecAIEAAOABAAAA4AEAAADgASAJJYAgCO0AAAANlCAAmIwgAJYUIAkl +ACAJJVAf/5e4IAjvoB//n6wgCPbQH/+arB//koAgCP3gIAj+cCAI/oAgCP6wSAAAACABhiAf/5pw +IAGIFB//lfgf/5os4QAuAB//mjThAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/5s0AAALiB//nHgf +/5x0AAANwAAA/4Af/5xsH/+c2CABi/AgAZWcA/8AAP+///88AAAAAAX//4MAAAAf/5vUIAkFcCAB +qNwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAACBgAAAAAAAAB//+eAf//ngH//5pB//+aQf//mkH//5pB//9Ngf//ds +H//2EB//9hAf//YQIAXlYAAAAAAAAAAAAAAAAAAAAAAgBejgIAXo4AAAAAAAAAAAAAAAAAAAAAAg +AY6YIAXlYB//+GQf//hkH//4ZB//+GQf//hkH//4ZAAAAAAf//TgAAAAAAAAAAAAAAAAAAAAAAIB +AAAAAAAAAAAAAAAAAAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAA +AAAAABgFAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAACgQAAAAAAAAgAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAACAKABHyOxPyO9MPA+YxAQIAFvI5F/I6d2sGkGC0Zndj+FQOnFWSVw8UAGP/+QAAAGwQ +BBjyNx3yMisgBxzyMiohCPoCAAdxuwEA7tw5DdwCgAALqgKcMOPyLBmwBIAACKoCHPIqIzCA+kAI +FeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7AgzPAoAA62YBJMvhAACZYwIEiZNnKGYG +BiCLGPIbJSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAAbTkCBQJh0Q8AAABsEAQc8gsmIAcb8gof +8hD+QQQVoNYRAA3LOZswhyD75A4FoAklAPpgRhWgGAUA6DYDK74CgAD45gAMcWYBAPhgJhWgDAUA +5SBXKzQCgAD3xgAOsCsFAP+mAA7wCjUA6PH6EoIBgACcNZw3mzMZ8fkKdQKVMZk2JSEJnTQvIAec +OZQ7+KYACTH/AQDiNgov/AKAAA/uAgjuAu42CC0QBIAA0Q8nIQgqIQmcNZQ3BncCCKoCmjYIdwLn +NgQskASAANEPAAAAAAAAAGwQCCggBScgBykxBfgghhXgGUUA+QAMxWF3AQCKIhbx2xjx2/FVDA3g +DZUADHsRprsssp79gAxD4AqlACuynesWBSWMOYAAjIj3gAxwkgCdAC1irmTROCtireSxNGZz/QAA +7oYIJYm5gAAoIBSkiAgIRygkFPUAC73QDwUAGfHFLiIWLCEpiBUa8cSuzJqA6iIeLmfCgAD9AGYV +oA0lAP0ARhXgC2UA7fGzHVYCgAALqgKLFJqB6QAVBEBBAACJFQgAiig8EP0gxhXgTAUA/SDmFaAM +RQDsuzYEyIEAAG25BQgAhgkCYe7xpRWgh4AAiBXuAAUNzwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEo +ISnqISgkQAUAAAgITyglKflACEQiAJ0A/+M6BeAMFQD6IKgV4B7lAOoiHixtQoAA/CAmFeAJBQD4 +IAYV4A0FAOkWAiXZgQAAWHWoDH4R98AARzANlQD906YV58UBAPmABilSAJ0AwCDRDwDqJAAJ2ASA +AOxEAAroBIAAWHdd0qDRDwDAsArPNO+GCC32jgAA2iD8QGgdoBvFAFh5N2P/ygAAAOokAArYBIAA +WHi80qDRDwD/+ewNoAsFAAAAK3wY6iQACWAEgABYeStj/5zAoFmM6BjxbIyI+Z/zQJAKpQBj/6wq +IQn8QrAVr/0FAA2NAQ2ODC4kFO20Ay5hAoAA77QALVYCgAD9RgANMAkVAAmqApqx+NWmFe/5YgAv +JSn/+9QNoAgFAIon60QACmgEgAD7RAAVoAwFAFhyFNKg0Q8AAABsEAYoIAUrIhDkIAcqUASAAPgD +Ah3gHsUA+94ADPAZRQD5AAxdYUQBAIwiH/FE6hYALgseAAAMSREPmQgtkp4PAgD3oAvjUgCdACeS +nQwGPmRxbospKiIKC6oM90AJC6IAnQAqIE4sIEyxrfuACyQgCxUALSROKjABKSIY80ALRpIAnQAr +IAcsIST8YCQV4AhVAPlABAQwqxEA4IgRDVKCgAAKiAIa8SoI3QIoIQcrIQkKzAL7pgAOuogBAOrx +JhxDAoAACLsCKCEinXCNIJtznHT7BgAMMAplAOh2Ai7uAoAACt0CnXEsIhCcdSsgOBjxGvwAIh3g +TBUA/OEmFeC7GQALzTkc8RWeePsNAA5wCAUAmHcNzAKcdu3xChTYBQAAKyYYG/EAmHuZeu0AFQPI +wQAACQCK63YOIchBAADudg8j8QEAAAkghg4CYwkAhg4CYQxMEa/M6sadIwCpgACOKS0gOKbuninz +oAVXkgCdAAUPR/ngBFFSAJ0AwCDRDwDqJAALWASAAFhRIcHs7/DrFXaRgADqJAAJ2ASAAOwSACro +BIAAWHbC0qDRDwAAAADqJAAK2ASAAFh4KNKg0Q8AAAArTBjqJAAJYASAAFh4mWP/wYgiwJQJiAL4 +QEYVr/7eAAAAAAAAAPxDqBWkiQEAAIEEAL0aDcwC/EOmFa/6HgCKJ40QwMDqrCAu2ASAAFhxjtKg +0Q/aIFh2bGP/UQAAbBAMLSAFJiIQLyAHKyE15RYDKcAEgAD7AIgVpzUBAPJ/wBXgDBUAA8M5+0EA +DXAVhQDrggIsYASAAPdeAAqx/wEA9wAwFaAVRQD1oB/VY7sBAIkiKBYA8z1cDeAOhQCYEPLAHgcS +AJ0AnxKfGpsWFvCrkxXqFgQvrwKAAOZVCAIwDQAA5hYJInAFAACIGi4WCCsSCfUABmISAJ0AKlKe ++0AJq+IAnQAvUp1k87sY8JyIiPcACViSAJ0AGfCYKZKuDAM+6vCWFIn5gAAqoq0W8JTqFgska/0A +AOsSCyUJaYAA7WYIJZuZgACIKYcqCHcM8uAJY+IAnQApGgDzIjIN4Pr1ACsgFpwR+2AJrSIAnQAY +8IyGFI3DKiA4/eDmFeAJBQD54SYV4EcFAPfhBhWgqhkACnk5F/CDKyIXm/orIhub+43ECng5/MAP +EuIAnQCYF54dhhWcEZkc5xIMKwgeAABgAX4Y8G+IiGqBJooZKVKeepNDK1KdmxuNG+nwaRQz/QAA +79QABoHZgACWmGX/HGAC1Z4d/CAmFaAKBQBZi9wY8GCIiIwR7hINJA8HAAD//2gNoA8FAADAkPgh +ZhXv/u4AG/BXwKoKijT7YQYVr/7+AAAAAAAAAP/7OA2gDwUAAJ4dnx78ICYVoAoFAFmLyBjwTIwR +iIiPHo4d+R/12JIAnQBgAlHAkJkbihsd8EXAuguLNOvWCC12jgAAYAI4AJ4dnx6cEeokAAnYBIAA +WFBwjBGPHu4SDSV1+YAAYAHvAJ4dnx76QPAVoAwFAFhQvIwRjx7uEg0tdcYAAGACxgCIEY4X9iDI +Fa+MBQAsJDuMFAZ2AgbuAqy5DNoMmoTpJhssWASAAO0iEClQBIAAWHdtjh2MEfqzphWhBwUAc3sI +KyAWKAr/eLleiikpIDijquomCST5poAALyIQLSE1+4CIFeAIFQD4IKYVoAY1AJYTDbs2+iCGFeAd +hQD/fgAO//a2AIonnx6LEOqsICpgBIAAWHRkjx6aESsiG/1AiBXv/YYAAAAAAADqIAcp4ASAAFhQ +dowR/iGoFa/+QgDaIFh1o4wR/iGoFa/+QgAALSIQihYrIDsW8AQKmQIJiQLmmAINifYAABrwAfhE +hBXjaQEAh8DrIAcrMgKAAAaZAiYhB/rgBAOwuxEA6u/xHdqCgAALdwIrISIKdwIqIQmX8IcgnfX5 +4MYVqmYBAOn2BCszAoAABqoCFu/n6vYDK74CgADn5wIHyMEAAOf2ASZAgQAA5rsCAlP5AADr9gIi +FDUAAG2pBQgAhgkCYSggFKSICAhHKCQU9QAGrdIAnQCKGPqzphWhCQUA8yHyDeD89QArIBb9YAkV +IgCdAC0iF7Hd7SYXIYCpgACPKS4gOKP/nynzwAe/kgCdAIYVZWDSwCDRDwAAAAAoIE5kjD0OmwKb +IusSAClQBIAA7RIDKmAEgABYdZPSoNEPAOsSAylQBIAAWHb60qDRDwDaIPxAaB2gG8UAWHdsY//H +AIsS2iDrvBgpYASAAFh3Z2P/tAAAAAAA6iQADlgEgAD8IIgVr44FAO4kOyxwBIAAWHbq+iEGFaAP +BQAvJhv+R2Yd7/yCAIsbKiEJ/EKwFa/9BQANjQENjgwuJBTkzBANVgKAAAyqAv1gZh3gDgUA/2AG +HaAGFQAGqgKasRnvjvc1phWv+8oAAIon60QACmgEgAD7RAAVoAwFAFhwSdKg0Q8AANogWHUnY/8E +AAAAAADqIAcp4ASAAFhP8mP+04sS2iDrvBIpYASAAFh3OGP+92wQCCggBe3veBnQBIAA897qBeAe +RQD/AAq1IAylACsgTinSCNMP6hYDJdv9AAArJE73IAiYkAcVAC8yrmTyMCoyreakAAURkYAAsJjo +1gglCIGAACkgFLOZCQlHKSQU9SARLdIAnQApIHMrIh37IAQA3//1AOB6GgTABQAA/1cAD/SIAQAo +JHP7QAQFcAgVAAqKOQ+7AesmHS0HPgAAiiJ8pwQrIE7KtH2nCC0gTCwgTn3DGcxsLiAU7yICL1gc +AABk8fzAINEPAAAAAAAAiCfHkwmpAekmAiRQwQAAWGfg4+9OFQE5gAAooADTD9MPA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6EqmRTKp4qZZK+XKKAAA4gKKIIQ7KAHLVgEgAD6QGgd +oA01AAuAAGWv4GP/dQAA//9UDaAKBQDAoFmKox3vJonYLAoK+T/3AJAeRQAmCgApIBSzmfhChh3v ++/oAAAAA6iQACtgEgABYdmLSoNEPAAAqIAUrIAcPAgD/QA8VIbsBAAUFR/igDylSAJ0AjhPu4gYv +eASAAJ4UC74C9WAKchIAnQAMuhEDqggoop73AA580gCdACqine4WASUK8YAA+kAIFeAMFQBYI+Ub +7wQvIQke7vooISItIAcc7wwpIST/BgAMMN0RAO4SBC7qgoAADZkCDJkCmaCMICimAv9AZhXgDSUA +7qYFLmYCgAANzAL9QCYVoAkFAOsAFQVQYQAAsZnqgx4Mj+gAAI8RDP8R8+AAR/AOpQAu9p30v/KB +EgCdACoiB+tEAApoBIAA+0QAFaAMBQBYb6Jj/jIAAAAAAP/3OA2gCgUADJs069YILW6uAABj/tkA +AC8hCfhCsBWgCwUA+sAGHe/6BQAKmgEqZAPqmgwMQQKAAOokFC/+AoAACP8CB/8Cn2H2daYV7/aq +AIonwLD7RAAVoAwVAFh2YB3u1J2gjCAb7tPrpgIuZgKAAAfMAv1AJhWgG8UA7CQACVAEgABYdnnA +INEPAACJ2PcgBKiSAJ0ADOoRo6ooop73AAV80gCdACqinWSgprCYmNjuFgEtdVYAAIki6xYAJIUZ +gACfEvi/6yFSAJ0AiifAsPtEABWgDBUAWHMAHu60nqCNIBvutewSAi7uAoAAB90CnaGMxpyj+0BG +Fe/0ygDrVAAJUASAAFh14mP9H48Tj/P+IIYV7/iOAAAAAAAAAP/40A2gCgUAAJ8SmxH6IAYV4AoF +AFmKDB3ukIsQidiPEo4R+T/6iJAMpQD//YwNoAoFAMCgDJg0+aEGFa/9WgAAAACLEO8WAilQBIAA +67wYKWAEgABYdj3+IEgV7/0iAGwQBCggFO+LHmoYBIAAiif6YGgd4AwFAOqsICnoBIAAWG830qDR +DwCLInO+fhTucolIapF6G+5v0w8ssq5kwFgqsq1koFSwne1GCCUC4YAAKSAU6SQULNrcAAAvIQn4 +QrAVoA0FAP1ABh3v/AUADJwBLKQD7JwMDEECgADsJBQv/gKAAPnmAA+wDhUADv8Cn6H/daYVr/3m +AMCgwOoOnjTuRggtfWYAAI8iyfXAINEPwKBZic2JSPk/+9CSAJ0AY//lANog/EBoHaAbxQBYdgfA +INEPbBAIiS/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDp +fR8MFIAAACggTw8CAO8gTSRABQAACAhHKCRP+eASu6IAnQAvIAWbEZoQ/eAQ3WIAnQCJIsej+UAN +gOIAnQAsIhmLMv1gEv0iAJ0AjTiPERjuJunuKBaRQYAA6RYCLycCgADoRAgH+A0AAPXADKISAJ0A +KUKe/yAZK+IAnQApQp3tlAAEkWGAAIspiioMBT4Lqgz1QAmr4gCdACwaAPWB8g3g+PUAKyAW+WAX +1SIAnQAa7iApISQrIQcKmQIqIQkLC0oMuxALqgIrIAcc7gwLK0Do7hkd2oKAAAy7AiwhIpvQiyCZ +1JrTCMwCnNL9YAAVsAxVAAy7ApvRG+4Qii+a1SkgOPvcHAWgDAUA/aDmFaBIJQD3oQYV4JkZAPlN +AA3wCiUACYo5iWSZ2YhlmNr8wMgVoAkFAOzWCyOH4YAA6e4BHMKCgAAJiAKY3Ixol9+c3owSiWkp +1hCIaijWEewAFQbJIQAACQCKjGf84AqjogCdABnt6Qq4AgmIApjWwPX+k6YV4Q4FAPXB8g3g+vUA +KyAW+2ASBSIAnQAuIhmMKS0gTysgOOXMCAdwBQAA7iYZJuv9AAAtJE+cKfNgDgeSAJ0AjRBl0b7A +INEPnxOeFJ4VnRbqJAAK2ASAAFhN+I0WjhTvEgMldaGAAI4QZe/XiifbMOwSASVQwQAAWHHwwCDR +Dxrtu4qo90AOyJIAnQArQp7/YA+z4gCdAClCnR3ttOSR6mVj/QAAnNjtlAAM8tYAAGAAegAoIDnx +H/gOEgCdAP/75A2gCRUAwaN6+RIpIDr+IKYVoAv1APsgECViAJ0A6iQACtgEgABYdOjSoNEPAAAA +AAAA8AAYDaAa1QDAoYw3KyEJjTiOMuuvEQ3dAoAAD7sC5LsCCVAEgABYdMrAINEPAAAA//9YDaAa +hQAAACvsGOokAAlgBIAAWHVJY/8oAAq5ApnWwIX4k6YVoQwFAHXLDSsgFioK//tgDUUiAJ0AixBk +sTaLaoxnimmrewfMDJxn92DSDeANBQCxqoxlm2qLZppprNqre3e7AbGqm2aaZYgpLSA4pYiYKfOg +CT+SAJ0AiScqmRTKpouZyrKfExnteyiwAJ4UnhUJiAooghAssAf6QGgdoA01AAuAAI4UjxOLIsej ++1/zYOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+AA5/88IA2iBYcv5j/juKJ+qsMCtYBIAA +WGAs0qDRDwAAAAAAAAD/83gNoAkFAJ8TnhSeFZ0W+kDwFaAMBQBYTdWNFo4U7xIDLWd+AAAr7BLq +JAAJYASAAFh1BGP+E+ogByrgBIAAWE22Y/21nxOeFP4gphWgCgUAWYi7Gu0+iqiOFI8T+V/weJIA +nQD/+IgNoAkFAMCQHO04wLoLqzT7gQYV7/hCAJ8TiieeFO4WBSnYBIAA7BIBJVDBAABYcWLuEgQt +MASAAP4gaBXv+pIAnxOeFO4WBSlQBIAAWHLJjhT+IGgV7/siAADBU/pAaB2gCwUA/AACHaANNQBY +bNkrIAWOFfV/3Z1iAJ0AY/1jnxOeFJ4V6iAHKuAEgABYTYmOFP4gaBXv+RYAAGwQDJUTJiAFLyAH +hy/qMgQpwASAAPxGhBXnNQEA8n/AFeAOFQAD4zn9QQANcBtFAOerHwxgBIAA+sAehWH/AQCJIpgQ +8zrMDeAOhQAmgAGYEPLAHKcSAJ0AnxKfGhns+5MXFuz56hYGIlgNAADrFgkvrwKAAOZVCAJwBQAA +iBqeGI0Z9QAFWhIAnQArUp79YAgT4gCdAC9SnWTzkIiY9wAH2JIAnQAW7OgmYq4MAz7q7OYTCHmA +ACqireoWCyRr/QAA6xILJQgBgADtlgglmnGAAIcphioHZgzywAfb4gCdACgaAPMCMg3g+vUAKyAW +nBH7YAgdIgCdABbs6CogOPvZzAXgDQUAnff3gIgV4KoZAAprOYYWxIAKjTn2wA9y4gCdAJ0UjRfr +FgUuh14AAGABjoiYaoEgjRkrUp59szwvUp2fG4YbsIrvZAADAdGAAJqYZf9GYALUnhz8ICYVoAoF +AFmINhnsuYiYjBHuEgwkDx8AAP//aA2gDwUAwLD6IWYV7/8KAMDaDY00/SEGFe//DgAA//wEDaAP +BQAAnhyfHfwgJhWgCgUAWYgkGeyojBGImI8djhz5H/dYkgCdAGACWcBglhuKG8C6C4s065YILXgO +AABgAkOeHJ8dnBHqJAAJ2ASAAFhMzYwRjx3uEgwld4GAAGAB+54cnx36QPAVoAwFAFhNGYwRjx3u +Egwtd1YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgewgQAABgJhhhaW+I3Hh8SIxq1tBncMl8R2 +2wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQBIAAWHPBGex4jhyMEfqzphWhBwUAc3sI +KyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV4AoVAPog5hWgCDUAmBMP3Tb8IMYV4B9F +APe+AA+/9wYAAJ4ciiefHYsQ6qwgKmAEgABYcLfvEg0tYASAAP4hiBWv/NoA6iAHKeAEgABYTMqM +EY4c+disBe/+QgAA2iBYcfaMEY4c+diiBe/+NgAmIDsX7FntuwIHyIEAAPmCABWjqwEA57cCCwjG +AACTH43AE+xSA90BIyAHAyNACjMQA90CE+xGJiEkA90CIyEH6yEJLVICgAD6xgALOjMBAOohIimb +AoAAA7sCgy+d8I0glvSX9pP1m/ODH+vsOh7uAoAADe0CnfELqgLq9gIiDD0AALBKbakFCACGCQJh +KCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHyDeD89QArIBb9YAilIgCdAMg/jiktIDij +7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxpDpsCmyLrEgApUASAAO0SAypgBIAAWHHt0qDRDwDq +JAAK2ASAAFhzVNKg0Q8A2iD8QGgdoBvFAFhzxmP/xwCLEtog67wYKWAEgABYc8Fj/7TbwPwgyBWv +jgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhzQ/ohBhWgDwUA/kdmHe/8qgCLGyohCfxCsBWv +/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9gBh2gBhUABqoCmrEZ6+f3NaYVr/vyAACK +J+tEAApoBIAA+0QAFaAMBQBYbKLSoNEP2iBYcYFj/wYAAAAA6iAHKeAEgABYTExj/uGLEtog67wS +KWAEgABYc5Jj/vdsEAYoIAUlIAckCgP3AAVkUVUBACggImSAoQIqAlhq+vlABMDQBhUAKSAh4+vI +GAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1ksGopICH6QAgVoPzlAAyZAfcmAAywDQUA ++EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBYb8wMXRGj3fWzphWgAgUA0Q8X662KeGqh +JgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q///igNoAsFAMCgWYcdinhroc7//4wNoAsF +AMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA+GBoHaelAQDoFgAlU/kAAOq6OQoYBIAA +6hYELCAEgAD9gcAEUZkBAMGz+4AbBWIAnQCMImXC5hvrhrQ+7hYDLMcCgACriOgWBizABIAA7BIG +KAQKgAD1AAQiEgCdAI0TLMKejxb9gAcr4gCdAC/yne8WBSeVoYAAJSEbikKGKpgYBaU29U8ADfEH +BQB7cwHVoIcpB2YM9MAF4+IAnQAqGgD1QjIN4Pz1ACsgFpgY/WAF/SIAnQCNKaXdnSmKQvqgClKi +AJ0AjBQb63mHQ5gYmRnrdwEGB+mAAGAArgAAGuteiqjoFgglDL+AAIsWjBMrsp6PFnyzQC/ynRvr +V+TwOWUz/QAAlrjvFgUv+24AAGACFQAAAAD4ISYV4AoFAFmGyRrrTYqoiRnoEgglDv8AAP//TA2g +DwUAwPAc60fAugurNPuBBhXv/wYAAAAAAP/8eA2gDwUAmRnqJAAK2ASAAFhLcYkZ6BIIJXmpgABg +Aa0AmRn6QPAVoAwFAFhLvokZ6BIILXmWAABgAozudAAKWASAAOWsDAroBIAA7xIFKVAEgADsRgIp +4ASAAFhvs4gYiRmOFvvTphWhDQUAddsIKyAWLwr/f7ktwGH2IIYVr/oCAIonixDqrCAp4ASAAFhv +dsCy66QCLSAEgAD7QEgVr/5yAAAAAOogByrgBIAAWEuIiRn4IQgVr/8GAACIQ4tAjBTpEgUsOASA +AP8AaB2n2wEA7RYBLgieAAAnIAcY6yEHB0HodwoEyIEAAPb0KBXgrnEA7qwQDVPCgADsqgICQEEA +AOp3AQHT/QAA5+cCAYxFAABtqQUIAIYJAmGOQ4tAwICYEhjrEhbrEokRjxUc6w4tIQf11hoFoa4x +AKyq+1AQFardAQDsIRou7wKAAATdAp3wHerlCloMhCCc9uf2ByTgQQAA6vYFJMg9AADs9gMh0AUA +APaGAAs0mR0A5vYEJMgFAADpOQwKJgKAAASkApTxCY05nfItIBTj3QgNIASAAO0kFCWp7oAAjxaI +EvXzphWhDgUA9cHyDeD29QArIBb3YATNIgCdANKA0Q8AiBRkgJvAINEPACucGOokAAlgBIAAWHKF +Y//kiif4IOYVp5tBAOqsICgECoAA9SAEedIAnQCMFcCx7MwgKegEgABYa3+aEo5D+oAIFe/8KgAA +AACLFexNEQlQBIAA/WAARfAMFQBYabT0gGAVr/3CAGWsoPmf5OjSAJ0ALyAg8f/kl5IAnQBj/3sA +AAAAAAAA6iAHKuAEgABYSxqIEtKA0Q+KJ9ww6xIAJVCBAABYbvvAsvtARh3gAgUA0Q8AAAAA+mBo +HeAMBQDtNAAMOASAAFhrW9tA7DQACugEgADqFgIr8ASAAO8SBSlQBIAAWG8b+oAIFe/7VgAAACuc +EuokAAlgBIAAWHJJY/70AGwQBBTqpiRAgAhEEfqAaB2gCxUAWYRlGOqPZKBC+EYADDAJJQCZoeim +ACEByYAAaCEcbyQZ7iIWZUghAAADQIgJCIoDIIgJBIoDAIgJAIraQPoAQh3gDBUAWYe9wCDRD8ck +0Q8P6DCfog7uMJ6jDcAwnaQMsTD9QKYVoAsFAJum+0DmFe//LgBsEBQjFhqUGYkwIhYb+iNoFedl +AQD838AVoA0VAAzcOSqwB4u3/CGmFaeZAQD4IoYV4aoBAOoWCiXYgQAAKxYe9MAvgRIAnQAuEhuO +4mXkJhLqVYIoE+pS9kAwAJAPpQAmMq5kZiMpMq1klh8a6k6wKJio7ZQABK/5gAAuEh4oEhr7wKQV +r8UFAAXuAS4WHO6uCARAgQAA7uxALCgEgAD/AC/KogCdACYSGiISFCUWFvbAaBWv+AUA5hYRIRA9 +AAAIKQGlluYWECsoBIAA/sAumqIAnQCdFpkVjBkkEhqOGhbqMpYX/iJmFaSiHQDqFhUi2BEAAOsW +CyLQIQAAmhwb6kIqEhvkQQwvdwKAAOPuCAZgQQAALBYSJBYZLBIcKqEHFOo9LhYY/YgAFaqqAQDs +FggtVwKAAAuqAvoh5hWgB7oAAAAAAAAnMADqIgwEyAUAAOoSHid4BQAA/+BoHaBvAQDzKzAN4A8V +ACsSHCzQACqhBQXMC6ur67xALiAEgAD7gBUC4gCdAAkMQPoAIh3gCgUADLo4BKsL5KoKBaAhAAD6 +I6gV4AwFAAb8OBbqHAt3C6bGJmCQ58sLDXgEgADnzAoF2GEAAOhoCAZgQQAAivAEAIkCqjaawAsA +i4zw7dwBIZgFAADzn/rrogCdAI0UAssMCsMMk/DygAgVoAcVAPKAKBXgBgUAC3Y4qWmjo5NBejsC +IiwBkkDzABnf0gCdABzqASMSGSISGhTp/hrp/O4SDycwBQAABNQB6toBDM4CgAAJRAIpEh0KZgIt +EhuWlJRQjycmEhUkEhcD/wz4IsgVoTgdAJ8no2MS6egvEhSTHp5AjdD+I8gVoAsFAO9GAyGYBQAA +4kYCLs4CgAD4ZgAM8ApVAOlGASIQQQAA5hYBKXgEgADoFgApoASAAFmHsi0SHioSFS4SHC3RBSgS +FisSEK7d7dxAKUgEgAD7oBWD4gCdAG2pBQgAhgkCYQM0Ai4SES8SGu/yBy8NLgAAZPGq9dOSBaDy +9QAc6cwuEhovEhgtEhsu4Q3z86YV4ApVAP2gCBXgCwUAWYeXJhIb0w8mYBbywAoFIgCdAC0SGy4S +GigSGf2gCBXgClUA/8DoFeALBQDoFgAqYASAAFmHii4SGy7gFiMK/3PhCioSG4sdWCwzZKKMLxIT +JhIYJxIS9eAFwhIAnQAmYp4pEhj2wBNT4gCdACmSnekWFySHeYAAKhIaIhIZiVCKpy4SF/gghhXg +CCUA+kEACTeZQQDiFhkkkRmAACoSHh3phisSHCqhBa2dLdAAF+mDq6sF3Qvk1AAF2QEAAPugEErg +yQEA+gAiHeAKBQAMujgEqwvkqgoFoCEAAIwV36DnnQgLmASAAP+AAEYwDgUA7BYdJlhhAAD9goAV +r/bqAIQc+iFoFa/2CgAA+48ACj/1ggAS6V6CKPZADpiSAJ0AJhIYJxISJmKeKRIY9sAOy+IAnQAp +kp0b6VXkkc1hU/0AAJq46RYXLPmGAABgABMrEhoqEhsrsQ1YK9hj/rTAINEPAIsaLBIb67wYLlAE +gABYcQPAINEPLOEAscz9wAQdr/laACUSGiYSGSVRDAZVDGVR/yYSGyZgBPTAENkSAJ0AIhIa4xIX +KbcCgACIIaYzIiIC5oI+adgEgADzABLgUAcFACkSG4oZKJAUhB6qiPaAAEJ3iAEA6JQUIiAFAAD1 +ABJeUgCdABzpTC4SGi8SGC0SGy7hDST2nf2gCBXgClUA9c8AD3ALBQBZhxUvEhsv8BYmCv928Q4r +EhorsQ0qEhsFuwxYK6UqEhuNGYqnwMDqrCAu2ASAAFhp1tKg0Q8iEh2LF/MAAgEwBwUA6wAVARBB +AACxd+KDHguP6AAA+QAgFa/ymgAAAC8SFtMP79oMCUAEgAD4IqgV5OodAPHBIA3gDQUADwCG6AwA +BugFAAB+2fEoEhePGA6eDPlAAEQwDQUA5O0hZEBBAAAPIIboLAAG6AUAAH7Z8WP9Cxfo/4Qc+iFo +Fa/4XgAAAPuvAAo/994A//ZkDaAJBQCLGiwSG+u8Ei5QBIAAWHClwCDRD8CgWYRiEujlgij4X/EY +kgCdAP/4/A2gCQUAwJAY6ODAagYmNPcBBhWv+LYALRIU3EDt3A8p2ASAAPojyBWk3R0AWPq4+iNG +FaAOFQD+IaYVr+fCAMCgWYRNEujQgij4X8+wkA+lAP/oBA2gCQUALBIb+4BoHaAbxQBYcIXAINEP +AADAkBjoxg8mNPcBBhWv53YAAAD7DwAKv+geAPrPAAq/6LYALBIaLxIWLsAVLcAUK8AR7MEJKVAE +gADu3QgLcASAAFj6jWP92igSGykSCSaAFC8SGglmCCaEFC/yAPH/8LKSAJ0AKxIX6hIbKe8CgAD9 +YABF8AwFAFhnqPRgYBWv9+IAAAAqEhvrNAAJYASAAFv2jCgSGoiBDKsR6zsIDTgEgADxH+1gUgCd +AOoSGylgBIAAW/Zb90AAQ//2ZgCMFvYjaBXv/wUAD48BD4YMJnQULXEJ/uKwFaALBQArxAAvxAPk +7hAO7gKAAP+mAA6wCRUACd0CncEa6Ij5VaYV7/XmAABsEAiIIi8gB5UU9CBmFaD99QDxGCwN4f8B +ACggFn2BLCsSBNMP0w/+IMYV57sBAPt/wBXgCRUA65s5CVAEgABYKxkvEgbzTpAN4P31ACwwDxXo +ahvocRbob+VQgC4LhgAAhxOwdyVcN/4gphXkVR0A5XUID88CgADmmQgCqA0AAPXgBuIQDKUAKJKe +9QAUy+IAnQAlkp3kVAACigGAAIq490AKOJIAnQAuYq5k4QEpYq3kkP1le/0AAO+2CCSIAYAAKCAW +fYEOmRDrMQYpUASAAFgq3YkQjBMqIBQrIAQMqgj1YAkZEgCdAAoKRyokFPVADK5SAJ0ALTAPKRIE +8bEcDeeZAQD5IA3pUgCdAOlUAAHAQQAAbXkFCACGCQJhwKCaEgx0EaRUKCAE9QAJ+RIAnQCJMeQW +ASpYBIAA5TICLI0iAADzIA4AUAQFAKR5ihXiEgItVwKAAKaqKaad0Q8Airj3QA8QkgCdAIkVDJkR +ppkukp71wA/D4gCdAC6SnZ4QiBDlhAAED5mAALCp+WEGFe/8FgAAAADsEgMpUASAAO0SBCnYBIAA +WG330qDRDwDAkAyuNO62CCz4RgAA2iD8QGgdoBvFAFhv0WP/yicwDvbgAIP/+kYAAAAr/BjqJAAJ +YASAAFhvyWP/rMCgWYOGG+gKirgtCv/5X/VgkAylAGP/uQAAAAAA+kKGHa/7rgAAACwhBx3oGfvQ +PAXqzAEA7jAOLmcCgAANzAIstiiKIBjoHv1AABUwDDUADKoCKrYp6AQFAfhBAAD5IAnBUgCdAG3p +DgQCYw9AhgQCZQ8AhgQCYcDQ/CBGFe/6+gCOMPPACuqSAJ0AjxXiEgIv/wKAAKb/J/ad0Q8rIQn8 +QrAVr/0FAA2tAQ2vDP5Chh3gDgUA7ZQDLmECgADulAAt3gKAAP1mAA2wCBUACLsCm5H41aYVr/jW +AIon/KBoHaALFQDtEgMlUIEAAFhokfogRhWv+Q4AANog60QACuAEgABb9bSLEYkxDKwR7LsIDSAE +gADxP/JAUgCdAOokAArgBIAAW/WDpKSkeYoV4hICLVcCgACmqimmndEP//WoDaAFBQAAACv8Euok +AAlgBIAAWG9zY/5UAAAAAAD+IMYV4AoFAFmDLRvnsYq4/iDIFeD99QD5X/AwkAylAP/0qA2gBQUA +wOD+IAYVr/guAAyoNPlhBhWv9FYAiicloRX7RAAVr8kFAAmpAalZKZxAbekTBAJjD4CGBAJpD2CG +BAJnefsY0w+NE9MP+6BoHeAMBQBYaFj6IEYVr/WOAPXvAA///44A2iD6gGgd4AwFAFhmj7N7jBXi +EgIuZwKAAKbMK8ad0Q9sEAQjIAAkCu10MQYiIQO8ItEPhiCFI4Qh9nAABDs2IQD4YABBs2YBAKYz +DjMR8q8ACX1EAQDjPBohE8kAAAQkLAQzKKMi0Q9sEAiKIicgB4kwlRT4QtAVoXcBAPFbDA3omQEA ++CAmFeD79QB7gSArEgQLC0f7f8AV4AkVAOubOQlQBIAAWCoL809gDeD79QAa52aIqBbnY/cADGCS +AJ0ALWKuZNGsJWKtZFGosIiYqOlUAAKMeYAAFedUJVCAJVw3+CAGFeRVHQDlRQgLzwKAAOaZCAKo +DQAA9OAIWhIAnQAokp71ABLD4gCdACWSnWRRbyogFvtDJg3g7NUAKzAQ/WASJCIAnQArMQu8u9og +WCnSKCAULCAEpIj1gArREgCdAAgIRygkFPUADG5SAJ0AihQe51eNESghBxznNBnnU/+h4BXqiAEA +/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxWAi3eAoAA60sCAshBAADrVgEhwEEA +APlAB+lSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgT6SAEIlv9AAAMuxGrW/UgB4ESAJ0AiDHlMgIl +2EEAAOsWAiwJsgAA8wAKsFADBQCjTIgTDH0Rpt3s1p0sEASAANEPAAAAAAAAAPcADTiSAJ0ADHkR +ppkukp71wA2T4gCdACWSnWRRqbCMnKhlXuRgAFHqJAAJ2ASAAO0SBCpgBIAAWGzd0qDRDwDAoFmC +exrm/oio+R/zUJD79QD/+cgNoAUFAADaIPxAaB2gG8UAWG6zY/+8wFDA2g2INPlBBhWv+UoAK3wY +6iQACWAEgABYbqtj/5wAAAAAAPhChh2v+tIAAAAAiif9IGgdoAsVAOqsICpoBIAAWGem+iBmFa/8 +DgCLMPNgCLqSAJ0A4hIDK+cCgACmzCTGndEPjxAuIQn4QrAV7/oFAAqKAQqMDCwkFOSZEA92AoAA +Ce4C++BmHaALBQD74AYd4A0VAA3uAp7x/NWmFe/49gAA6iQACuAEgABb9LOLEigyAeoWBS1nAoAA +7LsIDRgEgADxH/WQUgCdAOokAArgBIAAW/SBiBOjo6NMDH0Rpt3s1p0sEASAANEP//asDaAFBQCO +NIs3jTX+cAAHu84hAP+AAEZz7gEArswOzBH9bwANvd0BAOzMGiXbyQAADb0sDcwo/WAARb/2QgAA +K3wS6iQACWAEgABYbmNj/nzAoFmCIBrmpIio+R/yeJD79QD/+YQNoAUFAADAUMD6D480/0EGFe/5 +RgCwSwy7EetbCAlQBIAA+2IAFeAMBQBYZZWzTOISAyvvAoAApt0s1p3RDwAAbBAG2iBYKccX5rMl +MBb5zVQFoqYFAAamKIo3qGgFVQoIVQunVYhQ5KwIKQEKgAD6oCgV4AcVAOWBFXvICoAAiDKUsJWi +m6MJiAKUUZgy0Q/aIFgptBzmoCvCherCiC1IBIAAqbvvMBYt3kKAAKuqG+acGOaa7uaRHM8CgACr +mahomBCZEYaRK4J97IJ/L4EKgADuZgEL6AqAAA27AiuGfebGAgYAcYAAWALMixCJESuyfRjmbQaG +OAa/Ao5Rn5KMMpTg7kYBKQEKgADlRgAr6AqAAA3MApRRnDLRD2wQCNogWCmQ1KAX5n8b5oD5zP4F +4qYFAAZEKBXmcOlJCAlXAoAAq6qKoCmSf6VFp0QKmQH4IAYV4GMFAOEABQEzuQAA8ADcDaAHFQAA +AAM8CvWAAgZ/CEUA6MgICVAEgADogh8qWASAAP50ABWvfQUA7cwIC2gEgAALgAABAYcDN2DhAQcJ +9yAAANEPbBAEFuZhFeY+0w+mIgU1AiUmgCQigGdAC20IBSgigGeAAmP/89EPAGwQBCggBSUgB/pg +qBWv9NUA+kBIFeADJQD9ASAR0VUBAMAg0Q8AiCkZ5k+aK/sAB/wiAJ0ACVkJKZ0CKpEIKZEEDwIA ++yAEw6IAnQAqCh/7QARo4gCdAAIqAlhlNIsiDwIAA7oBZK+4iicEuwHrJgIlUMEAAFherOPmGhUB +OYAAKKAA0w/TDwOICiiCEOygBy1YBIAA+kBoHaANRQALgABlr9yJJ9MPZJ92KpkUyqeKmWSvbCig +AAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0oAAP//VA2gCgUA2iBYZSErICLquwwJUASA +AFhmctpQ+gAiHeAMBQBYZuSLIgO6AfN/+uZiAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAA +WG2ewCDRDwDrICIpUASAAFhmYCogBcHjfqEMaKgpiyLzYAQFf/xmAC8gOsCPePnq+kBoHaALBQD8 +AAIdoA0lAFhljGP/1wAA+kBoHaALBQD8AAIdoA0lAFhlCWP/vwAAbBAKiCsd5fYuICGLN/xgyBWg +/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAf4IQYV7/TVAPxASBXgAyUA +/RtAQdFVAQCKKZsr+0AH7GIAnQAb5d8LWwkrvQIssQgrsQT9YASzogCdAMHP/YAEYOIAnQDaIFhk +yIsiA7oBZK+biicEuwHrJgIlUMEAAFheQQqrAuPlrhUBKYAAKLAA0w8DiAooghAssAf6QGgdoA1F +AAuAAOukAA1/HgAAiSdkn1oqmRQrkgnKqGS/TyiwAAOICiiCECywB/pAaB2gDTUAC4AA66QADX8u +AABj/y0AAAAAAP//SA2gCwUA2iBYZLUrICLquwwJUASAAFhmBtpQ+gAiHeAMBQBYZniLIgO6AfN/ ++s5iAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAAWG0ywCDRDwDrICIpUASAAFhl9CogBcHj +fqEMaKgpiyLzYAQFf/xaAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFhlIGP/1wAA+kBoHaALBQD8 +AAIdoA0lAFhknWP/vwAAbBAEKTAWCVkU9SAG2JIAnQDxLrAN7/vlAOPlYxgECoAA9SAEGhIAnQBo +lQTAINEPACogBrCqCgpH6iQGLX9+AACMIoonC8sB6yYCJVDBAABYXefJrSigAAOICiiCEOygBy1Y +BIAA+kBoHaANRQALgABlr+CJJ2SfsiqZFGSgoIqZZK+nKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01 +AAuAAGWv4GP/hQAAKSAGsJkJCUfpJAYs+8YAAIknjCIqmRQLzAGLmewmAiUCgYAAKLAAA4gKKIIQ +2iD9YPAVoA01AAuAAMAg0Q8AAOokAAnYBIAA7EQACugEgABYZbnAINEPAOokAAnYBIAA7EQACugE +gABb/0/AINEPAP/+wA2gCwUA//10DaAKBQBsEATRDwAAAGwQCBXlQBTlHBflQJIS+CBIFaAKBQD6 +IGYVoAlFAJkUGuU6CIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA+CAmFa/59QD5FwAMcAYFAPgg +BhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYFMYAALVHC+sAEANALFQDguxoOo0wAAC5x +fmTvygIqAlhmhI8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKKEAqZAZkyijcqrDBYXYHKoSig +ANMP0w8EiAooghDsoActWASAAPpgaB2gDUUAC4AAZa/ciTfTD2SfbSqZFMuniplkr2MooAAEiAoo +ghDsoActWASAAPpgaB2gDTUAC4AAZa/gY/9BixP6IEgVoAkVAAubOVhncdEP//8UDaAKBQBsEAYd +5PcLKxGtsyoyfxnk9YigJd31+KAARPAEBQDpuQgEAbGAACwyeC8ye/mABYRiAJ0AZfDsLDZ8KzJ5 +KzZ73UAN5BYBAgCUoA3kFiwKCfxABfQiAJ0ALzJ7wcDt5OIXg3mAACIyfCohBI4g8+H+Daa6AQAk +Nnz0b2YVoAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFhl7WWg +mSohBP9BIAwWmgEAyJnRDwDaIFhnNtEPANogWGdq0Q8A+kBoHaALBQBYZzfRDwAAAOrSYCFj4QAA ++4AEANALFQD9YAEF3/z1AAy7AwuqASrWYFmEwSQ2fCQ2e/pv6BWv/MoAWXu9WGWgLVKwZN85WXuO +Y/8zHOSy/m+IFaAKVQD4b0gVoAtFAOgWACFr5QAAWYJr+m/oFa/70gApMnviNnws+2YAACI2e9EP +AABsEAQU5KQZ5KDo5IoZXsKAAKS0I0J/qYjouAgBgkGAAIoweKkCKkJ7HOSZKzEEKkZ/DLoB6jUE +KdAEgABYZbHOrikxBP8hAAwW2QEAyNfRD9owWGb70Q/aMFhnL9EPAAAAAAAA+kBoHaALBQBYZvvR +DyNGf9EPAABsEATwYOAN7/n1AIgiCTkDCYgBmCKKJyqsMFhc6OPkVRUBGYAAKKAAA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv4Ikny5IqmRTKpYqZya0ooAADiAooghDsoActWASAAPpAaB2gDTUA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:29:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 619F4CC4; Fri, 5 Jul 2013 18:29:10 +0000 (UTC) (envelope-from dteske@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 50F831B60; Fri, 5 Jul 2013 18:29:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65ITA1A030530; Fri, 5 Jul 2013 18:29:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65ITAki030529; Fri, 5 Jul 2013 18:29:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051829.r65ITAki030529@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252815 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:29:10 -0000 Author: dteske Date: Fri Jul 5 18:29:09 2013 New Revision: 252815 URL: http://svnweb.freebsd.org/changeset/base/252815 Log: Make a correction to the description of invocation with-versus-without arguments, making things a bit more clear [hopefully]. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:27:38 2013 (r252814) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:29:09 2013 (r252815) @@ -80,9 +80,9 @@ is used to set up many system configurat well as changing configuration settings of existing systems. .Pp .Nm -takes a command as an argument. -If invoked with no arguments, it will bring up a master menu listing the -available commands. +optionally takes a command as an argument. +If invoked with no arguments, it will bring up an interactive menu listing the +available modules. .Pp The following options are available: .Bl -tag -width indent+ From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:30:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2075E53; Fri, 5 Jul 2013 18:30:43 +0000 (UTC) (envelope-from dteske@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 A47731B93; Fri, 5 Jul 2013 18:30:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IUhHC032408; Fri, 5 Jul 2013 18:30:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IUhpP032407; Fri, 5 Jul 2013 18:30:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051830.r65IUhpP032407@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 18:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252816 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:30:43 -0000 Author: dteske Date: Fri Jul 5 18:30:43 2013 New Revision: 252816 URL: http://svnweb.freebsd.org/changeset/base/252816 Log: Document remaining undocumented modules (and remove my silly place-holder thing at the top, which I was using as a way to make sure I didn't forget to document any modules). Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:29:09 2013 (r252815) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:30:43 2013 (r252816) @@ -23,40 +23,6 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" docsinstall -.\" password -.\" diskmgmt -.\" usermgmt -.\" useradd -.\" useredit -.\" userdel -.\" groupmgmt -.\" groupadd -.\" groupedit -.\" groupdel -.\" console -.\" syscons_font -.\" syscons_keymap -.\" syscons_repeat -.\" syscons_saver -.\" syscons_screenmap -.\" syscons_ttys -.\" timezone -.\" mouse -.\" mouse_enable -.\" mouse_type -.\" mouse_port -.\" mouse_flags -.\" mouse_disable -.\" networking -.\" defaultrouter -.\" hostname -.\" nameservers -.\" netdev -.\" security -.\" ttys -.\" [dot] -.\" .\" $FreeBSD$ .\" .Dd Jun 5, 2013 @@ -163,6 +129,8 @@ Shortcut to the Edit/View Groups menu un Utilities to Add/Change/View/Delete Group Accounts. .It Cm hostname Shortcut to the Hostname/Domain menu under networking. +.It Cm kern_securelevel +Shortcut to the kern.securelevel menu under security. .It Cm mouse Utilities for configuring, exploring, and enabling console mouse support. .It Cm mouse_disable @@ -182,12 +150,28 @@ Shortcut to the Network Interfaces menu .It Cm networking Utilities to set/change Hostname/Domain, Network Interfaces, Default Router/Gateway, and DNS Nameservers. +.It Cm packages +Browse, install, uninstall, or re-install packaged software. .It Cm password Set the system administrator .Pq root password. .It Cm security Configure various system security settings. +.It Cm startup +Configure various aspects of system startup. +.It Cm startup_misc +Shortcut to the Miscellaneous Startup Services menu under startup. +.It Cm startup_rcadd +Shortcut to the Add New menu under the View/Edit Startup Configuration menu +(startup_rcconf) of startup. +.It Cm startup_rcconf +Shortcut to the View/Edit Startup Configuration menu under startup. +.It Cm startup_rcdelete +Shortcut to the Delete menu under the View/Edit Startup Configuration menu +(startup_rcconf) of startup. +.It Cm startup_rcvar +Shortcut to the Toggle Startup Services menu under startup. .It Cm syscons_font Shortcut to the Font menu under console. .It Cm syscons_keymap @@ -202,6 +186,10 @@ Shortcut to the Screenmap menu under con Shortcut to the Ttys menu under console. .It Cm timezone Set the regional timezone of the local machine. +.It Cm ttys +Edit the +.Xr ttys 5 +database with your favorite editor. .It Cm useradd Shortcut to the Add Users menu under usermgmt. .It Cm userdel From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:31:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CA55FE7; Fri, 5 Jul 2013 18:31:27 +0000 (UTC) (envelope-from dteske@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 F34D21BAE; Fri, 5 Jul 2013 18:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IVQZc032573; Fri, 5 Jul 2013 18:31:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IVQxM032572; Fri, 5 Jul 2013 18:31:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051831.r65IVQxM032572@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 18:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252817 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:31:27 -0000 Author: dteske Date: Fri Jul 5 18:31:26 2013 New Revision: 252817 URL: http://svnweb.freebsd.org/changeset/base/252817 Log: Adhere to 80-column width. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:30:43 2013 (r252816) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Fri Jul 5 18:31:26 2013 (r252817) @@ -215,17 +215,17 @@ The following environment variables affe .Bl -tag -width ".Ev LC_ALL" .It Ev LANG If LANG is set, messages and index information will be read from files named -messages.$LANG and INDEX.$LANG and fall back to files named messages and INDEX if -messages.$LANG and INDEX.$LANG do not exist. +messages.$LANG and INDEX.$LANG and fall back to files named messages and INDEX +if messages.$LANG and INDEX.$LANG do not exist. LANG takes precedence over LC_ALL. .It Ev LC_ALL If LC_ALL is set, messages and index information will be read from files named -messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and INDEX if -messages.$LC_ALL and INDEX.$LC_ALL do not exist. +messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and +INDEX if messages.$LC_ALL and INDEX.$LC_ALL do not exist. .El .Sh FILES -/usr/share/examples/bsdconfig/bsdconfigrc can be copied to $HOME/.bsdconfigrc and -customized as needed. +/usr/share/examples/bsdconfig/bsdconfigrc can be copied to $HOME/.bsdconfigrc +and customized as needed. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:44:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3AFD74E2; Fri, 5 Jul 2013 18:44:11 +0000 (UTC) (envelope-from trociny@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 2CCD61C5B; Fri, 5 Jul 2013 18:44:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IiBXW035816; Fri, 5 Jul 2013 18:44:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IiAcb035814; Fri, 5 Jul 2013 18:44:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051844.r65IiAcb035814@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:44:10 +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: r252818 - in stable/9/sbin: hastctl hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:44:11 -0000 Author: trociny Date: Fri Jul 5 18:44:10 2013 New Revision: 252818 URL: http://svnweb.freebsd.org/changeset/base/252818 Log: MFC r252472: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd Modified: stable/9/sbin/hastctl/hastctl.c stable/9/sbin/hastd/control.c Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:31:26 2013 (r252817) +++ stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:44:10 2013 (r252818) @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch static int control_list(struct nv *nv) { + pid_t pid; unsigned int ii; const char *str; int error, ret; @@ -331,6 +332,9 @@ control_list(struct nv *nv) str = nv_get_string(nv, "status%u", ii); if (str != NULL) printf(" status: %s\n", str); + pid = nv_get_int32(nv, "workerpid%u", ii); + if (pid != 0) + printf(" workerpid: %d\n", pid); printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); Modified: stable/9/sbin/hastd/control.c ============================================================================== --- stable/9/sbin/hastd/control.c Fri Jul 5 18:31:26 2013 (r252817) +++ stable/9/sbin/hastd/control.c Fri Jul 5 18:44:10 2013 (r252818) @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, compression_name(res->hr_compression), "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); + nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no); switch (res->hr_role) { case HAST_ROLE_PRIMARY: From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:44:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C86046FA; Fri, 5 Jul 2013 18:44:41 +0000 (UTC) (envelope-from trociny@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 BAA861C63; Fri, 5 Jul 2013 18:44:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Iifkc035907; Fri, 5 Jul 2013 18:44:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IifFK035905; Fri, 5 Jul 2013 18:44:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051844.r65IifFK035905@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252819 - in stable/8/sbin: hastctl hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:44:41 -0000 Author: trociny Date: Fri Jul 5 18:44:41 2013 New Revision: 252819 URL: http://svnweb.freebsd.org/changeset/base/252819 Log: MFC r252472: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd Modified: stable/8/sbin/hastctl/hastctl.c stable/8/sbin/hastd/control.c Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Fri Jul 5 18:44:10 2013 (r252818) +++ stable/8/sbin/hastctl/hastctl.c Fri Jul 5 18:44:41 2013 (r252819) @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch static int control_list(struct nv *nv) { + pid_t pid; unsigned int ii; const char *str; int error, ret; @@ -331,6 +332,9 @@ control_list(struct nv *nv) str = nv_get_string(nv, "status%u", ii); if (str != NULL) printf(" status: %s\n", str); + pid = nv_get_int32(nv, "workerpid%u", ii); + if (pid != 0) + printf(" workerpid: %d\n", pid); printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Fri Jul 5 18:44:10 2013 (r252818) +++ stable/8/sbin/hastd/control.c Fri Jul 5 18:44:41 2013 (r252819) @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, compression_name(res->hr_compression), "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); + nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no); switch (res->hr_role) { case HAST_ROLE_PRIMARY: From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:46:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5DB3E86F; Fri, 5 Jul 2013 18:46:36 +0000 (UTC) (envelope-from trociny@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 4F5421C72; Fri, 5 Jul 2013 18:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Ika1O036381; Fri, 5 Jul 2013 18:46:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IkZuD036378; Fri, 5 Jul 2013 18:46:35 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051846.r65IkZuD036378@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:46: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: r252820 - stable/9/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:46:36 -0000 Author: trociny Date: Fri Jul 5 18:46:35 2013 New Revision: 252820 URL: http://svnweb.freebsd.org/changeset/base/252820 Log: MFC r252516, r252540: Add a mib for worker process ID. Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:46:35 2013 (r252820) @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY REVISION "201304130000Z" DESCRIPTION "Initial revision." + REVISION "201307010000Z" + DESCRIPTION + "Added hastResourceWorkerPid." ::= { begemot 220 } begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } @@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE { hastResourceReadErrors Counter64, hastResourceWriteErrors Counter64, hastResourceDeleteErrors Counter64, - hastResourceFlushErrors Counter64 + hastResourceFlushErrors Counter64, + hastResourceWorkerPid INTEGER } hastResourceIndex OBJECT-TYPE @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE "Count of resource local flush operations that failed." ::= { hastResourceEntry 21 } +hastResourceWorkerPid OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Worker process ID." + ::= { hastResourceEntry 22 } + END Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:46:35 2013 (r252820) @@ -78,6 +78,7 @@ struct hast_snmp_resource { uint64_t write_errors; uint64_t delete_errors; uint64_t flush_errors; + pid_t workerpid; }; static TAILQ_HEAD(, hast_snmp_resource) resources = @@ -343,6 +344,7 @@ update_resources(void) nv_get_uint64(nvout, "stat_delete_error%u", i); res->flush_errors = nv_get_uint64(nvout, "stat_flush_error%u", i); + res->workerpid = nv_get_int32(nvout, "workerpid%u", i); TAILQ_INSERT_TAIL(&resources, res, link); } nv_free(nvout); @@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context case LEAF_hastResourceFlushErrors: value->v.counter64 = res->flush_errors; break; + case LEAF_hastResourceWorkerPid: + value->v.integer = res->workerpid; + break; default: ret = SNMP_ERR_RES_UNAVAIL; break; Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:46:35 2013 (r252820) @@ -59,6 +59,7 @@ (19 hastResourceWriteErrors COUNTER64 GET) (20 hastResourceDeleteErrors COUNTER64 GET) (21 hastResourceFlushErrors COUNTER64 GET) + (22 hastResourceWorkerPid INTEGER GET) ) ) ) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:47:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 478ECA91; Fri, 5 Jul 2013 18:47:26 +0000 (UTC) (envelope-from trociny@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 3971D1C83; Fri, 5 Jul 2013 18:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IlQDo036546; Fri, 5 Jul 2013 18:47:26 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IlPVn036543; Fri, 5 Jul 2013 18:47:25 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051847.r65IlPVn036543@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252821 - stable/8/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:47:26 -0000 Author: trociny Date: Fri Jul 5 18:47:25 2013 New Revision: 252821 URL: http://svnweb.freebsd.org/changeset/base/252821 Log: MFC r252516, r252540: Add a mib for worker process ID. Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:47:25 2013 (r252821) @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY REVISION "201304130000Z" DESCRIPTION "Initial revision." + REVISION "201307010000Z" + DESCRIPTION + "Added hastResourceWorkerPid." ::= { begemot 220 } begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } @@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE { hastResourceReadErrors Counter64, hastResourceWriteErrors Counter64, hastResourceDeleteErrors Counter64, - hastResourceFlushErrors Counter64 + hastResourceFlushErrors Counter64, + hastResourceWorkerPid INTEGER } hastResourceIndex OBJECT-TYPE @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE "Count of resource local flush operations that failed." ::= { hastResourceEntry 21 } +hastResourceWorkerPid OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Worker process ID." + ::= { hastResourceEntry 22 } + END Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:47:25 2013 (r252821) @@ -78,6 +78,7 @@ struct hast_snmp_resource { uint64_t write_errors; uint64_t delete_errors; uint64_t flush_errors; + pid_t workerpid; }; static TAILQ_HEAD(, hast_snmp_resource) resources = @@ -343,6 +344,7 @@ update_resources(void) nv_get_uint64(nvout, "stat_delete_error%u", i); res->flush_errors = nv_get_uint64(nvout, "stat_flush_error%u", i); + res->workerpid = nv_get_int32(nvout, "workerpid%u", i); TAILQ_INSERT_TAIL(&resources, res, link); } nv_free(nvout); @@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context case LEAF_hastResourceFlushErrors: value->v.counter64 = res->flush_errors; break; + case LEAF_hastResourceWorkerPid: + value->v.integer = res->workerpid; + break; default: ret = SNMP_ERR_RES_UNAVAIL; break; Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:47:25 2013 (r252821) @@ -59,6 +59,7 @@ (19 hastResourceWriteErrors COUNTER64 GET) (20 hastResourceDeleteErrors COUNTER64 GET) (21 hastResourceFlushErrors COUNTER64 GET) + (22 hastResourceWorkerPid INTEGER GET) ) ) ) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:50:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EE4FC3C; Fri, 5 Jul 2013 18:50:18 +0000 (UTC) (envelope-from dteske@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 6199D1CAA; Fri, 5 Jul 2013 18:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IoItI036998; Fri, 5 Jul 2013 18:50:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IoIen036997; Fri, 5 Jul 2013 18:50:18 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051850.r65IoIen036997@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 18:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252822 - head/usr.sbin/bsdconfig/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:50:18 -0000 Author: dteske Date: Fri Jul 5 18:50:17 2013 New Revision: 252822 URL: http://svnweb.freebsd.org/changeset/base/252822 Log: Oops, r252810 forgot to hook the new example file (browse_packages.sh) into the Makefile. Modified: head/usr.sbin/bsdconfig/examples/Makefile Modified: head/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/examples/Makefile Fri Jul 5 18:47:25 2013 (r252821) +++ head/usr.sbin/bsdconfig/examples/Makefile Fri Jul 5 18:50:17 2013 (r252822) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= bsdconfigrc +FILES= browse_packages.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:51:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA0B9D85; Fri, 5 Jul 2013 18:51:21 +0000 (UTC) (envelope-from andre@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 AABE71CBB; Fri, 5 Jul 2013 18:51:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IpLFk038733; Fri, 5 Jul 2013 18:51:21 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IpLcn038732; Fri, 5 Jul 2013 18:51:21 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051851.r65IpLcn038732@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 18:51:21 +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: r252823 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:51:21 -0000 Author: andre Date: Fri Jul 5 18:51:21 2013 New Revision: 252823 URL: http://svnweb.freebsd.org/changeset/base/252823 Log: MFC r243628: Update comment to prefer M_NOWAIT over M_DONTWAIT and M_WAITOK over M_WAIT. Modified: stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Fri Jul 5 18:50:17 2013 (r252822) +++ stable/9/sys/sys/mbuf.h Fri Jul 5 18:51:21 2013 (r252823) @@ -350,8 +350,8 @@ struct mbstat { * Flags specifying how an allocation should be made. * * The flag to use is as follows: - * - M_DONTWAIT or M_NOWAIT from an interrupt handler to not block allocation. - * - M_WAIT or M_WAITOK from wherever it is safe to block. + * - M_NOWAIT (M_DONTWAIT) from an interrupt handler to not block allocation. + * - M_WAITOK (M_WAIT) from wherever it is safe to block. * * M_DONTWAIT/M_NOWAIT means that we will not block the thread explicitly and * if we cannot allocate immediately we may return NULL, whereas From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 18:56:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28F0FF2D; Fri, 5 Jul 2013 18:56:05 +0000 (UTC) (envelope-from andre@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 0AA281CFB; Fri, 5 Jul 2013 18:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Iu4lS039361; Fri, 5 Jul 2013 18:56:04 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Iu4Wu039360; Fri, 5 Jul 2013 18:56:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051856.r65Iu4Wu039360@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 18:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252824 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 18:56:05 -0000 Author: andre Date: Fri Jul 5 18:56:04 2013 New Revision: 252824 URL: http://svnweb.freebsd.org/changeset/base/252824 Log: MFC r242998: Remove description of deprecated IP fragment checksum support. Since SMPng it wasn't really supported anymore and if it worked then only by chance. Only very few drivers ever supported it. Discussed with: yongari Modified: stable/9/share/man/man9/mbuf.9 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/mbuf.9 ============================================================================== --- stable/9/share/man/man9/mbuf.9 Fri Jul 5 18:51:21 2013 (r252823) +++ stable/9/share/man/man9/mbuf.9 Fri Jul 5 18:56:04 2013 (r252824) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2011 +.Dd November 13, 2012 .Dt MBUF 9 .Os .\" @@ -1064,45 +1064,6 @@ In this case, the checksum field will be set by the TCP/IP module to the checksum of the pseudo header defined by the TCP and UDP specifications. .Pp -For outbound packets which have been fragmented -by the host CPU, the following will also be true, -regardless of the checksum flag settings: -.Bl -bullet -offset indent -.It -all fragments will have the flag -.Dv M_FRAG -set in their -.Va m_flags -field; -.It -the first and the last fragments in the chain will have -.Dv M_FIRSTFRAG -or -.Dv M_LASTFRAG -set in their -.Va m_flags , -correspondingly; -.It -the first fragment in the chain will have the total number -of fragments contained in its -.Va csum_data -field. -.El -.Pp -The last rule for fragmented packets takes precedence over the one -for a TCP or UDP checksum. -Nevertheless, offloading a TCP or UDP checksum is possible for a -fragmented packet if the flag -.Dv CSUM_IP_FRAGS -is set in the field -.Va ifnet.if_data.ifi_hwassist -associated with the network interface. -However, in this case the interface is expected to figure out -the location of the checksum field within the sequence of fragments -by itself because -.Va csum_data -contains a fragment count instead of a checksum offset value. -.Pp On input, an interface indicates the actions it has performed on a packet by setting one or more of the following flags in .Va csum_flags @@ -1148,22 +1109,6 @@ It is a peculiarity of the algorithm use calculated over any valid packet will be .Li 0xFFFF as long as the original checksum field is included. -.Pp -For inbound packets which are IP fragments, all -.Va csum_data -fields will be summed during reassembly to obtain the final checksum -value passed to an upper layer in the -.Va csum_data -field of the reassembled packet. -The -.Va csum_flags -fields of all fragments will be consolidated using logical AND -to obtain the final value for -.Va csum_flags . -Thus, in order to successfully -offload checksum computation for fragmented data, -all fragments should have the same value of -.Va csum_flags . .Sh STRESS TESTING When running a kernel compiled with the option .Dv MBUF_STRESS_TEST , From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:11:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 688DE4EC; Fri, 5 Jul 2013 19:11:13 +0000 (UTC) (envelope-from andre@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 5955B1D94; Fri, 5 Jul 2013 19:11:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JBD6W045049; Fri, 5 Jul 2013 19:11:13 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JBDfW045048; Fri, 5 Jul 2013 19:11:13 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051911.r65JBDfW045048@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:11:13 +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: r252825 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:11:13 -0000 Author: andre Date: Fri Jul 5 19:11:12 2013 New Revision: 252825 URL: http://svnweb.freebsd.org/changeset/base/252825 Log: MFC r242308: Define the delayed ACK timeout value directly as hz/10 instead of obfuscating it by going through PR_FASTHZ. No functional change. Modified: stable/9/sys/netinet/tcp_timer.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.h ============================================================================== --- stable/9/sys/netinet/tcp_timer.h Fri Jul 5 18:56:04 2013 (r252824) +++ stable/9/sys/netinet/tcp_timer.h Fri Jul 5 19:11:12 2013 (r252825) @@ -118,7 +118,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ -#define TCPTV_DELACK (hz / PR_FASTHZ / 2) /* 100ms timeout */ +#define TCPTV_DELACK ( hz/10 ) /* 100ms timeout */ #ifdef TCPTIMERS static const char *tcptimers[] = From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:26:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5DBFBBA4; Fri, 5 Jul 2013 19:26:02 +0000 (UTC) (envelope-from rmh@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 4E4631E7F; Fri, 5 Jul 2013 19:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JQ21G048981; Fri, 5 Jul 2013 19:26:02 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JQ1Ls048979; Fri, 5 Jul 2013 19:26:01 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201307051926.r65JQ1Ls048979@svn.freebsd.org> From: Robert Millan Date: Fri, 5 Jul 2013 19:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252826 - head/usr.sbin/ppp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:26:02 -0000 Author: rmh Date: Fri Jul 5 19:26:01 2013 New Revision: 252826 URL: http://svnweb.freebsd.org/changeset/base/252826 Log: Remove ancient code for FreeBSD 2.x compatibility. Reviewed by: brian, freebsd-net Modified: head/usr.sbin/ppp/defs.c head/usr.sbin/ppp/defs.h Modified: head/usr.sbin/ppp/defs.c ============================================================================== --- head/usr.sbin/ppp/defs.c Fri Jul 5 19:11:12 2013 (r252825) +++ head/usr.sbin/ppp/defs.c Fri Jul 5 19:26:01 2013 (r252826) @@ -43,7 +43,7 @@ #include #endif #include -#if !defined(__FreeBSD__) || __FreeBSD__ < 3 +#ifndef __FreeBSD__ #include #endif #include @@ -56,20 +56,11 @@ #define issep(c) ((c) == '\t' || (c) == ' ') -#if defined(__NetBSD__) || __FreeBSD__ < 3 +#ifdef __NetBSD__ void randinit() { -#if defined(__FreeBSD__) - static int initdone; /* srandomdev() call is only required once */ - - if (!initdone) { - initdone = 1; - srandomdev(); - } -#else srandom((time(NULL)^getpid())+random()); -#endif } #endif Modified: head/usr.sbin/ppp/defs.h ============================================================================== --- head/usr.sbin/ppp/defs.h Fri Jul 5 19:11:12 2013 (r252825) +++ head/usr.sbin/ppp/defs.h Fri Jul 5 19:26:01 2013 (r252826) @@ -117,7 +117,7 @@ #define ROUNDUP(x) ((x) ? (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long)) -#if defined(__NetBSD__) || __FreeBSD__ < 3 +#ifdef __NetBSD__ extern void randinit(void); #else #define random arc4random From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:35:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEF07E9C; Fri, 5 Jul 2013 19:35:55 +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 D0AE41F20; Fri, 5 Jul 2013 19:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JZtFF051806; Fri, 5 Jul 2013 19:35:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JZpqe051782; Fri, 5 Jul 2013 19:35:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051935.r65JZpqe051782@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:35: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: r252827 - in stable/9: . etc etc/mtree gnu/usr.bin/gdb gnu/usr.bin/gdb/arch/amd64 gnu/usr.bin/gdb/arch/arm gnu/usr.bin/gdb/arch/i386 gnu/usr.bin/gdb/arch/ia64 gnu/usr.bin/gdb/arch/mips ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:35:56 -0000 Author: emaste Date: Fri Jul 5 19:35:51 2013 New Revision: 252827 URL: http://svnweb.freebsd.org/changeset/base/252827 Log: MFC r244236,r244408,r244915,r247054,r251512: Add a new knob WITH_DEBUG_FILES to control the building of standalone debug files for userland programs and libraries. The "-g" debug flag is automatically applied when WITH_DEBUG_FILES is set. The debug files are named ${prog}.debug and ${shlib}.debug for consistency with other systems and documentation. In addition they are installed under /usr/lib/debug, to simplify the process of installing them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the base system place the standalone debug files in a .debug subdirectory. GDB automatically searches both of these directories for standalone debug files. Added: stable/9/etc/mtree/BSD.debug.dist - copied unchanged from r251512, head/etc/mtree/BSD.debug.dist stable/9/tools/build/options/WITH_DEBUG_FILES - copied unchanged from r251512, head/tools/build/options/WITH_DEBUG_FILES Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/etc/Makefile stable/9/etc/mtree/Makefile stable/9/gnu/usr.bin/gdb/Makefile.inc stable/9/gnu/usr.bin/gdb/arch/amd64/config.h stable/9/gnu/usr.bin/gdb/arch/arm/config.h stable/9/gnu/usr.bin/gdb/arch/i386/config.h stable/9/gnu/usr.bin/gdb/arch/ia64/config.h stable/9/gnu/usr.bin/gdb/arch/mips/config.h stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h stable/9/gnu/usr.bin/gdb/gdb/Makefile stable/9/share/mk/bsd.crunchgen.mk stable/9/share/mk/bsd.lib.mk stable/9/share/mk/bsd.own.mk stable/9/share/mk/bsd.prog.mk stable/9/share/mk/sys.mk Directory Properties: stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/gnu/usr.bin/gdb/ (props changed) stable/9/share/mk/ (props changed) stable/9/tools/build/options/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/Makefile.inc1 Fri Jul 5 19:35:51 2013 (r252827) @@ -419,6 +419,13 @@ _worldtmp: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null ln -sf ${.CURDIR}/sys ${WORLDTMP} +.if ${MK_DEBUG_FILES} != "no" + # We could instead disable debug files for these build stages + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${WORLDTMP}/legacy/usr/lib >/dev/null + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${WORLDTMP}/usr/lib >/dev/null +.endif .if ${MK_BIND_LIBS} != "no" mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null @@ -504,6 +511,10 @@ build32: -p ${LIB32TMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${LIB32TMP}/usr/include >/dev/null +.if ${MK_DEBUG_FILES} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${LIB32TMP}/usr/lib >/dev/null +.endif mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} .if ${MK_KERBEROS} != "no" @@ -733,6 +744,10 @@ distributeworld installworld: installche -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null +.if ${MK_DEBUG_FILES} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null +.endif .if defined(NO_ROOT) ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ sed -e 's#^\./#./${dist}/#' >> ${METALOG} Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/etc/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -143,6 +143,9 @@ MTREE+= BIND.chroot.dist MTREE+= BIND.include.dist .endif .endif +.if ${MK_DEBUG_FILES} != "no" +MTREE+= BSD.debug.dist +.endif PPPCNF= ppp.conf @@ -309,6 +312,9 @@ MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ mtree/BSD.include.dist /usr/include +.if ${MK_DEBUG_FILES} != "no" +MTREES+= mtree/BSD.debug.dist /usr/lib +.endif .if ${MK_BIND_LIBS} != "no" MTREES+= mtree/BIND.include.dist /usr/include .endif Copied: stable/9/etc/mtree/BSD.debug.dist (from r251512, head/etc/mtree/BSD.debug.dist) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/etc/mtree/BSD.debug.dist Fri Jul 5 19:35:51 2013 (r252827, copy of r251512, head/etc/mtree/BSD.debug.dist) @@ -0,0 +1,48 @@ +# $FreeBSD$ +# +# Please see the file src/etc/mtree/README before making changes to this file. +# + +/set type=dir uname=root gname=wheel mode=0755 +. + debug + bin + .. + boot + .. + lib + geom + .. + .. + libexec + .. + sbin + .. + usr + bin + .. + games + .. + lib + engines + .. + .. + lib32 + .. + libexec + bsdinstall + .. + lpr + ru + .. + .. + sendmail + .. + sm.bin + .. + .. + sbin + .. + .. + .. +.. Modified: stable/9/etc/mtree/Makefile ============================================================================== --- stable/9/etc/mtree/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/etc/mtree/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -4,6 +4,7 @@ FILES= ${_BIND.chroot.dist} \ ${_BIND.include.dist} \ + ${_BSD.debug.dist} \ BSD.include.dist \ BSD.root.dist \ ${_BSD.sendmail.dist} \ @@ -16,6 +17,9 @@ _BIND.chroot.dist= BIND.chroot.dist _BIND.include.dist= BIND.include.dist .endif .endif +.if ${MK_DEBUG_FILES} != "no" +_BSD.debug.dist= BSD.debug.dist +.endif .if ${MK_GROFF} != "no" _BSD.groff.dist= BSD.groff.dist .endif Modified: stable/9/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- stable/9/gnu/usr.bin/gdb/Makefile.inc Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/Makefile.inc Fri Jul 5 19:35:51 2013 (r252827) @@ -37,6 +37,7 @@ GDB_CROSS_DEBUGGER= ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH} Modified: stable/9/gnu/usr.bin/gdb/arch/amd64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/amd64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/amd64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_i386_arch Modified: stable/9/gnu/usr.bin/gdb/arch/arm/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/arm/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/arm/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -451,9 +451,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_arm_arch Modified: stable/9/gnu/usr.bin/gdb/arch/i386/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/i386/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/i386/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_i386_arch Modified: stable/9/gnu/usr.bin/gdb/arch/ia64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/ia64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/ia64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_ia64_arch Modified: stable/9/gnu/usr.bin/gdb/arch/mips/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/mips/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/mips/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_mips_arch Modified: stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_rs6000_arch Modified: stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_rs6000_arch Modified: stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_sparc_arch Modified: stable/9/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- stable/9/gnu/usr.bin/gdb/gdb/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/gdb/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -15,3 +15,4 @@ DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LI LDADD= ${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex .include +CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: stable/9/share/mk/bsd.crunchgen.mk ============================================================================== --- stable/9/share/mk/bsd.crunchgen.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.crunchgen.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -44,6 +44,9 @@ CANONICALOBJDIR:= /usr/obj${.CURDIR} CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h +# Don't try to extract debug info from ${PROG}. +NO_DEBUG_FILES= + # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in $(CRUNCH_SRCDIRS) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.lib.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -43,6 +43,12 @@ CTFFLAGS+= -g STRIP?= -s .endif +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf*) +CFLAGS+= -g +CTFFLAGS+= -g +.endif + .include # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries @@ -113,12 +119,29 @@ PO_FLAG=-pg all: objwarn +.if defined(SHLIB_NAME) +.if ${MK_DEBUG_FILES} != "no" +SHLIB_NAME_FULL=${SHLIB_NAME}.full +# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory +.if ${SHLIBDIR} == "/boot" ||\ + ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ + ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib" +DEBUGFILEDIR=${DEBUGDIR}${SHLIBDIR} +.else +DEBUGFILEDIR=${SHLIBDIR}/.debug +DEBUGMKDIR= +.endif +.else +SHLIB_NAME_FULL=${SHLIB_NAME} +.endif +.endif + .include # Allow libraries to specify their own version map or have it # automatically generated (see bsd.symver.mk above). .if ${MK_SYMVER} == "yes" && !empty(VERSION_MAP) -${SHLIB_NAME}: ${VERSION_MAP} +${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif @@ -171,11 +194,12 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .endif .if target(beforelinking) -${SHLIB_NAME}: beforelinking +beforelinking: ${SOBJS} +${SHLIB_NAME_FULL}: beforelinking .endif -${SHLIB_NAME}: ${SOBJS} +${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} - @rm -f ${.TARGET} ${SHLIB_LINK} + @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif @@ -191,6 +215,16 @@ ${SHLIB_NAME}: ${SOBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif + +.if ${MK_DEBUG_FILES} != "no" +CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ + ${SHLIB_NAME_FULL} ${.TARGET} + +${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} + ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" @@ -267,6 +301,14 @@ _libinstall: ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} +.if ${MK_DEBUG_FILES} != "no" +.if defined(DEBUGMKDIR) + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} +.endif + ${INSTALL} -T debug -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ + ${_INSTALLFLAGS} \ + ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} +.endif .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.own.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -43,6 +43,11 @@ # LIBMODE Library mode. [${NOBINMODE}] # # +# DEBUGDIR Base path for standalone debug files. [/usr/lib/debug] +# +# DEBUGMODE Mode for debug files. [${NOBINMODE}] +# +# # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/kernel] # @@ -147,6 +152,9 @@ LIBOWN?= ${BINOWN} LIBGRP?= ${BINGRP} LIBMODE?= ${NOBINMODE} +DEBUGDIR?= /usr/lib/debug +DEBUGMODE?= ${NOBINMODE} + # Share files SHAREDIR?= /usr/share @@ -213,6 +221,7 @@ COMPRESS_EXT?= .gz # .for var in \ CTF \ + DEBUG_FILES \ INSTALLLIB \ MAN \ PROFILE @@ -434,6 +443,8 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CLANG_IS_CC \ CTF \ + DEBUG_FILES \ + GPL_DTC \ HESIOD \ ICONV \ IDEA \ Modified: stable/9/share/mk/bsd.prog.mk ============================================================================== --- stable/9/share/mk/bsd.prog.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.prog.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -24,8 +24,24 @@ CTFFLAGS+= -g .endif .endif +.if defined(PROG_CXX) +PROG= ${PROG_CXX} +.endif + +.if defined(PROG) && target(${PROG}) +MK_DEBUG_FILES= no +.elif !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static) +MK_DEBUG_FILES= no +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} +.else +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf-*) +CFLAGS+= -g +CTFFLAGS+= -g +.endif .endif .if !defined(DEBUG_FLAGS) @@ -36,20 +52,36 @@ STRIP?= -s LDFLAGS+= -static .endif -.if defined(PROG_CXX) -PROG= ${PROG_CXX} +.if ${MK_DEBUG_FILES} != "no" +PROG_FULL=${PROG}.full +# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory +.if defined(BINDIR) && (\ + ${BINDIR} == "/bin" ||\ + ${BINDIR} == "/libexec" ||\ + ${BINDIR} == "/sbin" ||\ + ${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\ + ) +DEBUGFILEDIR= ${DEBUGDIR}${BINDIR} +.else +DEBUGFILEDIR?= ${BINDIR}/.debug +DEBUGMKDIR= +.endif +.else +PROG_FULL= ${PROG} .endif .if defined(PROG) PROGNAME?= ${PROG} + .if defined(SRCS) OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: beforelinking +beforelinking: ${OBJS} +${PROG_FULL}: beforelinking .endif -${PROG}: ${OBJS} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,9 +108,10 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: beforelinking +beforelinking: ${OBJS} +${PROG_FULL}: beforelinking .endif -${PROG}: ${OBJS} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -87,10 +120,19 @@ ${PROG}: ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif -.endif +.endif # !target(${PROG}) .endif # !defined(SRCS) +.if ${MK_DEBUG_FILES} != "no" +${PROG}: ${PROG_FULL} ${PROGNAME}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ + ${PROG_FULL} ${.TARGET} + +${PROGNAME}.debug: ${PROG_FULL} + ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} +.endif + .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ @@ -107,6 +149,9 @@ all: _manpages .if defined(PROG) CLEANFILES+= ${PROG} +.if ${MK_DEBUG_FILES} != "no" +CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug +.endif .endif .if defined(OBJS) @@ -154,6 +199,13 @@ _proginstall: .if defined(PROG) ${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} +.if ${MK_DEBUG_FILES} != "no" +.if defined(DEBUGMKDIR) + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} +.endif + ${INSTALL} -T debug -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ + ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug +.endif .endif .endif # !target(realinstall) Modified: stable/9/share/mk/sys.mk ============================================================================== --- stable/9/share/mk/sys.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/sys.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -130,6 +130,8 @@ MAKE ?= make OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import +OBJCOPY ?= objcopy + PC ?= pc PFLAGS ?= Copied: stable/9/tools/build/options/WITH_DEBUG_FILES (from r251512, head/tools/build/options/WITH_DEBUG_FILES) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_DEBUG_FILES Fri Jul 5 19:35:51 2013 (r252827, copy of r251512, head/tools/build/options/WITH_DEBUG_FILES) @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Set to strip debug info into a separate file for each executable binary +and shared library. +The debug files will be placed in a subdirectory of +.Pa /usr/lib/debug +and are located automatically by +.Xr gdb 1 . From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:36:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48C44D9; Fri, 5 Jul 2013 19:36:36 +0000 (UTC) (envelope-from andre@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 3A25F1F37; Fri, 5 Jul 2013 19:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JaaBv051937; Fri, 5 Jul 2013 19:36:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JaZOj051931; Fri, 5 Jul 2013 19:36:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051936.r65JaZOj051931@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:36: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: r252828 - in stable/9/sys: dev/bce dev/bxe net netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:36:36 -0000 Author: andre Date: Fri Jul 5 19:36:34 2013 New Revision: 252828 URL: http://svnweb.freebsd.org/changeset/base/252828 Log: MFC r243624: Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability. Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari Note that the definition of CSUM_IP_FRAGS is left in mbuf.h to allow for stable branch source compatibility. Modified: stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/net/if_vlan.c stable/9/sys/netinet/ip_output.c stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/dev/bce/if_bce.c Fri Jul 5 19:36:34 2013 (r252828) @@ -9798,7 +9798,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", mp->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/dev/bxe/if_bxe.c Fri Jul 5 19:36:34 2013 (r252828) @@ -16276,7 +16276,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc, "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", m->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/net/if_vlan.c Fri Jul 5 19:36:34 2013 (r252828) @@ -1491,7 +1491,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: stable/9/sys/netinet/ip_output.c ============================================================================== --- stable/9/sys/netinet/ip_output.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/netinet/ip_output.c Fri Jul 5 19:36:34 2013 (r252828) @@ -719,14 +719,12 @@ ip_fragment(struct ip *ip, struct mbuf * * If the interface will not calculate checksums on * fragmented packets, then do it here. */ - if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP - if (m0->m_pkthdr.csum_flags & CSUM_SCTP && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/sys/mbuf.h Fri Jul 5 19:36:34 2013 (r252828) @@ -279,7 +279,7 @@ struct mbuf { #define CSUM_IP 0x0001 /* will csum IP */ #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ -#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ +#define CSUM_IP_FRAGS 0x0008 /* removed, left for compat */ #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:38:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37173429; Fri, 5 Jul 2013 19:38:58 +0000 (UTC) (envelope-from trociny@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 1943E1F5C; Fri, 5 Jul 2013 19:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Jcv5o052236; Fri, 5 Jul 2013 19:38:57 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JcvQY052235; Fri, 5 Jul 2013 19:38:57 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051938.r65JcvQY052235@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 19:38: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: r252829 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:38:58 -0000 Author: trociny Date: Fri Jul 5 19:38:57 2013 New Revision: 252829 URL: http://svnweb.freebsd.org/changeset/base/252829 Log: MFC r252313, r252349, 252436: To avoid LOR, drop the filedesc lock in export_fd_to_sb(), before writing to sbuf. MFC r252351 (mjg): Remove duplicate NULL check in kern_proc_filedesc_out. No functional changes. Modified: stable/9/sys/kern/kern_descrip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Fri Jul 5 19:36:34 2013 (r252828) +++ stable/9/sys/kern/kern_descrip.c Fri Jul 5 19:38:57 2013 (r252829) @@ -3262,10 +3262,17 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif +struct export_fd_buf { + struct filedesc *fdp; + struct sbuf *sb; + ssize_t remainder; + struct kinfo_file kif; +}; + static int export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, int64_t offset, int fd_is_cap, cap_rights_t fd_cap_rights, - struct kinfo_file *kif, struct sbuf *sb, ssize_t *remainder) + struct export_fd_buf *efbuf) { struct { int fflag; @@ -3288,16 +3295,23 @@ export_fd_to_sb(void *data, int type, in { O_TRUNC, KF_FLAG_TRUNC } }; #define NFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table)) + struct kinfo_file *kif; struct vnode *vp; - int error, vfslocked; + int error, locked, vfslocked; unsigned int i; - if (*remainder == 0) + if (efbuf->remainder == 0) return (0); + kif = &efbuf->kif; bzero(kif, sizeof(*kif)); + locked = efbuf->fdp != NULL; switch (type) { case KF_TYPE_FIFO: case KF_TYPE_VNODE: + if (locked) { + FILEDESC_SUNLOCK(efbuf->fdp); + locked = 0; + } vp = (struct vnode *)data; error = fill_vnode_info(vp, kif); vfslocked = VFS_LOCK_GIANT(vp->v_mount); @@ -3346,15 +3360,21 @@ export_fd_to_sb(void *data, int type, in kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); - if (*remainder != -1) { - if (*remainder < kif->kf_structsize) { + if (efbuf->remainder != -1) { + if (efbuf->remainder < kif->kf_structsize) { /* Terminate export. */ - *remainder = 0; + efbuf->remainder = 0; + if (efbuf->fdp != NULL && !locked) + FILEDESC_SLOCK(efbuf->fdp); return (0); } - *remainder -= kif->kf_structsize; + efbuf->remainder -= kif->kf_structsize; } - error = sbuf_bcat(sb, kif, kif->kf_structsize); + if (locked) + FILEDESC_SUNLOCK(efbuf->fdp); + error = sbuf_bcat(efbuf->sb, kif, kif->kf_structsize); + if (efbuf->fdp != NULL) + FILEDESC_SLOCK(efbuf->fdp); return (error); } @@ -3368,18 +3388,16 @@ kern_proc_filedesc_out(struct proc *p, { struct file *fp; struct filedesc *fdp; - struct kinfo_file *kif; + struct export_fd_buf *efbuf; struct vnode *cttyvp, *textvp, *tracevp; int64_t offset; void *data; - ssize_t remainder; int error, i; int fd_is_cap, type, refcnt, fflags; cap_rights_t fd_cap_rights; PROC_LOCK_ASSERT(p, MA_OWNED); - remainder = maxlen; /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) @@ -3397,46 +3415,44 @@ kern_proc_filedesc_out(struct proc *p, } fdp = fdhold(p); PROC_UNLOCK(p); - kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); + efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK); + efbuf->fdp = NULL; + efbuf->sb = sb; + efbuf->remainder = maxlen; if (tracevp != NULL) export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); + FREAD | FWRITE, -1, -1, 0, 0, efbuf); if (textvp != NULL) export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); + FREAD, -1, -1, 0, 0, efbuf); if (cttyvp != NULL) export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); + FREAD | FWRITE, -1, -1, 0, 0, efbuf); error = 0; if (fdp == NULL) goto fail; + efbuf->fdp = fdp; FILEDESC_SLOCK(fdp); /* working directory */ if (fdp->fd_cdir != NULL) { vref(fdp->fd_cdir); data = fdp->fd_cdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } /* root directory */ if (fdp->fd_rdir != NULL) { vref(fdp->fd_rdir); data = fdp->fd_rdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } /* jail directory */ if (fdp->fd_jdir != NULL) { vref(fdp->fd_jdir); data = fdp->fd_jdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } for (i = 0; i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i]) == NULL) @@ -3531,20 +3547,15 @@ kern_proc_filedesc_out(struct proc *p, * re-validate and re-evaluate its properties when * the loop continues. */ - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SUNLOCK(fdp); error = export_fd_to_sb(data, type, i, fflags, refcnt, - offset, fd_is_cap, fd_cap_rights, kif, sb, &remainder); - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SLOCK(fdp); + offset, fd_is_cap, fd_cap_rights, efbuf); if (error) break; } FILEDESC_SUNLOCK(fdp); + fddrop(fdp); fail: - if (fdp != NULL) - fddrop(fdp); - free(kif, M_TEMP); + free(efbuf, M_TEMP); return (error); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:39:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D36C655C; Fri, 5 Jul 2013 19:39:19 +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 A95271F63; Fri, 5 Jul 2013 19:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JdJLU052333; Fri, 5 Jul 2013 19:39:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JdJKG052332; Fri, 5 Jul 2013 19:39:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051939.r65JdJKG052332@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:39: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: r252830 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:39:19 -0000 Author: emaste Date: Fri Jul 5 19:39:19 2013 New Revision: 252830 URL: http://svnweb.freebsd.org/changeset/base/252830 Log: Undo accidental MFC of GPL_DTC in r252827 Modified: stable/9/share/mk/bsd.own.mk Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Fri Jul 5 19:38:57 2013 (r252829) +++ stable/9/share/mk/bsd.own.mk Fri Jul 5 19:39:19 2013 (r252830) @@ -444,7 +444,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_IS_CC \ CTF \ DEBUG_FILES \ - GPL_DTC \ HESIOD \ ICONV \ IDEA \ From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:43:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A67E86FD; Fri, 5 Jul 2013 19:43:33 +0000 (UTC) (envelope-from andre@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 7D2121F8A; Fri, 5 Jul 2013 19:43:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JhX4V054470; Fri, 5 Jul 2013 19:43:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JhXbd054469; Fri, 5 Jul 2013 19:43:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051943.r65JhXbd054469@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:43: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: r252831 - stable/9/sys/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:43:33 -0000 Author: andre Date: Fri Jul 5 19:43:33 2013 New Revision: 252831 URL: http://svnweb.freebsd.org/changeset/base/252831 Log: MFC r241724: Remove splimp() comment from sysinit table and attribute SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END to VNET related initializations. Modified: stable/9/sys/sys/kernel.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/kernel.h ============================================================================== --- stable/9/sys/sys/kernel.h Fri Jul 5 19:39:19 2013 (r252830) +++ stable/9/sys/sys/kernel.h Fri Jul 5 19:43:33 2013 (r252831) @@ -84,12 +84,6 @@ extern volatile int ticks; * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent * order to support porting. - * - * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of - * initializations to take place at splimp(). This is a historical - * wart that should be removed -- probably running everything at - * splimp() until the first init that doesn't want it is the correct - * fix. They are currently present to ensure historical behavior. */ enum sysinit_sub_id { SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/ @@ -147,12 +141,12 @@ enum sysinit_sub_id { SI_SUB_P1003_1B = 0x6E00000, /* P1003.1B realtime */ SI_SUB_PSEUDO = 0x7000000, /* pseudo devices*/ SI_SUB_EXEC = 0x7400000, /* execve() handlers */ - SI_SUB_PROTO_BEGIN = 0x8000000, /* XXX: set splimp (kludge)*/ + SI_SUB_PROTO_BEGIN = 0x8000000, /* VNET initialization */ SI_SUB_PROTO_IF = 0x8400000, /* interfaces*/ SI_SUB_PROTO_DOMAININIT = 0x8600000, /* domain registration system */ SI_SUB_PROTO_DOMAIN = 0x8800000, /* domains (address families?)*/ SI_SUB_PROTO_IFATTACHDOMAIN = 0x8800001, /* domain dependent data init*/ - SI_SUB_PROTO_END = 0x8ffffff, /* XXX: set splx (kludge)*/ + SI_SUB_PROTO_END = 0x8ffffff, /* VNET helper functions */ SI_SUB_KPROF = 0x9000000, /* kernel profiling*/ SI_SUB_KICK_SCHEDULER = 0xa000000, /* start the timeout events*/ SI_SUB_INT_CONFIG_HOOKS = 0xa800000, /* Interrupts enabled config */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:45:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B23C491C; Fri, 5 Jul 2013 19:45:16 +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 A3F9D1F9E; Fri, 5 Jul 2013 19:45:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JjGYH054918; Fri, 5 Jul 2013 19:45:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JjG6Y054917; Fri, 5 Jul 2013 19:45:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051945.r65JjG6Y054917@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:45:16 +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: r252832 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:45:16 -0000 Author: emaste Date: Fri Jul 5 19:45:16 2013 New Revision: 252832 URL: http://svnweb.freebsd.org/changeset/base/252832 Log: Regenerate after r252827 Modified: stable/9/share/man/man5/src.conf.5 Modified: stable/9/share/man/man5/src.conf.5 ============================================================================== --- stable/9/share/man/man5/src.conf.5 Fri Jul 5 19:43:33 2013 (r252831) +++ stable/9/share/man/man5/src.conf.5 Fri Jul 5 19:45:16 2013 (r252832) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/9/tools/build/options/makeman 236430 2012-06-02 02:26:37Z gjb +.\" from FreeBSD: stable/9/tools/build/options/makeman 252812 2013-07-05 17:57:25Z emaste .\" $FreeBSD$ -.Dd March 1, 2013 +.Dd July 5, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -372,6 +372,14 @@ When set, it also enforces the following .It .Va WITHOUT_GROFF .El +.It Va WITH_DEBUG_FILES +.\" from FreeBSD: stable/9/tools/build/options/WITH_DEBUG_FILES 252827 2013-07-05 19:35:51Z emaste +Set to strip debug info into a separate file for each executable binary +and shared library. +The debug files will be placed in a subdirectory of +.Pa /usr/lib/debug +and are located automatically by +.Xr gdb 1 . .It Va WITHOUT_DICT .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 19:57:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 86578C99; Fri, 5 Jul 2013 19:57:41 +0000 (UTC) (envelope-from dteske@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 5E172101B; Fri, 5 Jul 2013 19:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JvfCi058108; Fri, 5 Jul 2013 19:57:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JvfZA058106; Fri, 5 Jul 2013 19:57:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307051957.r65JvfZA058106@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 19:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252833 - in head/usr.sbin/bsdconfig: . share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 19:57:41 -0000 Author: dteske Date: Fri Jul 5 19:57:40 2013 New Revision: 252833 URL: http://svnweb.freebsd.org/changeset/base/252833 Log: Don't calculate the tag until we know that we're going to make a new menu item entry. Also join simple NULL assignments into a single line. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 19:45:16 2013 (r252832) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 19:57:40 2013 (r252833) @@ -170,11 +170,8 @@ dialog_menu_main() local menuitem menu_title menu_help menu_selection index=2 for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do [ $index -lt ${#DIALOG_MENU_TAGS} ] || break - tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) - menu_program= - menu_title= - menu_help= + menu_program= menu_title= menu_help= f_include_lang $BSDCFG_LIBE/$menuitem/INDEX [ "$menu_program" ] || continue @@ -183,9 +180,11 @@ dialog_menu_main() *) menu_program="$menuitem/$menu_program" esac + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + setvar "menu_program$tag" "$menu_program" + f_shell_escape "$menu_title" menu_title f_shell_escape "$menu_help" menu_help - setvar "menu_program$tag" "$menu_program" menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" index=$(( $index + 1 )) Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 19:45:16 2013 (r252832) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 19:57:40 2013 (r252833) @@ -531,12 +531,22 @@ f_index_file() if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && - return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return + + # No match? Fall-thru to `local' libexec sources (add-on modules) + + [ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE + if [ "$lang" ]; then + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return + # No match, fall-thru to non-i18n sources + fi + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX } # f_index_menusel_keyword $indexfile $pgm From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:01:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3F2DE0C; Fri, 5 Jul 2013 20:01:07 +0000 (UTC) (envelope-from dteske@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 A56EB1047; Fri, 5 Jul 2013 20:01:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65K17oN060409; Fri, 5 Jul 2013 20:01:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65K1746060408; Fri, 5 Jul 2013 20:01:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052001.r65K1746060408@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 20:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252834 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:01:07 -0000 Author: dteske Date: Fri Jul 5 20:01:07 2013 New Revision: 252834 URL: http://svnweb.freebsd.org/changeset/base/252834 Log: Oops, r252833 was not supposed to touch this file. Back-out and recommit this file with the rest of the files it was supposed to go with. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 19:57:40 2013 (r252833) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 20:01:07 2013 (r252834) @@ -531,22 +531,12 @@ f_index_file() if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && + return # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return - - # No match? Fall-thru to `local' libexec sources (add-on modules) - - [ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE - if [ "$lang" ]; then - awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return - # No match, fall-thru to non-i18n sources - fi - awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LOCAL_LIBE/*/INDEX + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX } # f_index_menusel_keyword $indexfile $pgm From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:11:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC20210D; Fri, 5 Jul 2013 20:11:28 +0000 (UTC) (envelope-from andre@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 AD7A01098; Fri, 5 Jul 2013 20:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KBSAh063758; Fri, 5 Jul 2013 20:11:28 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KBRCG063754; Fri, 5 Jul 2013 20:11:27 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307052011.r65KBRCG063754@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 20:11: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: r252835 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:11:28 -0000 Author: andre Date: Fri Jul 5 20:11:27 2013 New Revision: 252835 URL: http://svnweb.freebsd.org/changeset/base/252835 Log: MFC r226433: Update the comment and description of tcp_sendspace and tcp_recvspace to better reflect their purpose. MFC r226437: VNET virtualize tcp_sendspace/tcp_recvspace and change the type to INT. A long is not necessary as the TCP window is limited to 2**30. A larger initial window isn't useful. MFC r226448: Move the tcp_sendspace and tcp_recvspace sysctl's from the middle of tcp_usrreq.c to the top of tcp_output.c and tcp_input.c respectively next to the socket buffer autosizing controls. MFC r227034: Restore sysctl names for tcp_sendspace/tcp_recvspace. They seem to be changed unintentionally in r226437, and there were no any mentions of renaming in commit log message. Reported by: Anton Yuzhaninov Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_usrreq.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_insecure_rst), 0, "Follow the old (insecure) criteria for accepting RST packets"); +VNET_DEFINE(int, tcp_recvspace) = 1024*64 +#define V_tcp_recvspace VNET(tcp_recvspace) +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); + VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, @@ -3590,7 +3595,7 @@ tcp_mss(struct tcpcb *tp, int offer) */ so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd); - if ((so->so_snd.sb_hiwat == tcp_sendspace) && metrics.rmx_sendpipe) + if ((so->so_snd.sb_hiwat == V_tcp_sendspace) && metrics.rmx_sendpipe) bufsize = metrics.rmx_sendpipe; else bufsize = so->so_snd.sb_hiwat; @@ -3607,7 +3612,7 @@ tcp_mss(struct tcpcb *tp, int offer) tp->t_maxseg = mss; SOCKBUF_LOCK(&so->so_rcv); - if ((so->so_rcv.sb_hiwat == tcp_recvspace) && metrics.rmx_recvpipe) + if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe) bufsize = metrics.rmx_recvpipe; else bufsize = so->so_rcv.sb_hiwat; Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 20:11:27 2013 (r252835) @@ -98,6 +98,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); +VNET_DEFINE(int, tcp_sendspace) = 1024*32; +#define V_tcp_sendspace VNET(tcp_sendspace) +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW, + &VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size"); + VNET_DEFINE(int, tcp_do_autosndbuf) = 1; #define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, Modified: stable/9/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/9/sys/netinet/tcp_usrreq.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_usrreq.c Fri Jul 5 20:11:27 2013 (r252835) @@ -1597,18 +1597,6 @@ unlock_and_done: #undef INP_WLOCK_RECHECK /* - * tcp_sendspace and tcp_recvspace are the default send and receive window - * sizes, respectively. These are obsolescent (this information should - * be set by the route). - */ -u_long tcp_sendspace = 1024*32; -SYSCTL_ULONG(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW, - &tcp_sendspace , 0, "Maximum outgoing TCP datagram size"); -u_long tcp_recvspace = 1024*64; -SYSCTL_ULONG(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, - &tcp_recvspace , 0, "Maximum incoming TCP datagram size"); - -/* * Attach TCP protocol to socket, allocating * internet protocol control block, tcp control block, * bufer space, and entering LISTEN state if to accept connections. @@ -1621,7 +1609,7 @@ tcp_attach(struct socket *so) int error; if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { - error = soreserve(so, tcp_sendspace, tcp_recvspace); + error = soreserve(so, V_tcp_sendspace, V_tcp_recvspace); if (error) return (error); } Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 20:11:27 2013 (r252835) @@ -623,6 +623,8 @@ VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); VNET_DECLARE(int, tcp_do_initcwnd10); +VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); @@ -634,6 +636,8 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) +#define V_tcp_sendspace VNET(tcp_sendspace) +#define V_tcp_recvspace VNET(tcp_recvspace) #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) @@ -731,8 +735,6 @@ void tcp_hc_updatemtu(struct in_conninf void tcp_hc_update(struct in_conninfo *, struct hc_metrics_lite *); extern struct pr_usrreqs tcp_usrreqs; -extern u_long tcp_sendspace; -extern u_long tcp_recvspace; tcp_seq tcp_new_isn(struct tcpcb *); void tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:13:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6ADE9330; Fri, 5 Jul 2013 20:13:01 +0000 (UTC) (envelope-from dteske@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 5C33F10AF; Fri, 5 Jul 2013 20:13:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KD1Nu064054; Fri, 5 Jul 2013 20:13:01 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KD1BX064045; Fri, 5 Jul 2013 20:13:01 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052013.r65KD1BX064045@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 20:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252836 - in head/usr.sbin/bsdconfig: . share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:13:01 -0000 Author: dteske Date: Fri Jul 5 20:13:00 2013 New Revision: 252836 URL: http://svnweb.freebsd.org/changeset/base/252836 Log: Add support for processing add-on modules from /usr/local/libexec/bsdconfig (this is designed to allow new modules to be installed via ports/packages). To prevent conflict with itself (sysutils/bsdconfig) as a port (which installs its base modules to the above directory, it was long-ago decided that so-called `base' modules would look different than now-defined `add-on' modules. The structure of the contents for each is the same, but the naming convention for the module directory must be different. Base modules are named `[0-9][0-9][0-9].*' to allow SysV-style organization while add-on modules must avoid this naming style and are simply listed in alphabetical order by their module directory. For example, a hypothetical port named `bsdconfig-jails' could install /usr/local/libexec/bsdconfig/jails and provide `bsdconfig jails' as well as a new menu entry in the main-menu. Add-on modules are listed in the main-menu (when bsdconfig is executed with- out arguments) below a separator after the last base-module. In `bsdconfig -h' output, add-on modules are listed right alongside base modules (sorted alphabetically in columnar fashion; left-to-right). If a base module declares a keyword used by an add-on module, the base module will always win when given `bsdconfig keyword' syntax. Add-on modules should avoid declaring any keyword found in `script.subr' as a reserved-word (`Resword') since bsdconfig also supports `bsdconfig resword' as a fall-back if no keyword is found to be declared by any module. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 20:11:27 2013 (r252835) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 20:13:00 2013 (r252836) @@ -57,6 +57,13 @@ f_include_lang $BSDCFG_LIBE/include/mess BSDCONFIG_HELPFILE=$BSDCFG_LIBE/include/bsdconfig.hlp USAGE_HELPFILE=$BSDCFG_LIBE/include/usage.hlp +############################################################ CONFIGURATION + +# +# Alternate `local' libexec directory for add-on modules (e.g., from ports) +# +BSDCFG_LOCAL_LIBE="/usr/local/libexec/bsdconfig" + ############################################################ FUNCTIONS # usage @@ -83,6 +90,27 @@ usage() }' */$index | sort ) + local alt_cmd_list # Calculated below (if $BSDCFG_LOCAL_LIBE exists) + if f_quietly cd $BSDCFG_LOCAL_LIBE; then + # No need to preserve CWD (headed toward exit) + + # Test for language-specific indices + f_quietly ls */"$index.${LANG:-$LC_ALL}" && + index="$index.${LANG:-$LC_ALL}" + + alt_cmd_list=$( + awk '/^menu_selection="/ { + sub(/\|.*/, "") + sub(/^menu_selection="/, "") + print + }' */$index 2> /dev/null | sort + ) + + # Conflate lists, removing duplicates + cmd_list=$( printf "%s\n%s\n" \ + "$cmd_list" "$alt_cmd_list" | sort -u ) + fi + # # Determine the longest command-length (in characters) # @@ -167,6 +195,9 @@ dialog_menu_main() local defaultitem= # Calculated below local hline= + # + # Pick up the base modules (directories named `[0-9][0-9][0-9].*') + # local menuitem menu_title menu_help menu_selection index=2 for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do [ $index -lt ${#DIALOG_MENU_TAGS} ] || break @@ -190,6 +221,49 @@ dialog_menu_main() index=$(( $index + 1 )) done + # + # Process the `local' libexec sources. + # + # Whereas modules in $BSDCFG_LIBE must be named [0-9][0-9][0-9].* + # modules in $BSDCFG_LOCAL_LIBE should NOT be named this way (making it + # more practical for port-maintainers). + # + # This also has the fortunate side-effect of making the de-duplication + # effort rather simple (because so-called `base' modules must be named + # differently than add-on modules). + # + local separator_added= + for menuitem in $( cd "$BSDCFG_LOCAL_LIBE" 2> /dev/null && ls -d * ) + do + [ $index -lt ${#DIALOG_MENU_TAGS} ] || break + + # Skip the module if it looks like a `base' module + case "$menuitem" in [0-9][0-9][0-9].*) continue;; esac + + menu_program= menu_title= menu_help= + f_include_lang $BSDCFG_LOCAL_LIBE/$menuitem/INDEX || continue + [ "$menu_program" ] || continue + + if [ ! "$separator_added" ]; then + menu_list="$menu_list '-' '-' ''" + separator_added=1 + fi + + case "$menu_program" in + /*) : already fully qualified ;; + *) menu_program="$BSDCFG_LOCAL_LIBE/$menuitem/$menu_program" + esac + + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + setvar "menu_program$tag" "$menu_program" + + f_shell_escape "$menu_title" menu_title + f_shell_escape "$menu_help" menu_help + menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" + + index=$(( $index + 1 )) + done + local height width rows eval f_dialog_menu_with_help_size height width rows \ \"\$title\" \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 20:11:27 2013 (r252835) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Jul 5 20:13:00 2013 (r252836) @@ -531,12 +531,22 @@ f_index_file() if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && - return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return + + # No match? Fall-thru to `local' libexec sources (add-on modules) + + [ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE + if [ "$lang" ]; then + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return + # No match, fall-thru to non-i18n sources + fi + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX } # f_index_menusel_keyword $indexfile $pgm From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:22:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85057648; Fri, 5 Jul 2013 20:22:00 +0000 (UTC) (envelope-from andrew@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 5CFF410FB; Fri, 5 Jul 2013 20:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KM0Rl066873; Fri, 5 Jul 2013 20:22:00 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KM0PH066872; Fri, 5 Jul 2013 20:22:00 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307052022.r65KM0PH066872@svn.freebsd.org> From: Andrew Turner Date: Fri, 5 Jul 2013 20:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252837 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:22:00 -0000 Author: andrew Date: Fri Jul 5 20:21:59 2013 New Revision: 252837 URL: http://svnweb.freebsd.org/changeset/base/252837 Log: Fix the build with gcc. Gcc outputs pre-UAL asm and expects the ldcl instruction with a condition in the form ldcl, where the code produces the instruction in the UAL form ldcl. Work around this by checking if we are using clang or gcc and adjusting the instruction. While here correct the cmp instruction's value to include the # before the immediate value. Modified: head/sys/arm/arm/vfp.c Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Fri Jul 5 20:13:00 2013 (r252836) +++ head/sys/arm/arm/vfp.c Fri Jul 5 20:21:59 2013 (r252837) @@ -195,10 +195,23 @@ vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; + /* + * Work around an issue with GCC where the asm it generates is + * not unified syntax and fails to assemble because it expects + * the ldcleq instruction in the form ldcl, not in the UAL + * form ldcl, and similar for stcleq. + */ +#ifdef __clang__ +#define ldcleq "ldcleq" +#define stcleq "stcleq" +#else +#define ldcleq "ldceql" +#define stcleq "stceql" +#endif if (vfpsave) { __asm __volatile("ldc p10, c0, [%0], #128\n" /* d0-d15 */ - "cmp %0, 0\n" /* -D16 or -D32? */ - "ldcleq p11, c0, [%0], #128\n" /* d16-d31 */ + "cmp %0, #0\n" /* -D16 or -D32? */ + ldcleq" p11, c0, [%0], #128\n" /* d16-d31 */ "addne %0, %0, #128\n" /* skip missing regs */ "ldr %1, [%0]\n" /* set old vfpscr */ "mcr p10, 7, %1, cr1, c0, 0\n" @@ -225,13 +238,16 @@ vfp_store(struct vfp_state *vfpsave) tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ if (vfpsave && tmp & VFPEXC_EN) { __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ - "cmp %0, 0\n" /* -D16 or -D32? */ - "stcleq p11, c0, [%1], #128\n" /* d16-d31 */ + "cmp %0, #0\n" /* -D16 or -D32? */ + stcleq" p11, c0, [%1], #128\n" /* d16-d31 */ "addne %1, %1, #128\n" /* skip missing regs */ "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ "str %0, [%1]\n" /* save vfpscr */ : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); } +#undef ldcleq +#undef stcleq + #ifndef SMP /* eventually we will use this information for UP also */ PCPU_SET(vfpcthread, 0); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:24:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7037E7FB; Fri, 5 Jul 2013 20:24:51 +0000 (UTC) (envelope-from jilles@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 614BA1133; Fri, 5 Jul 2013 20:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KOpjm067220; Fri, 5 Jul 2013 20:24:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KOpx1067219; Fri, 5 Jul 2013 20:24:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307052024.r65KOpx1067219@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 5 Jul 2013 20:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252838 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:24:51 -0000 Author: jilles Date: Fri Jul 5 20:24:50 2013 New Revision: 252838 URL: http://svnweb.freebsd.org/changeset/base/252838 Log: mktemp(3): Add standards section. Prefer standard header. mktemp(), mkstemp() and mkdtemp() are available in standard and also in . Encourage use of the former by listing it in the synopsis. Modified: head/lib/libc/stdio/mktemp.3 Modified: head/lib/libc/stdio/mktemp.3 ============================================================================== --- head/lib/libc/stdio/mktemp.3 Fri Jul 5 20:21:59 2013 (r252837) +++ head/lib/libc/stdio/mktemp.3 Fri Jul 5 20:24:50 2013 (r252838) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 4, 2012 +.Dd July 5, 2013 .Dt MKTEMP 3 .Os .Sh NAME @@ -37,15 +37,16 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In stdlib.h .Ft char * .Fn mktemp "char *template" .Ft int .Fn mkstemp "char *template" -.Ft int -.Fn mkstemps "char *template" "int suffixlen" .Ft char * .Fn mkdtemp "char *template" +.In unistd.h +.Ft int +.Fn mkstemps "char *template" "int suffixlen" .Sh DESCRIPTION The .Fn mktemp @@ -180,12 +181,36 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. +.Pp +The +.Fn mkdtemp , +.Fn mkstemp +and +.Fn mktemp +function prototypes are also available from +.In unistd.h . .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , .Xr mkdir 2 , .Xr open 2 , .Xr stat 2 +.Sh STANDARDS +The +.Fn mkstemp +and +.Fn mkdtemp +functions are expected to conform to +.St -p1003.1-2008 . +The +.Fn mktemp +function is expected to conform to +.St -p1003.1-2001 +and is not specified by +.St -p1003.1-2008 . +The +.Fn mkstemps +function does not conform to any standard. .Sh HISTORY A .Fn mktemp From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:37:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 99BA4B57; Fri, 5 Jul 2013 20:37:00 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [IPv6:2a00:1450:4010:c04::235]) by mx1.freebsd.org (Postfix) with ESMTP id 87EB711C8; Fri, 5 Jul 2013 20:36:59 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id w10so2312429lbi.40 for ; Fri, 05 Jul 2013 13:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=PvkIZwE0iru+nZu+Pgo52VYnLF5L4t1/sejWrvy/+FE=; b=lKHkloMWFg0YiIt4rWUaEBlp9ycUYLY1sJ58K2aUFfm3F2y2pg/5LAHGUdS2sW+cRh x9TQORgb0sQ+6TLBjpNMFA2EFSTdlLVyjlwUKVcD//+Vcg1nIwVQmd3JzFCwQFJEhv5V HPULEmjKEvEhrRTxzQtECyk4mwE91CB/kgdvqTnhrCp7bbVpq1yo4T6Hwn0dSXhNa+C9 dRKw1DE2bY1VF7h/gDSYPM5/Lxj+HtMyDccOpbaFSMys79tLgUauD4Rnb9vVI+JZsCUS JUIMb29Q4bK6+mVc8VWsJ5EGKKlpf0uMAsS7xNbCBQW+8RnOhVOePOl+Nfb05AocMlyF 1WAw== MIME-Version: 1.0 X-Received: by 10.112.51.99 with SMTP id j3mr6146798lbo.82.1373056618388; Fri, 05 Jul 2013 13:36:58 -0700 (PDT) Sender: nparhar@gmail.com Received: by 10.114.71.146 with HTTP; Fri, 5 Jul 2013 13:36:58 -0700 (PDT) In-Reply-To: <201307012221.r61MLhaM079236@svn.freebsd.org> References: <201307012221.r61MLhaM079236@svn.freebsd.org> Date: Fri, 5 Jul 2013 13:36:58 -0700 X-Google-Sender-Auth: 80x9oBSr3vx6E5plsL7TZyu6MUM Message-ID: Subject: Re: svn commit: r252491 - head/sys/modules From: Navdeep Parhar To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:37:00 -0000 This is a bit excessive. A better option would be to disconnect just the firmware based on the SOURCELESS flag. cxgbe(4) can be built and will work just fine without its firmware. The firmware is bundled with the driver just in case the one already on the card (every card has a firmware on it) is out of date. Regards, Navdeep On Mon, Jul 1, 2013 at 3:21 PM, Robert Millan wrote: > Author: rmh > Date: Mon Jul 1 22:21:42 2013 > New Revision: 252491 > URL: http://svnweb.freebsd.org/changeset/base/252491 > > Log: > Wrap cxgbe declaration around MK_SOURCELESS_UCODE check > > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > > ============================================================================== > --- head/sys/modules/Makefile Mon Jul 1 22:07:01 2013 (r252490) > +++ head/sys/modules/Makefile Mon Jul 1 22:21:42 2013 (r252491) > @@ -81,7 +81,7 @@ SUBDIR= \ > ${_ctau} \ > ctl \ > ${_cxgb} \ > - cxgbe \ > + ${_cxgbe} \ > ${_cyclic} \ > dc \ > dcons \ > @@ -386,6 +386,10 @@ _cxgb= cxgb > .endif > .endif > > +.if ${MK_SOURCELESS_UCODE} != "no" > +_cxgbe= cxgbe > +.endif > + > .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) > .if exists(${.CURDIR}/../opencrypto) > _crypto= crypto > From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:37:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BADA3C3D; Fri, 5 Jul 2013 20:37:10 +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 9CE0411CD; Fri, 5 Jul 2013 20:37:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KbA16070669; Fri, 5 Jul 2013 20:37:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KbANV070667; Fri, 5 Jul 2013 20:37:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307052037.r65KbANV070667@svn.freebsd.org> From: Martin Matuska Date: Fri, 5 Jul 2013 20:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r252839 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:37:10 -0000 Author: mm Date: Fri Jul 5 20:37:09 2013 New Revision: 252839 URL: http://svnweb.freebsd.org/changeset/base/252839 Log: Update vendor-sys/illumos/dist to illumos-gate 14070:d4c9f8eba8fa Illumos ZFS issues: 3836 zio_free() can be processed immediately in the common case Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h Fri Jul 5 20:24:50 2013 (r252838) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h Fri Jul 5 20:37:09 2013 (r252839) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Jul 5 20:24:50 2013 (r252838) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Jul 5 20:37:09 2013 (r252839) @@ -698,7 +698,20 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, 0))); + } } zio_t * @@ -706,6 +719,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -717,9 +731,18 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp), NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); + return (zio); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:51:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8216DF33; Fri, 5 Jul 2013 20:51:27 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe001.messaging.microsoft.com [216.32.180.184]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5C5124A; Fri, 5 Jul 2013 20:51:26 +0000 (UTC) Received: from mail22-co1-R.bigfish.com (10.243.78.230) by CO1EHSOBE035.bigfish.com (10.243.66.100) with Microsoft SMTP Server id 14.1.225.22; Fri, 5 Jul 2013 20:36:10 +0000 Received: from mail22-co1 (localhost [127.0.0.1]) by mail22-co1-R.bigfish.com (Postfix) with ESMTP id 4534CCA01FE; Fri, 5 Jul 2013 20:36:10 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.53; KIP:(null); UIP:(null); IPV:NLI; H:P-EMHUB02-HQ.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VPS3(zzzz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6h1082kzzz2fh2a8h668h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b88h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1155h) Received-SPF: pass (mail22-co1: domain of juniper.net designates 66.129.224.53 as permitted sender) client-ip=66.129.224.53; envelope-from=sjg@juniper.net; helo=P-EMHUB02-HQ.jnpr.net ; -HQ.jnpr.net ; Received: from mail22-co1 (localhost.localdomain [127.0.0.1]) by mail22-co1 (MessageSwitch) id 1373056568542577_9257; Fri, 5 Jul 2013 20:36:08 +0000 (UTC) Received: from CO1EHSMHS002.bigfish.com (unknown [10.243.78.229]) by mail22-co1.bigfish.com (Postfix) with ESMTP id 819CA880043; Fri, 5 Jul 2013 20:36:08 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net (66.129.224.53) by CO1EHSMHS002.bigfish.com (10.243.66.12) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 5 Jul 2013 20:36:07 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Fri, 5 Jul 2013 13:36:06 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r65Ka5L54024; Fri, 5 Jul 2013 13:36:05 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 5CC2A58097; Fri, 5 Jul 2013 13:36:05 -0700 (PDT) To: Tijl Coosemans Subject: Re: svn commit: r251422 - in head: contrib/bmake usr.bin/bmake In-Reply-To: <51D6EF0D.3050506@FreeBSD.org> References: <201306051612.r55GCpPG050941@svn.freebsd.org> <51C8967F.2060905@FreeBSD.org> <51D6EF0D.3050506@FreeBSD.org> Comments: In-reply-to: Tijl Coosemans message dated "Fri, 05 Jul 2013 18:06:37 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Fri, 5 Jul 2013 13:36:05 -0700 Message-ID: <20130705203605.5CC2A58097@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-OriginatorOrg: juniper.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:51:27 -0000 On Fri, 5 Jul 2013 18:06:37 +0200, Tijl Coosemans writes: >> I've been noticing that bmake doesn't run parallel jobs as like fmake. No it doesn't. fmake exports the name of a FIFO, which any submake can open. bmake passes open descriptors to a pipe, but only if the target is flagged .MAKE. .MAKE's other property is to run the target even when -n is given. This feature, while documented in fmake's man page doesn't work. >> I've attached a Makefile that I think shows what's going wrong. Hmm I can't see the makefile, but if you add .MAKE to the target which run's the sub-makes you will see things work as expected. >> Bmake outputs the target name in -j mode (e.g. "--- all ---"), but >> there's no "--- sub_1 ---" and "--- sub_3 ---" which suggests -j isn't Because the -J flag although passed, the descriptors were closed, this cause the sub-make to ignore -j and -J not to be added to .MAKEFLAGS >> I suspect the descriptors for the job server have to remain open so >> submakes can pick them up. At least, when I comment out the two fcntl Correct, and if the target is flagged .MAKE, the close-on-exec flag will be cleared in the child. >Now that I've taken a closer look at the code it seems bmake requires >targets that run make to be marked with .MAKE. Several targets in >Makefile and Makefile.inc1 already have this, but some don't, such as >bootstrap-tools. Can this be added there? I expect so. I was being somewhat cautious. As noted above .MAKE is also supposed to cause the target to run even when -n is given. I noted that some targets which might otherwise warrant .MAKE also did things which might not be a good idea with -n. FWIW make -N would supresses the behavior of .MAKE, but few are likely to have noted that. I don't see any reason to not add .MAKE to bootstrap-tools. From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:30:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 399E1856; Fri, 5 Jul 2013 21:30:00 +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 2ABF815CB; Fri, 5 Jul 2013 21:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LTxhG087673; Fri, 5 Jul 2013 21:29:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LTxOD087671; Fri, 5 Jul 2013 21:29:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307052129.r65LTxOD087671@svn.freebsd.org> From: Martin Matuska Date: Fri, 5 Jul 2013 21:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252840 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:30:00 -0000 Author: mm Date: Fri Jul 5 21:29:59 2013 New Revision: 252840 URL: http://svnweb.freebsd.org/changeset/base/252840 Log: MFV r252839: Quoting illumos issue #3836: Currently zio_free() always puts the zio on a list for subsequent processing by zio_free_sync(). This is only necessary for frees that might need to issue reads (gang and dedup blocks). By processing the majority of the frees as we encounter them, we reduce the amount of time that the spa_sync() thread spends burning CPU and not doing any i/o, thus increasing the overall write throughput of the system. Illumos ZFS issues: 3836 zio_free() can be processed immediately in the common case MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Fri Jul 5 20:37:09 2013 (r252839) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Fri Jul 5 21:29:59 2013 (r252840) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 5 20:37:09 2013 (r252839) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 5 21:29:59 2013 (r252840) @@ -763,7 +763,21 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, + BP_GET_PSIZE(bp), 0))); + } } zio_t * @@ -771,6 +785,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui uint64_t size, enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -782,9 +797,17 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:31:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45B6CA69; Fri, 5 Jul 2013 21:31:17 +0000 (UTC) (envelope-from jamie@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 1B7CF15F5; Fri, 5 Jul 2013 21:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LVGCh089553; Fri, 5 Jul 2013 21:31:16 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LVGKr089550; Fri, 5 Jul 2013 21:31:16 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201307052131.r65LVGKr089550@svn.freebsd.org> From: Jamie Gritton Date: Fri, 5 Jul 2013 21:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252841 - in head/sys: dev/mem kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:31:17 -0000 Author: jamie Date: Fri Jul 5 21:31:16 2013 New Revision: 252841 URL: http://svnweb.freebsd.org/changeset/base/252841 Log: Add new privileges, PRIV_KMEM_READ and PRIV_KMEM_WRITE, used in opening /dev/kmem and /dev/mem (in addition to traditional file permission checks). PRIV_KMEM_READ is different from other PRIV_* checks in that it's allowed by default. Reviewed by: kib, mckusick Modified: head/sys/dev/mem/memdev.c head/sys/kern/kern_priv.c head/sys/sys/priv.h Modified: head/sys/dev/mem/memdev.c ============================================================================== --- head/sys/dev/mem/memdev.c Fri Jul 5 21:29:59 2013 (r252840) +++ head/sys/dev/mem/memdev.c Fri Jul 5 21:31:16 2013 (r252841) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,8 +68,14 @@ memopen(struct cdev *dev __unused, int f { int error = 0; - if (flags & FWRITE) - error = securelevel_gt(td->td_ucred, 0); + if (flags & FREAD) + error = priv_check(td, PRIV_KMEM_READ); + if (flags & FWRITE) { + if (error == 0) + error = priv_check(td, PRIV_KMEM_WRITE); + if (error == 0) + error = securelevel_gt(td->td_ucred, 0); + } return (error); } Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Fri Jul 5 21:29:59 2013 (r252840) +++ head/sys/kern/kern_priv.c Fri Jul 5 21:31:16 2013 (r252841) @@ -142,6 +142,15 @@ priv_check_cred(struct ucred *cred, int } /* + * Writes to kernel memory are a typical root-only operation, + * but non-root users are expected to be able to read it. + */ + if (priv == PRIV_KMEM_READ) { + error = 0; + goto out; + } + + /* * Now check with MAC, if enabled, to see if a policy module grants * privilege. */ Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Fri Jul 5 21:29:59 2013 (r252840) +++ head/sys/sys/priv.h Fri Jul 5 21:31:16 2013 (r252841) @@ -494,6 +494,12 @@ #define PRIV_RCTL_REMOVE_RULE 674 /* + * Kernel memory privileges. + */ +#define PRIV_KMEM_READ 680 /* Read from kernel memory. */ +#define PRIV_KMEM_WRITE 681 /* Write to kernel memory. */ + +/* * Track end of privilege list. */ #define _PRIV_HIGHEST 675 From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:32:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A20A8BBF; Fri, 5 Jul 2013 21:32:54 +0000 (UTC) (envelope-from dteske@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 93507160C; Fri, 5 Jul 2013 21:32:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LWswi089761; Fri, 5 Jul 2013 21:32:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LWsrf089760; Fri, 5 Jul 2013 21:32:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052132.r65LWsrf089760@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 21:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252842 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:32:54 -0000 Author: dteske Date: Fri Jul 5 21:32:54 2013 New Revision: 252842 URL: http://svnweb.freebsd.org/changeset/base/252842 Log: Remove superfluous continue at end of loop. (pointy-hat) Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 21:31:16 2013 (r252841) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 21:32:54 2013 (r252842) @@ -640,7 +640,7 @@ f_package_review() debug= f_getvar _mark_$varpkg mark [ "$mark" = "I" ] || continue f_dprintf "%s: Installing %s package" $fname "$package" - f_package_add "$package" || continue + f_package_add "$package" done for package in $SELECTED_PACKAGES; do mark= From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:33:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63619CF7; Fri, 5 Jul 2013 21:33:33 +0000 (UTC) (envelope-from andre@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 449F21613; Fri, 5 Jul 2013 21:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LXXZe089927; Fri, 5 Jul 2013 21:33:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LXXfD089926; Fri, 5 Jul 2013 21:33:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307052133.r65LXXfD089926@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 21:33: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: r252843 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:33:33 -0000 Author: andre Date: Fri Jul 5 21:33:32 2013 New Revision: 252843 URL: http://svnweb.freebsd.org/changeset/base/252843 Log: MFC r241703: Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within zero copy specialized sosend_copyin() helper function. MFC r241704: Remove unnecessary includes from sosend_copyin() and fix a couple of style issues. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:32:54 2013 (r252842) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:33:32 2013 (r252843) @@ -893,12 +893,6 @@ struct so_zerocopy_stats{ int found_ifp; }; struct so_zerocopy_stats so_zerocp_stats = {0,0,0}; -#include -#include -#include -#include -#include -#include /* * sosend_copyin() is only used if zero copy sockets are enabled. Otherwise @@ -923,9 +917,7 @@ sosend_copyin(struct uio *uio, struct mb long len; ssize_t resid; int error; -#ifdef ZERO_COPY_SOCKETS int cow_send; -#endif *retmp = top = NULL; mp = ⊤ @@ -933,11 +925,8 @@ sosend_copyin(struct uio *uio, struct mb resid = uio->uio_resid; error = 0; do { -#ifdef ZERO_COPY_SOCKETS cow_send = 0; -#endif /* ZERO_COPY_SOCKETS */ if (resid >= MINCLSIZE) { -#ifdef ZERO_COPY_SOCKETS if (top == NULL) { m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; @@ -945,9 +934,9 @@ sosend_copyin(struct uio *uio, struct mb } else m = m_get(M_WAITOK, MT_DATA); if (so_zero_copy_send && - resid>=PAGE_SIZE && - *space>=PAGE_SIZE && - uio->uio_iov->iov_len>=PAGE_SIZE) { + resid >= PAGE_SIZE && + *space >= PAGE_SIZE && + uio->uio_iov->iov_len >= PAGE_SIZE) { so_zerocp_stats.size_ok++; so_zerocp_stats.align_ok++; cow_send = socow_setup(m, uio); @@ -957,15 +946,6 @@ sosend_copyin(struct uio *uio, struct mb m_clget(m, M_WAITOK); len = min(min(MCLBYTES, resid), *space); } -#else /* ZERO_COPY_SOCKETS */ - if (top == NULL) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); - m->m_pkthdr.len = 0; - m->m_pkthdr.rcvif = NULL; - } else - m = m_getcl(M_WAIT, MT_DATA, 0); - len = min(min(MCLBYTES, resid), *space); -#endif /* ZERO_COPY_SOCKETS */ } else { if (top == NULL) { m = m_gethdr(M_WAIT, MT_DATA); @@ -990,12 +970,10 @@ sosend_copyin(struct uio *uio, struct mb } *space -= len; -#ifdef ZERO_COPY_SOCKETS if (cow_send) error = 0; else -#endif /* ZERO_COPY_SOCKETS */ - error = uiomove(mtod(m, void *), (int)len, uio); + error = uiomove(mtod(m, void *), (int)len, uio); resid = uio->uio_resid; m->m_len = len; *mp = m; @@ -1013,7 +991,7 @@ out: *retmp = top; return (error); } -#endif /*ZERO_COPY_SOCKETS*/ +#endif /* ZERO_COPY_SOCKETS */ #define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:40:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C137FF0C; Fri, 5 Jul 2013 21:40:32 +0000 (UTC) (envelope-from dteske@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 9953A166F; Fri, 5 Jul 2013 21:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LeWRj092372; Fri, 5 Jul 2013 21:40:32 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LeWGK092370; Fri, 5 Jul 2013 21:40:32 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052140.r65LeWGK092370@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252844 - in head/usr.sbin/bsdconfig/share: . packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:40:32 -0000 Author: dteske Date: Fri Jul 5 21:40:31 2013 New Revision: 252844 URL: http://svnweb.freebsd.org/changeset/base/252844 Log: Add the necessary code to reinstall packages. Both scripted access (packageReinstall) and UI access have been tested successfully with a variation of different situations including: + Reinstall a package for which no other packages depend + Purposefully do thinks like reinstall a package that is not installed + Try to reinstall a package which other installed packages still depend NOTE: There is no "force" used; if a package is required by other packages, it will not be uninstalled (and therefore no reinstall is done). Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 21:33:32 2013 (r252843) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jul 5 21:40:31 2013 (r252844) @@ -648,7 +648,7 @@ f_package_review() debug= f_getvar _mark_$varpkg mark [ "$mark" = "R" ] || continue f_dprintf "%s: Reinstalling %s package" $fname "$package" - # XXX Re-install package + f_package_reinstall "$package" done for package in $SELECTED_PACKAGES; do mark= @@ -1186,6 +1186,15 @@ f_package_delete() fi } +# f_package_reinstall $name +# +# A simple wrapper to f_package_delete() + f_package_add() +# +f_package_reinstall() +{ + f_package_delete "$1" && f_package_add "$1" +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 21:33:32 2013 (r252843) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Jul 5 21:40:31 2013 (r252844) @@ -196,6 +196,7 @@ f_resword_new configPCNFSD f_config_pcnf f_resword_new configPackages f_package_config f_resword_new packageAdd f_package_add f_resword_new packageDelete f_package_delete +f_resword_new packageReinstall f_package_reinstall # variable.subr f_resword_new installVarDefaults f_variable_set_defaults From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 21:41:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3FC9C9; Fri, 5 Jul 2013 21:41:05 +0000 (UTC) (envelope-from jamie@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 E65EE1673; Fri, 5 Jul 2013 21:41:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Lf5Ji092481; Fri, 5 Jul 2013 21:41:05 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Lf5CD092480; Fri, 5 Jul 2013 21:41:05 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201307052141.r65Lf5CD092480@svn.freebsd.org> From: Jamie Gritton Date: Fri, 5 Jul 2013 21:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252845 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 21:41:06 -0000 Author: jamie Date: Fri Jul 5 21:41:05 2013 New Revision: 252845 URL: http://svnweb.freebsd.org/changeset/base/252845 Log: Bump up _PRIV_HIGHEST to account for PRIV_KMEM_READ/WRITE. Submitted by: mdf Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Fri Jul 5 21:40:31 2013 (r252844) +++ head/sys/sys/priv.h Fri Jul 5 21:41:05 2013 (r252845) @@ -502,7 +502,7 @@ /* * Track end of privilege list. */ -#define _PRIV_HIGHEST 675 +#define _PRIV_HIGHEST 682 /* * Validate that a named privilege is known by the privilege system. Invalid From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 22:04:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 654A54C7; Fri, 5 Jul 2013 22:04:50 +0000 (UTC) (envelope-from gjb@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 46F2B17AD; Fri, 5 Jul 2013 22:04:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65M4oRb098776; Fri, 5 Jul 2013 22:04:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65M4nTn098774; Fri, 5 Jul 2013 22:04:49 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201307052204.r65M4nTn098774@svn.freebsd.org> From: Glen Barber Date: Fri, 5 Jul 2013 22:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252846 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 22:04:50 -0000 Author: gjb Date: Fri Jul 5 22:04:49 2013 New Revision: 252846 URL: http://svnweb.freebsd.org/changeset/base/252846 Log: - Add SRC_FORCE_CHECKOUT configuration option to force svn to checkout the src/ tree into a directory that contains files/directories, such as a case where a custom kernel configuration file is specified. - Allow specification of multiple KERNCONFs to pass to 'make release'. - Move evaluation of NODOCS/NOPORTS earlier, and set based on how the release process expects these options to be evaluated. - Wrap KERNCONF specification in double quotes, and use 'eval' so multiple kernel configurations do not cause the build to fail in strange ways. - Set WITHOUT_X11 for the port build flags for the documentation toolchain build. Also run 'clean distclean' targets during port build. PR: 180192 Submitted by: Anes Mukhametov MFC after: 3 days Approved by: kib (mentor, implicit) Modified: head/release/release.conf.sample head/release/release.sh Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Fri Jul 5 21:41:05 2013 (r252845) +++ head/release/release.conf.sample Fri Jul 5 22:04:49 2013 (r252846) @@ -14,6 +14,9 @@ SRCBRANCH="base/head" DOCBRANCH="doc/head" PORTBRANCH="ports/head" +## Run svn co --force for src checkout. +#SRC_FORCE_CHECKOUT=yes + ## Set the src/, ports/, and doc/ revisions. SRCREVISION="-rHEAD" DOCREVISION="-rHEAD" @@ -23,6 +26,8 @@ PORTREVISION="-rHEAD" #TARGET="amd64" #TARGET_ARCH="amd64" #KERNEL="GENERIC" +## Multiple kernels may be set. +#KERNEL="GENERIC XENHVM" ## Set to specify a custom make.conf and/or src.conf #MAKE_CONF="/etc/local/make.conf" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Jul 5 21:41:05 2013 (r252845) +++ head/release/release.sh Fri Jul 5 22:04:49 2013 (r252846) @@ -45,6 +45,10 @@ SRCBRANCH="base/head" DOCBRANCH="doc/head" PORTBRANCH="ports/head" +# Sometimes one needs to checkout src with --force svn option. +# If custom kernel configs copied to src tree before checkout, e.g. +SRC_FORCE_CHECKOUT= + # The default src/, doc/, and ports/ revisions. SRCREVISION="-rHEAD" DOCREVISION="-rHEAD" @@ -109,6 +113,25 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree +# is required to build the documentation set. +if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then + echo "*** NOTICE: Setting NODOC=1 since ports tree is required" + echo " and NOPORTS is set." + NODOC=yes +fi + +# If NOPORTS and/or NODOC are unset, they must not pass to make as variables. +# The release makefile verifies definedness of NOPORTS/NODOC variables +# instead of their values. +DOCPORTS= +if [ "x${NOPORTS}" != "x" ]; then + DOCPORTS="NOPORTS=yes " +fi +if [ "x${NODOC}" != "x" ]; then + DOCPORTS="${DOCPORTS}NODOC=yes" +fi + # The aggregated build-time flags based upon variables defined within # this file, unless overridden by release.conf. In most cases, these # will not need to be changed. @@ -118,16 +141,14 @@ CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD CHROOT_IMAKEFLAGS="${CONF_FILES}" CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=${KERNEL} ${ARCH_FLAGS} ${CONF_FILES}" -RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=${KERNEL} ${CONF_FILES} \ - NODOC=${NODOC} NOPORTS=${NOPORTS}" - -# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree -# is required to build the documentation set. -if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then - echo "*** NOTICE: Setting NODOC=1 since ports tree is required" - echo " and NOPORTS is set." - NODOC=1 +RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" +RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ + ${DOCPORTS}" + +# Force src checkout if configured +FORCE_SRC_KEY= +if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then + FORCE_SRC_KEY="--force" fi if [ ! ${CHROOTDIR} ]; then @@ -144,7 +165,7 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr -svn co ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION +svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION if [ "x${NODOC}" = "x" ]; then svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc $DOCREVISION fi @@ -164,10 +185,10 @@ trap "umount ${CHROOTDIR}/dev" EXIT # Cl build_doc_ports() { ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) - if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" != "x" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes BATCH=yes" + if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then + PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes WITHOUT_X11=yes BATCH=yes" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} install + ${PBUILD_FLAGS} install clean distclean fi } @@ -191,11 +212,11 @@ if [ "x${RELSTRING}" = "x" ]; then RELSTRING="$(chroot ${CHROOTDIR} uname -s)-${OSRELEASE}-${TARGET_ARCH}" fi -chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld -chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel -chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ +eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld +eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel +eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ release RELSTRING=${RELSTRING} -chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ +eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ install DESTDIR=/R RELSTRING=${RELSTRING} cd ${CHROOTDIR}/R From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 22:10:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BDECA690; Fri, 5 Jul 2013 22:10:50 +0000 (UTC) (envelope-from adrian@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 B09B117D9; Fri, 5 Jul 2013 22:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65MAosm001426; Fri, 5 Jul 2013 22:10:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65MAoHb001425; Fri, 5 Jul 2013 22:10:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307052210.r65MAoHb001425@svn.freebsd.org> From: Adrian Chadd Date: Fri, 5 Jul 2013 22:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252847 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 22:10:50 -0000 Author: adrian Date: Fri Jul 5 22:10:50 2013 New Revision: 252847 URL: http://svnweb.freebsd.org/changeset/base/252847 Log: Add a missing unlock. Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Jul 5 22:04:49 2013 (r252846) +++ head/sys/net80211/ieee80211_mesh.c Fri Jul 5 22:10:50 2013 (r252847) @@ -1142,6 +1142,7 @@ mesh_transmit_to_gate(struct ieee80211va m = ieee80211_encap(vap, ni, m); if (m == NULL) { /* NB: stat+msg handled in ieee80211_encap */ + IEEE80211_TX_UNLOCK(ic); ieee80211_free_node(ni); return; } From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 22:24:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B0EAADD; Fri, 5 Jul 2013 22:24:44 +0000 (UTC) (envelope-from dteske@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 1D2701841; Fri, 5 Jul 2013 22:24:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65MOi8C005074; Fri, 5 Jul 2013 22:24:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65MOhhA005073; Fri, 5 Jul 2013 22:24:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052224.r65MOhhA005073@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 22:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252848 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 22:24:44 -0000 Author: dteske Date: Fri Jul 5 22:24:43 2013 New Revision: 252848 URL: http://svnweb.freebsd.org/changeset/base/252848 Log: Check menuitem before calculating tag. Modified: head/usr.sbin/bsdconfig/bsdconfig Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 22:10:50 2013 (r252847) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 22:24:43 2013 (r252848) @@ -235,11 +235,11 @@ dialog_menu_main() local separator_added= for menuitem in $( cd "$BSDCFG_LOCAL_LIBE" 2> /dev/null && ls -d * ) do - [ $index -lt ${#DIALOG_MENU_TAGS} ] || break - # Skip the module if it looks like a `base' module case "$menuitem" in [0-9][0-9][0-9].*) continue;; esac + [ $index -lt ${#DIALOG_MENU_TAGS} ] || break + menu_program= menu_title= menu_help= f_include_lang $BSDCFG_LOCAL_LIBE/$menuitem/INDEX || continue [ "$menu_program" ] || continue From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 22:25:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F99AC28; Fri, 5 Jul 2013 22:25:41 +0000 (UTC) (envelope-from dteske@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 41E15184C; Fri, 5 Jul 2013 22:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65MPffu005245; Fri, 5 Jul 2013 22:25:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65MPfPe005244; Fri, 5 Jul 2013 22:25:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052225.r65MPfPe005244@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 22:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252849 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 22:25:41 -0000 Author: dteske Date: Fri Jul 5 22:25:40 2013 New Revision: 252849 URL: http://svnweb.freebsd.org/changeset/base/252849 Log: Check for INDEX file first before anything else when processing modules. Modified: head/usr.sbin/bsdconfig/bsdconfig Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 22:24:43 2013 (r252848) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Jul 5 22:25:40 2013 (r252849) @@ -200,6 +200,7 @@ dialog_menu_main() # local menuitem menu_title menu_help menu_selection index=2 for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do + [ -f "$BSDCFG_LIBE/$menuitem/INDEX" ] || continue [ $index -lt ${#DIALOG_MENU_TAGS} ] || break menu_program= menu_title= menu_help= @@ -238,6 +239,7 @@ dialog_menu_main() # Skip the module if it looks like a `base' module case "$menuitem" in [0-9][0-9][0-9].*) continue;; esac + [ -f "$BSDCFG_LOCAL_LIBE/$menuitem/INDEX" ] || continue [ $index -lt ${#DIALOG_MENU_TAGS} ] || break menu_program= menu_title= menu_help= From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 22:42:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F134C3; Fri, 5 Jul 2013 22:42:11 +0000 (UTC) (envelope-from markj@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 4F46318EC; Fri, 5 Jul 2013 22:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65MgBUW010427; Fri, 5 Jul 2013 22:42:11 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65MgA6K010423; Fri, 5 Jul 2013 22:42:10 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307052242.r65MgA6K010423@svn.freebsd.org> From: Mark Johnston Date: Fri, 5 Jul 2013 22:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252850 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 22:42:11 -0000 Author: markj Date: Fri Jul 5 22:42:10 2013 New Revision: 252850 URL: http://svnweb.freebsd.org/changeset/base/252850 Log: Hide references to mod_lock. In FreeBSD it is always acquired with the provider lock held, so its use has no effect. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jul 5 22:42:10 2013 (r252850) @@ -278,8 +278,6 @@ static kmutex_t dtrace_meta_lock; /* me #if !defined(sun) /* XXX FreeBSD hacks. */ -static kmutex_t mod_lock; - #define cr_suid cr_svuid #define cr_sgid cr_svgid #define ipaddr_t in_addr_t @@ -7678,7 +7676,9 @@ dtrace_unregister(dtrace_provider_id_t i } } else { mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); } @@ -7692,7 +7692,9 @@ dtrace_unregister(dtrace_provider_id_t i dtrace_anon.dta_state->dts_necbs > 0))) { if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } return (EBUSY); @@ -7726,7 +7728,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -7808,7 +7812,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -8141,6 +8147,7 @@ dtrace_probe_provide(dtrace_probedesc_t */ prv->dtpv_pops.dtps_provide(prv->dtpv_arg, desc); +#if defined(sun) /* * Now call the per-module provide operation. We will grab * mod_lock to prevent the list from being modified. Note @@ -8149,7 +8156,6 @@ dtrace_probe_provide(dtrace_probedesc_t */ mutex_enter(&mod_lock); -#if defined(sun) ctl = &modules; do { if (ctl->mod_busy || ctl->mod_mp == NULL) @@ -8158,11 +8164,11 @@ dtrace_probe_provide(dtrace_probedesc_t prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); } while ((ctl = ctl->mod_next) != &modules); + + mutex_exit(&mod_lock); #else (void) linker_file_foreach(dtrace_probe_provide_cb, prv); #endif - - mutex_exit(&mod_lock); } while (all && (prv = prv->dtpv_next) != NULL); } @@ -15156,7 +15162,9 @@ dtrace_module_loaded(modctl_t *ctl) dtrace_provider_t *prv; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif ASSERT(ctl->mod_busy); @@ -15167,7 +15175,9 @@ dtrace_module_loaded(modctl_t *ctl) for (prv = dtrace_provider; prv != NULL; prv = prv->dtpv_next) prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); /* @@ -15212,7 +15222,9 @@ dtrace_module_unloaded(modctl_t *ctl) template.dtpr_mod = ctl->mod_modname; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (dtrace_bymod == NULL) { @@ -15221,7 +15233,9 @@ dtrace_module_unloaded(modctl_t *ctl) * we don't have any work to do. */ mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); return; } @@ -15230,7 +15244,9 @@ dtrace_module_unloaded(modctl_t *ctl) probe != NULL; probe = probe->dtpr_nextmod) { if (probe->dtpr_ecb != NULL) { mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); /* @@ -15293,7 +15309,9 @@ dtrace_module_unloaded(modctl_t *ctl) } mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Jul 5 22:42:10 2013 (r252850) @@ -580,19 +580,25 @@ dtrace_ioctl(struct cdev *dev, u_long cm return (EINVAL); mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (desc->dtargd_id > dtrace_nprobes) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } if ((probe = dtrace_probes[desc->dtargd_id - 1]) == NULL) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } @@ -616,7 +622,9 @@ dtrace_ioctl(struct cdev *dev, u_long cm probe->dtpr_id, probe->dtpr_arg, desc); } +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (0); Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jul 5 22:42:10 2013 (r252850) @@ -57,12 +57,6 @@ dtrace_load(void *dummy) dtrace_invop_init(); /* - * XXX This is a short term hack to avoid having to comment - * out lots and lots of lock/unlock calls. - */ - mutex_init(&mod_lock,"XXX mod_lock hack", MUTEX_DEFAULT, NULL); - - /* * Initialise the mutexes without 'witness' because the dtrace * code is mostly written to wait for memory. To have the * witness code change a malloc() from M_WAITOK to M_NOWAIT Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Fri Jul 5 22:42:10 2013 (r252850) @@ -123,9 +123,6 @@ dtrace_unload() mutex_destroy(&dtrace_lock); mutex_destroy(&dtrace_errlock); - /* XXX Hack */ - mutex_destroy(&mod_lock); - /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 23:10:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 552E34EC; Fri, 5 Jul 2013 23:10:03 +0000 (UTC) (envelope-from delphij@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 2D4C219FA; Fri, 5 Jul 2013 23:10:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65NA3q2017480; Fri, 5 Jul 2013 23:10:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65NA2pR017478; Fri, 5 Jul 2013 23:10:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307052310.r65NA2pR017478@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 23:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252851 - in head: share/man/man4 sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 23:10:03 -0000 Author: delphij Date: Fri Jul 5 23:10:02 2013 New Revision: 252851 URL: http://svnweb.freebsd.org/changeset/base/252851 Log: Add PCI IDs for HighPoint RocketRAID 4521, 3620, 3622 and 3640 controllers. Update the hptiop(4) manual page to reflect this as well as mentioning that some cards are already end-of-life. Many thanks to Highpoint for providing this driver update. MFC after: 1 day Modified: head/share/man/man4/hptiop.4 head/sys/dev/hptiop/hptiop.c Modified: head/share/man/man4/hptiop.4 ============================================================================== --- head/share/man/man4/hptiop.4 Fri Jul 5 22:42:10 2013 (r252850) +++ head/share/man/man4/hptiop.4 Fri Jul 5 23:10:02 2013 (r252851) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd July 5, 2013 .Dt HPTIOP 4 .Os .Sh NAME @@ -60,6 +60,8 @@ driver supports the following SAS and SA .It HighPoint RocketRAID 4522 .It +HighPoint RocketRAID 4521 +.It HighPoint RocketRAID 4520 .It HighPoint RocketRAID 4322 @@ -72,6 +74,20 @@ HighPoint RocketRAID 4311 .It HighPoint RocketRAID 4310 .It +HighPoint RocketRAID 3640 +.It +HighPoint RocketRAID 3622 +.It +HighPoint RocketRAID 3620 +.El +.Pp +The +.Nm +driver also supports the following SAS and SATA RAID controllers that +are already End-of-Life: +.Pp +.Bl -bullet -compact +.It HighPoint RocketRAID 4211 .It HighPoint RocketRAID 4210 Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Fri Jul 5 22:42:10 2013 (r252850) +++ head/sys/dev/hptiop/hptiop.c Fri Jul 5 23:10:02 2013 (r252851) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #include static const char driver_name[] = "hptiop"; -static const char driver_version[] = "v1.8"; +static const char driver_version[] = "v1.9"; static devclass_t hptiop_devclass; @@ -1821,8 +1821,12 @@ static int hptiop_probe(device_t dev) switch (id) { case 0x4520: + case 0x4521: case 0x4522: sas = 1; + case 0x3620: + case 0x3622: + case 0x3640: ops = &hptiop_mvfrey_ops; break; case 0x4210: From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 23:13:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 68955806; Fri, 5 Jul 2013 23:13:55 +0000 (UTC) (envelope-from delphij@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 5A59B1A25; Fri, 5 Jul 2013 23:13:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65NDtuO019718; Fri, 5 Jul 2013 23:13:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65NDtxs019715; Fri, 5 Jul 2013 23:13:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307052313.r65NDtxs019715@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 23:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252852 - head/sys/dev/hpt27xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 23:13:55 -0000 Author: delphij Date: Fri Jul 5 23:13:54 2013 New Revision: 252852 URL: http://svnweb.freebsd.org/changeset/base/252852 Log: Update hpt27xx(4) driver to address a problem reported by FreeNAS user, where when more than one hpt27xx adapters are being used, the "unit number" stays at 0. Many thanks to HighPoint for providing this driver update. MFC after: 1 day Modified: head/sys/dev/hpt27xx/hpt27xx_config.c head/sys/dev/hpt27xx/osm_bsd.c Modified: head/sys/dev/hpt27xx/hpt27xx_config.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_config.c Fri Jul 5 23:10:02 2013 (r252851) +++ head/sys/dev/hpt27xx/hpt27xx_config.c Fri Jul 5 23:13:54 2013 (r252852) @@ -60,7 +60,7 @@ int init_config(void) const char driver_name[] = "hpt27xx"; const char driver_name_long[] = "RocketRAID 27xx controller driver"; -const char driver_ver[] = "v1.0"; +const char driver_ver[] = "v1.1"; int osm_max_targets = 0xff; Modified: head/sys/dev/hpt27xx/osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/osm_bsd.c Fri Jul 5 23:10:02 2013 (r252851) +++ head/sys/dev/hpt27xx/osm_bsd.c Fri Jul 5 23:13:54 2013 (r252852) @@ -944,7 +944,6 @@ static void hpt_stop_tasks(PVBUS_EXT vbu static d_open_t hpt_open; static d_close_t hpt_close; static d_ioctl_t hpt_ioctl; -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb); static int hpt_rescan_bus(void); static struct cdevsw hpt_cdevsw = { @@ -974,7 +973,7 @@ static struct intr_config_hook hpt_ich; */ static void hpt_final_init(void *dummy) { - int i; + int i,unit_number=0; PVBUS_EXT vbus_ext; PVBUS vbus; PHBA hba; @@ -1058,12 +1057,12 @@ static void hpt_final_init(void *dummy) #if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, &Giant, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, &Giant, os_max_queue_comm, /*tagged*/8, devq); #else vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); #endif - + unit_number++; if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); cam_simq_free(devq); @@ -1337,44 +1336,26 @@ invalid: static int hpt_rescan_bus(void) { - struct cam_path *path; union ccb *ccb; PVBUS vbus; PVBUS_EXT vbus_ext; -#if (__FreeBSD_version >= 500000) mtx_lock(&Giant); -#endif ldm_for_each_vbus(vbus, vbus_ext) { - if (xpt_create_path(&path, NULL, cam_sim_path(vbus_ext->sim), + if ((ccb = xpt_alloc_ccb()) == NULL) + { + return(ENOMEM); + } + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) + { + xpt_free_ccb(ccb); return(EIO); - if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL) - return(ENOMEM); - bzero(ccb, sizeof(union ccb)); - xpt_setup_ccb(&ccb->ccb_h, path, 5); - ccb->ccb_h.func_code = XPT_SCAN_BUS; - ccb->ccb_h.cbfcnp = hpt_bus_scan_cb; - ccb->crcn.flags = CAM_FLAG_NONE; - xpt_action(ccb); + } + xpt_rescan(ccb); } - -#if (__FreeBSD_version >= 500000) mtx_unlock(&Giant); -#endif - return(0); } -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb) -{ - if (ccb->ccb_h.status != CAM_REQ_CMP) - KdPrint(("cam_scan_callback: failure status = %x",ccb->ccb_h.status)); - else - KdPrint(("Scan bus successfully!")); - - xpt_free_path(ccb->ccb_h.path); - free(ccb, M_TEMP); - return; -} From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 23:16:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADC9B95B; Fri, 5 Jul 2013 23:16:57 +0000 (UTC) (envelope-from dteske@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 8F50B1A39; Fri, 5 Jul 2013 23:16:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65NGvhI020153; Fri, 5 Jul 2013 23:16:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65NGut2020144; Fri, 5 Jul 2013 23:16:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307052316.r65NGut2020144@svn.freebsd.org> From: Devin Teske Date: Fri, 5 Jul 2013 23:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252853 - in head/usr.sbin/bsdconfig/networking: include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 23:16:57 -0000 Author: dteske Date: Fri Jul 5 23:16:56 2013 New Revision: 252853 URL: http://svnweb.freebsd.org/changeset/base/252853 Log: Don't prevent the user from hanging their system by changing network settings while NFS mounts are active; but DO warn them and make the default action to do nothing. (thanks julian) Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/routing.subr Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -73,7 +73,7 @@ msg_network_configuration="%s Network Co msg_network_interfaces="Network Interfaces" msg_network_management="Network Management" msg_networking_devices="Networking Devices" -msg_nfs_mounts_may_cause_hang="WARNING! Changing this setting while NFS directories are\nmounted may cause the system to hang. Please exit this\nutility and dismount any/all remaining NFS-mounts before\nattempting to change this setting.\n\n%s" +msg_nfs_mounts_may_cause_hang="WARNING! Changing this setting while NFS directories are\nmounted may cause the system to hang. Are you sure you\nwant to proceed?\n\n%s" msg_no_network_interfaces="No network interfaces detected." msg_no_options="No options (Default)" msg_ok="OK" Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -263,16 +263,15 @@ f_dialog_menu_netdev_edit() case "$tag" in X\ *) break ;; 2\ *) # - # Do not proceed if/when there are NFS-mounts currently - # active. If the network is changed while NFS-exported - # directories are mounted, the system may hang (if any - # NFS mounts are using that interface). + # Proceed cautiously (confirm with the user) if/when NFS- + # mounts are active. If the network on which these mounts + # are made is changed parts of the system may hang. # if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_dhcp_status" \ "$interface" "$dhcp_status" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - continue + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + continue fi # Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -146,8 +146,8 @@ f_dialog_input_ipaddr() if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_ipaddr" \ "$interface" "$_ipaddr" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - return $FAILURE + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + return $FAILURE fi local msg="$( printf "$msg_please_enter_new_ip_addr" "$interface" )" Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -117,8 +117,8 @@ f_dialog_input_options() if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_options" \ "$interface" "$options" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - return $FAILURE + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + return $FAILURE fi local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )" @@ -164,8 +164,8 @@ f_dialog_menu_media_options() if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_options" \ "$interface" "$_options" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - return $FAILURE + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + return $FAILURE fi # Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -96,8 +96,8 @@ f_dialog_input_netmask() if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_subnet" \ "$interface" "$_netmask" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - return $FAILURE + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + return $FAILURE fi # Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Jul 5 23:13:54 2013 (r252852) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Jul 5 23:16:56 2013 (r252853) @@ -74,8 +74,8 @@ f_dialog_input_defaultrouter() if f_nfs_mounted && ! f_jailed; then local setting="$( printf "$msg_current_default_router" \ "$defaultrouter" )" - f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting" - return $FAILURE + f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || + return $FAILURE fi # From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 23:40:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2BDE8EB0; Fri, 5 Jul 2013 23:40:09 +0000 (UTC) (envelope-from cperciva@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 1C8A01ADD; Fri, 5 Jul 2013 23:40:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Ne911026293; Fri, 5 Jul 2013 23:40:09 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Ne8uo026292; Fri, 5 Jul 2013 23:40:08 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201307052340.r65Ne8uo026292@svn.freebsd.org> From: Colin Percival Date: Fri, 5 Jul 2013 23:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252854 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 23:40:09 -0000 Author: cperciva Date: Fri Jul 5 23:40:08 2013 New Revision: 252854 URL: http://svnweb.freebsd.org/changeset/base/252854 Log: Fix typo: minmum -> minimum. Submitted by: @z3ndrag0n Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Fri Jul 5 23:16:56 2013 (r252853) +++ head/sys/net/if_var.h Fri Jul 5 23:40:08 2013 (r252854) @@ -204,7 +204,7 @@ struct ifnet { u_int if_fib; /* interface FIB */ u_char if_alloctype; /* if_type at time of allocation */ - u_int if_hw_tsomax; /* tso burst length limit, the minmum + u_int if_hw_tsomax; /* tso burst length limit, the minimum * is (IP_MAXPACKET / 8). * XXXAO: Have to find a better place * for it eventually. */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 00:10:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0FC83763; Sat, 6 Jul 2013 00:10:53 +0000 (UTC) (envelope-from jamie@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 01E7C1C0B; Sat, 6 Jul 2013 00:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r660AqQV036924; Sat, 6 Jul 2013 00:10:52 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r660Aqsp036921; Sat, 6 Jul 2013 00:10:52 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201307060010.r660Aqsp036921@svn.freebsd.org> From: Jamie Gritton Date: Sat, 6 Jul 2013 00:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252855 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 00:10:53 -0000 Author: jamie Date: Sat Jul 6 00:10:52 2013 New Revision: 252855 URL: http://svnweb.freebsd.org/changeset/base/252855 Log: Make the comments a little more clear about PRIV_KMEM_*, explicitly referring to /dev/[k]mem and noting it's about opening the files rather than actually reading and writing. Reviewed by: jmallett Modified: head/sys/kern/kern_priv.c head/sys/sys/priv.h Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Fri Jul 5 23:40:08 2013 (r252854) +++ head/sys/kern/kern_priv.c Sat Jul 6 00:10:52 2013 (r252855) @@ -142,8 +142,9 @@ priv_check_cred(struct ucred *cred, int } /* - * Writes to kernel memory are a typical root-only operation, - * but non-root users are expected to be able to read it. + * Writes to kernel/physical memory are a typical root-only operation, + * but non-root users are expected to be able to read it (provided they + * have permission to access /dev/[k]mem). */ if (priv == PRIV_KMEM_READ) { error = 0; Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Fri Jul 5 23:40:08 2013 (r252854) +++ head/sys/sys/priv.h Sat Jul 6 00:10:52 2013 (r252855) @@ -494,10 +494,10 @@ #define PRIV_RCTL_REMOVE_RULE 674 /* - * Kernel memory privileges. + * mem(4) privileges. */ -#define PRIV_KMEM_READ 680 /* Read from kernel memory. */ -#define PRIV_KMEM_WRITE 681 /* Write to kernel memory. */ +#define PRIV_KMEM_READ 680 /* Open mem/kmem for reading. */ +#define PRIV_KMEM_WRITE 681 /* Open mem/kmem for writing. */ /* * Track end of privilege list. From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 00:13:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BE9078AD; Sat, 6 Jul 2013 00:13:08 +0000 (UTC) (envelope-from sjg@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 A05DE1C1B; Sat, 6 Jul 2013 00:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r660D80h037292; Sat, 6 Jul 2013 00:13:08 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r660D8bg037291; Sat, 6 Jul 2013 00:13:08 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201307060013.r660D8bg037291@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sat, 6 Jul 2013 00:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252856 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 00:13:08 -0000 Author: sjg Date: Sat Jul 6 00:13:08 2013 New Revision: 252856 URL: http://svnweb.freebsd.org/changeset/base/252856 Log: Sprinkle some .MAKE magic Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jul 6 00:10:52 2013 (r252855) +++ head/Makefile.inc1 Sat Jul 6 00:13:08 2013 (r252856) @@ -1237,7 +1237,7 @@ _kerberos5_bootstrap_tools= \ # Please document (add comment) why something is in 'bootstrap-tools'. # Try to bound the building of the bootstrap-tool to just the # FreeBSD versions that need the tool built at this stage of the build. -bootstrap-tools: +bootstrap-tools: .MAKE .for _tool in \ ${_clang_tblgen} \ ${_kerberos5_bootstrap_tools} \ @@ -1290,7 +1290,7 @@ _gcc_tools= gnu/usr.bin/cc/cc_tools _rescue= rescue/rescue .endif -build-tools: +build-tools: .MAKE .for _tool in \ bin/csh \ bin/sh \ @@ -1352,7 +1352,7 @@ _cc= gnu/usr.bin/cc .endif .endif -cross-tools: +cross-tools: .MAKE .for _tool in \ ${_clang_libs} \ ${_clang} \ @@ -1383,12 +1383,12 @@ hierarchy hier: # interdependencies (__L) are built automatically by the # ${.CURDIR}/tools/make_libdeps.sh script. # -libraries: - cd ${.CURDIR}; \ - ${MAKE} -f Makefile.inc1 _prereq_libs; \ - ${MAKE} -f Makefile.inc1 _startup_libs; \ - ${MAKE} -f Makefile.inc1 _prebuild_libs; \ - ${MAKE} -f Makefile.inc1 _generic_libs; +libraries: .MAKE + cd ${.CURDIR} && \ + ${MAKE} -f Makefile.inc1 _prereq_libs && \ + ${MAKE} -f Makefile.inc1 _startup_libs && \ + ${MAKE} -f Makefile.inc1 _prebuild_libs && \ + ${MAKE} -f Makefile.inc1 _generic_libs # # static libgcc.a prerequisite for shared libc @@ -1542,7 +1542,7 @@ lib/libradius__L: lib/libmd__L .endif .for _lib in ${_prereq_libs} -${_lib}__PL: .PHONY +${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ @@ -1554,7 +1554,7 @@ ${_lib}__PL: .PHONY .endfor .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} -${_lib}__L: .PHONY +${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ @@ -1568,7 +1568,7 @@ ${_lib}__L: .PHONY # libpam is special: we need to build static PAM modules before # static PAM library, and dynamic PAM library before dynamic PAM # modules. -lib/libpam__L: .PHONY +lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ cd ${.CURDIR}/lib/libpam && \ ${MAKE} DIRPRFX=lib/libpam/ obj && \ @@ -1583,7 +1583,7 @@ _generic_libs: ${_generic_libs:S/$/__L/} .for __target in all clean cleandepend cleandir depend includes obj .for entry in ${SUBDIR} -${entry}.${__target}__D: .PHONY +${entry}.${__target}__D: .PHONY .MAKE ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ edir=${entry}.${MACHINE_ARCH}; \ From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 01:46:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9AD872D; Sat, 6 Jul 2013 01:46:59 +0000 (UTC) (envelope-from delphij@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 AB6271F4B; Sat, 6 Jul 2013 01:46:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r661kxlg064493; Sat, 6 Jul 2013 01:46:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r661kx1j064491; Sat, 6 Jul 2013 01:46:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060146.r661kx1j064491@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 01:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252857 - head/sys/dev/arcmsr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 01:46:59 -0000 Author: delphij Date: Sat Jul 6 01:46:58 2013 New Revision: 252857 URL: http://svnweb.freebsd.org/changeset/base/252857 Log: Refresh vendor driver version which fixes command queue full issue with ARC-1214 and ARC-1224. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 1 day Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Sat Jul 6 00:13:08 2013 (r252856) +++ head/sys/dev/arcmsr/arcmsr.c Sat Jul 6 01:46:58 2013 (r252857) @@ -35,44 +35,45 @@ ******************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support -** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, -** firmware version check -** and firmware update notify for hardware bug fix -** handling if none zero high part physical address -** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy -** add iop message xfer -** with scsi pass-through command -** add new device id of sas raid adapters -** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report -** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x -** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic -** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start -** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed -** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command -** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition -** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** clean unused function +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** firmware version check +** and firmware update notify for hardware bug fix +** handling if none zero high part physical address +** of srb resource +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** add iop message xfer +** with scsi pass-through command +** add new device id of sas raid adapters +** code fit for SPARC64 & PPC +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** and cause g_vfs_done() read write error +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** bus_dmamem_alloc() with BUS_DMA_ZERO +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 +** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ****************************************************************************************** */ @@ -144,7 +145,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06" #include /* ************************************************************************** @@ -753,7 +754,7 @@ static void arcmsr_srb_complete(struct C if(stand_flag == 1) { atomic_subtract_int(&acb->srboutstandingcount, 1); if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < (acb->firm_numbers_queue -10))) { + acb->srboutstandingcount < (acb->maxOutstanding -10))) { acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } @@ -1599,8 +1600,7 @@ static void arcmsr_rescan_lun(struct Ada if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) return; - if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) - != CAM_REQ_CMP) + if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); return; @@ -1940,11 +1940,11 @@ static void arcmsr_hbc_postqueue_isr(str /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); + throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); - break; + throttling = 0; } - throttling++; } /*drain reply FIFO*/ } /* @@ -2687,7 +2687,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= acb->firm_numbers_queue) { + if(acb->srboutstandingcount >= acb->maxOutstanding) { if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) == 0) { xpt_freeze_simq(acb->psim, 1); @@ -3431,6 +3431,10 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3477,6 +3481,10 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBB_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBB_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3524,6 +3532,10 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3572,6 +3584,10 @@ static void arcmsr_get_hbd_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Sat Jul 6 00:13:08 2013 (r252856) +++ head/sys/dev/arcmsr/arcmsr.h Sat Jul 6 01:46:58 2013 (r252857) @@ -1182,6 +1182,7 @@ struct AdapterControlBlock { u_int32_t pktReturnCount; u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; + u_int32_t maxOutstanding; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 02:49:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 865ECCF2; Sat, 6 Jul 2013 02:49:57 +0000 (UTC) (envelope-from markj@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 5DEC21093; Sat, 6 Jul 2013 02:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r662nv9I082277; Sat, 6 Jul 2013 02:49:57 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r662nvHp082274; Sat, 6 Jul 2013 02:49:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060249.r662nvHp082274@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 02:49: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: r252858 - in stable/9/sys/cddl/dev: dtrace/amd64 sdt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 02:49:57 -0000 Author: markj Date: Sat Jul 6 02:49:56 2013 New Revision: 252858 URL: http://svnweb.freebsd.org/changeset/base/252858 Log: MFC r251238: SDT probes can directly pass up to five arguments as arguments to dtrace_probe(). Arguments beyond these five must be obtained in an architecture-specific way; this can be done through the getargval provider method, and through dtrace_getarg() if getargval isn't overridden. This change fixes two off-by-one bugs in the way these arguments are fetched in FreeBSD's DTrace implementation. First, the SDT provider must set the aframes parameter to 1 when creating a probe. The aframes parameter controls the number of frames that dtrace_getarg() will step over in order to find the frame containing the extra arguments. On FreeBSD, dtrace_getarg() is called in SDT probe context via dtrace_probe()->dtrace_dif_emulate()->dtrace_dif_variable->dtrace_getarg() so aframes must be 3 since the arguments are in dtrace_probe()'s frame; it was previously being called with a value of 2 instead. illumos uses a different aframes value for SDT probes, but this is because illumos SDT probes fire by triggering the #UD fault handler rather than calling dtrace_probe() directly. The second bug has to do with the way arguments are grabbed out dtrace_probe()'s frame on amd64. The code currently jumps over the first stack argument and retrieves the rest of them using a pointer into the stack. This works on i386 because all of dtrace_probe()'s arguments will be on the stack and the first argument is the probe ID, which should be ignored. However, it is incorrect to ignore the first stack argument on amd64, so we correct the pointer used to access the arguments. Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/9/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 01:46:58 2013 (r252857) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:49:56 2013 (r252858) @@ -398,7 +398,7 @@ dtrace_getarg(int arg, int aframes) } arg -= (inreg + 1); - stack = (uintptr_t *)&fp[1]; + stack = (uintptr_t *)fp + 2; load: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Sat Jul 6 01:46:58 2013 (r252857) +++ stable/9/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:49:56 2013 (r252858) @@ -134,7 +134,7 @@ sdt_probe_callback(struct sdt_probe *pro return (0); (void) dtrace_probe_create(prov->id, probe->mod, probe->func, - probe->name, 0, probe); + probe->name, 1, probe); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 02:50:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8C3CE1D; Sat, 6 Jul 2013 02:50:23 +0000 (UTC) (envelope-from markj@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 7F8081098; Sat, 6 Jul 2013 02:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r662oNTw082462; Sat, 6 Jul 2013 02:50:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r662oNjG082460; Sat, 6 Jul 2013 02:50:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060250.r662oNjG082460@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 02:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252859 - in stable/8/sys/cddl/dev: dtrace/amd64 sdt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 02:50:23 -0000 Author: markj Date: Sat Jul 6 02:50:22 2013 New Revision: 252859 URL: http://svnweb.freebsd.org/changeset/base/252859 Log: MFC r251238: SDT probes can directly pass up to five arguments as arguments to dtrace_probe(). Arguments beyond these five must be obtained in an architecture-specific way; this can be done through the getargval provider method, and through dtrace_getarg() if getargval isn't overridden. This change fixes two off-by-one bugs in the way these arguments are fetched in FreeBSD's DTrace implementation. First, the SDT provider must set the aframes parameter to 1 when creating a probe. The aframes parameter controls the number of frames that dtrace_getarg() will step over in order to find the frame containing the extra arguments. On FreeBSD, dtrace_getarg() is called in SDT probe context via dtrace_probe()->dtrace_dif_emulate()->dtrace_dif_variable->dtrace_getarg() so aframes must be 3 since the arguments are in dtrace_probe()'s frame; it was previously being called with a value of 2 instead. illumos uses a different aframes value for SDT probes, but this is because illumos SDT probes fire by triggering the #UD fault handler rather than calling dtrace_probe() directly. The second bug has to do with the way arguments are grabbed out dtrace_probe()'s frame on amd64. The code currently jumps over the first stack argument and retrieves the rest of them using a pointer into the stack. This works on i386 because all of dtrace_probe()'s arguments will be on the stack and the first argument is the probe ID, which should be ignored. However, it is incorrect to ignore the first stack argument on amd64, so we correct the pointer used to access the arguments. Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/8/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:49:56 2013 (r252858) +++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:50:22 2013 (r252859) @@ -398,7 +398,7 @@ dtrace_getarg(int arg, int aframes) } arg -= (inreg + 1); - stack = (uintptr_t *)&fp[1]; + stack = (uintptr_t *)fp + 2; load: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); Modified: stable/8/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/8/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:49:56 2013 (r252858) +++ stable/8/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:50:22 2013 (r252859) @@ -134,7 +134,7 @@ sdt_probe_callback(struct sdt_probe *pro return (0); (void) dtrace_probe_create(prov->id, probe->mod, probe->func, - probe->name, 0, probe); + probe->name, 1, probe); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 03:39:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5AAB775A; Sat, 6 Jul 2013 03:39:41 +0000 (UTC) (envelope-from markj@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 4D1CE133A; Sat, 6 Jul 2013 03:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r663dfqh098341; Sat, 6 Jul 2013 03:39:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r663dfkM098340; Sat, 6 Jul 2013 03:39:41 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060339.r663dfkM098340@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 03: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: r252860 - stable/9/sys/cddl/dev/dtmalloc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 03:39:41 -0000 Author: markj Date: Sat Jul 6 03:39:40 2013 New Revision: 252860 URL: http://svnweb.freebsd.org/changeset/base/252860 Log: MFC r252325: The dtmalloc provider uses the short description of a malloc type as the function name of its corresponding DTrace probes. These descriptions may contain whitespace, but probe names cannot, so just replace any whitespace with underscores when creating probes. Modified: stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 02:50:22 2013 (r252859) +++ stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:39:40 2013 (r252860) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp { char name[DTRACE_FUNCNAMELEN]; struct malloc_type_internal *mtip = mtp->ks_handle; + int i; + /* + * malloc_type descriptions are allowed to contain whitespace, but + * DTrace probe identifiers are not, so replace the whitespace with + * underscores. + */ strlcpy(name, mtp->ks_shortdesc, sizeof(name)); + for (i = 0; name[i] != 0; i++) + if (isspace(name[i])) + name[i] = '_'; if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0) return; From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 03:40:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8995D887; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) (envelope-from markj@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 7735D133F; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r663e0LU098445; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r663e0Jh098444; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060340.r663e0Jh098444@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 03:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252861 - stable/8/sys/cddl/dev/dtmalloc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 03:40:00 -0000 Author: markj Date: Sat Jul 6 03:40:00 2013 New Revision: 252861 URL: http://svnweb.freebsd.org/changeset/base/252861 Log: MFC r252325: The dtmalloc provider uses the short description of a malloc type as the function name of its corresponding DTrace probes. These descriptions may contain whitespace, but probe names cannot, so just replace any whitespace with underscores when creating probes. Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:39:40 2013 (r252860) +++ stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:40:00 2013 (r252861) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp { char name[DTRACE_FUNCNAMELEN]; struct malloc_type_internal *mtip = mtp->ks_handle; + int i; + /* + * malloc_type descriptions are allowed to contain whitespace, but + * DTrace probe identifiers are not, so replace the whitespace with + * underscores. + */ strlcpy(name, mtp->ks_shortdesc, sizeof(name)); + for (i = 0; name[i] != 0; i++) + if (isspace(name[i])) + name[i] = '_'; if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0) return; From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 04:13:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3535D16A; Sat, 6 Jul 2013 04:13:48 +0000 (UTC) (envelope-from dteske@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 281B115F6; Sat, 6 Jul 2013 04:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r664DmYJ009603; Sat, 6 Jul 2013 04:13:48 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r664DmT5009602; Sat, 6 Jul 2013 04:13:48 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307060413.r664DmT5009602@svn.freebsd.org> From: Devin Teske Date: Sat, 6 Jul 2013 04:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252862 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 04:13:48 -0000 Author: dteske Date: Sat Jul 6 04:13:47 2013 New Revision: 252862 URL: http://svnweb.freebsd.org/changeset/base/252862 Log: Take the training-wheels off, after nearly 30 months of development. MFC to stable/9 planned after MFC 3-day period. The MFC to stable/9 is desired for the next release to get some much-needed time: + Living side-by-side with sysinstall for compare/contrast/transition + Living side-by-side with bsdinstall for integration/transition + Additional feedback/testing before eventual 10.0-R to make it even better MFC after: 3 days Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Jul 6 03:40:00 2013 (r252861) +++ head/usr.sbin/Makefile Sat Jul 6 04:13:47 2013 (r252862) @@ -6,6 +6,7 @@ SUBDIR= adduser \ arp \ bootparamd \ + bsdconfig \ bsdinstall \ cdcontrol \ chkgrp \ @@ -80,6 +81,7 @@ SUBDIR= adduser \ snapinfo \ spray \ syslogd \ + sysrc \ tcpdchk \ tcpdmatch \ tcpdrop \ @@ -146,11 +148,6 @@ SUBDIR+= rndc-confgen SUBDIR+= bluetooth .endif -.if ${MK_BSDCONFIG} != "no" -SUBDIR+= bsdconfig -SUBDIR+= sysrc -.endif - .if ${MK_BSNMP} != "no" SUBDIR+= bsnmpd .endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 04:18:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 87C18355; Sat, 6 Jul 2013 04:18:35 +0000 (UTC) (envelope-from rpaulo@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 6085616A2; Sat, 6 Jul 2013 04:18:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r664IZGI010492; Sat, 6 Jul 2013 04:18:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r664IZTh010490; Sat, 6 Jul 2013 04:18:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307060418.r664IZTh010490@svn.freebsd.org> From: Rui Paulo Date: Sat, 6 Jul 2013 04:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252863 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 04:18:35 -0000 Author: rpaulo Date: Sat Jul 6 04:18:34 2013 New Revision: 252863 URL: http://svnweb.freebsd.org/changeset/base/252863 Log: Don't clear the SYSCONFIG register on boot. This follows section 18.4.2.2 SD Soft Reset Flow in the TI AM335x Technical Reference Manual and seems to fix the "ti_mmchs0: Error: current cmd NULL, already done?" messages. Modified: head/sys/arm/ti/ti_mmchs.c head/sys/arm/ti/ti_mmchs.h Modified: head/sys/arm/ti/ti_mmchs.c ============================================================================== --- head/sys/arm/ti/ti_mmchs.c Sat Jul 6 04:13:47 2013 (r252862) +++ head/sys/arm/ti/ti_mmchs.c Sat Jul 6 04:18:34 2013 (r252863) @@ -1327,7 +1327,7 @@ ti_mmchs_hw_init(device_t dev) unsigned long timeout; uint32_t sysctl; uint32_t capa; - uint32_t con; + uint32_t con, sysconfig; /* 1: Enable the controller and interface/functional clocks */ clk = MMC0_CLK + sc->device_id; @@ -1344,7 +1344,9 @@ ti_mmchs_hw_init(device_t dev) } /* 2: Issue a softreset to the controller */ - ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, 0x0002); + sysconfig = ti_mmchs_read_4(sc, MMCHS_SYSCONFIG); + sysconfig |= MMCHS_SYSCONFIG_SRST; + ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, sysconfig); timeout = 100; while ((ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & 0x01) == 0x0) { DELAY(1000); Modified: head/sys/arm/ti/ti_mmchs.h ============================================================================== --- head/sys/arm/ti/ti_mmchs.h Sat Jul 6 04:13:47 2013 (r252862) +++ head/sys/arm/ti/ti_mmchs.h Sat Jul 6 04:18:34 2013 (r252863) @@ -67,6 +67,12 @@ #define AM335X_MMCHS_REG_OFFSET 0x100 /* Register bit settings */ +#define MMCHS_SYSCONFIG_CLK_FUN (2 << 8) +#define MMCHS_SYSCONFIG_CLK_IFC (1 << 8) +#define MMCHS_SYSCONFIG_SIDL (2 << 3) +#define MMCHS_SYSCONFIG_ENW (1 << 2) +#define MMCHS_SYSCONFIG_SRST (1 << 1) +#define MMCHS_SYSCONFIG_AIDL (1 << 0) #define MMCHS_STAT_BADA (1UL << 29) #define MMCHS_STAT_CERR (1UL << 28) #define MMCHS_STAT_ACE (1UL << 24) From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 04:46:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 990C46A5; Sat, 6 Jul 2013 04:46:42 +0000 (UTC) (envelope-from kib@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 8BDEF1730; Sat, 6 Jul 2013 04:46:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r664kg0H018635; Sat, 6 Jul 2013 04:46:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r664kgqt018634; Sat, 6 Jul 2013 04:46:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307060446.r664kgqt018634@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 6 Jul 2013 04:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252864 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 04:46:42 -0000 Author: kib Date: Sat Jul 6 04:46:42 2013 New Revision: 252864 URL: http://svnweb.freebsd.org/changeset/base/252864 Log: Remove unneeded page lock around vm_page_insert(). Submitted by: alc Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Jul 6 04:18:34 2013 (r252863) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Jul 6 04:46:42 2013 (r252864) @@ -220,9 +220,7 @@ reserve: } m->valid = VM_PAGE_BITS_ALL; *mres = m; - vm_page_lock(m); vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); - vm_page_unlock(m); vm_page_busy(m); if (oldm != NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 07:49:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BB796A5F; Sat, 6 Jul 2013 07:49:43 +0000 (UTC) (envelope-from delphij@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 9D7761CA5; Sat, 6 Jul 2013 07:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r667nhw3070883; Sat, 6 Jul 2013 07:49:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r667nfQG070874; Sat, 6 Jul 2013 07:49:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060749.r667nfQG070874@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 07:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252867 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/hpt27xx sys/dev/hptnr sys/i386/conf sys/modules sys/modules/hpt27xx sys/modules/hptnr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 07:49:43 -0000 Author: delphij Date: Sat Jul 6 07:49:41 2013 New Revision: 252867 URL: http://svnweb.freebsd.org/changeset/base/252867 Log: Import HighPoint DC Series Data Center HBA (DC7280 and R750) driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. MFC after: 1 day Added: head/share/man/man4/hptnr.4 (contents, props changed) head/sys/dev/hpt27xx/hpt27xx_os_bsd.c - copied unchanged from r252864, head/sys/dev/hpt27xx/os_bsd.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c - copied unchanged from r252859, head/sys/dev/hpt27xx/osm_bsd.c head/sys/dev/hptnr/ head/sys/dev/hptnr/README (contents, props changed) head/sys/dev/hptnr/amd64-elf.hptnr_lib.o.uu (contents, props changed) head/sys/dev/hptnr/array.h (contents, props changed) head/sys/dev/hptnr/him.h (contents, props changed) head/sys/dev/hptnr/himfuncs.h (contents, props changed) head/sys/dev/hptnr/hptintf.h (contents, props changed) head/sys/dev/hptnr/hptnr_config.c (contents, props changed) head/sys/dev/hptnr/hptnr_config.h (contents, props changed) head/sys/dev/hptnr/hptnr_os_bsd.c (contents, props changed) head/sys/dev/hptnr/hptnr_osm_bsd.c (contents, props changed) head/sys/dev/hptnr/i386-elf.hptnr_lib.o.uu (contents, props changed) head/sys/dev/hptnr/ldm.h (contents, props changed) head/sys/dev/hptnr/list.h (contents, props changed) head/sys/dev/hptnr/os_bsd.h (contents, props changed) head/sys/dev/hptnr/osm.h (contents, props changed) head/sys/dev/hptnr/wj.h (contents, props changed) head/sys/modules/hptnr/ head/sys/modules/hptnr/Makefile (contents, props changed) Deleted: head/sys/dev/hpt27xx/os_bsd.c head/sys/dev/hpt27xx/osm_bsd.c Modified: head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/WITHOUT_SOURCELESS_HOST head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/i386/conf/PAE head/sys/i386/conf/XEN head/sys/modules/Makefile head/sys/modules/hpt27xx/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Jul 6 06:34:53 2013 (r252866) +++ head/share/man/man4/Makefile Sat Jul 6 07:49:41 2013 (r252867) @@ -163,6 +163,7 @@ MAN= aac.4 \ ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ + ${_hptnr.4} \ ${_hptrr.4} \ hwpmc.4 \ ichsmb.4 \ @@ -745,6 +746,7 @@ _dpms.4= dpms.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 +_hptnr.4= hptnr.4 _hptrr.4= hptrr.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 Added: head/share/man/man4/hptnr.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hptnr.4 Sat Jul 6 07:49:41 2013 (r252867) @@ -0,0 +1,92 @@ +.\"- +.\" Copyright (c) 2013 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 5, 2013 +.Dt HPTNR 4 +.Os +.Sh NAME +.Nm hptnr +.Nd "HighPoint DC Series Data Center HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hptnr" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hptnr_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's DC Series Data Center HBA card. +.Sh HARDWARE +The +.Nm +driver supports the following SATA +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's DC7280 series +.It +HighPoint's Rocket R750 series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat Jul 6 06:34:53 2013 (r252866) +++ head/sys/amd64/conf/GENERIC Sat Jul 6 07:49:41 2013 (r252867) @@ -147,6 +147,7 @@ device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sat Jul 6 06:34:53 2013 (r252866) +++ head/sys/amd64/conf/NOTES Sat Jul 6 07:49:41 2013 (r252867) @@ -418,6 +418,10 @@ device hpt27xx device hptmv # +# Highpoint DC7280 and R750. +device hptnr + +# # Highpoint RocketRAID. Supports RR172x, RR222x, RR2240, RR232x, RR2340, # RR2210, RR174x, RR2522, RR231x, RR230x. device hptrr Modified: head/sys/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 06:34:53 2013 (r252866) +++ head/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 07:49:41 2013 (r252867) @@ -6,5 +6,6 @@ nodevice hpt27xx nodevice hptmv +nodevice hptnr nodevice hptrr nodevice nve Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Jul 6 06:34:53 2013 (r252866) +++ head/sys/conf/files.amd64 Sat Jul 6 07:49:41 2013 (r252867) @@ -62,10 +62,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ no-implicit-rule +# +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ @@ -190,14 +197,17 @@ dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard dev/fdt/fdt_x86.c optional fdt -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Jul 6 06:34:53 2013 (r252866) +++ head/sys/conf/files.i386 Sat Jul 6 07:49:41 2013 (r252867) @@ -61,11 +61,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ no-implicit-rule # +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ @@ -181,14 +187,17 @@ dev/fe/if_fe_isa.c optional fe isa dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Copied: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c (from r252864, head/sys/dev/hpt27xx/os_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jul 6 07:49:41 2013 (r252867, copy of r252864, head/sys/dev/hpt27xx/os_bsd.c) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include + +/* hardware access */ +HPT_U8 os_inb (void *port) { return inb((unsigned)(HPT_UPTR)port); } +HPT_U16 os_inw (void *port) { return inw((unsigned)(HPT_UPTR)port); } +HPT_U32 os_inl (void *port) { return inl((unsigned)(HPT_UPTR)port); } + +void os_outb (void *port, HPT_U8 value) { outb((unsigned)(HPT_UPTR)port, (value)); } +void os_outw (void *port, HPT_U16 value) { outw((unsigned)(HPT_UPTR)port, (value)); } +void os_outl (void *port, HPT_U32 value) { outl((unsigned)(HPT_UPTR)port, (value)); } + +void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count) +{ insw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count) +{ outsw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +HPT_U32 __dummy_reg = 0; + +/* PCI configuration space */ +HPT_U8 os_pci_readb (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 1); +} + +HPT_U16 os_pci_readw (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 2); +} + +HPT_U32 os_pci_readl (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 4); +} + +void os_pci_writeb (void *osext, HPT_U8 offset, HPT_U8 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 1); +} + +void os_pci_writew (void *osext, HPT_U8 offset, HPT_U16 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 2); +} + +void os_pci_writel (void *osext, HPT_U8 offset, HPT_U32 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 4); +} + +#if __FreeBSD_version < 500043 +/* PCI space access */ +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U8 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 1); + return v; +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U32 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 4); + return v; +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 4); +}/* PCI space access */ +#else +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U8)pci_cfgregread(bus, dev, func, reg, 1); +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4); +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 4); +}/* PCI space access */ +#endif + +void *os_map_pci_bar( + void *osext, + int index, + HPT_U32 offset, + HPT_U32 length +) +{ + PHBA hba = (PHBA)osext; + HPT_U32 base; + + hba->pcibar[index].rid = 0x10 + index * 4; + base = pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4); + + if (base & 1) { + hba->pcibar[index].type = SYS_RES_IOPORT; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); + } else { + hba->pcibar[index].type = SYS_RES_MEMORY; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; + } + + return hba->pcibar[index].base; +} + +void os_unmap_pci_bar(void *osext, void *base) +{ + PHBA hba = (PHBA)osext; + int index; + + for (index=0; index<6; index++) { + if (hba->pcibar[index].base==base) { + bus_release_resource(hba->pcidev, hba->pcibar[index].type, + hba->pcibar[index].rid, hba->pcibar[index].res); + hba->pcibar[index].base = 0; + return; + } + } +} + +void freelist_reserve(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_head; + vbus_ext->freelist_head = list; + list->dma = 0; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get(struct freelist *list) +{ + void * result; + if (list->count) { + HPT_ASSERT(list->head); + result = list->head; + list->head = *(void **)result; + list->count--; + return result; + } + return 0; +} + +void freelist_put(struct freelist * list, void *p) +{ + HPT_ASSERT(list->dma==0); + list->count++; + *(void **)p = list->head; + list->head = p; +} + +void freelist_reserve_dma(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT alignment, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_dma_head; + vbus_ext->freelist_dma_head = list; + list->dma = 1; + list->alignment = alignment; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get_dma(struct freelist *list, BUS_ADDRESS *busaddr) +{ + void *result; + HPT_ASSERT(list->dma); + result = freelist_get(list); + if (result) + *busaddr = *(BUS_ADDRESS *)((void **)result+1); + return result; +} + +void freelist_put_dma(struct freelist *list, void *p, BUS_ADDRESS busaddr) +{ + HPT_ASSERT(list->dma); + list->count++; + *(void **)p = list->head; + *(BUS_ADDRESS *)((void **)p+1) = busaddr; + list->head = p; +} + +HPT_U32 os_get_stamp(void) +{ + HPT_U32 stamp; + do { stamp = random(); } while (stamp==0); + return stamp; +} + +void os_stallexec(HPT_U32 microseconds) +{ + DELAY(microseconds); +} + +static void os_timer_for_ldm(void *arg) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)arg; + ldm_on_timer((PVBUS)vbus_ext->vbus); +} + +void os_request_timer(void * osext, HPT_U32 interval) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); + + untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); + vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); +} + +HPT_TIME os_query_time(void) +{ + return ticks * (1000000 / hz); +} + +void os_schedule_task(void *osext, OSM_TASK *task) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(task->next==0); + + if (vbus_ext->tasks==0) + vbus_ext->tasks = task; + else { + OSM_TASK *t = vbus_ext->tasks; + while (t->next) t = t->next; + t->next = task; + } + + if (vbus_ext->worker.ta_context) + TASK_ENQUEUE(&vbus_ext->worker); +} + +int os_revalidate_device(void *osext, int id) +{ + + return 0; +} + +int os_query_remove_device(void *osext, int id) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; + struct cam_periph *periph = NULL; + struct cam_path *path; + int status,retval = 0; + + status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); + if (status == CAM_REQ_CMP) { + if((periph = cam_periph_find(path, "da")) != NULL){ + if(periph->refcount >= 1) + retval = -1; + } + xpt_free_path(path); + } + + return retval; +} + +HPT_U8 os_get_vbus_seq(void *osext) +{ + return ((PVBUS_EXT)osext)->sim->path_id; +} + +int os_printk(char *fmt, ...) +{ + va_list args; + static char buf[512]; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + return printf("%s: %s\n", driver_name, buf); +} + +#if DBG +void os_check_stack(const char *location, int size){} + +void __os_dbgbreak(const char *file, int line) +{ + printf("*** break at %s:%d ***", file, line); + while (1); +} + +int hpt_dbg_level = 1; +#endif Copied: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c (from r252859, head/sys/dev/hpt27xx/osm_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jul 6 07:49:41 2013 (r252867, copy of r252859, head/sys/dev/hpt27xx/osm_bsd.c) @@ -0,0 +1,1361 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include + +static int hpt_probe(device_t dev) +{ + PCI_ID pci_id; + HIM *him; + int i; + PHBA hba; + + for (him = him_list; him; him = him->next) { + for (i=0; him->get_supported_device_id(i, &pci_id); i++) { + if (him->get_controller_count) + him->get_controller_count(&pci_id,0,0); + if ((pci_get_vendor(dev) == pci_id.vid) && + (pci_get_device(dev) == pci_id.did)){ + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + hba = (PHBA)device_get_softc(dev); + memset(hba, 0, sizeof(HBA)); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; + return 0; + } + } + } + + return (ENXIO); +} + +static int hpt_attach(device_t dev) +{ + PHBA hba = (PHBA)device_get_softc(dev); + HIM *him = hba->ldm_adapter.him; + PCI_ID pci_id; + HPT_UINT size; + PVBUS vbus; + PVBUS_EXT vbus_ext; + + KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); + +#if __FreeBSD_version >=440000 + pci_enable_busmaster(dev); +#endif + + pci_id.vid = pci_get_vendor(dev); + pci_id.did = pci_get_device(dev); + pci_id.rev = pci_get_revid(dev); + pci_id.subsys = (HPT_U32)(pci_get_subdevice(dev)) << 16 | pci_get_subvendor(dev); + + size = him->get_adapter_size(&pci_id); + hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); + if (!hba->ldm_adapter.him_handle) + return ENXIO; + + hba->pcidev = dev; + hba->pciaddr.tree = 0; + hba->pciaddr.bus = pci_get_bus(dev); + hba->pciaddr.device = pci_get_slot(dev); + hba->pciaddr.function = pci_get_function(dev); + + if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + + os_printk("adapter at PCI %d:%d:%d, IRQ %d", + hba->pciaddr.bus, hba->pciaddr.device, hba->pciaddr.function, pci_get_irq(dev)); + + if (!ldm_register_adapter(&hba->ldm_adapter)) { + size = ldm_get_vbus_size(); + vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); + if (!vbus_ext) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + memset(vbus_ext, 0, sizeof(VBUS_EXT)); + vbus_ext->ext_type = EXT_TYPE_VBUS; + ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); + ldm_register_adapter(&hba->ldm_adapter); + } + + ldm_for_each_vbus(vbus, vbus_ext) { + if (hba->ldm_adapter.vbus==vbus) { + hba->vbus_ext = vbus_ext; + hba->next = vbus_ext->hba_list; + vbus_ext->hba_list = hba; + break; + } + } + return 0; +} + +/* + * Maybe we'd better to use the bus_dmamem_alloc to alloc DMA memory, + * but there are some problems currently (alignment, etc). + */ +static __inline void *__get_free_pages(int order) +{ + /* don't use low memory - other devices may get starved */ + return contigmalloc(PAGE_SIZE<hba_list; hba; hba = hba->next) + hba->ldm_adapter.him->get_meminfo(hba->ldm_adapter.him_handle); + + ldm_get_mem_info((PVBUS)vbus_ext->vbus, 0); + + for (f=vbus_ext->freelist_head; f; f=f->next) { + KdPrint(("%s: %d*%d=%d bytes", + f->tag, f->count, f->size, f->count*f->size)); + for (i=0; icount; i++) { + p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); + if (!p) return (ENXIO); + *p = f->head; + f->head = p; + } + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size, j; + + HPT_ASSERT((f->size & (f->alignment-1))==0); + + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) + ; + + KdPrint(("%s: %d*%d=%d bytes, order %d", + f->tag, f->count, f->size, f->count*f->size, order)); + HPT_ASSERT(f->alignment<=PAGE_SIZE); + + for (i=0; icount;) { + p = (void **)__get_free_pages(order); + if (!p) return -1; + for (j = size/f->size; j && icount; i++,j--) { + *p = f->head; + *(BUS_ADDRESS *)(p+1) = (BUS_ADDRESS)vtophys(p); + f->head = p; + p = (void **)((unsigned long)p + f->size); + } + } + } + + HPT_ASSERT(PAGE_SIZE==DMAPOOL_PAGE_SIZE); + + for (i=0; ivbus, p, (BUS_ADDRESS)vtophys(p)); + } + + return 0; +} + +static void hpt_free_mem(PVBUS_EXT vbus_ext) +{ + struct freelist *f; + void *p; + int i; + BUS_ADDRESS bus; + + for (f=vbus_ext->freelist_head; f; f=f->next) { +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + while ((p=freelist_get(f))) + free(p, M_DEVBUF); + } + + for (i=0; ivbus, &bus); + HPT_ASSERT(p); + free_pages(p, 0); + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size; +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for dma freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; + + while ((p=freelist_get_dma(f, &bus))) { + if (order) + free_pages(p, order); + else { + /* can't free immediately since other blocks in this page may still be in the list */ + if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) + dmapool_put_page((PVBUS)vbus_ext->vbus, p, bus); + } + } + } + + while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) + free_pages(p, 0); +} + +static int hpt_init_vbus(PVBUS_EXT vbus_ext) +{ + PHBA hba; + + for (hba = vbus_ext->hba_list; hba; hba = hba->next) + if (!hba->ldm_adapter.him->initialize(hba->ldm_adapter.him_handle)) { + KdPrint(("fail to initialize %p", hba)); + return -1; + } + + ldm_initialize_vbus((PVBUS)vbus_ext->vbus, &vbus_ext->hba_list->ldm_adapter); + return 0; +} + +static void hpt_flush_done(PCOMMAND pCmd) +{ + PVDEV vd = pCmd->target; + + if (mIsArray(vd->type) && vd->u.array.transform && vd!=vd->u.array.transform->target) { + vd = vd->u.array.transform->target; + HPT_ASSERT(vd); + pCmd->target = vd; + pCmd->Result = RETURN_PENDING; + vdev_queue_cmd(pCmd); + return; + } + + *(int *)pCmd->priv = 1; + wakeup(pCmd); +} + +/* + * flush a vdev (without retry). + */ +static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) +{ + PCOMMAND pCmd; + int result = 0, done; + HPT_UINT count; + + KdPrint(("flusing dev %p", vd)); + + hpt_lock_vbus(vbus_ext); + + if (mIsArray(vd->type) && vd->u.array.transform) + count = MAX(vd->u.array.transform->source->cmds_per_request, + vd->u.array.transform->target->cmds_per_request); + else + count = vd->cmds_per_request; + + pCmd = ldm_alloc_cmds(vd->vbus, count); + + if (!pCmd) { + hpt_unlock_vbus(vbus_ext); + return -1; + } + + pCmd->type = CMD_TYPE_FLUSH; + pCmd->flags.hard_flush = 1; + pCmd->target = vd; + pCmd->done = hpt_flush_done; + done = 0; + pCmd->priv = &done; + + ldm_queue_cmd(pCmd); + + if (!done) { + while (hpt_sleep(vbus_ext, pCmd, PPAUSE, "hptfls", HPT_OSM_TIMEOUT)) { + ldm_reset_vbus(vd->vbus); + } + } + + KdPrint(("flush result %d", pCmd->Result)); + + if (pCmd->Result!=RETURN_SUCCESS) + result = -1; + + ldm_free_cmds(pCmd); + + hpt_unlock_vbus(vbus_ext); + + return result; +} + +static void hpt_stop_tasks(PVBUS_EXT vbus_ext); +static void hpt_shutdown_vbus(PVBUS_EXT vbus_ext, int howto) +{ + PVBUS vbus = (PVBUS)vbus_ext->vbus; + PHBA hba; + int i; + + KdPrint(("hpt_shutdown_vbus")); + + /* stop all ctl tasks and disable the worker taskqueue */ + hpt_stop_tasks(vbus_ext); + vbus_ext->worker.ta_context = 0; + + /* flush devices */ + for (i=0; ihba_list; hba; hba=hba->next) + bus_teardown_intr(hba->pcidev, hba->irq_res, hba->irq_handle); + + hpt_free_mem(vbus_ext); + + while ((hba=vbus_ext->hba_list)) { + vbus_ext->hba_list = hba->next; + free(hba->ldm_adapter.him_handle, M_DEVBUF); + } + + free(vbus_ext, M_DEVBUF); + KdPrint(("hpt_shutdown_vbus done")); +} + +static void __hpt_do_tasks(PVBUS_EXT vbus_ext) +{ + OSM_TASK *tasks; + + tasks = vbus_ext->tasks; + vbus_ext->tasks = 0; + + while (tasks) { + OSM_TASK *t = tasks; + tasks = t->next; + t->next = 0; + t->func(vbus_ext->vbus, t->data); + } +} + +static void hpt_do_tasks(PVBUS_EXT vbus_ext, int pending) +{ + if(vbus_ext){ + hpt_lock_vbus(vbus_ext); + __hpt_do_tasks(vbus_ext); + hpt_unlock_vbus(vbus_ext); + } +} + +static void hpt_action(struct cam_sim *sim, union ccb *ccb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:30:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BA37DF; Sat, 6 Jul 2013 08:30:47 +0000 (UTC) (envelope-from delphij@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 4C26B1DC0; Sat, 6 Jul 2013 08:30:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668UlAF084606; Sat, 6 Jul 2013 08:30:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668UkPE084595; Sat, 6 Jul 2013 08:30:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060830.r668UkPE084595@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 08:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252869 - in head: share/man/man4 sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:30:47 -0000 Author: delphij Date: Sat Jul 6 08:30:45 2013 New Revision: 252869 URL: http://svnweb.freebsd.org/changeset/base/252869 Log: Update driver with recent vendor improvements, most notably support of Skyhawk adapters. Many thanks to Emulex for their continued support of FreeBSD. Submitted by: "Duvvuru,Venkat Kumar" MFC after: 1 day Modified: head/share/man/man4/oce.4 head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_queue.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/oce/oce_util.c Modified: head/share/man/man4/oce.4 ============================================================================== --- head/share/man/man4/oce.4 Sat Jul 6 08:16:17 2013 (r252868) +++ head/share/man/man4/oce.4 Sat Jul 6 08:30:45 2013 (r252869) @@ -1,4 +1,4 @@ -.\" Copyright (C) 2012 Emulex +.\" Copyright (C) 2013 Emulex .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Sat Jul 6 08:16:17 2013 (r252868) +++ head/sys/dev/oce/oce_hw.c Sat Jul 6 08:30:45 2013 (r252869) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,12 +53,12 @@ oce_POST(POCE_SOFTC sc) int tmo = 60000; /* read semaphore CSR */ - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); /* if host is ready then wait for fw ready else send POST */ if (post_status.bits.stage <= POST_STAGE_AWAITING_HOST_RDY) { post_status.bits.stage = POST_STAGE_CHIP_RESET; - OCE_WRITE_REG32(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); } /* wait for FW ready */ @@ -68,7 +68,7 @@ oce_POST(POCE_SOFTC sc) DELAY(1000); - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); if (post_status.bits.error) { device_printf(sc->dev, "POST failed: %x\n", post_status.dw0); @@ -129,7 +129,7 @@ oce_hw_init(POCE_SOFTC sc) if (rc) goto error; - if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) { + if ((IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) || IS_SH(sc)) { rc = oce_mbox_check_native_mode(sc); if (rc) goto error; @@ -258,7 +258,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) rr = PCIR_BAR(pci_cfg_barnum); - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) sc->devcfg_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); @@ -298,7 +298,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) sc->flags |= OCE_FLAGS_VIRTUAL_PORT; /* Lancer has one BAR (CFG) but BE3 has three (CFG, CSR, DB) */ - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /* set up CSR region */ rr = PCIR_BAR(OCE_PCI_CSR_BAR); sc->csr_res = bus_alloc_resource_any(sc->dev, @@ -387,7 +387,7 @@ oce_create_nw_interface(POCE_SOFTC sc) } /* enable capabilities controlled via driver startup parameters */ - if (sc->rss_enable) + if (is_rss_enabled(sc)) capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; else { capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS; @@ -447,9 +447,9 @@ oce_pci_soft_reset(POCE_SOFTC sc) int rc; mpu_ep_control_t ctrl; - ctrl.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_CONTROL); + ctrl.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_CONTROL); ctrl.bits.cpu_reset = 1; - OCE_WRITE_REG32(sc, csr, MPU_EP_CONTROL, ctrl.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_CONTROL, ctrl.dw0); DELAY(50); rc=oce_POST(sc); Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Sat Jul 6 08:16:17 2013 (r252868) +++ head/sys/dev/oce/oce_hw.h Sat Jul 6 08:30:45 2013 (r252869) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,8 +63,7 @@ #define MPU_EP_CONTROL 0 #define MPU_EP_SEMAPHORE_BE3 0xac #define MPU_EP_SEMAPHORE_XE201 0x400 -#define MPU_EP_SEMAPHORE(sc) \ - ((IS_BE(sc)) ? MPU_EP_SEMAPHORE_BE3 : MPU_EP_SEMAPHORE_XE201) +#define MPU_EP_SEMAPHORE_SH 0x94 #define PCICFG_INTR_CTRL 0xfc #define HOSTINTR_MASK (1 << 29) #define HOSTINTR_PFUNC_SHIFT 26 @@ -1998,6 +1997,79 @@ struct mbx_lowlevel_set_loopback_mode { } rsp; } params; }; +#define MAX_RESC_DESC 256 +#define RESC_DESC_SIZE 88 +#define ACTIVE_PROFILE 2 +#define NIC_RESC_DESC_TYPE_V0 0x41 +#define NIC_RESC_DESC_TYPE_V1 0x51 +/* OPCODE_COMMON_GET_FUNCTION_CONFIG */ +struct mbx_common_get_func_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + + +/* OPCODE_COMMON_GET_PROFILE_CONFIG */ + +struct mbx_common_get_profile_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + +struct oce_nic_resc_desc { + uint8_t desc_type; + uint8_t desc_len; + uint8_t rsvd1; + uint8_t flags; + uint8_t vf_num; + uint8_t rsvd2; + uint8_t pf_num; + uint8_t rsvd3; + uint16_t unicast_mac_count; + uint8_t rsvd4[6]; + uint16_t mcc_count; + uint16_t vlan_count; + uint16_t mcast_mac_count; + uint16_t txq_count; + uint16_t rq_count; + uint16_t rssq_count; + uint16_t lro_count; + uint16_t cq_count; + uint16_t toe_conn_count; + uint16_t eq_count; + uint32_t rsvd5; + uint32_t cap_flags; + uint8_t link_param; + uint8_t rsvd6[3]; + uint32_t bw_min; + uint32_t bw_max; + uint8_t acpi_params; + uint8_t wol_param; + uint16_t rsvd7; + uint32_t rsvd8[7]; + +}; + struct flash_file_hdr { uint8_t sign[52]; Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Jul 6 08:16:17 2013 (r252868) +++ head/sys/dev/oce/oce_if.c Sat Jul 6 08:30:45 2013 (r252869) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ static void update_queues_got(POCE_SOFTC static void process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe); static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static void oce_get_config(POCE_SOFTC sc); static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); /* IP specific */ @@ -147,6 +148,7 @@ static uint32_t supportedDevices[] = { (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_BE3, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201_VF, + (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_SH }; @@ -190,6 +192,9 @@ oce_probe(device_t dev) case PCI_PRODUCT_XE201_VF: sc->flags |= OCE_FLAGS_XE201; break; + case PCI_PRODUCT_SH: + sc->flags |= OCE_FLAGS_SH; + break; default: return ENXIO; } @@ -214,7 +219,6 @@ oce_attach(device_t dev) if (rc) return rc; - sc->rss_enable = oce_enable_rss; sc->tx_ring_size = OCE_TX_RING_SIZE; sc->rx_ring_size = OCE_RX_RING_SIZE; sc->rq_frag_size = OCE_RQ_BUF_SIZE; @@ -229,6 +233,8 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; + oce_get_config(sc); + setup_max_queues_want(sc); rc = oce_setup_intr(sc); @@ -486,17 +492,18 @@ oce_multiq_start(struct ifnet *ifp, stru int queue_index = 0; int status = 0; + if (!sc->link_status) + return ENXIO; + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; - + wq = sc->wq[queue_index]; - if (TRY_LOCK(&wq->tx_lock)) { - status = oce_multiq_transmit(ifp, m, wq); - UNLOCK(&wq->tx_lock); - } else { - status = drbr_enqueue(ifp, wq->br, m); - } + LOCK(&wq->tx_lock); + status = oce_multiq_transmit(ifp, m, wq); + UNLOCK(&wq->tx_lock); + return status; } @@ -579,7 +586,7 @@ oce_setup_intr(POCE_SOFTC sc) int rc = 0, use_intx = 0; int vector = 0, req_vectors = 0; - if (sc->rss_enable) + if (is_rss_enabled(sc)) req_vectors = MAX((sc->nrqs - 1), sc->nwqs); else req_vectors = 1; @@ -778,7 +785,6 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct mbuf *m, *m_temp; struct oce_wq *wq = sc->wq[wq_index]; struct oce_packet_desc *pd; - uint32_t out; struct oce_nic_hdr_wqe *nichdr; struct oce_nic_frag_wqe *nicfrag; int num_wqes; @@ -816,20 +822,14 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } } - out = wq->packets_out + 1; - if (out == OCE_WQ_PACKET_ARRAY_SIZE) - out = 0; - if (out == wq->packets_in) - return EBUSY; - - pd = &wq->pckts[wq->packets_out]; + pd = &wq->pckts[wq->pkt_desc_head]; retry: rc = bus_dmamap_load_mbuf_sg(wq->tag, pd->map, m, segs, &pd->nsegs, BUS_DMA_NOWAIT); if (rc == 0) { num_wqes = pd->nsegs + 1; - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /*Dummy required only for BE3.*/ if (num_wqes & 1) num_wqes++; @@ -838,10 +838,11 @@ retry: bus_dmamap_unload(wq->tag, pd->map); return EBUSY; } - + atomic_store_rel_int(&wq->pkt_desc_head, + (wq->pkt_desc_head + 1) % \ + OCE_WQ_PACKET_ARRAY_SIZE); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_PREWRITE); pd->mbuf = m; - wq->packets_out = out; nichdr = RING_GET_PRODUCER_ITEM_VA(wq->ring, struct oce_nic_hdr_wqe); @@ -870,12 +871,12 @@ retry: nichdr->u0.s.lso = 1; nichdr->u0.s.lso_mss = m->m_pkthdr.tso_segsz; } - if (!IS_BE(sc)) + if (!IS_BE(sc) || !IS_SH(sc)) nichdr->u0.s.ipcs = 1; } RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); for (i = 0; i < pd->nsegs; i++) { nicfrag = @@ -887,7 +888,7 @@ retry: nicfrag->u0.s.frag_len = segs[i].ds_len; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); } if (num_wqes > (pd->nsegs + 1)) { nicfrag = @@ -899,7 +900,7 @@ retry: nicfrag->u0.dw[3] = 0; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); pd->nsegs++; } @@ -912,7 +913,7 @@ retry: bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; - OCE_WRITE_REG32(sc, db, PD_TXULP_DB, reg_value); + OCE_WRITE_REG32(sc, db, wq->db_offset, reg_value); } else if (rc == EFBIG) { if (retry_cnt == 0) { @@ -929,7 +930,7 @@ retry: return rc; else goto free_ret; - + return 0; free_ret: @@ -942,21 +943,14 @@ free_ret: static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status) { - uint32_t in; struct oce_packet_desc *pd; POCE_SOFTC sc = (POCE_SOFTC) wq->parent; struct mbuf *m; - if (wq->packets_out == wq->packets_in) - device_printf(sc->dev, "WQ transmit descriptor missing\n"); - - in = wq->packets_in + 1; - if (in == OCE_WQ_PACKET_ARRAY_SIZE) - in = 0; - - pd = &wq->pckts[wq->packets_in]; - wq->packets_in = in; - wq->ring->num_used -= (pd->nsegs + 1); + pd = &wq->pckts[wq->pkt_desc_tail]; + atomic_store_rel_int(&wq->pkt_desc_tail, + (wq->pkt_desc_tail + 1) % OCE_WQ_PACKET_ARRAY_SIZE); + atomic_subtract_int(&wq->ring->num_used, pd->nsegs + 1); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(wq->tag, pd->map); @@ -964,6 +958,7 @@ oce_tx_complete(struct oce_wq *wq, uint3 m_freem(m); pd->mbuf = NULL; + if (sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) { if (wq->ring->num_used < (wq->ring->num_items / 2)) { sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); @@ -1066,16 +1061,15 @@ oce_tx_task(void *arg, int npending) POCE_SOFTC sc = wq->parent; struct ifnet *ifp = sc->ifp; int rc = 0; - + #if __FreeBSD_version >= 800000 - if (TRY_LOCK(&wq->tx_lock)) { - rc = oce_multiq_transmit(ifp, NULL, wq); - if (rc) { - device_printf(sc->dev, - "TX[%d] restart failed\n", wq->queue_index); - } - UNLOCK(&wq->tx_lock); + LOCK(&wq->tx_lock); + rc = oce_multiq_transmit(ifp, NULL, wq); + if (rc) { + device_printf(sc->dev, + "TX[%d] restart failed\n", wq->queue_index); } + UNLOCK(&wq->tx_lock); #else oce_start(ifp); #endif @@ -1134,7 +1128,6 @@ oce_wq_handler(void *arg) struct oce_nic_tx_cqe *cqe; int num_cqes = 0; - LOCK(&wq->tx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_tx_cqe); @@ -1158,7 +1151,6 @@ oce_wq_handler(void *arg) if (num_cqes) oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE); - UNLOCK(&wq->tx_lock); return 0; } @@ -1233,7 +1225,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } /* Get vlan_tag value */ - if(IS_BE(sc)) + if(IS_BE(sc) || IS_SH(sc)) vtag = BSWAP_16(cqe->u0.s.vlan_tag); else vtag = cqe->u0.s.vlan_tag; @@ -1294,7 +1286,10 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.rcvif = sc->ifp; #if __FreeBSD_version >= 800000 - m->m_pkthdr.flowid = rq->queue_index; + if (rq->queue_index) + m->m_pkthdr.flowid = (rq->queue_index - 1); + else + m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif /* This deternies if vlan tag is Valid */ @@ -1401,7 +1396,7 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru struct oce_nic_rx_cqe_v1 *cqe_v1; int port_id = 0; - if (sc->be3_native && IS_BE(sc)) { + if (sc->be3_native && (IS_BE(sc) || IS_SH(sc))) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; port_id = cqe_v1->u0.s.port; if (sc->port_id != port_id) @@ -1547,7 +1542,6 @@ oce_rq_handler(void *arg) int num_cqes = 0, rq_buffers_used = 0; - LOCK(&rq->rx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_rx_cqe); @@ -1594,8 +1588,6 @@ oce_rq_handler(void *arg) oce_alloc_rx_bufs(rq, (rq_buffers_used - 1)); } - UNLOCK(&rq->rx_lock); - return 0; } @@ -1889,7 +1881,7 @@ oce_local_timer(void *arg) oce_tx_restart(sc, sc->wq[i]); /* calculate and set the eq delay for optimal interrupt rate */ - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) oce_eqd_set_periodic(sc); callout_reset(&sc->timer, hz, oce_local_timer, sc); @@ -2080,38 +2072,22 @@ oce_mq_handler(void *arg) static void setup_max_queues_want(POCE_SOFTC sc) { - int max_rss = 0; - /* Check if it is FLEX machine. Is so dont use RSS */ if ((sc->function_mode & FNM_FLEX10_MODE) || (sc->function_mode & FNM_UMC_MODE) || (sc->function_mode & FNM_VNIC_MODE) || - (!sc->rss_enable) || + (!is_rss_enabled(sc)) || (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; - sc->rss_enable = 0; - } else { - /* For multiq, our deisgn is to have TX rings equal to - RSS rings. So that we can pair up one RSS ring and TX - to a single intr, which improves CPU cache efficiency. - */ - if (IS_BE(sc) && (!sc->be3_native)) - max_rss = OCE_LEGACY_MODE_RSS; - else - max_rss = OCE_MAX_RSS; - - sc->nrqs = MIN(OCE_NCPUS, max_rss) + 1; /* 1 for def RX */ - sc->nwqs = MIN(OCE_NCPUS, max_rss); } - } static void update_queues_got(POCE_SOFTC sc) { - if (sc->rss_enable) { + if (is_rss_enabled(sc)) { sc->nrqs = sc->intr_count + 1; sc->nwqs = sc->intr_count; } else { @@ -2196,3 +2172,31 @@ oce_tx_asic_stall_verify(POCE_SOFTC sc, } return FALSE; } + +static void +oce_get_config(POCE_SOFTC sc) +{ + int rc = 0; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + if (!IS_BE(sc)) { + rc = oce_get_func_config(sc); + if (rc) { + sc->nwqs = OCE_MAX_WQ; + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + } + } + else { + rc = oce_get_profile_config(sc); + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + if (rc) + sc->nwqs = OCE_MAX_WQ; + } +} Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Sat Jul 6 08:16:17 2013 (r252868) +++ head/sys/dev/oce/oce_if.h Sat Jul 6 08:30:45 2013 (r252869) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,11 +97,21 @@ #define PCI_PRODUCT_BE3 0x0710 /* BE3 network adapter */ #define PCI_PRODUCT_XE201 0xe220 /* XE201 network adapter */ #define PCI_PRODUCT_XE201_VF 0xe228 /* XE201 with VF in Lancer */ +#define PCI_PRODUCT_SH 0x0720 /* Skyhawk network adapter */ #define IS_BE(sc) (((sc->flags & OCE_FLAGS_BE3) | \ (sc->flags & OCE_FLAGS_BE2))? 1:0) +#define IS_BE3(sc) (sc->flags & OCE_FLAGS_BE3) +#define IS_BE2(sc) (sc->flags & OCE_FLAGS_BE2) #define IS_XE201(sc) ((sc->flags & OCE_FLAGS_XE201) ? 1:0) #define HAS_A0_CHIP(sc) ((sc->flags & OCE_FLAGS_HAS_A0_CHIP) ? 1:0) +#define IS_SH(sc) ((sc->flags & OCE_FLAGS_SH) ? 1 : 0) + +#define is_be_mode_mc(sc) ((sc->function_mode & FNM_FLEX10_MODE) || \ + (sc->function_mode & FNM_UMC_MODE) || \ + (sc->function_mode & FNM_VNIC_MODE)) +#define OCE_FUNCTION_CAPS_SUPER_NIC 0x40 +#define IS_PROFILE_SUPER_NIC(sc) (sc->function_caps & OCE_FUNCTION_CAPS_SUPER_NIC) /* proportion Service Level Interface queues */ @@ -113,8 +123,9 @@ extern int mp_ncpus; /* system's total #define OCE_NCPUS mp_ncpus /* This should be powers of 2. Like 2,4,8 & 16 */ -#define OCE_MAX_RSS 4 /* TODO: 8*/ +#define OCE_MAX_RSS 8 #define OCE_LEGACY_MODE_RSS 4 /* For BE3 Legacy mode*/ +#define is_rss_enabled(sc) ((sc->function_caps & FNC_RSS) && !is_be_mode_mc(sc)) #define OCE_MIN_RQ 1 #define OCE_MIN_WQ 1 @@ -149,6 +160,7 @@ extern int mp_ncpus; /* system's total #define RSS_ENABLE_IPV6 0x4 #define RSS_ENABLE_TCP_IPV6 0x8 +#define INDIRECTION_TABLE_ENTRIES 128 /* flow control definitions */ #define OCE_FC_NONE 0x00000000 @@ -194,6 +206,9 @@ extern int mp_ncpus; /* system's total for (i = 0, wq = sc->wq[0]; i < sc->nwqs; i++, wq = sc->wq[i]) #define for_all_rq_queues(sc, rq, i) \ for (i = 0, rq = sc->rq[0]; i < sc->nrqs; i++, rq = sc->rq[i]) +#define for_all_rss_queues(sc, rq, i) \ + for (i = 0, rq = sc->rq[i + 1]; i < (sc->nrqs - 1); \ + i++, rq = sc->rq[i + 1]) #define for_all_evnt_queues(sc, eq, i) \ for (i = 0, eq = sc->eq[0]; i < sc->neqs; i++, eq = sc->eq[i]) #define for_all_cq_queues(sc, cq, i) \ @@ -671,8 +686,8 @@ struct oce_wq { struct oce_cq *cq; bus_dma_tag_t tag; struct oce_packet_desc pckts[OCE_WQ_PACKET_ARRAY_SIZE]; - uint32_t packets_in; - uint32_t packets_out; + uint32_t pkt_desc_tail; + uint32_t pkt_desc_head; uint32_t wqm_used; boolean_t resched; uint32_t wq_free; @@ -685,6 +700,7 @@ struct oce_wq { struct oce_tx_queue_stats tx_stats; struct buf_ring *br; struct task txtask; + uint32_t db_offset; }; struct rq_config { @@ -765,6 +781,7 @@ struct link_status { #define OCE_FLAGS_BE3 0x00000200 #define OCE_FLAGS_XE201 0x00000400 #define OCE_FLAGS_BE2 0x00000800 +#define OCE_FLAGS_SH 0x00001000 #define OCE_DEV_BE2_CFG_BAR 1 #define OCE_DEV_CFG_BAR 0 @@ -833,11 +850,11 @@ typedef struct oce_softc { uint32_t ncqs; uint32_t nrqs; uint32_t nwqs; + uint32_t nrssqs; uint32_t tx_ring_size; uint32_t rx_ring_size; uint32_t rq_frag_size; - uint32_t rss_enable; uint32_t if_id; /* interface ID */ uint32_t nifs; /* number of adapter interfaces, 0 or 1 */ @@ -873,37 +890,47 @@ typedef struct oce_softc { * BE3: accesses three BAR spaces (CFG, CSR, DB) * Lancer: accesses one BAR space (CFG) **************************************************/ -#define OCE_READ_REG32(sc, space, o) \ +#define OCE_READ_CSR_MPU(sc, space, o) \ ((IS_BE(sc)) ? (bus_space_read_4((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) +#define OCE_READ_REG32(sc, space, o) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG16(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_2((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_2((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG8(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_1((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_1((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) -#define OCE_WRITE_REG32(sc, space, o, v) \ +#define OCE_WRITE_CSR_MPU(sc, space, o, v) \ ((IS_BE(sc)) ? (bus_space_write_4((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) +#define OCE_WRITE_REG32(sc, space, o, v) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o,v)) \ + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG16(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_2((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_2((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG8(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_1((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_1((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) /*********************************************************** @@ -1024,6 +1051,8 @@ int oce_mbox_cq_create(struct oce_cq *cq int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num); void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd, int num); +int oce_get_profile_config(POCE_SOFTC sc); +int oce_get_func_config(POCE_SOFTC sc); void mbx_common_req_hdr_init(struct mbx_hdr *hdr, uint8_t dom, uint8_t port, @@ -1072,6 +1101,9 @@ extern uint32_t oce_max_rsp_handled; /* #define LE_64(x) htole64(x) #define LE_32(x) htole32(x) #define LE_16(x) htole16(x) +#define HOST_64(x) le64toh(x) +#define HOST_32(x) le32toh(x) +#define HOST_16(x) le16toh(x) #define DW_SWAP(x, l) #define IS_ALIGNED(x,a) ((x % a) == 0) #define ADDR_HI(x) ((uint32_t)((uint64_t)(x) >> 32)) @@ -1104,6 +1136,16 @@ static inline uint32_t oce_highbit(uint3 return 0; } +static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc) +{ + if (IS_BE(sc)) + return MPU_EP_SEMAPHORE_BE3; + else if (IS_SH(sc)) + return MPU_EP_SEMAPHORE_SH; + else + return MPU_EP_SEMAPHORE_XE201; +} + #define TRANSCEIVER_DATA_NUM_ELE 64 #define TRANSCEIVER_DATA_SIZE 256 #define TRANSCEIVER_A0_SIZE 128 Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Sat Jul 6 08:16:17 2013 (r252868) +++ head/sys/dev/oce/oce_mbox.c Sat Jul 6 08:30:45 2013 (r252869) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -727,12 +727,14 @@ oce_rss_itbl_init(POCE_SOFTC sc, struct { int i = 0, j = 0, rc = 0; uint8_t *tbl = fwcmd->params.req.cputable; + struct oce_rq *rq = NULL; - for (j = 0; j < sc->nrqs; j++) { - if (sc->rq[j]->cfg.is_rss_queue) { - tbl[i] = sc->rq[j]->rss_cpuid; - i = i + 1; + for (j = 0; j < INDIRECTION_TABLE_ENTRIES ; j += (sc->nrqs - 1)) { + for_all_rss_queues(sc, rq, i) { + if ((j + i) >= INDIRECTION_TABLE_ENTRIES) + break; + tbl[j + i] = rq->rss_cpuid; } } if (i == 0) { @@ -766,7 +768,7 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 bzero(&mbx, sizeof(struct oce_mbx)); - if (IS_XE201(sc)) { + if (IS_XE201(sc) || IS_SH(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.enable_rss = RSS_ENABLE_UDP_IPV4 | RSS_ENABLE_UDP_IPV6; @@ -1674,8 +1676,11 @@ oce_mbox_create_wq(struct oce_wq *wq) if (IS_XE201(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.if_id = sc->if_id; - } else - version = OCE_MBX_VER_V0; + } else if(IS_BE(sc)) + IS_PROFILE_SUPER_NIC(sc) ? (version = OCE_MBX_VER_V2) + : (version = OCE_MBX_VER_V0); + else + version = OCE_MBX_VER_V2; mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, @@ -1703,6 +1708,10 @@ oce_mbox_create_wq(struct oce_wq *wq) goto error; } wq->wq_id = LE_16(fwcmd->params.rsp.wq_id); + if (version == OCE_MBX_VER_V2) + wq->db_offset = LE_32(fwcmd->params.rsp.db_offset); + else + wq->db_offset = PD_TXULP_DB; error: return rc; @@ -1874,7 +1883,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC /* command post */ rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) { device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); @@ -1894,6 +1903,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC TRANSCEIVER_A2_SIZE); } error: + oce_dma_free(sc, &dma); return rc; } @@ -1935,10 +1945,193 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); } +int +oce_get_profile_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_profile_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + + if (IS_BE2(sc)) + return -1; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_profile_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_profile_config); + bzero(fwcmd, sizeof(struct mbx_common_get_profile_config)); + + if (IS_BE3(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_PROFILE_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_profile_config), + version); + /* fill rest of mbx */ + mbx.u0.s.embedded = 0; + mbx.payload_length = sizeof(struct mbx_common_get_profile_config); + mbx.u0.s.sge_count = 1; + sgl = &mbx.payload.u0.u1.sgl[0]; + sgl->pa_hi = htole32(upper_32_bits(dma.paddr)); + sgl->pa_lo = htole32((dma.paddr) & 0xFFFFFFFF); + sgl->length = htole32(mbx.payload_length); + DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); + + fwcmd->params.req.type = ACTIVE_PROFILE; + + /* command post */ + rc = oce_mbox_post(sc, &mbx, NULL); + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); + goto error; + } + + nic_desc = (struct oce_nic_resc_desc *) fwcmd->params.rsp.resources; + desc_count = HOST_32(fwcmd->params.rsp.desc_count); + for (i = 0; i < desc_count; i++) { + if ((nic_desc->desc_type == NIC_RESC_DESC_TYPE_V0) || + (nic_desc->desc_type == NIC_RESC_DESC_TYPE_V1)) { + nic_desc_valid = TRUE; + break; + } + nic_desc = (struct oce_nic_resc_desc *) \ + ((char *)nic_desc + nic_desc->desc_len); + } + if (!nic_desc_valid) { + rc = -1; + goto error; + } + else { + sc->nwqs = HOST_32(nic_desc->txq_count); + if (sc->nwqs) + sc->nwqs = MIN(sc->nwqs, OCE_MAX_WQ); + else + sc->nwqs = OCE_MAX_WQ; + + } +error: + oce_dma_free(sc, &dma); + return rc; + +} + +int +oce_get_func_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_func_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_func_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_func_config); + bzero(fwcmd, sizeof(struct mbx_common_get_func_config)); + + if (IS_SH(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_FUNCTION_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_func_config), + version); + /* fill rest of mbx */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:37:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E017B249; Sat, 6 Jul 2013 08:37: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 C18991DDD; Sat, 6 Jul 2013 08:37:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668biMO085700; Sat, 6 Jul 2013 08:37:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668bhu0085695; Sat, 6 Jul 2013 08:37:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060837.r668bhu0085695@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252870 - stable/8/sys/dev/uart X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:37:45 -0000 Author: avg Date: Sat Jul 6 08:37:43 2013 New Revision: 252870 URL: http://svnweb.freebsd.org/changeset/base/252870 Log: MFC r246243: uart: add resume method and enable it for attachments on the most common x86 buses Modified: stable/8/sys/dev/uart/uart_bus.h stable/8/sys/dev/uart/uart_bus_acpi.c stable/8/sys/dev/uart/uart_bus_isa.c stable/8/sys/dev/uart/uart_bus_pci.c stable/8/sys/dev/uart/uart_core.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus.h ============================================================================== --- stable/8/sys/dev/uart/uart_bus.h Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus.h Sat Jul 6 08:37:43 2013 (r252870) @@ -137,6 +137,7 @@ extern char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); +int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); Modified: stable/8/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_acpi.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_acpi.c Sat Jul 6 08:37:43 2013 (r252870) @@ -47,6 +47,7 @@ static device_method_t uart_acpi_methods DEVMETHOD(device_probe, uart_acpi_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/8/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_isa.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_isa.c Sat Jul 6 08:37:43 2013 (r252870) @@ -50,6 +50,7 @@ static device_method_t uart_isa_methods[ DEVMETHOD(device_probe, uart_isa_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_pci.c Sat Jul 6 08:37:43 2013 (r252870) @@ -51,6 +51,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_probe, uart_pci_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), DEVMETHOD_END }; Modified: stable/8/sys/dev/uart/uart_core.c ============================================================================== --- stable/8/sys/dev/uart/uart_core.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_core.c Sat Jul 6 08:37:43 2013 (r252870) @@ -578,3 +578,12 @@ uart_bus_detach(device_t dev) return (0); } + +int +uart_bus_resume(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + return (UART_ATTACH(sc)); +} From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:40:32 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2AB2F37C; Sat, 6 Jul 2013 08:40:32 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 88B7B1DE6; Sat, 6 Jul 2013 08:40:30 +0000 (UTC) Received: from server.rulingia.com (c220-239-237-213.belrs5.nsw.optusnet.com.au [220.239.237.213]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id r668eTpI011888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 6 Jul 2013 18:40:30 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id r668eM2d091295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Jul 2013 18:40:22 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id r668eMw1091294; Sat, 6 Jul 2013 18:40:22 +1000 (EST) (envelope-from peter) Date: Sat, 6 Jul 2013 18:40:22 +1000 From: Peter Jeremy To: Tim Kientzle Subject: Re: svn commit: r252373 - head/usr.bin Message-ID: <20130706084022.GA91077@server.rulingia.com> References: <201306291531.r5TFVOKb016748@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <201306291531.r5TFVOKb016748@svn.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:40:32 -0000 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-Jun-29 15:31:24 +0000, Tim Kientzle wrote: >Log: > Enable svnlite on armv6. This breaks building world with gcc on Raspberry Pi: gcc -O -pipe -I/tank/src10r/usr.bin/svn/svn/../../../contrib/subversion/su= bversion/include -I/tank/src10r/usr.bin/svn/svn/../../../contrib/subversion= /subversion -I/tank/src10r/usr.bin/svn/svn/.. -I/tank/src10r/usr.bin/svn/s= vn/../lib/libapr -I/tank/src10r/usr.bin/svn/svn/../../../contrib/apr/inclu= de/arch/unix -I/tank/src10r/usr.bin/svn/svn/../../../contrib/apr/include = -I/tank/src10r/usr.bin/svn/svn/../lib/libapr_util -I/tank/src10r/usr.bin/s= vn/svn/../../../contrib/apr-util/include/private -I/tank/src10r/usr.bin/sv= n/svn/../../../contrib/apr-util/include -std=3Dgnu99 -Wno-pointer-sign -o = svnlite add-cmd.o blame-cmd.o cat-cmd.o changelist-cmd.o checkout-cmd.o cl-= conflicts.o cleanup-cmd.o commit-cmd.o conflict-callbacks.o copy-cmd.o dele= te-cmd.o deprecated.o diff-cmd.o export-cmd.o file-merge.o help-cmd.o impor= t-cmd.o info-cmd.o list-cmd.o lock-cmd.o log-cmd.o merge-cmd.o mergeinfo-cm= d.o mkdir-cmd.o move-cmd.o notify.o patch-cmd.o propdel-cmd.o propedit-cmd.= o propget-cmd.o proplist-cmd.o props.o propset-cmd.o relocate-cmd.o resolve= -cmd.o resolved-cmd.o revert-cmd.o status-cmd.o status.o svn.o switch-cmd.o= unlock-cmd.o update-cmd.o upgrade-cmd.o util.o -L/tank/obj/rpi/arm.armv6/t= ank/src10r/usr.bin/svn/svn/../lib/libsvn_client -lsvn_client -L/tank/obj/r= pi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_wc -lsvn_wc -L/tank= /obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_ra -lsvn_ra -= L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_ra_local= -lsvn_ra_local -L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../l= ib/libsvn_ra_svn -lsvn_ra_svn -L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bi= n/svn/svn/../lib/libsvn_ra_serf -lsvn_ra_serf -L/tank/obj/rpi/arm.armv6/ta= nk/src10r/usr.bin/svn/svn/../lib/libsvn_repos -lsvn_repos -L/tank/obj/rpi/= arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_fs -lsvn_fs -L/tank/ob= j/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_fs_fs -lsvn_fs_fs= -L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_fs_ut= il -lsvn_fs_util -L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../= lib/libsvn_delta -lsvn_delta -L/tank/obj/rpi/arm.armv6/tank/src10r/usr.bin= /svn/svn/../lib/libsvn_diff -lsvn_diff -L/tank/obj/rpi/arm.armv6/tank/src1= 0r/usr.bin/svn/svn/../lib/libsvn_subr -lsvn_subr -L/tank/obj/rpi/arm.armv6= /tank/src10r/usr.bin/svn/svn/../lib/libserf -lserf -L/tank/obj/rpi/arm.arm= v6/tank/src10r/usr.bin/svn/svn/../lib/libapr_util -lapr-util -lbsdxml -L/= tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libapr -lapr -L/= tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsqlite3 -lsqli= te3 -lz -lcrypt -lmagic -lcrypto -lssl -lpthread /tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_subr/libs= vn_subr.a(named_atomic.o): In function `svn_named_atomic__cmpxchg': named_atomic.c:(.text+0xf0): undefined reference to `__sync_val_compare_and= _swap_8' /tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_subr/libs= vn_subr.a(named_atomic.o): In function `svn_named_atomic__add': named_atomic.c:(.text+0x174): undefined reference to `__sync_add_and_fetch_= 8' /tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libsvn_subr/libs= vn_subr.a(named_atomic.o): In function `svn_named_atomic__write': named_atomic.c:(.text+0x1c0): undefined reference to `__sync_lock_test_and_= set_8' /tank/obj/rpi/arm.armv6/tank/src10r/usr.bin/svn/svn/../lib/libapr/libapr.a(= builtins.o): In function `apr_atomic_dec32': builtins.c:(.text+0x90): undefined reference to `__sync_sub_and_fetch_4' *** Error code 1 Stop. make: stopped in /tank/src10r/usr.bin/svn/svn I've split the failures into two categories: __sync_add_and_fetch_8 __sync_lock_test_and_set_8 __sync_val_compare_and_swap_8 these should be defined in /usr/src/sys/arm/arm/stdatomic.c (and compiled into libcompiler_rt.a) but that file only defines 1-, 2- and 4-byte variants for userland armv6 (it looks like it fakes 8-byte variants in the kernel by disabling interrupts). I don't know ARM assembler well enough to know if there's any way to do 64-bit atomic operations. I suspect not. __sync_sub_and_fetch_4 There are references to __sync_sub_and_fetch() but I can't any sign of a definition. It looks like __sync_sub_and_fetch_4 is supposed to be a gcc builtin so I'm not sure why it's being emitted without a definition. --=20 Peter Jeremy --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHX1/YACgkQ/opHv/APuIcuwwCcCjDgQlNkFiZegVo5BdIhlFIl n1wAn2I+HLgmSVKWQlIqC7nKKOMhIgpS =TF+/ -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:43:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85E404C0; Sat, 6 Jul 2013 08:43:10 +0000 (UTC) (envelope-from delphij@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 77C5F1DF4; Sat, 6 Jul 2013 08:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668hAEg088082; Sat, 6 Jul 2013 08:43:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668h9qe088077; Sat, 6 Jul 2013 08:43:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060843.r668h9qe088077@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 08:43: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: r252871 - stable/9/sbin/swapon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:43:10 -0000 Author: delphij Date: Sat Jul 6 08:43:09 2013 New Revision: 252871 URL: http://svnweb.freebsd.org/changeset/base/252871 Log: MFC r226712 (sobomax): Add new option -F to specify alternative location of the /etc/fstab file. MFC r226742 (ed): Build swapon with WARNS=6. Don't use a variable called stat, because it collides with stat(2). Modified: stable/9/sbin/swapon/Makefile stable/9/sbin/swapon/swapon.8 stable/9/sbin/swapon/swapon.c Directory Properties: stable/9/sbin/swapon/ (props changed) Modified: stable/9/sbin/swapon/Makefile ============================================================================== --- stable/9/sbin/swapon/Makefile Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/Makefile Sat Jul 6 08:43:09 2013 (r252871) @@ -8,7 +8,6 @@ LINKS+= ${BINDIR}/swapon ${BINDIR}/swapc MLINKS= swapon.8 swapoff.8 MLINKS+=swapon.8 swapctl.8 -WARNS?= 3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/9/sbin/swapon/swapon.8 ============================================================================== --- stable/9/sbin/swapon/swapon.8 Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/swapon.8 Sat Jul 6 08:43:09 2013 (r252871) @@ -35,8 +35,14 @@ .Nm swapon , swapoff , swapctl .Nd "specify devices for paging and swapping" .Sh SYNOPSIS -.Nm swapon Fl aq | Ar -.Nm swapoff Fl aq | Ar +.Nm swapon +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar +.Nm swapoff +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar .Nm swapctl .Op Fl AghklmsU .Oo @@ -99,6 +105,18 @@ must move swapped pages out of the devic lead to high system loads for a period of time, depending on how much data has been swapped out to that device. .Pp +Other options supported by both +.Nm swapon +and +.Nm swapoff +are as follows: +.Bl -tag -width indent +.It Fl F Ar fstab +Specify the +.Pa fstab +file to use. +.El +.Pp The .Nm swapctl utility exists primarily for those familiar with other Modified: stable/9/sbin/swapon/swapon.c ============================================================================== --- stable/9/sbin/swapon/swapon.c Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/swapon.c Sat Jul 6 08:43:09 2013 (r252871) @@ -67,9 +67,10 @@ main(int argc, char **argv) { struct fstab *fsp; char *ptr; - int stat; + int ret; int ch, doall; int sflag = 0, lflag = 0, hflag = 0, qflag = 0; + const char *etc_fstab; if ((ptr = strrchr(argv[0], '/')) == NULL) ptr = argv[0]; @@ -80,7 +81,8 @@ main(int argc, char **argv) orig_prog = which_prog; doall = 0; - while ((ch = getopt(argc, argv, "AadghklmqsU")) != -1) { + etc_fstab = NULL; + while ((ch = getopt(argc, argv, "AadghklmqsUF:")) != -1) { switch(ch) { case 'A': if (which_prog == SWAPCTL) { @@ -132,6 +134,9 @@ main(int argc, char **argv) usage(); } break; + case 'F': + etc_fstab = optarg; + break; case '?': default: usage(); @@ -139,7 +144,9 @@ main(int argc, char **argv) } argv += optind; - stat = 0; + ret = 0; + if (etc_fstab != NULL) + setfstab(etc_fstab); if (which_prog == SWAPON || which_prog == SWAPOFF) { if (doall) { while ((fsp = getfsent()) != NULL) { @@ -148,7 +155,7 @@ main(int argc, char **argv) if (strstr(fsp->fs_mntops, "noauto")) continue; if (swap_on_off(fsp->fs_spec, 1)) { - stat = 1; + ret = 1; } else { if (!qflag) { printf("%s: %sing %s as swap device\n", @@ -163,7 +170,7 @@ main(int argc, char **argv) usage(); for (; *argv; ++argv) { if (swap_on_off(*argv, 0)) { - stat = 1; + ret = 1; } else if (orig_prog == SWAPCTL) { printf("%s: %sing %s as swap device\n", getprogname(), which_prog == SWAPOFF ? "remov" : "add", @@ -176,7 +183,7 @@ main(int argc, char **argv) else usage(); } - exit(stat); + exit(ret); } static int @@ -210,7 +217,7 @@ usage(void) switch(orig_prog) { case SWAPON: case SWAPOFF: - fprintf(stderr, "-aq | file ...\n"); + fprintf(stderr, "[-F fstab] -aq | file ...\n"); break; case SWAPCTL: fprintf(stderr, "[-AghklmsU] [-a file ... | -d file ...]\n"); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:43:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDFF85EB; Sat, 6 Jul 2013 08:43: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 E0FCB1DF9; Sat, 6 Jul 2013 08:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668hVCo088160; Sat, 6 Jul 2013 08:43:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668hVOJ088159; Sat, 6 Jul 2013 08:43:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060843.r668hVOJ088159@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:43: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: r252872 - stable/9/lib/libdwarf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:43:32 -0000 Author: avg Date: Sat Jul 6 08:43:31 2013 New Revision: 252872 URL: http://svnweb.freebsd.org/changeset/base/252872 Log: MFC r248641: libdwarf: anonymous types are expected to have empty type names Modified: stable/9/lib/libdwarf/dwarf_die.c Directory Properties: stable/9/lib/libdwarf/ (props changed) Modified: stable/9/lib/libdwarf/dwarf_die.c ============================================================================== --- stable/9/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:09 2013 (r252871) +++ stable/9/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:31 2013 (r252872) @@ -29,8 +29,6 @@ #include #include "_libdwarf.h" -static const char *anon_name = "__anon__"; - int dwarf_die_add(Dwarf_CU cu, int level, uint64_t offset, uint64_t abnum, Dwarf_Abbrev a, Dwarf_Die *diep, Dwarf_Error *err) { @@ -57,7 +55,7 @@ dwarf_die_add(Dwarf_CU cu, int level, ui die->die_abnum = abnum; die->die_a = a; die->die_cu = cu; - die->die_name = anon_name; + die->die_name = ""; /* Initialise the list of attribute values. */ STAILQ_INIT(&die->die_attrval); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:43:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 70414714; Sat, 6 Jul 2013 08:43:50 +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 636581DFD; Sat, 6 Jul 2013 08:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668horC088347; Sat, 6 Jul 2013 08:43:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668hopZ088345; Sat, 6 Jul 2013 08:43:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060843.r668hopZ088345@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252873 - stable/8/lib/libdwarf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:43:50 -0000 Author: avg Date: Sat Jul 6 08:43:49 2013 New Revision: 252873 URL: http://svnweb.freebsd.org/changeset/base/252873 Log: MFC r248641: libdwarf: anonymous types are expected to have empty type names Modified: stable/8/lib/libdwarf/dwarf_die.c Directory Properties: stable/8/lib/libdwarf/ (props changed) Modified: stable/8/lib/libdwarf/dwarf_die.c ============================================================================== --- stable/8/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:31 2013 (r252872) +++ stable/8/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:49 2013 (r252873) @@ -29,8 +29,6 @@ #include #include "_libdwarf.h" -static const char *anon_name = "__anon__"; - int dwarf_die_add(Dwarf_CU cu, int level, uint64_t offset, uint64_t abnum, Dwarf_Abbrev a, Dwarf_Die *diep, Dwarf_Error *err) { @@ -57,7 +55,7 @@ dwarf_die_add(Dwarf_CU cu, int level, ui die->die_abnum = abnum; die->die_a = a; die->die_cu = cu; - die->die_name = anon_name; + die->die_name = ""; /* Initialise the list of attribute values. */ STAILQ_INIT(&die->die_attrval); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 55B41B4E; Sat, 6 Jul 2013 08:51:57 +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 47C551E2B; Sat, 6 Jul 2013 08:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668pvxT091216; Sat, 6 Jul 2013 08:51:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668pvrI091215; Sat, 6 Jul 2013 08:51:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060851.r668pvrI091215@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:51: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: r252874 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:51:57 -0000 Author: avg Date: Sat Jul 6 08:51:56 2013 New Revision: 252874 URL: http://svnweb.freebsd.org/changeset/base/252874 Log: MFC r248645: post mountroot event after a real/final root is mounted Modified: stable/9/sys/kern/vfs_mountroot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mountroot.c ============================================================================== --- stable/9/sys/kern/vfs_mountroot.c Sat Jul 6 08:43:49 2013 (r252873) +++ stable/9/sys/kern/vfs_mountroot.c Sat Jul 6 08:51:56 2013 (r252874) @@ -199,8 +199,6 @@ set_rootvnode(void) VREF(rootvnode); FILEDESC_XUNLOCK(p->p_fd); - - EVENTHANDLER_INVOKE(mountroot); } static int @@ -994,6 +992,8 @@ vfs_mountroot(void) atomic_store_rel_int(&root_mount_complete, 1); wakeup(&root_mount_complete); mtx_unlock(&mountlist_mtx); + + EVENTHANDLER_INVOKE(mountroot); } static struct mntarg * From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:58:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADD33E38; Sat, 6 Jul 2013 08:58:30 +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 A00811E5E; Sat, 6 Jul 2013 08:58:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668wUvh092267; Sat, 6 Jul 2013 08:58:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668wUhs092266; Sat, 6 Jul 2013 08:58:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060858.r668wUhs092266@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:58: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: r252875 - stable/9/sys/boot/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:58:30 -0000 Author: avg Date: Sat Jul 6 08:58:30 2013 New Revision: 252875 URL: http://svnweb.freebsd.org/changeset/base/252875 Log: MFC r249139: strncmp for boot code: fix an off by one error Modified: stable/9/sys/boot/common/util.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/common/util.c ============================================================================== --- stable/9/sys/boot/common/util.c Sat Jul 6 08:51:56 2013 (r252874) +++ stable/9/sys/boot/common/util.c Sat Jul 6 08:58:30 2013 (r252875) @@ -68,9 +68,9 @@ int strncmp(const char *s1, const char *s2, size_t len) { - for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + for (; len > 0 && *s1 == *s2 && *s1 != '\0'; len--, s1++, s2++) ; - return ((unsigned char)*s1 - (unsigned char)*s2); + return (len == 0 ? 0 : (unsigned char)*s1 - (unsigned char)*s2); } void From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 08:59:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D082CF7A; Sat, 6 Jul 2013 08:59:27 +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 C28EA1E71; Sat, 6 Jul 2013 08:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668xRXG092434; Sat, 6 Jul 2013 08:59:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668xRkt092433; Sat, 6 Jul 2013 08:59:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060859.r668xRkt092433@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252876 - stable/8/sys/boot/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 08:59:27 -0000 Author: avg Date: Sat Jul 6 08:59:27 2013 New Revision: 252876 URL: http://svnweb.freebsd.org/changeset/base/252876 Log: MFC r249139: strncmp for boot code: fix an off by one error Modified: stable/8/sys/boot/common/util.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/common/util.c ============================================================================== --- stable/8/sys/boot/common/util.c Sat Jul 6 08:58:30 2013 (r252875) +++ stable/8/sys/boot/common/util.c Sat Jul 6 08:59:27 2013 (r252876) @@ -68,9 +68,9 @@ int strncmp(const char *s1, const char *s2, size_t len) { - for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + for (; len > 0 && *s1 == *s2 && *s1 != '\0'; len--, s1++, s2++) ; - return ((unsigned char)*s1 - (unsigned char)*s2); + return (len == 0 ? 0 : (unsigned char)*s1 - (unsigned char)*s2); } void From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:02:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D789F1A8; Sat, 6 Jul 2013 09:02:30 +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 CA5611E99; Sat, 6 Jul 2013 09:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6692UIZ094718; Sat, 6 Jul 2013 09:02:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6692Uvg094717; Sat, 6 Jul 2013 09:02:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060902.r6692Uvg094717@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 09:02: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: r252877 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:02:30 -0000 Author: avg Date: Sat Jul 6 09:02:30 2013 New Revision: 252877 URL: http://svnweb.freebsd.org/changeset/base/252877 Log: MFC r248820: rc.subr: disabling globbing while processing devfs rules 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 Jul 6 08:59:27 2013 (r252876) +++ stable/9/etc/rc.subr Sat Jul 6 09:02:30 2013 (r252877) @@ -1318,7 +1318,7 @@ make_symlink() # devfs_rulesets_from_file() { - local file _err _me + local file _err _me _opts file="$1" _me="devfs_rulesets_from_file" _err=0 @@ -1331,6 +1331,11 @@ devfs_rulesets_from_file() debug "$_me: no such file ($file)" return 0 fi + + # Disable globbing so that the rule patterns are not expanded + # by accident with matching filesystem entries. + _opts=$-; set -f + debug "reading rulesets from file ($file)" { while read line do @@ -1377,6 +1382,7 @@ devfs_rulesets_from_file() break fi done } < $file + case $_opts in *f*) ;; *) set +f ;; esac return $_err } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:03:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B48832D3; Sat, 6 Jul 2013 09:03:02 +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 A74EE1E9E; Sat, 6 Jul 2013 09:03:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66932Rg094858; Sat, 6 Jul 2013 09:03:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66932B0094857; Sat, 6 Jul 2013 09:03:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060903.r66932B0094857@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 09:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252878 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:03:02 -0000 Author: avg Date: Sat Jul 6 09:03:02 2013 New Revision: 252878 URL: http://svnweb.freebsd.org/changeset/base/252878 Log: MFC r248820: rc.subr: disabling globbing while processing devfs rules Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Sat Jul 6 09:02:30 2013 (r252877) +++ stable/8/etc/rc.subr Sat Jul 6 09:03:02 2013 (r252878) @@ -1322,7 +1322,7 @@ make_symlink() # devfs_rulesets_from_file() { - local file _err _me + local file _err _me _opts file="$1" _me="devfs_rulesets_from_file" _err=0 @@ -1335,6 +1335,11 @@ devfs_rulesets_from_file() debug "$_me: no such file ($file)" return 0 fi + + # Disable globbing so that the rule patterns are not expanded + # by accident with matching filesystem entries. + _opts=$-; set -f + debug "reading rulesets from file ($file)" { while read line do @@ -1381,6 +1386,7 @@ devfs_rulesets_from_file() break fi done } < $file + case $_opts in *f*) ;; *) set +f ;; esac return $_err } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:04:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B61F4F7; Sat, 6 Jul 2013 09:04:57 +0000 (UTC) (envelope-from tuexen@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 2D1A41EAE; Sat, 6 Jul 2013 09:04:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6694vgH095508; Sat, 6 Jul 2013 09:04:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6694tH9095494; Sat, 6 Jul 2013 09:04:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060904.r6694tH9095494@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:04:55 +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: r252879 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:04:57 -0000 Author: tuexen Date: Sat Jul 6 09:04:55 2013 New Revision: 252879 URL: http://svnweb.freebsd.org/changeset/base/252879 Log: MFC r237540: Do packet logging in a consistent way. Modified: stable/9/sys/netinet/sctp_bsd_addr.c stable/9/sys/netinet/sctp_bsd_addr.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_os_bsd.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_bsd_addr.c Sat Jul 6 09:04:55 2013 (r252879) @@ -422,11 +422,12 @@ sctp_get_mbuf_for_msg(unsigned int space #ifdef SCTP_PACKET_LOGGING void -sctp_packet_log(struct mbuf *m, int length) +sctp_packet_log(struct mbuf *m) { int *lenat, thisone; void *copyto; uint32_t *tick_tock; + int length; int total_len; int grabbed_lock = 0; int value, newval, thisend, thisbegin; @@ -436,6 +437,7 @@ sctp_packet_log(struct mbuf *m, int leng * (value) -ticks of log (ticks) o -ip packet o -as logged - * where this started (thisbegin) x <--end points here */ + length = SCTP_HEADER_LEN(m); total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); /* Log a packet to the buffer. */ if (total_len > SCTP_PACKET_LOG_SIZE) { Modified: stable/9/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.h Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_bsd_addr.h Sat Jul 6 09:04:55 2013 (r252879) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING -void sctp_packet_log(struct mbuf *m, int length); +void sctp_packet_log(struct mbuf *m); int sctp_copy_out_packet_log(uint8_t * target, int length); #endif Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:04:55 2013 (r252879) @@ -5930,9 +5930,9 @@ sctp_input_with_port(struct mbuf *i_pak, } } #endif -#ifdef SCTP_PACKET_LOGGING +#ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, mlen); + sctp_packet_log(m); #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; Modified: stable/9/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 09:04:55 2013 (r252879) @@ -365,7 +365,7 @@ typedef struct callout sctp_os_timer_t; */ #define SCTP_HEADER_TO_CHAIN(m) (m) #define SCTP_DETACH_HEADER_FROM_CHAIN(m) -#define SCTP_HEADER_LEN(m) (m->m_pkthdr.len) +#define SCTP_HEADER_LEN(m) ((m)->m_pkthdr.len) #define SCTP_GET_HEADER_FOR_OUTPUT(o_pak) 0 #define SCTP_RELEASE_HEADER(m) #define SCTP_RELEASE_PKT(m) sctp_m_freem(m) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:04:55 2013 (r252879) @@ -4114,10 +4114,6 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4138,6 +4134,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif /* send it out. table id is taken from stcb */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -4463,10 +4463,6 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4494,6 +4490,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_SOCKET_UNLOCK(so, 0); } #endif +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -11068,11 +11068,6 @@ sctp_send_resp_msg(struct mbuf *m, struc } } iph_out->ip_len = len; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11092,17 +11087,17 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); } #endif #ifdef INET6 if (ip6_out != NULL) { ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11122,6 +11117,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:04:55 2013 (r252879) @@ -101,10 +101,12 @@ sctp6_input(struct mbuf **i_pak, int *of return (-1); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN((*i_pak)); + pkt_len = SCTP_HEADER_LEN(*i_pak); -#ifdef SCTP_PACKET_LOGGING - sctp_packet_log(m, pkt_len); +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:08:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC97E753; Sat, 6 Jul 2013 09:08:17 +0000 (UTC) (envelope-from tuexen@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 94D9C1EC8; Sat, 6 Jul 2013 09:08:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6698HEl096120; Sat, 6 Jul 2013 09:08:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6698H3L096119; Sat, 6 Jul 2013 09:08:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060908.r6698H3L096119@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:08:17 +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: r252880 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:08:17 -0000 Author: tuexen Date: Sat Jul 6 09:08:17 2013 New Revision: 252880 URL: http://svnweb.freebsd.org/changeset/base/252880 Log: MFC r237541: Remove redundant check. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:04:55 2013 (r252879) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:08:17 2013 (r252880) @@ -2392,7 +2392,7 @@ sctp_handle_cookie_echo(struct mbuf *m, uint8_t calc_sig[SCTP_SIGNATURE_SIZE], tmp_sig[SCTP_SIGNATURE_SIZE]; uint8_t *sig; uint8_t cookie_ok = 0; - unsigned int size_of_pkt, sig_offset, cookie_offset; + unsigned int sig_offset, cookie_offset; unsigned int cookie_len; struct timeval now; struct timeval time_expires; @@ -2434,7 +2434,6 @@ sctp_handle_cookie_echo(struct mbuf *m, lsin->sin_len = sizeof(*lsin); lsin->sin_port = sh->dest_port; lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - size_of_pkt = SCTP_GET_IPV4_LENGTH(iph); break; } #endif @@ -2452,7 +2451,6 @@ sctp_handle_cookie_echo(struct mbuf *m, ip6 = mtod(m, struct ip6_hdr *); lsin6->sin6_port = sh->dest_port; lsin6->sin6_addr = ip6->ip6_dst; - size_of_pkt = SCTP_GET_IPV6_LENGTH(ip6) + iphlen; break; } #endif @@ -2476,11 +2474,10 @@ sctp_handle_cookie_echo(struct mbuf *m, */ return (NULL); } - if (cookie_len > size_of_pkt || - cookie_len < sizeof(struct sctp_cookie_echo_chunk) + + if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + sizeof(struct sctp_init_chunk) + sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { - /* cookie too long! or too small */ + /* cookie too small */ return (NULL); } /* @@ -2488,11 +2485,6 @@ sctp_handle_cookie_echo(struct mbuf *m, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - if (sig_offset > size_of_pkt) { - /* packet not correct size! */ - /* XXX this may already be accounted for earlier... */ - return (NULL); - } m_sig = m_split(m, sig_offset, M_DONTWAIT); if (m_sig == NULL) { /* out of memory or ?? */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:11:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CAD578B5; Sat, 6 Jul 2013 09:11:39 +0000 (UTC) (envelope-from tuexen@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 BC3B81EE7; Sat, 6 Jul 2013 09:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669BdXp098358; Sat, 6 Jul 2013 09:11:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669BcC6098352; Sat, 6 Jul 2013 09:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060911.r669BcC6098352@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:11:38 +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: r252881 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:11:39 -0000 Author: tuexen Date: Sat Jul 6 09:11:38 2013 New Revision: 252881 URL: http://svnweb.freebsd.org/changeset/base/252881 Log: MFC r237542: Pass the packet length explicitly around. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:11:38 2013 (r252881) @@ -2762,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int /* * we need to report rwnd overrun drops. */ - sctp_send_packet_dropped(stcb, net, *mm, iphlen, 0); + sctp_send_packet_dropped(stcb, net, *mm, length, iphlen, 0); } if (num_chunks) { /* Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:11:38 2013 (r252881) @@ -6011,7 +6011,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:11:38 2013 (r252881) @@ -11309,21 +11309,15 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, - struct mbuf *m, int iphlen, int bad_crc) + struct mbuf *m, int len, int iphlen, int bad_crc) { struct sctp_association *asoc; struct sctp_pktdrop_chunk *drp; struct sctp_tmit_chunk *chk; uint8_t *datap; - int len; int was_trunc = 0; struct ip *iph; - -#ifdef INET6 - struct ip6_hdr *ip6h; - -#endif - int fullsz = 0, extra = 0; + int fullsz = 0; long spc; int offset; struct sctp_chunkhdr *ch, chunk_buf; @@ -11353,23 +11347,8 @@ sctp_send_packet_dropped(struct sctp_tcb sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - /* IPv4 */ - len = chk->send_size = iph->ip_len; - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - /* IPv6 */ - ip6h = mtod(m, struct ip6_hdr *); - len = chk->send_size = htons(ip6h->ip6_plen); - break; -#endif - default: - return; - } + len -= iphlen; + chk->send_size = len; /* Validate that we do not have an ABORT in here. */ offset = iphlen + sizeof(struct sctphdr); ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, @@ -11405,7 +11384,7 @@ sctp_send_packet_dropped(struct sctp_tcb /* * only send 1 mtu worth, trim off the excess on the end. */ - fullsz = len - extra; + fullsz = len; len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; was_trunc = 1; } Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_output.h Sat Jul 6 09:11:38 2013 (r252881) @@ -162,7 +162,7 @@ void sctp_send_ecn_echo(struct sctp_tcb void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, - int, int); + int, int, int); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) @@ -184,7 +184,7 @@ sctp6_input(struct mbuf **i_pak, int *of } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((in6p != NULL) && (stcb == NULL)) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:17:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4812EA1A; Sat, 6 Jul 2013 09:17:56 +0000 (UTC) (envelope-from tuexen@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 39DCF1F08; Sat, 6 Jul 2013 09:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669HuGa099240; Sat, 6 Jul 2013 09:17:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669Hsu6099230; Sat, 6 Jul 2013 09:17:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060917.r669Hsu6099230@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:17: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: r252882 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:17:56 -0000 Author: tuexen Date: Sat Jul 6 09:17:54 2013 New Revision: 252882 URL: http://svnweb.freebsd.org/changeset/base/252882 Log: MFC r237565: Whitespace cleanup. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:17:54 2013 (r252882) @@ -1529,7 +1529,7 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1545,7 +1545,7 @@ sctp_process_a_data_chunk(struct sctp_tc } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3982,7 +3982,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* sa_ignore NO_NULL_CHK */ if (stcb->sctp_socket) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3991,7 +3991,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4005,7 +4005,7 @@ sctp_express_handle_sack(struct sctp_tcb } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { @@ -4734,7 +4734,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4742,7 +4742,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4756,7 +4756,7 @@ sctp_handle_sack(struct mbuf *m, int off } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:17:54 2013 (r252882) @@ -757,7 +757,7 @@ static void sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -807,7 +807,7 @@ sctp_handle_abort(struct sctp_abort_chun #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -818,7 +818,7 @@ sctp_handle_abort(struct sctp_abort_chun stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); @@ -860,7 +860,7 @@ sctp_handle_shutdown(struct sctp_shutdow struct sctp_association *asoc; int some_on_streamwheel; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -892,7 +892,7 @@ sctp_handle_shutdown(struct sctp_shutdow asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -906,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -966,7 +966,7 @@ sctp_handle_shutdown_ack(struct sctp_shu { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1000,7 +1000,7 @@ sctp_handle_shutdown_ack(struct sctp_shu asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1013,7 +1013,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1037,7 +1037,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1046,7 +1046,7 @@ sctp_handle_shutdown_ack(struct sctp_shu #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_10); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1132,7 +1132,7 @@ sctp_handle_error(struct sctp_chunkhdr * struct sctp_association *asoc; int adjust; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1195,7 +1195,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->max_init_times) { sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1205,7 +1205,7 @@ sctp_handle_error(struct sctp_chunkhdr * #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_11); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return (-1); @@ -1580,7 +1580,7 @@ sctp_process_cookie_existing(struct mbuf (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0) ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1592,7 +1592,7 @@ sctp_process_cookie_existing(struct mbuf */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1798,13 +1798,13 @@ sctp_process_cookie_existing(struct mbuf if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1817,7 +1817,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -2029,7 +2029,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_in6 *sin6; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -2133,14 +2133,14 @@ sctp_process_cookie_new(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2165,13 +2165,13 @@ sctp_process_cookie_new(struct mbuf *m, retval = 0; if (retval < 0) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2182,13 +2182,13 @@ sctp_process_cookie_new(struct mbuf *m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_17); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2211,13 +2211,13 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2274,13 +2274,13 @@ sctp_process_cookie_new(struct mbuf *m, #endif default: atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2301,7 +2301,7 @@ sctp_process_cookie_new(struct mbuf *m, * a bit of protection is worth having.. */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2313,7 +2313,7 @@ sctp_process_cookie_new(struct mbuf *m, } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -2780,7 +2780,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (so == NULL) { struct mbuf *op_err; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *pcb_so; #endif @@ -2791,7 +2791,7 @@ sctp_handle_cookie_echo(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); @@ -2800,7 +2800,7 @@ sctp_handle_cookie_echo(struct mbuf *m, atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); #endif (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(pcb_so, 1); #endif return (NULL); @@ -2890,13 +2890,13 @@ sctp_handle_cookie_echo(struct mbuf *m, * Pull it from the incomplete queue and wake the * guy */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); SCTP_SOCKET_LOCK(so, 1); #endif soisconnected(so); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_LOCK((*stcb)); atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); SCTP_SOCKET_UNLOCK(so, 1); @@ -2952,12 +2952,12 @@ sctp_handle_cookie_ack(struct sctp_cooki sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -2968,7 +2968,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { soisconnected(stcb->sctp_socket); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3196,7 +3196,7 @@ sctp_handle_shutdown_complete(struct sct { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3231,7 +3231,7 @@ sctp_handle_shutdown_complete(struct sct /* free the TCB */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: calls free-asoc\n"); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3240,7 +3240,7 @@ sctp_handle_shutdown_complete(struct sct atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return; @@ -4427,7 +4427,7 @@ __attribute__((noinline)) int auth_skipped = 0; int asconf_cnt = 0; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4785,7 +4785,7 @@ process_control_chunks: } *offset = length; if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4794,7 +4794,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -5205,7 +5205,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5214,7 +5214,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5368,7 +5368,7 @@ process_control_chunks: *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5377,7 +5377,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5413,7 +5413,7 @@ process_control_chunks: } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5422,7 +5422,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:17:54 2013 (r252882) @@ -3899,7 +3899,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif uint8_t tos_value; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; #endif @@ -4139,14 +4139,14 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); } #endif SCTP_IP_OUTPUT(ret, o_pak, ro, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4484,7 +4484,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif } /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); @@ -4495,7 +4495,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_sysctl.c Sat Jul 6 09:17:54 2013 (r252882) @@ -665,7 +665,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); #endif } @@ -1125,7 +1125,7 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_sysctl.h Sat Jul 6 09:17:54 2013 (r252882) @@ -531,7 +531,7 @@ struct sctp_sysctl { #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) #define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) @@ -224,7 +224,7 @@ sctp_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif @@ -5836,7 +5836,7 @@ sctp_ctloutput(struct socket *so, struct if (INP_CHECK_SOCKAF(so, AF_INET6)) error = ip6_ctloutput(so, sopt); #endif /* INET6 */ -#if defined(INET) && defined (INET6) +#if defined(INET) && defined(INET6) else #endif #ifdef INET Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctputil.c Sat Jul 6 09:17:54 2013 (r252882) @@ -1412,7 +1412,7 @@ sctp_timeout_handler(void *t) struct sctp_nets *net; struct sctp_timer *tmr; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1777,7 +1777,7 @@ sctp_timeout_handler(void *t) /* Can we free it yet? */ SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1786,7 +1786,7 @@ sctp_timeout_handler(void *t) atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif /* @@ -2600,7 +2600,7 @@ sctp_notify_assoc_change(uint16_t state, size_t notif_len, abort_len; unsigned int i; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -2698,7 +2698,7 @@ set_error: } } /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); @@ -2719,7 +2719,7 @@ set_error: } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3134,7 +3134,7 @@ sctp_notify_partial_delivery_indication( } if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3151,7 +3151,7 @@ sctp_notify_partial_delivery_indication( } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3173,7 +3173,7 @@ sctp_notify_shutdown_event(struct sctp_t if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* mark socket closed for read/write and wakeup! */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3188,7 +3188,7 @@ sctp_notify_shutdown_event(struct sctp_t } #endif socantsendmore(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3832,7 +3832,7 @@ sctp_abort_association(struct sctp_inpcb { uint32_t vtag; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3851,7 +3851,7 @@ sctp_abort_association(struct sctp_inpcb vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3865,7 +3865,7 @@ sctp_abort_association(struct sctp_inpcb SCTP_STAT_DECR_GAUGE32(sctps_currestab); } (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3944,12 +3944,12 @@ sctp_abort_an_association(struct sctp_in #endif ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); #endif if (stcb == NULL) { @@ -3979,7 +3979,7 @@ sctp_abort_an_association(struct sctp_in #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3989,7 +3989,7 @@ sctp_abort_an_association(struct sctp_in } #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_5); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4477,7 +4477,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4498,7 +4498,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4631,7 +4631,7 @@ get_out: if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4650,7 +4650,7 @@ get_out: } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -4907,7 +4907,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -4925,7 +4925,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t } #endif sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) @@ -396,7 +396,7 @@ sctp6_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -451,7 +451,7 @@ sctp6_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -460,7 +460,7 @@ sctp6_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:23:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E39DC6B; Sat, 6 Jul 2013 09:23:05 +0000 (UTC) (envelope-from tuexen@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 4FD151F29; Sat, 6 Jul 2013 09:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669N5o9001752; Sat, 6 Jul 2013 09:23:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669N5Il001750; Sat, 6 Jul 2013 09:23:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060923.r669N5Il001750@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:23: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: r252883 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:23:05 -0000 Author: tuexen Date: Sat Jul 6 09:23:04 2013 New Revision: 252883 URL: http://svnweb.freebsd.org/changeset/base/252883 Log: MFC r237569: Unify sctp_input() and sctp6_input(). Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:17:54 2013 (r252882) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:23:04 2013 (r252883) @@ -5883,12 +5883,12 @@ sctp_input_with_port(struct mbuf *i_pak, uint8_t ecn_bits; struct ip *ip; struct sctphdr *sh; + struct sctp_chunkhdr *ch; struct sctp_inpcb *inp = NULL; - struct sctp_nets *net; struct sctp_tcb *stcb = NULL; - struct sctp_chunkhdr *ch; + struct sctp_nets *net = NULL; int refcount_up = 0; - int length, mlen, offset; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -5897,19 +5897,12 @@ sctp_input_with_port(struct mbuf *i_pak, #endif + iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { SCTP_RELEASE_PKT(i_pak); return; } - mlen = SCTP_HEADER_LEN(i_pak); - iphlen = off; m = SCTP_HEADER_TO_CHAIN(i_pak); - - net = NULL; - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - - #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { @@ -5923,8 +5916,9 @@ sctp_input_with_port(struct mbuf *i_pak, } #endif #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; @@ -5933,17 +5927,11 @@ sctp_input_with_port(struct mbuf *i_pak, mflowid = 0; use_mflowid = 0; } - /* - * Must take out the iphlen, since mlen expects this (only effect lb - * case) - */ - mlen -= iphlen; - - /* - * Get IP, SCTP, and first chunk header together in first mbuf. - */ + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip = mtod(m, struct ip *); - offset = iphlen + sizeof(*sh) + sizeof(*ch); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { if ((m = m_pullup(m, offset)) == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5951,28 +5939,26 @@ sctp_input_with_port(struct mbuf *i_pak, } ip = mtod(m, struct ip *); } - /* validate mbuf chain length with IP payload length */ - if (mlen < (SCTP_GET_IPV4_LENGTH(ip) - iphlen)) { + sh = (struct sctphdr *)((caddr_t)ip + iphlen); + ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); + offset -= sizeof(struct sctp_chunkhdr); + length = ip->ip_len + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); SCTP_STAT_INCR(sctps_hdrops); goto bad; } - sh = (struct sctphdr *)((caddr_t)ip + iphlen); - ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(*sh)); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", mlen, iphlen); - /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { goto bad; } if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { - /* - * We only look at broadcast if its a front state, All - * others we will not have a tcb for anyway. - */ goto bad; } - /* validate SCTP checksum */ + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, @@ -5983,21 +5969,18 @@ sctp_input_with_port(struct mbuf *i_pak, #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum_4; + goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, mlen, iphlen); - - stcb = sctp_findassociation_addr(m, - offset - sizeof(*ch), - sh, ch, &inp, &net, - vrf_id); + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -6011,7 +5994,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; @@ -6020,18 +6003,14 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } -sctp_skip_csum_4: +sctp_skip_csum: #endif /* destination port of 0 is illegal, based on RFC2960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), + stcb = sctp_findassociation_addr(m, offset, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6045,27 +6024,10 @@ sctp_skip_csum_4: net->flowidset = 1; #endif } - /* inp's ref-count increased && stcb locked */ if (inp == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - SCTP_STAT_INCR(sctps_noport); if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; - SCTPDBG(SCTP_DEBUG_INPUT1, - "Sending a ABORT from packet entry!\n"); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk != NULL) - sh->v_tag = init_chk->init.initiate_tag; - } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -6089,7 +6051,7 @@ sctp_skip_csum_4: refcount_up = 1; } #ifdef IPSEC - /* + /*- * I very much doubt any of the IPSEC stuff will work but I have no * idea, so I will leave it in place. */ @@ -6098,28 +6060,22 @@ sctp_skip_csum_4: SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ - - /* - * common chunk processing - */ - length = ip->ip_len + iphlen; - offset -= sizeof(struct sctp_chunkhdr); +#endif ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return; bad: @@ -6128,7 +6084,9 @@ bad: } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } if (m) { sctp_m_freem(m); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:23:04 2013 (r252883) @@ -69,22 +69,17 @@ int sctp6_input(struct mbuf **i_pak, int *offp, int proto) { struct mbuf *m; + int iphlen; + uint32_t vrf_id = 0; + uint8_t ecn_bits; struct ip6_hdr *ip6; struct sctphdr *sh; - struct sctp_inpcb *in6p = NULL; - struct sctp_nets *net; - int refcount_up = 0; - uint32_t vrf_id = 0; - -#ifdef IPSEC - struct inpcb *in6p_ip; - -#endif struct sctp_chunkhdr *ch; - int length, offset, iphlen; - uint8_t ecn_bits; + struct sctp_inpcb *inp = NULL; struct sctp_tcb *stcb = NULL; - int pkt_len = 0; + struct sctp_nets *net = NULL; + int refcount_up = 0; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -92,17 +87,26 @@ sctp6_input(struct mbuf **i_pak, int *of uint32_t check, calc_check; #endif - int off = *offp; uint16_t port = 0; - /* get the VRF and table id's */ + iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { SCTP_RELEASE_PKT(*i_pak); - return (-1); + return (IPPROTO_DONE); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN(*i_pak); - +#ifdef SCTP_MBUF_LOGGING + /* Log in any input mbufs */ + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { + struct mbuf *mat; + + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + if (SCTP_BUF_IS_EXTENDED(mat)) { + sctp_log_mb(mat, SCTP_MBUF_INPUT); + } + } + } +#endif #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); @@ -115,42 +119,38 @@ sctp6_input(struct mbuf **i_pak, int *of mflowid = 0; use_mflowid = 0; } + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip6 = mtod(m, struct ip6_hdr *); - /* Ensure that (sctphdr + sctp_chunkhdr) in a row. */ - IP6_EXTHDR_GET(sh, struct sctphdr *, m, off, - (int)(sizeof(*sh) + sizeof(*ch))); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, + (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { SCTP_STAT_INCR(sctps_hdrops); return (IPPROTO_DONE); } ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); - iphlen = off; - offset = iphlen + sizeof(*sh) + sizeof(*ch); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", pkt_len, iphlen); - - -#if defined(NFAITH) && NFAITH > 0 - + offset -= sizeof(struct sctp_chunkhdr); if (faithprefix_p != NULL && (*faithprefix_p) (&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ goto bad; } -#endif /* NFAITH defined and > 0 */ - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - SCTPDBG(SCTP_DEBUG_INPUT1, "V6 input gets a packet iphlen:%d pktlen:%d\n", - iphlen, pkt_len); - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - /* No multi-cast support in SCTP */ + length = ntohs(ip6->ip6_plen) + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(*i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { goto bad; - + } + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), m->m_pkthdr.csum_flags); @@ -161,15 +161,16 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvhwcrc); goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p phlen:%d\n", - calc_check, check, m, iphlen); - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -182,28 +183,25 @@ sctp6_input(struct mbuf **i_pak, int *of net->flowidset = 1; #endif } - /* in6p's ref-count increased && stcb locked */ - if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); - sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((in6p != NULL) && (stcb == NULL)) { + if ((inp) && (stcb)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; } SCTP_STAT_INCR(sctps_badsum); SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } - sh->checksum = calc_check; - sctp_skip_csum: #endif - net = NULL; - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + /* destination port of 0 is illegal, based on RFC2960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto bad; + } + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -216,25 +214,10 @@ sctp_skip_csum: net->flowidset = 1; #endif } - /* in6p's ref-count increased */ - if (in6p == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - + if (inp == NULL) { SCTP_STAT_INCR(sctps_noport); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk) - sh->v_tag = init_chk->init.initiate_tag; - else - sh->v_tag = 0; - } + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) + goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -258,55 +241,46 @@ sctp_skip_csum: refcount_up = 1; } #ifdef IPSEC - /* - * Check AH/ESP integrity. + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. */ - in6p_ip = (struct inpcb *)in6p; - if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { -/* XXX */ + if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ +#endif - /* - * CONTROL chunk processing - */ - offset -= sizeof(*ch); ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - - /* Length now holds the total packet length payload + iphlen */ - length = ntohs(ip6->ip6_plen) + iphlen; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - in6p, stcb, net, ecn_bits, + inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ - /* XXX this stuff below gets moved to appropriate parts later... */ - if (m) + if (m) { sctp_m_freem(m); - if ((in6p) && refcount_up) { + } + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return (IPPROTO_DONE); - bad: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - if ((in6p) && refcount_up) { + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } - if (m) + if (m) { sctp_m_freem(m); + } return (IPPROTO_DONE); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 09:49:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F24139E; Sat, 6 Jul 2013 09:49:02 +0000 (UTC) (envelope-from delphij@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 5587E1FEC; Sat, 6 Jul 2013 09:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669n2K8008323; Sat, 6 Jul 2013 09:49:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669n2mP008321; Sat, 6 Jul 2013 09:49:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060949.r669n2mP008321@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 09:49:02 +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: r252884 - in stable/9: share/man/man4 sys/dev/hptiop X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 09:49:02 -0000 Author: delphij Date: Sat Jul 6 09:49:01 2013 New Revision: 252884 URL: http://svnweb.freebsd.org/changeset/base/252884 Log: MFC r252851: Add PCI IDs for HighPoint RocketRAID 4521, 3620, 3622 and 3640 controllers. Update the hptiop(4) manual page to reflect this as well as mentioning that some cards are already end-of-life. Many thanks to Highpoint for providing this driver update. Modified: stable/9/share/man/man4/hptiop.4 stable/9/sys/dev/hptiop/hptiop.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/hptiop.4 ============================================================================== --- stable/9/share/man/man4/hptiop.4 Sat Jul 6 09:23:04 2013 (r252883) +++ stable/9/share/man/man4/hptiop.4 Sat Jul 6 09:49:01 2013 (r252884) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd July 5, 2013 .Dt HPTIOP 4 .Os .Sh NAME @@ -60,6 +60,8 @@ driver supports the following SAS and SA .It HighPoint RocketRAID 4522 .It +HighPoint RocketRAID 4521 +.It HighPoint RocketRAID 4520 .It HighPoint RocketRAID 4322 @@ -72,6 +74,20 @@ HighPoint RocketRAID 4311 .It HighPoint RocketRAID 4310 .It +HighPoint RocketRAID 3640 +.It +HighPoint RocketRAID 3622 +.It +HighPoint RocketRAID 3620 +.El +.Pp +The +.Nm +driver also supports the following SAS and SATA RAID controllers that +are already End-of-Life: +.Pp +.Bl -bullet -compact +.It HighPoint RocketRAID 4211 .It HighPoint RocketRAID 4210 Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Sat Jul 6 09:23:04 2013 (r252883) +++ stable/9/sys/dev/hptiop/hptiop.c Sat Jul 6 09:49:01 2013 (r252884) @@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$"); #include static const char driver_name[] = "hptiop"; -static const char driver_version[] = "v1.8"; +static const char driver_version[] = "v1.9"; static devclass_t hptiop_devclass; @@ -1869,8 +1869,12 @@ static int hptiop_probe(device_t dev) switch (id) { case 0x4520: + case 0x4521: case 0x4522: sas = 1; + case 0x3620: + case 0x3622: + case 0x3640: ops = &hptiop_mvfrey_ops; break; case 0x4210: From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 11:39:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C1E67EB6; Sat, 6 Jul 2013 11:39:37 +0000 (UTC) (envelope-from jilles@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 B3FDB12FF; Sat, 6 Jul 2013 11:39:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66BdbJa041031; Sat, 6 Jul 2013 11:39:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Bdbqc041030; Sat, 6 Jul 2013 11:39:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307061139.r66Bdbqc041030@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 6 Jul 2013 11:39:37 +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: r252885 - stable/9/sys/fs/fdescfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 11:39:37 -0000 Author: jilles Date: Sat Jul 6 11:39:37 2013 New Revision: 252885 URL: http://svnweb.freebsd.org/changeset/base/252885 Log: MFC r250567: fdescfs: Supply a real value for d_type in readdir. All the fdescfs nodes (except . and ..) appear as character devices to stat(), so DT_CHR is correct. Modified: stable/9/sys/fs/fdescfs/fdesc_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/9/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 6 09:49:01 2013 (r252884) +++ stable/9/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 6 11:39:37 2013 (r252885) @@ -538,7 +538,7 @@ fdesc_readdir(ap) break; dp->d_namlen = sprintf(dp->d_name, "%d", fcnt); dp->d_reclen = UIO_MX; - dp->d_type = DT_UNKNOWN; + dp->d_type = DT_CHR; dp->d_fileno = i + FD_DESC; break; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 12:56:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08E50D99; Sat, 6 Jul 2013 12:56:31 +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 ED5F91711; Sat, 6 Jul 2013 12:56:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66CuUN3064077; Sat, 6 Jul 2013 12:56:30 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66CuUJN064076; Sat, 6 Jul 2013 12:56:30 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307061256.r66CuUJN064076@svn.freebsd.org> From: Mateusz Guzik Date: Sat, 6 Jul 2013 12:56: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: r252886 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 12:56:31 -0000 Author: mjg Date: Sat Jul 6 12:56:30 2013 New Revision: 252886 URL: http://svnweb.freebsd.org/changeset/base/252886 Log: MFC r252415, r252422: acct: reduce code duplication by using acct_disable as cleanup for failed kproc_create acct: create a special plimit object and set it for exiting processe instead of allocating new one each time All limits are set to RLIM_INFINITY which sould be ok (even though we care only about RLIMT_FSIZE in this case). Modified: stable/9/sys/kern/kern_acct.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_acct.c ============================================================================== --- stable/9/sys/kern/kern_acct.c Sat Jul 6 11:39:37 2013 (r252885) +++ stable/9/sys/kern/kern_acct.c Sat Jul 6 12:56:30 2013 (r252886) @@ -133,6 +133,7 @@ static int acct_configured; static int acct_suspended; static struct vnode *acct_vp; static struct ucred *acct_cred; +static struct plimit *acct_limit; static int acct_flags; static struct sx acct_sx; @@ -196,7 +197,7 @@ int sys_acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, vfslocked, replacing; + int error, flags, i, vfslocked, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -274,6 +275,15 @@ sys_acct(struct thread *td, struct acct_ } /* + * Create our own plimit object without limits. It will be assigned + * to exiting processes. + */ + acct_limit = lim_alloc(); + for (i = 0; i < RLIM_NLIMITS; i++) + acct_limit->pl_rlimit[i].rlim_cur = + acct_limit->pl_rlimit[i].rlim_max = RLIM_INFINITY; + + /* * Save the new accounting file vnode, and schedule the new * free space watcher. */ @@ -292,13 +302,8 @@ sys_acct(struct thread *td, struct acct_ "accounting"); if (error) { vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); - (void) vn_close(acct_vp, acct_flags, acct_cred, td); + (void) acct_disable(td, 0); VFS_UNLOCK_GIANT(vfslocked); - crfree(acct_cred); - acct_configured = 0; - acct_vp = NULL; - acct_cred = NULL; - acct_flags = 0; sx_xunlock(&acct_sx); log(LOG_NOTICE, "Unable to start accounting thread\n"); return (error); @@ -323,6 +328,7 @@ acct_disable(struct thread *td, int logg sx_assert(&acct_sx, SX_XLOCKED); error = vn_close(acct_vp, acct_flags, acct_cred, td); crfree(acct_cred); + lim_free(acct_limit); acct_configured = 0; acct_vp = NULL; acct_cred = NULL; @@ -343,7 +349,7 @@ acct_process(struct thread *td) { struct acctv2 acct; struct timeval ut, st, tmp; - struct plimit *newlim, *oldlim; + struct plimit *oldlim; struct proc *p; struct rusage ru; int t, ret, vfslocked; @@ -419,7 +425,6 @@ acct_process(struct thread *td) /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flagx = p->p_acflag; - PROC_UNLOCK(p); /* Setup ancillary structure fields. */ acct.ac_flagx |= ANVER; @@ -428,14 +433,10 @@ acct_process(struct thread *td) acct.ac_len = acct.ac_len2 = sizeof(acct); /* - * Eliminate any file size rlimit. + * Eliminate rlimits (file size limit in particular). */ - newlim = lim_alloc(); - PROC_LOCK(p); oldlim = p->p_limit; - lim_copy(newlim, oldlim); - newlim->pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; - p->p_limit = newlim; + p->p_limit = lim_hold(acct_limit); PROC_UNLOCK(p); lim_free(oldlim); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 14:21:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99076B81; Sat, 6 Jul 2013 14:21:22 +0000 (UTC) (envelope-from jilles@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 8A6741942; Sat, 6 Jul 2013 14:21:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66ELMxs090109; Sat, 6 Jul 2013 14:21:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66ELMAw090108; Sat, 6 Jul 2013 14:21:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307061421.r66ELMAw090108@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 6 Jul 2013 14:21: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: r252887 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 14:21:22 -0000 Author: jilles Date: Sat Jul 6 14:21:22 2013 New Revision: 252887 URL: http://svnweb.freebsd.org/changeset/base/252887 Log: MFC r250102: socket: Make shutdown() wake up a blocked accept(). A blocking accept (and some other operations) waits on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. The error from accept() is [ECONNABORTED] which is not the nicest one -- the thread calling accept() needs to know out-of-band what is happening. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER, and in that case there is no descriptor to call shutdown() on) so this should be fairly safe. A shutdown() already woke up a blocked accept() for TCP sockets, but not for Unix domain sockets. This fix is generic for all domains. This patch was sent to -hackers@ and -net@ on April 5. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sat Jul 6 12:56:30 2013 (r252886) +++ stable/9/sys/kern/uipc_socket.c Sat Jul 6 14:21:22 2013 (r252887) @@ -2339,9 +2339,11 @@ soshutdown(struct socket *so, int how) sorflush(so); if (how != SHUT_RD) { error = (*pr->pr_usrreqs->pru_shutdown)(so); + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (error); } + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 17:11:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A7E638B; Sat, 6 Jul 2013 17:11:35 +0000 (UTC) (envelope-from tuexen@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 6C1A71D49; Sat, 6 Jul 2013 17:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66HBZx6040034; Sat, 6 Jul 2013 17:11:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66HBYhl040024; Sat, 6 Jul 2013 17:11:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307061711.r66HBYhl040024@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 17:11:34 +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: r252889 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 17:11:35 -0000 Author: tuexen Date: Sat Jul 6 17:11:33 2013 New Revision: 252889 URL: http://svnweb.freebsd.org/changeset/base/252889 Log: MFC rr237715, r238294: Pass the src and dst address of a received packet explicitly around. Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_asconf.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_os_bsd.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_asconf.c Sat Jul 6 17:11:33 2013 (r252889) @@ -50,59 +50,8 @@ __FBSDID("$FreeBSD$"); */ -static void -sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) -{ - struct ip *iph; - -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - break; - } -#endif -#ifdef INET6 - case (IPV6_VERSION >> 4): - { - /* IPv6 source */ - struct ip6_hdr *ip6; - - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - break; - } -#endif /* INET6 */ - default: - break; - } - return; -} - /* - * draft-ietf-tsvwg-addip-sctp + * RFC 5061 * * An ASCONF parameter queue exists per asoc which holds the pending address * operations. Lists are updated upon receipt of ASCONF-ACK. @@ -194,12 +143,12 @@ sctp_asconf_error_response(uint32_t id, } static struct mbuf * -sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_add_ip(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int send_hb, int response_required) { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -279,11 +228,10 @@ sctp_process_asconf_add_ip(struct mbuf * /* if 0.0.0.0/::0, add the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* add the address */ if (bad_address) { @@ -343,11 +291,12 @@ sctp_asconf_del_remote_addrs_except(stru } static struct mbuf * -sctp_process_asconf_delete_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_delete_ip(struct sockaddr *src, + struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -365,9 +314,6 @@ sctp_process_asconf_delete_ip(struct mbu #endif - /* get the source IP address for src and 0.0.0.0/::0 delete checks */ - sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); - aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); @@ -424,7 +370,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* make sure the source address is not being deleted */ - if (sctp_cmpaddr(sa, (struct sockaddr *)&sa_source)) { + if (sctp_cmpaddr(sa, src)) { /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -434,8 +380,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - result = sctp_asconf_del_remote_addrs_except(stcb, - (struct sockaddr *)&sa_source); + result = sctp_asconf_del_remote_addrs_except(stcb, src); if (result) { /* src address did not exist? */ @@ -475,12 +420,12 @@ sctp_process_asconf_delete_ip(struct mbu } static struct mbuf * -sctp_process_asconf_set_primary(struct mbuf *m, +sctp_process_asconf_set_primary(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -550,11 +495,10 @@ sctp_process_asconf_set_primary(struct m /* if 0.0.0.0/::0, use the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* set the primary address */ if (sctp_set_primary_addr(stcb, sa, NULL) == 0) { @@ -626,6 +570,7 @@ sctp_process_asconf_set_primary(struct m */ void sctp_handle_asconf(struct mbuf *m, unsigned int offset, + struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first) { @@ -762,13 +707,13 @@ sctp_handle_asconf(struct mbuf *m, unsig switch (param_type) { case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_add_ip(m, aph, stcb, + m_result = sctp_process_asconf_add_ip(src, aph, stcb, (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_delete_ip(m, aph, stcb, + m_result = sctp_process_asconf_delete_ip(src, aph, stcb, error); break; case SCTP_ERROR_CAUSE_IND: @@ -776,7 +721,7 @@ sctp_handle_asconf(struct mbuf *m, unsig break; case SCTP_SET_PRIM_ADDR: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_set_primary(m, aph, + m_result = sctp_process_asconf_set_primary(src, aph, stcb, error); break; case SCTP_NAT_VTAGS: @@ -856,11 +801,7 @@ send_reply: * this could happen if the source address was just newly * added */ - struct sockaddr_storage addr; - struct sockaddr *src = (struct sockaddr *)&addr; - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - sctp_asconf_get_source_ip(m, src); SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); /* look up the from address */ Modified: stable/9/sys/netinet/sctp_asconf.h ============================================================================== --- stable/9/sys/netinet/sctp_asconf.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_asconf.h Sat Jul 6 17:11:33 2013 (r252889) @@ -46,8 +46,8 @@ extern void sctp_asconf_cleanup(struct s extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *, int *, int); extern void -sctp_handle_asconf(struct mbuf *, unsigned int, struct sctp_asconf_chunk *, - struct sctp_tcb *, int i); +sctp_handle_asconf(struct mbuf *, unsigned int, struct sockaddr *, + struct sctp_asconf_chunk *, struct sctp_tcb *, int); extern void sctp_handle_asconf_ack(struct mbuf *, int, struct sctp_asconf_ack_chunk *, Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 17:11:33 2013 (r252889) @@ -2516,6 +2516,7 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, uint8_t use_mflowid, uint32_t mflowid, @@ -2626,8 +2627,8 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; - sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (2); @@ -2695,6 +2696,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_indata.h Sat Jul 6 17:11:33 2013 (r252889) @@ -111,7 +111,9 @@ void sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int -sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, +sctp_process_data(struct mbuf **, int, int *, int, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint32_t *, uint8_t, uint32_t, Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 17:11:33 2013 (r252889) @@ -80,7 +80,8 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void -sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -97,7 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -109,7 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -119,7 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -129,7 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_inbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -139,7 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_outbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -149,7 +150,7 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -178,7 +179,7 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -191,7 +192,8 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, + sh, cp, use_mflowid, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); @@ -419,7 +421,8 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -454,13 +457,14 @@ sctp_process_init_ack(struct mbuf *m, in initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, - NULL))) { + (offset + sizeof(struct sctp_init_chunk)), initack_limit, + src, dst, NULL))) { /* Huh, we should abort */ SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -536,7 +540,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1278,7 +1282,8 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -1298,8 +1303,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1310,8 +1315,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->initiate_tag == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1320,8 +1325,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1330,8 +1335,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_inbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1340,8 +1345,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_outbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1365,7 +1370,7 @@ sctp_handle_init_ack(struct mbuf *m, int sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } - if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, + if (sctp_process_init_ack(m, iphlen, offset, src, dst, sh, cp, stcb, net, abort_no_unlock, use_mflowid, mflowid, vrf_id) < 0) { @@ -1419,6 +1424,7 @@ sctp_handle_init_ack(struct mbuf *m, int static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1435,6 +1441,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1477,7 +1484,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) @@ -1642,7 +1649,7 @@ sctp_process_cookie_existing(struct mbuf */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; return (NULL); @@ -1703,7 +1710,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -1786,7 +1793,7 @@ sctp_process_cookie_existing(struct mbuf } if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; return (NULL); @@ -1867,7 +1874,8 @@ sctp_process_cookie_existing(struct mbuf * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, + return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -1972,7 +1980,7 @@ sctp_process_cookie_existing(struct mbuf if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; @@ -2003,6 +2011,7 @@ sctp_process_cookie_existing(struct mbuf */ static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -2102,7 +2111,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2130,7 +2139,7 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2179,8 +2188,8 @@ sctp_process_cookie_new(struct mbuf *m, } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, - init_src)) { + init_offset + sizeof(struct sctp_init_chunk), initack_offset, + src, dst, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2376,6 +2385,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct mbuf * sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, @@ -2396,9 +2406,6 @@ sctp_handle_cookie_echo(struct mbuf *m, unsigned int cookie_len; struct timeval now; struct timeval time_expires; - struct sockaddr_storage dest_store; - struct sockaddr *localep_sa = (struct sockaddr *)&dest_store; - struct ip *iph; int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; @@ -2419,45 +2426,6 @@ sctp_handle_cookie_echo(struct mbuf *m, if (inp_p == NULL) { return (NULL); } - /* First get the destination address setup too. */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *lsin; - - lsin = (struct sockaddr_in *)(localep_sa); - memset(lsin, 0, sizeof(*lsin)); - lsin->sin_family = AF_INET; - lsin->sin_len = sizeof(*lsin); - lsin->sin_port = sh->dest_port; - lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *lsin6; - - lsin6 = (struct sockaddr_in6 *)(localep_sa); - memset(lsin6, 0, sizeof(*lsin6)); - lsin6->sin6_family = AF_INET6; - lsin6->sin6_len = sizeof(struct sockaddr_in6); - ip6 = mtod(m, struct ip6_hdr *); - lsin6->sin6_port = sh->dest_port; - lsin6->sin6_addr = ip6->ip6_dst; - break; - } -#endif - default: - return (NULL); - } - cookie = &cp->cookie; cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); @@ -2608,7 +2576,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2652,7 +2620,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*stcb == NULL) && to) { /* Yep, lets check */ - *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, localep_sa, NULL); + *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, dst, NULL); if (*stcb == NULL) { /* * We should have only got back the same inp. If we @@ -2695,15 +2663,17 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ - *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, - cookie_len, *inp_p, netp, to, ¬ification, + *stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, + cookie, cookie_len, *inp_p, + netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; - *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, + *stcb = sctp_process_cookie_existing(m, iphlen, offset, + src, dst, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -2788,7 +2758,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -4402,6 +4372,7 @@ __attribute__((noinline)) #endif static struct sctp_tcb * sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, uint8_t use_mflowid, uint32_t mflowid, @@ -4518,7 +4489,9 @@ __attribute__((noinline)) if (asconf_len < sizeof(struct sctp_asconf_paramhdr)) break; stcb = sctp_findassociation_ep_asconf(m, - *offset, sh, &inp, netp, vrf_id); + *offset, + dst, + sh, &inp, netp, vrf_id); if (stcb != NULL) break; asconf_offset += SCTP_SIZE32(asconf_len); @@ -4560,7 +4533,7 @@ __attribute__((noinline)) } if (stcb == NULL) { /* no association, so it's out of the blue... */ - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4598,7 +4571,8 @@ __attribute__((noinline)) if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, + sh, inp, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -4740,8 +4714,8 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4752,14 +4726,14 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); *offset = length; return (NULL); } - sctp_handle_init(m, iphlen, *offset, sh, + sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, stcb, &abort_no_unlock, use_mflowid, mflowid, @@ -4811,7 +4785,8 @@ process_control_chunks: return (NULL); } if ((netp) && (*netp)) { - ret = sctp_handle_init_ack(m, iphlen, *offset, sh, + ret = sctp_handle_init_ack(m, iphlen, *offset, + src, dst, sh, (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, @@ -5121,8 +5096,8 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); } @@ -5149,7 +5124,9 @@ process_control_chunks: if (netp) { ret_buf = sctp_handle_cookie_echo(m, iphlen, - *offset, sh, + *offset, + src, dst, + sh, (struct sctp_cookie_echo_chunk *)ch, &inp, &stcb, netp, auth_skipped, @@ -5312,7 +5289,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_asconf(m, *offset, + sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } @@ -5608,8 +5585,9 @@ __attribute__((noinline)) * common input chunk processing (v4 and v6) */ void -sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, - int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, +sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, @@ -5648,7 +5626,7 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5657,7 +5635,8 @@ sctp_common_input_processing(struct mbuf if (IS_SCTP_CONTROL(ch)) { /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ - stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, + stcb = sctp_process_control(m, iphlen, &offset, length, + src, dst, sh, ch, inp, stcb, &net, &fwd_tsn_seen, use_mflowid, mflowid, vrf_id, port); @@ -5695,7 +5674,7 @@ sctp_common_input_processing(struct mbuf } if (stcb == NULL) { /* out of the blue DATA chunk */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5765,7 +5744,7 @@ sctp_common_input_processing(struct mbuf /* * We consider OOTB any data sent during asoc setup. */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); @@ -5786,7 +5765,8 @@ sctp_common_input_processing(struct mbuf break; } /* plow through the data chunks while length > offset */ - retval = sctp_process_data(mm, iphlen, &offset, length, sh, + retval = sctp_process_data(mm, iphlen, &offset, length, + src, dst, sh, inp, stcb, net, &high_tsn, use_mflowid, mflowid, vrf_id, port); @@ -5881,6 +5861,7 @@ sctp_input_with_port(struct mbuf *i_pak, int iphlen; uint32_t vrf_id = 0; uint8_t ecn_bits; + struct sockaddr_in src, dst; struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; @@ -5930,18 +5911,27 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip = mtod(m, struct ip *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + iphlen); ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); offset -= sizeof(struct sctp_chunkhdr); + memset(&src, 0, sizeof(struct sockaddr_in)); + src.sin_family = AF_INET; + src.sin_len = sizeof(struct sockaddr_in); + src.sin_port = sh->src_port; + src.sin_addr = ip->ip_src; + memset(&dst, 0, sizeof(struct sockaddr_in)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(struct sockaddr_in); + dst.sin_port = sh->dest_port; + dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ if (SCTP_HEADER_LEN(i_pak) != length) { @@ -5951,10 +5941,10 @@ sctp_input_with_port(struct mbuf *i_pak, goto bad; } /* SCTP does not allow broadcasts or multicasts */ - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { goto bad; } - if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { + if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { goto bad; } SCTPDBG(SCTP_DEBUG_INPUT1, @@ -5980,6 +5970,8 @@ sctp_input_with_port(struct mbuf *i_pak, SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", calc_check, check, m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6011,6 +6003,8 @@ sctp_skip_csum: goto bad; } stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6029,7 +6023,9 @@ sctp_skip_csum: if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, + sctp_send_shutdown_complete2((struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, use_mflowid, mflowid, vrf_id, port); goto bad; @@ -6041,7 +6037,10 @@ sctp_skip_csum: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -6064,8 +6063,10 @@ sctp_skip_csum: ecn_bits = ip->ip_tos; /* sa_ignore NO_NULL_CHK */ - sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, + sctp_common_input_processing(&m, iphlen, offset, length, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); if (m) { @@ -6117,15 +6118,14 @@ sctp_input(struct mbuf *m, int off) * No flow id built by lower layers fix it so we * create one. */ - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); + offset = off + sizeof(struct sctphdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + off); tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_input.h Sat Jul 6 17:11:33 2013 (r252889) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, + struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, Modified: stable/9/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 17:11:33 2013 (r252889) @@ -177,18 +177,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); } \ } while (0); \ } -#define SCTPDBG_PKT(level, iph, sh) \ -{ \ - do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level) { \ - sctp_print_address_pkt(iph, sh); \ - } \ - } while (0); \ -} #else #define SCTPDBG(level, params...) #define SCTPDBG_ADDR(level, addr) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 18:28:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDE93408; Sat, 6 Jul 2013 18:28:07 +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 B00A71F74; Sat, 6 Jul 2013 18:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66IS70l061427; Sat, 6 Jul 2013 18:28:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66IS7cC061422; Sat, 6 Jul 2013 18:28:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307061828.r66IS7cC061422@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 6 Jul 2013 18:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252890 - in head/sys: fs/ext2fs modules/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 18:28:07 -0000 Author: pfg Date: Sat Jul 6 18:28:06 2013 New Revision: 252890 URL: http://svnweb.freebsd.org/changeset/base/252890 Log: Initial implementation of the HTree directory index. This is a port of NetBSD's GSoC 2012 Ext3 HTree directory indexing by Vyacheslav Matyushin. It was cleaned up and enhanced for FreeBSD by Zheng Liu (lz@). This is an excellent example of work shared among different projects: Vyacheslav was able to look at an early prototype from Zheng Liu who was also able to check the code from Haiku (with permission). As in linux, the feature is not available by default and must be enabled explicitly with tune2fs. We still do not support the workarounds required in readdir for NFS. Submitted by: Zheng Liu Tested by: Mike Ma Sponsored by: Google Inc. MFC after: 1 week Added: head/sys/fs/ext2fs/ext2_hash.c (contents, props changed) head/sys/fs/ext2fs/ext2_htree.c (contents, props changed) head/sys/fs/ext2fs/htree.h (contents, props changed) Modified: head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h head/sys/modules/ext2fs/Makefile Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Sat Jul 6 17:11:33 2013 (r252889) +++ head/sys/fs/ext2fs/ext2_dir.h Sat Jul 6 18:28:06 2013 (r252890) @@ -40,6 +40,21 @@ struct ext2fs_direct { uint16_t e2d_namlen; /* length of string in e2d_name */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; + +enum slotstatus { + NONE, + COMPACT, + FOUND +}; + +struct ext2fs_searchslot { + enum slotstatus slotstatus; + doff_t slotoffset; /* offset of area with free space */ + int slotsize; /* size of area at slotoffset */ + int slotfreespace; /* amount of space free in slot */ + int slotneeded; /* sizeof the entry we are seeking */ +}; + /* * The new version of the directory entry. Since EXT2 structures are * stored in intel byte order, and the name_len field could never be Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Sat Jul 6 17:11:33 2013 (r252889) +++ head/sys/fs/ext2fs/ext2_extern.h Sat Jul 6 18:28:06 2013 (r252890) @@ -40,12 +40,15 @@ #define _FS_EXT2FS_EXT2_EXTERN_H_ struct ext2fs_dinode; +struct ext2fs_direct_2; +struct ext2fs_searchslot; struct indir; struct inode; struct mount; struct vfsconf; struct vnode; +int ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *); int ext2_alloc(struct inode *, int32_t, int32_t, int, struct ucred *, int32_t *); int ext2_balloc(struct inode *, @@ -81,6 +84,18 @@ int ext2_dirempty(struct inode *, ino_t, int ext2_checkpath(struct inode *, struct inode *, struct ucred *); int cg_has_sb(int i); int ext2_inactive(struct vop_inactive_args *); +int ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *, + struct componentname *); +int ext2_htree_create_index(struct vnode *, struct componentname *, + struct ext2fs_direct_2 *); +int ext2_htree_has_idx(struct inode *); +int ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *, + uint32_t *); +int ext2_htree_lookup(struct inode *, const char *, int, struct buf **, + int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); +int ext2_search_dirblock(struct inode *, void *, int *, const char *, int, + int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); + /* Flags to low-level allocation routines. * The low 16-bits are reserved for IO_ flags from vnode.h. Added: head/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_hash.c Sat Jul 6 18:28:06 2013 (r252890) @@ -0,0 +1,289 @@ +/*- + * Copyright (c) 2010, 2013 Zheng Liu + * Copyright (c) 2012, Vyacheslav Matyushin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* F, G, and H are MD4 functions */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) + +/* + * FF, GG, and HH are transformations for rounds 1, 2, and 3. + * Rotation is separated from addition to prevent recompuatation + */ +#define FF(a, b, c, d, x, s) { \ + (a) += F ((b), (c), (d)) + (x); \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +#define GG(a, b, c, d, x, s) { \ + (a) += G ((b), (c), (d)) + (x) + (uint32_t)0x5A827999; \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +#define HH(a, b, c, d, x, s) { \ + (a) += H ((b), (c), (d)) + (x) + (uint32_t)0x6ED9EBA1; \ + (a) = ROTATE_LEFT ((a), (s)); \ +} + +/* + * MD4 basic transformation. It transforms state based on block. + * + * This is a half md4 algorithm because in Linux it uses this algorithm in dir + * index. This function is copied from kern/md4c.c file and is modified as + * necessary. + * + * The return value of this function is uint32_t in Linux, but actually we don't + * need to check this value. So in our version this function don't return any + * values. + */ +static void +ext2_half_md4(uint32_t hash[4], uint32_t data[8]) +{ + uint32_t a = hash[0], b = hash[1], c = hash[2], d = hash[3]; + + /* Round 1 */ + FF(a, b, c, d, data[0], 3); + FF(d, a, b, c, data[1], 7); + FF(c, d, a, b, data[2], 11); + FF(b, c, d, a, data[3], 19); + FF(a, b, c, d, data[4], 3); + FF(d, a, b, c, data[5], 7); + FF(c, d, a, b, data[6], 11); + FF(b, c, d, a, data[7], 19); + + /* Round 2 */ + GG(a, b, c, d, data[1], 3); + GG(d, a, b, c, data[3], 5); + GG(c, d, a, b, data[5], 9); + GG(b, c, d, a, data[7], 13); + GG(a, b, c, d, data[0], 3); + GG(d, a, b, c, data[2], 5); + GG(c, d, a, b, data[4], 9); + GG(b, c, d, a, data[6], 13); + + /* Round 3 */ + HH(a, b, c, d, data[3], 3); + HH(d, a, b, c, data[7], 9); + HH(c, d, a, b, data[2], 11); + HH(b, c, d, a, data[6], 15); + HH(a, b, c, d, data[1], 3); + HH(d, a, b, c, data[5], 9); + HH(c, d, a, b, data[0], 11); + HH(b, c, d, a, data[4], 15); + + hash[0] += a; + hash[1] += b; + hash[2] += c; + hash[3] += d; +} + +/* + * Tiny Encryption Algorithm. + */ +static void +ext2_tea(uint32_t hash[4], uint32_t data[8]) +{ + uint32_t tea_delta = 0x9E3779B9; + uint32_t sum; + uint32_t x = hash[0], y = hash[1]; + int n = 16; + int i = 1; + + while (n-- > 0) { + sum = i * tea_delta; + x += ((y << 4) + data[0]) ^ (y + sum) ^ ((y >> 5) + data[1]); + y += ((x << 4) + data[2]) ^ (x + sum) ^ ((x >> 5) + data[3]); + i++; + } + + hash[0] += x; + hash[1] += y; +} + +static uint32_t +ext2_legacy_hash(const char *name, int len, int unsigned_char) +{ + uint32_t h0, h1 = 0x12A3FE2D, h2 = 0x37ABE8F9; + uint32_t multi = 0x6D22F5; + const unsigned char *uname = (const unsigned char *)name; + const signed char *sname = (const signed char *)name; + int val, i; + + for (i = 0; i < len; i++) { + if (unsigned_char) + val = (u_int)*uname++; + else + val = (int)*sname++; + + h0 = h2 + (h1 ^ (val * multi)); + if (h0 & 0x80000000) + h0 -= 0x7FFFFFFF; + h2 = h1; + h1 = h0; + } + + return (h1 << 1); +} + +static void +ext2_prep_hashbuf(const char *src, int slen, uint32_t *dst, int dlen, + int unsigned_char) +{ + uint32_t padding = slen | (slen << 8) | (slen << 16) | (slen << 24); + uint32_t buf_val; + int len, i; + int buf_byte; + const unsigned char *ubuf = (const unsigned char *)src; + const signed char *sbuf = (const signed char *)src; + + if (slen > dlen) + len = dlen; + else + len = slen; + + buf_val = padding; + + for (i = 0; i < len; i++) { + if (unsigned_char) + buf_byte = (u_int)ubuf[i]; + else + buf_byte = (int)sbuf[i]; + + if ((i % 4) == 0) + buf_val = padding; + + buf_val <<= 8; + buf_val += buf_byte; + + if ((i % 4) == 3) { + *dst++ = buf_val; + dlen -= sizeof(uint32_t); + buf_val = padding; + } + } + + dlen -= sizeof(uint32_t); + if (dlen >= 0) + *dst++ = buf_val; + + dlen -= sizeof(uint32_t); + while (dlen >= 0) { + *dst++ = padding; + dlen -= sizeof(uint32_t); + } +} + +int +ext2_htree_hash(const char *name, int len, + uint32_t *hash_seed, int hash_version, + uint32_t *hash_major, uint32_t *hash_minor) +{ + uint32_t hash[4]; + uint32_t data[8]; + uint32_t major = 0, minor = 0; + int unsigned_char = 0; + + if (!name || !hash_major) + return (-1); + + if (len < 1 || len > 255) + goto error; + + hash[0] = 0x67452301; + hash[1] = 0xEFCDAB89; + hash[2] = 0x98BADCFE; + hash[3] = 0x10325476; + + if (hash_seed) + memcpy(hash, hash_seed, sizeof(hash)); + + switch (hash_version) { + case EXT2_HTREE_TEA_UNSIGNED: + unsigned_char = 1; + case EXT2_HTREE_TEA: + while (len > 0) { + ext2_prep_hashbuf(name, len, data, 16, unsigned_char); + ext2_tea(hash, data); + len -= 16; + name += 16; + } + major = hash[0]; + minor = hash[1]; + break; + case EXT2_HTREE_LEGACY_UNSIGNED: + unsigned_char = 1; + case EXT2_HTREE_LEGACY: + major = ext2_legacy_hash(name, len, unsigned_char); + break; + case EXT2_HTREE_HALF_MD4_UNSIGNED: + unsigned_char = 1; + case EXT2_HTREE_HALF_MD4: + while (len > 0) { + ext2_prep_hashbuf(name, len, data, 32, unsigned_char); + ext2_half_md4(hash, data); + len -= 32; + name += 32; + } + major = hash[0]; + minor = hash[1]; + break; + default: + goto error; + } + + major &= ~1; + if (major == (EXT2_HTREE_EOF << 1)) + major = (EXT2_HTREE_EOF - 1) << 1; + *hash_major = major; + if (hash_minor) + *hash_minor = minor; + + return (0); + +error: + *hash_major = 0; + if (hash_minor) + *hash_minor = 0; + return (-1); +} Added: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_htree.c Sat Jul 6 18:28:06 2013 (r252890) @@ -0,0 +1,899 @@ +/*- + * Copyright (c) 2010, 2012 Zheng Liu + * Copyright (c) 2012, Vyacheslav Matyushin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static void ext2_append_entry(char *block, uint32_t blksize, + struct ext2fs_direct_2 *last_entry, + struct ext2fs_direct_2 *new_entry); +static int ext2_htree_append_block(struct vnode *vp, char *data, + struct componentname *cnp, uint32_t blksize); +static int ext2_htree_check_next(struct inode *ip, uint32_t hash, + const char *name, struct ext2fs_htree_lookup_info *info); +static int ext2_htree_cmp_sort_entry(const void *e1, const void *e2); +static int ext2_htree_find_leaf(struct inode *ip, const char *name, + int namelen, uint32_t *hash, uint8_t *hash_verion, + struct ext2fs_htree_lookup_info *info); +static uint32_t ext2_htree_get_block(struct ext2fs_htree_entry *ep); +static uint16_t ext2_htree_get_count(struct ext2fs_htree_entry *ep); +static uint32_t ext2_htree_get_hash(struct ext2fs_htree_entry *ep); +static uint16_t ext2_htree_get_limit(struct ext2fs_htree_entry *ep); +static void ext2_htree_insert_entry_to_level(struct ext2fs_htree_lookup_level *level, + uint32_t hash, uint32_t blk); +static void ext2_htree_insert_entry(struct ext2fs_htree_lookup_info *info, + uint32_t hash, uint32_t blk); +static uint32_t ext2_htree_node_limit(struct inode *ip); +static void ext2_htree_set_block(struct ext2fs_htree_entry *ep, + uint32_t blk); +static void ext2_htree_set_count(struct ext2fs_htree_entry *ep, + uint16_t cnt); +static void ext2_htree_set_hash(struct ext2fs_htree_entry *ep, + uint32_t hash); +static void ext2_htree_set_limit(struct ext2fs_htree_entry *ep, + uint16_t limit); +static int ext2_htree_split_dirblock(char *block1, char *block2, + uint32_t blksize, uint32_t *hash_seed, uint8_t hash_version, + uint32_t *split_hash, struct ext2fs_direct_2 *entry); +static void ext2_htree_release(struct ext2fs_htree_lookup_info *info); +static uint32_t ext2_htree_root_limit(struct inode *ip, int len); +static int ext2_htree_writebuf(struct ext2fs_htree_lookup_info *info); + +int +ext2_htree_has_idx(struct inode *ip) +{ + if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && + ip->i_flags & EXT4_INDEX) + return (1); + else + return (0); +} + +static int +ext2_htree_check_next(struct inode *ip, uint32_t hash, const char *name, + struct ext2fs_htree_lookup_info *info) +{ + struct vnode *vp = ITOV(ip); + struct ext2fs_htree_lookup_level *level; + struct buf *bp; + uint32_t next_hash; + int idx = info->h_levels_num - 1; + int levels = 0; + + do { + level = &info->h_levels[idx]; + level->h_entry++; + if (level->h_entry < level->h_entries + + ext2_htree_get_count(level->h_entries)) + break; + if (idx == 0) + return (0); + idx--; + levels++; + } while (1); + + next_hash = ext2_htree_get_hash(level->h_entry); + if ((hash & 1) == 0) { + if (hash != (next_hash & ~1)) + return (0); + } + + while (levels > 0) { + levels--; + if (ext2_blkatoff(vp, ext2_htree_get_block(level->h_entry) * + ip->i_e2fs->e2fs_bsize, NULL, &bp) != 0) + return (0); + level = &info->h_levels[idx + 1]; + brelse(level->h_bp); + level->h_bp = bp; + level->h_entry = level->h_entries = + ((struct ext2fs_htree_node *)bp->b_data)->h_entries; + } + + return (1); +} + +static uint32_t +ext2_htree_get_block(struct ext2fs_htree_entry *ep) +{ + return (ep->h_blk & 0x00FFFFFF); +} + +static void +ext2_htree_set_block(struct ext2fs_htree_entry *ep, uint32_t blk) +{ + ep->h_blk = blk; +} + +static uint16_t +ext2_htree_get_count(struct ext2fs_htree_entry *ep) +{ + return (((struct ext2fs_htree_count *)(ep))->h_entries_num); +} + +static void +ext2_htree_set_count(struct ext2fs_htree_entry *ep, uint16_t cnt) +{ + ((struct ext2fs_htree_count *)(ep))->h_entries_num = cnt; +} + +static uint32_t +ext2_htree_get_hash(struct ext2fs_htree_entry *ep) +{ + return (ep->h_hash); +} + +static uint16_t +ext2_htree_get_limit(struct ext2fs_htree_entry *ep) +{ + return (((struct ext2fs_htree_count *)(ep))->h_entries_max); +} + +static void +ext2_htree_set_hash(struct ext2fs_htree_entry *ep, uint32_t hash) +{ + ep->h_hash = hash; +} + +static void +ext2_htree_set_limit(struct ext2fs_htree_entry *ep, uint16_t limit) +{ + ((struct ext2fs_htree_count *)(ep))->h_entries_max = limit; +} + +static void +ext2_htree_release(struct ext2fs_htree_lookup_info *info) +{ + int i; + + for (i = 0; i < info->h_levels_num; i++) { + struct buf *bp = info->h_levels[i].h_bp; + if (bp != NULL) + brelse(bp); + } +} + +static uint32_t +ext2_htree_root_limit(struct inode *ip, int len) +{ + uint32_t space; + + space = ip->i_e2fs->e2fs_bsize - EXT2_DIR_REC_LEN(1) - + EXT2_DIR_REC_LEN(2) - len; + return (space / sizeof(struct ext2fs_htree_entry)); +} + +static uint32_t +ext2_htree_node_limit(struct inode *ip) +{ + struct m_ext2fs *fs; + uint32_t space; + + fs = ip->i_e2fs; + space = fs->e2fs_bsize - EXT2_DIR_REC_LEN(0); + + return (space / sizeof(struct ext2fs_htree_entry)); +} + +static int +ext2_htree_find_leaf(struct inode *ip, const char *name, int namelen, + uint32_t *hash, uint8_t *hash_ver, + struct ext2fs_htree_lookup_info *info) +{ + struct vnode *vp; + struct ext2fs *fs; + struct m_ext2fs *m_fs; + struct buf *bp = NULL; + struct ext2fs_htree_root *rootp; + struct ext2fs_htree_entry *entp, *start, *end, *middle, *found; + struct ext2fs_htree_lookup_level *level_info; + uint32_t hash_major = 0, hash_minor = 0; + uint32_t levels, cnt; + uint8_t hash_version; + + if (name == NULL || info == NULL) + return (-1); + + vp = ITOV(ip); + fs = ip->i_e2fs->e2fs; + m_fs = ip->i_e2fs; + + if (ext2_blkatoff(vp, 0, NULL, &bp) != 0) + return (-1); + + info->h_levels_num = 1; + info->h_levels[0].h_bp = bp; + rootp = (struct ext2fs_htree_root *)bp->b_data; + if (rootp->h_info.h_hash_version != EXT2_HTREE_LEGACY && + rootp->h_info.h_hash_version != EXT2_HTREE_HALF_MD4 && + rootp->h_info.h_hash_version != EXT2_HTREE_TEA) + goto error; + + hash_version = rootp->h_info.h_hash_version; + if (hash_version <= EXT2_HTREE_TEA) + hash_version += m_fs->e2fs_uhash; + *hash_ver = hash_version; + + ext2_htree_hash(name, namelen, fs->e3fs_hash_seed, + hash_version, &hash_major, &hash_minor); + *hash = hash_major; + + if ((levels = rootp->h_info.h_ind_levels) > 1) + goto error; + + entp = (struct ext2fs_htree_entry *)(((char *)&rootp->h_info) + + rootp->h_info.h_info_len); + + if (ext2_htree_get_limit(entp) != + ext2_htree_root_limit(ip, rootp->h_info.h_info_len)) + goto error; + + while (1) { + cnt = ext2_htree_get_count(entp); + if (cnt == 0 || cnt > ext2_htree_get_limit(entp)) + goto error; + + start = entp + 1; + end = entp + cnt - 1; + while (start <= end) { + middle = start + (end - start) / 2; + if (ext2_htree_get_hash(middle) > hash_major) + end = middle - 1; + else + start = middle + 1; + } + found = start - 1; + + level_info = &(info->h_levels[info->h_levels_num - 1]); + level_info->h_bp = bp; + level_info->h_entries = entp; + level_info->h_entry = found; + if (levels == 0) + return (0); + levels--; + if (ext2_blkatoff(vp, + ext2_htree_get_block(found) * m_fs->e2fs_bsize, + NULL, &bp) != 0) + goto error; + entp = ((struct ext2fs_htree_node *)bp->b_data)->h_entries; + info->h_levels_num++; + info->h_levels[info->h_levels_num - 1].h_bp = bp; + } + +error: + ext2_htree_release(info); + return (-1); +} + +/* + * Try to lookup an directory entry in HTree index + */ +int +ext2_htree_lookup(struct inode *ip, const char *name, int namelen, + struct buf **bpp, int *entryoffp, doff_t *offp, + doff_t *prevoffp, doff_t *endusefulp, + struct ext2fs_searchslot *ss) +{ + struct vnode *vp; + struct ext2fs_htree_lookup_info info; + struct ext2fs_htree_entry *leaf_node; + struct m_ext2fs *m_fs; + struct buf *bp; + uint32_t blk; + uint32_t dirhash; + uint32_t bsize; + uint8_t hash_version; + int search_next; + int found = 0; + + m_fs = ip->i_e2fs; + bsize = m_fs->e2fs_bsize; + vp = ITOV(ip); + + /* TODO: print error msg because we don't lookup '.' and '..' */ + + memset(&info, 0, sizeof(info)); + if (ext2_htree_find_leaf(ip, name, namelen, &dirhash, + &hash_version, &info)) + return (-1); + + do { + leaf_node = info.h_levels[info.h_levels_num - 1].h_entry; + blk = ext2_htree_get_block(leaf_node); + if (ext2_blkatoff(vp, blk * bsize, NULL, &bp) != 0) { + ext2_htree_release(&info); + return (-1); + } + + *offp = blk * bsize; + *entryoffp = 0; + *prevoffp = blk * bsize; + *endusefulp = blk * bsize; + + if (ss->slotstatus == NONE) { + ss->slotoffset = -1; + ss->slotfreespace = 0; + } + + if (ext2_search_dirblock(ip, bp->b_data, &found, + name, namelen, entryoffp, offp, prevoffp, + endusefulp, ss) != 0) { + brelse(bp); + ext2_htree_release(&info); + return (-1); + } + + if (found) { + *bpp = bp; + ext2_htree_release(&info); + return (0); + } + + brelse(bp); + search_next = ext2_htree_check_next(ip, dirhash, name, &info); + } while (search_next); + + ext2_htree_release(&info); + return (ENOENT); +} + +static int +ext2_htree_append_block(struct vnode *vp, char *data, + struct componentname *cnp, uint32_t blksize) +{ + struct iovec aiov; + struct uio auio; + struct inode *dp = VTOI(vp); + uint64_t cursize, newsize; + int error; + + cursize = roundup(dp->i_size, blksize); + newsize = roundup(dp->i_size, blksize) + blksize; + + auio.uio_offset = cursize; + auio.uio_resid = blksize; + aiov.iov_len = blksize; + aiov.iov_base = data; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_WRITE; + auio.uio_segflg = UIO_SYSSPACE; + error = VOP_WRITE(vp, &auio, IO_SYNC, cnp->cn_cred); + if (!error) + dp->i_size = newsize; + + return (error); +} + +static int +ext2_htree_writebuf(struct ext2fs_htree_lookup_info *info) +{ + int i, error; + + for (i = 0; i < info->h_levels_num; i++) { + struct buf *bp = info->h_levels[i].h_bp; + error = bwrite(bp); + if (error) + return (error); + } + + return (0); +} + +static void +ext2_htree_insert_entry_to_level(struct ext2fs_htree_lookup_level *level, + uint32_t hash, uint32_t blk) +{ + struct ext2fs_htree_entry *target; + int entries_num; + + target = level->h_entry + 1; + entries_num = ext2_htree_get_count(level->h_entries); + + memmove(target + 1, target, (char *)(level->h_entries + entries_num) - + (char *)target); + ext2_htree_set_block(target, blk); + ext2_htree_set_hash(target, hash); + ext2_htree_set_count(level->h_entries, entries_num + 1); +} + +/* + * Insert an index entry to the index node. + */ +static void +ext2_htree_insert_entry(struct ext2fs_htree_lookup_info *info, + uint32_t hash, uint32_t blk) +{ + struct ext2fs_htree_lookup_level *level; + + level = &info->h_levels[info->h_levels_num - 1]; + ext2_htree_insert_entry_to_level(level, hash, blk); +} + +/* + * Compare two entry sort descriptiors by name hash value. + * This is used together with qsort. + */ +static int +ext2_htree_cmp_sort_entry(const void *e1, const void *e2) +{ + const struct ext2fs_htree_sort_entry *entry1, *entry2; + + entry1 = (const struct ext2fs_htree_sort_entry *)e1; + entry2 = (const struct ext2fs_htree_sort_entry *)e2; + + if (entry1->h_hash < entry2->h_hash) + return (-1); + if (entry2->h_hash > entry2->h_hash) + return (1); + return (0); +} + +/* + * Append an entry to the end of the directory block. + */ +static void +ext2_append_entry(char *block, uint32_t blksize, + struct ext2fs_direct_2 *last_entry, + struct ext2fs_direct_2 *new_entry) +{ + uint16_t entry_len; + + entry_len = EXT2_DIR_REC_LEN(last_entry->e2d_namlen); + last_entry->e2d_reclen = entry_len; + last_entry = (struct ext2fs_direct_2 *)((char *)last_entry + entry_len); + new_entry->e2d_reclen = block + blksize - (char *)last_entry; + memcpy(last_entry, new_entry, EXT2_DIR_REC_LEN(new_entry->e2d_namlen)); +} + +/* + * Move half of entries from the old directory block to the new one. + */ +static int +ext2_htree_split_dirblock(char *block1, char *block2, uint32_t blksize, + uint32_t *hash_seed, uint8_t hash_version, + uint32_t *split_hash, struct ext2fs_direct_2 *entry) +{ + int entry_cnt = 0; + int size = 0; + int i, k; + uint32_t offset; + uint16_t entry_len = 0; + uint32_t entry_hash; + struct ext2fs_direct_2 *ep, *last; + char *dest; + struct ext2fs_htree_sort_entry *sort_info; + + ep = (struct ext2fs_direct_2 *)block1; + dest = block2; + sort_info = (struct ext2fs_htree_sort_entry *) + ((char *)block2 + blksize); + + /* + * Calculate name hash value for the entry which is to be added. + */ + ext2_htree_hash(entry->e2d_name, entry->e2d_namlen, hash_seed, + hash_version, &entry_hash, NULL); + + /* + * Fill in directory entry sort descriptors. + */ + while ((char *)ep < block1 + blksize) { + if (ep->e2d_ino && ep->e2d_namlen) { + entry_cnt++; + sort_info--; + sort_info->h_size = ep->e2d_reclen; + sort_info->h_offset = (char *)ep - block1; + ext2_htree_hash(ep->e2d_name, ep->e2d_namlen, + hash_seed, hash_version, + &sort_info->h_hash, NULL); + } + ep = (struct ext2fs_direct_2 *) + ((char *)ep + ep->e2d_reclen); + } + + /* + * Sort directory entry descriptors by name hash value. + */ + qsort(sort_info, entry_cnt, sizeof(struct ext2fs_htree_sort_entry), + ext2_htree_cmp_sort_entry); + + /* + * Count the number of entries to move to directory block 2. + */ + for (i = entry_cnt - 1; i >= 0; i--) { + if (sort_info[i].h_size + size > blksize / 2) + break; + size += sort_info[i].h_size; + } + + *split_hash = sort_info[i + 1].h_hash; + + /* + * Set collision bit. + */ + if (*split_hash == sort_info[i].h_hash) + *split_hash += 1; + + /* + * Move half of directory entries from block 1 to block 2. + */ + for (k = i + 1; k < entry_cnt; k++) { + ep = (struct ext2fs_direct_2 *)((char *)block1 + + sort_info[k].h_offset); + entry_len = EXT2_DIR_REC_LEN(ep->e2d_namlen); + memcpy(dest, ep, entry_len); + ((struct ext2fs_direct_2 *)dest)->e2d_reclen = entry_len; + /* Mark directory entry as unused. */ + ep->e2d_ino = 0; + dest += entry_len; + } + dest -= entry_len; + + /* Shrink directory entries in block 1. */ + last = (struct ext2fs_direct_2 *)block1; + entry_len = EXT2_DIR_REC_LEN(last->e2d_namlen); + for (offset = last->e2d_reclen; offset < blksize; ) { + ep = (struct ext2fs_direct_2 *)(block1 + offset); + offset += ep->e2d_reclen; + if (last->e2d_ino) { + /* trim the existing slot */ + last->e2d_reclen = entry_len; + last = (struct ext2fs_direct_2 *) + ((char *)last + entry_len); + } + entry_len = EXT2_DIR_REC_LEN(ep->e2d_namlen); + memcpy((void *)last, (void *)ep, entry_len); + } + + if (entry_hash >= *split_hash) { + /* Add entry to block 2. */ + ext2_append_entry(block2, blksize, + (struct ext2fs_direct_2 *)dest, entry); + + /* Adjust length field of last entry of block 1. */ + last->e2d_reclen = block1 + blksize - (char *)last; + } else { + /* Add entry to block 1. */ + ext2_append_entry(block1, blksize, last, entry); + + /* Adjust length field of last entry of block 2. */ + ((struct ext2fs_direct_2 *)dest)->e2d_reclen = + block2 + blksize - dest; + } + + return (0); +} + +/* + * Create an HTree index for a directory + */ +int +ext2_htree_create_index(struct vnode *vp, struct componentname *cnp, + struct ext2fs_direct_2 *new_entry) +{ + struct buf *bp = NULL; + struct inode *dp; + struct ext2fs *fs; + struct m_ext2fs *m_fs; + struct ext2fs_direct_2 *ep, *dotdot; + struct ext2fs_htree_root *root; + struct ext2fs_htree_lookup_info info; + uint32_t blksize, dirlen, split_hash; + uint8_t hash_version; + char *buf1 = NULL; + char *buf2 = NULL; + int error = 0; + + dp = VTOI(vp); + fs = dp->i_e2fs->e2fs; + m_fs = dp->i_e2fs; + blksize = m_fs->e2fs_bsize; + + buf1 = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); + buf2 = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); + + if ((error = ext2_blkatoff(vp, 0, NULL, &bp)) != 0) + goto out; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 18:42:29 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B126567D; Sat, 6 Jul 2013 18:42:29 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 7C0721FE2; Sat, 6 Jul 2013 18:42:29 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A0CC8402; Sat, 6 Jul 2013 20:37:45 +0200 (CEST) Date: Sat, 6 Jul 2013 20:42:49 +0200 From: Pawel Jakub Dawidek To: Bruce Evans Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol Message-ID: <20130706184249.GD25842@garage.freebsd.pl> References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mJm6k4Vb/yFcL9ZU" Content-Disposition: inline In-Reply-To: <20130704105843.B982@besplex.bde.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 18:42:29 -0000 --mJm6k4Vb/yFcL9ZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote: > Many style bugs are visible in this patch: [...] > - sysexits.h is used [...] Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used, please stop calling this a bug, because you are just confusing people. At this point sysexits(3) actually even suggests it is blessed by style(9). This is how it starts: According to style(9), it is not a good practice to call exit(3) with arbitrary values to indicate a failure condition when ending a program. Instead, the pre-defined exit codes from sysexits should be used, so the caller of the process can get a rough estimation about the failure class without looking up the source code. In my personal opinion it doesn't hurt to use sysexits(3) - if you don't want to interpret exit status then treat every value !=3D 0 as an error. In HAST (IIRC) I do interpret exit status - if I get EX_TEMPFAIL, I know I can try to restart the process, if I get something else I don't restart it, as I risk an infinite loop. Apart from my personal opinion, if you want to call it a bug and not confuse people, then start discussion and change the manual page to recommend avoiding sysexits(3). As of now we are just sending mixed signals and create confusion. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --mJm6k4Vb/yFcL9ZU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHYZSkACgkQForvXbEpPzSmCACfcmIPcu2kOTW0gFLjEyD2TM2v +oUAn0SY1J/FQ7FQ0YJLCPzJEO7cxtTm =2Pp6 -----END PGP SIGNATURE----- --mJm6k4Vb/yFcL9ZU-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 19:21:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8B23F3D; Sat, 6 Jul 2013 19:21:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id AF866112D; Sat, 6 Jul 2013 19:21:57 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:29]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id D83C923F845; Sat, 6 Jul 2013 15:21:49 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us D83C923F845 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 6 Jul 2013 15:21:46 -0400 From: Glen Barber To: Andre Oppermann Subject: Re: svn commit: r252835 - stable/9/sys/netinet Message-ID: <20130706192146.GL20631@glenbarber.us> References: <201307052011.r65KBRCG063754@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UK1lfQXsnwKrySH9" Content-Disposition: inline In-Reply-To: <201307052011.r65KBRCG063754@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 19:21:58 -0000 --UK1lfQXsnwKrySH9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 05, 2013 at 08:11:27PM +0000, Andre Oppermann wrote: > Author: andre > Date: Fri Jul 5 20:11:27 2013 > New Revision: 252835 > URL: http://svnweb.freebsd.org/changeset/base/252835 >=20 > Log: > MFC r226433: > =20 > Update the comment and description of tcp_sendspace and tcp_recvspace > to better reflect their purpose. > =20 > MFC r226437: > =20 > VNET virtualize tcp_sendspace/tcp_recvspace and change the > type to INT. A long is not necessary as the TCP window is > limited to 2**30. A larger initial window isn't useful. > =20 > MFC r226448: > =20 > Move the tcp_sendspace and tcp_recvspace sysctl's from > the middle of tcp_usrreq.c to the top of tcp_output.c > and tcp_input.c respectively next to the socket buffer > autosizing controls. > =20 > MFC r227034: > =20 > Restore sysctl names for tcp_sendspace/tcp_recvspace. > =20 > They seem to be changed unintentionally in r226437, and there were no > any mentions of renaming in commit log message. > =20 > Reported by: Anton Yuzhaninov >=20 > Modified: > stable/9/sys/netinet/tcp_input.c > stable/9/sys/netinet/tcp_output.c > stable/9/sys/netinet/tcp_usrreq.c > stable/9/sys/netinet/tcp_var.h > Directory Properties: > stable/9/sys/ (props changed) >=20 > Modified: stable/9/sys/netinet/tcp_input.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) > +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) > @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, > &VNET_NAME(tcp_insecure_rst), 0, > "Follow the old (insecure) criteria for accepting RST packets"); > =20 > +VNET_DEFINE(int, tcp_recvspace) =3D 1024*64 > +#define V_tcp_recvspace VNET(tcp_recvspace) > +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, > + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); > + > VNET_DEFINE(int, tcp_do_autorcvbuf) =3D 1; > #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) > SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, I think this breaks the LINT build. cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=3Dc99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -DGPROF -falign-functions=3D16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/netinet/tcp_input.c /src/sys/netinet/tcp_input.c:199: error: expected ',' or ';' before 'static' /src/sys/netinet/tcp_input.c:199: error: 'sysctl___net_inet_tcp_recvspace' undeclared here (not in a function) *** Error code 1 Stop in /obj/amd64.amd64/src/sys/LINT-VIMAGE. *** Error code 1 Glen --UK1lfQXsnwKrySH9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJR2G5KAAoJEFJPDDeguUajxQYIAJZG90GfFBuzWMU/Rx/HhgMS HG5XElZOtrc0V+RTqRc0Wib6Vk/tyfXlmCObqpv2QFRznVIdcP0xw9DuDzW0mC0U X0pnRgsx3FV4eQVYQSJRKW37BGszizrO+sNWetGMJU/aJRlnFQEkdiokOTDHyXGh IewXOZCYoD/7HCBVkHJ6iM5XGK+nQOrdhcilN4sFEkej51piOt8+Kq/JoYX0n50a Ggi2HOWwIIVBAT4xyLOVaY5x70GyipLE3in0QfYabGjZq7C63icPXjfT7lrsuBXw OTeyVpLs181oz7PhmpCDbJSYfJXGDkXQxRQMckFmcQ4FuTRcTXjK8HM2jl83mCs= =Yxda -----END PGP SIGNATURE----- --UK1lfQXsnwKrySH9-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 19:43:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30CF295D; Sat, 6 Jul 2013 19:43:43 +0000 (UTC) (envelope-from gavin@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 209E2121A; Sat, 6 Jul 2013 19:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Jhhq8084269; Sat, 6 Jul 2013 19:43:43 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66JhhuN084268; Sat, 6 Jul 2013 19:43:43 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307061943.r66JhhuN084268@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 6 Jul 2013 19:43:42 +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: r252891 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 19:43:43 -0000 Author: gavin Date: Sat Jul 6 19:43:42 2013 New Revision: 252891 URL: http://svnweb.freebsd.org/changeset/base/252891 Log: Merge r252337 from head: Don't try to re-insert an already present but invalid page. This could happen if a thread doing a page-in loses a ZFS range lock race to a thread writing to the same range This fixes "panic: vm_page_alloc: pindex already allocated" in http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel Submitted by: avg 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 Jul 6 18:28:06 2013 (r252890) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 6 19:43:42 2013 (r252891) @@ -343,10 +343,13 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_sleep(pp, "zfsmwb"); continue; } - } else { + } else if (pp == NULL) { pp = vm_page_alloc(obj, OFF_TO_IDX(start), VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | VM_ALLOC_NOBUSY); + } else { + ASSERT(pp != NULL && !pp->valid); + pp = NULL; } if (pp != NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 19:51:23 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29018B68; Sat, 6 Jul 2013 19:51:23 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id DE275125D; Sat, 6 Jul 2013 19:51:22 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C7FCD1203C0; Sat, 6 Jul 2013 21:51:08 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 9334628493; Sat, 6 Jul 2013 21:51:08 +0200 (CEST) Date: Sat, 6 Jul 2013 21:51:08 +0200 From: Jilles Tjoelker To: Pawel Jakub Dawidek Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol Message-ID: <20130706195108.GA34684@stack.nl> References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130706184249.GD25842@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 19:51:23 -0000 On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote: > On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote: > > Many style bugs are visible in this patch: > [...] > > - sysexits.h is used > [...] > Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used, > please stop calling this a bug, because you are just confusing people. > At this point sysexits(3) actually even suggests it is blessed by > style(9). This is how it starts: > According to style(9), it is not a good practice to call exit(3) > with arbitrary values to indicate a failure condition when > ending a program. Instead, the pre-defined exit codes from > sysexits should be used, so the caller of the process can get a > rough estimation about the failure class without looking up the > source code. > In my personal opinion it doesn't hurt to use sysexits(3) - if you don't > want to interpret exit status then treat every value != 0 as an error. > In HAST (IIRC) I do interpret exit status - if I get EX_TEMPFAIL, I know > I can try to restart the process, if I get something else I don't > restart it, as I risk an infinite loop. > Apart from my personal opinion, if you want to call it a bug and not > confuse people, then start discussion and change the manual page to > recommend avoiding sysexits(3). As of now we are just sending mixed > signals and create confusion. This is indeed confusing, because style(9) itself does not recommend sysexits at all. This was changed in 2008 but sysexits(3) was not adjusted along with that. The text in style(9) that only allows 0 or 1 is not universally valid either. Firstly, in some application areas like mail delivery, it is conventional and documented to use and interpret sysexits codes. (So if HAST uses sysexits, it should document that fact.) Secondly, some other utilities such as test, cmp and diff use 0 for a "true" condition, 1 for a "false" condition and greater than 1 (usually 2) for failures. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 19:59:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C002EDC0; Sat, 6 Jul 2013 19:59:07 +0000 (UTC) (envelope-from netchild@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 A1DCB1286; Sat, 6 Jul 2013 19:59:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Jx7HK087891; Sat, 6 Jul 2013 19:59:07 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Jx7Wi087888; Sat, 6 Jul 2013 19:59:07 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201307061959.r66Jx7Wi087888@svn.freebsd.org> From: Alexander Leidinger Date: Sat, 6 Jul 2013 19:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252892 - in head/sys: compat/linux contrib/v4l X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 19:59:07 -0000 Author: netchild Date: Sat Jul 6 19:59:06 2013 New Revision: 252892 URL: http://svnweb.freebsd.org/changeset/base/252892 Log: - Move videodev headers from compat/linux to contrib/v4l (cp from vendor and apply diff to compat/linux versions). - The cp implies an update of videodev2.h to the linux kernel 2.6.34.14 one. The update makes video in skype v4 work on FreeBSD. Tested by: Artyom Mirgorodskiy (update of header only) Added: head/sys/contrib/v4l/ - copied from r252890, vendor/v4l/dist/ Deleted: head/sys/compat/linux/linux_videodev.h head/sys/compat/linux/linux_videodev2.h Modified: head/sys/compat/linux/linux_ioctl.c head/sys/contrib/v4l/videodev.h head/sys/contrib/v4l/videodev2.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Jul 6 19:43:42 2013 (r252891) +++ head/sys/compat/linux/linux_ioctl.c Sat Jul 6 19:59:06 2013 (r252892) @@ -85,10 +85,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include -#include +#include #include CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); Modified: head/sys/contrib/v4l/videodev.h ============================================================================== --- vendor/v4l/dist/videodev.h Sat Jul 6 18:28:06 2013 (r252890) +++ head/sys/contrib/v4l/videodev.h Sat Jul 6 19:59:06 2013 (r252892) @@ -1,48 +1,41 @@ +/* + * This header comes from linux, but it has no license. The author + * (Alan Cox @ Redhat) gave explicit permissions to use it in FreeBSD. + * The FreeBSD vendor branch for v4l gives a more detailed description + * about this in the README. + * + * $FreeBSD$ + */ + #ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H -#include +#include +typedef int32_t __s32; +typedef uint32_t __u32; +typedef uint16_t __u16; +typedef uint8_t __u8; +#if 0 #define HAVE_V4L1 1 #include +#endif -#ifdef __KERNEL__ - -#include - -extern struct video_device* video_devdata(struct file*); - -#define to_video_device(cd) container_of(cd, struct video_device, class_dev) -static inline void -video_device_create_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_create_file(&vfd->class_dev, attr); -} -static inline void -video_device_remove_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_remove_file(&vfd->class_dev, attr); -} - -#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ -/* helper functions to access driver private data. */ -static inline void *video_get_drvdata(struct video_device *dev) -{ - return dev->priv; -} - -static inline void video_set_drvdata(struct video_device *dev, void *data) -{ - dev->priv = data; -} -#endif - -extern int video_exclusive_open(struct inode *inode, struct file *file); -extern int video_exclusive_release(struct inode *inode, struct file *file); -#endif /* __KERNEL__ */ +#define VID_TYPE_CAPTURE 1 /* Can capture */ +#define VID_TYPE_TUNER 2 /* Can tune */ +#define VID_TYPE_TELETEXT 4 /* Does teletext */ +#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ +#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ +#define VID_TYPE_CLIPPING 32 /* Can clip */ +#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ +#define VID_TYPE_SCALES 128 /* Scalable */ +#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ +#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ +#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ +#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ +#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ +#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ struct video_capability { @@ -157,7 +150,7 @@ struct video_window __u32 width,height; /* Its size */ __u32 chromakey; __u32 flags; - struct video_clip __user *clips; /* Set only */ + struct video_clip *clips; /* Set only */ int clipcount; #define VIDEO_WINDOW_INTERLACE 1 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ @@ -197,6 +190,8 @@ struct video_key __u32 flags; }; +#define VIDEO_MAX_FRAME 32 + struct video_mbuf { int size; /* Total memory to map */ Modified: head/sys/contrib/v4l/videodev2.h ============================================================================== --- vendor/v4l/dist/videodev2.h Sat Jul 6 18:28:06 2013 (r252890) +++ head/sys/contrib/v4l/videodev2.h Sat Jul 6 19:59:06 2013 (r252892) @@ -52,10 +52,18 @@ * Justin Schoeman * Hans Verkuil * et al. + * + * $FreeBSD$ */ #ifndef __LINUX_VIDEODEV2_H #define __LINUX_VIDEODEV2_H +#ifdef __FreeBSD__ +#define __user +typedef uint64_t __u64; +typedef int64_t __s64; +typedef uint32_t __le32; +#else #ifdef __KERNEL__ #include /* need struct timeval */ #else @@ -64,6 +72,7 @@ #include #include #include +#endif /* * Common stuff for both V4L1 and V4L2 From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:10:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02D0D296; Sat, 6 Jul 2013 20:10:40 +0000 (UTC) (envelope-from kib@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 E84B612ED; Sat, 6 Jul 2013 20:10:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KAdwF093212; Sat, 6 Jul 2013 20:10:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KAdsR093211; Sat, 6 Jul 2013 20:10:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307062010.r66KAdsR093211@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 6 Jul 2013 20:10:39 +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: r252893 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:10:40 -0000 Author: kib Date: Sat Jul 6 20:10:39 2013 New Revision: 252893 URL: http://svnweb.freebsd.org/changeset/base/252893 Log: MFC r226454 (by bz): Fix VNET build. Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sat Jul 6 19:59:06 2013 (r252892) +++ stable/9/sys/netinet/tcp_input.c Sat Jul 6 20:10:39 2013 (r252893) @@ -194,7 +194,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_insecure_rst), 0, "Follow the old (insecure) criteria for accepting RST packets"); -VNET_DEFINE(int, tcp_recvspace) = 1024*64 +VNET_DEFINE(int, tcp_recvspace) = 1024*64; #define V_tcp_recvspace VNET(tcp_recvspace) SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:12:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6559A3CD; Sat, 6 Jul 2013 20:12:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CBD4112F9; Sat, 6 Jul 2013 20:12:34 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r66KCTS6018264; Sat, 6 Jul 2013 23:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r66KCTS6018264 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r66KCTC0018263; Sat, 6 Jul 2013 23:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 6 Jul 2013 23:12:29 +0300 From: Konstantin Belousov To: Glen Barber Subject: Re: svn commit: r252835 - stable/9/sys/netinet Message-ID: <20130706201229.GB91021@kib.kiev.ua> References: <201307052011.r65KBRCG063754@svn.freebsd.org> <20130706192146.GL20631@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UXNJ9ANe8MmuJ4dV" Content-Disposition: inline In-Reply-To: <20130706192146.GL20631@glenbarber.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:12:35 -0000 --UXNJ9ANe8MmuJ4dV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 06, 2013 at 03:21:46PM -0400, Glen Barber wrote: > On Fri, Jul 05, 2013 at 08:11:27PM +0000, Andre Oppermann wrote: > > Author: andre > > Date: Fri Jul 5 20:11:27 2013 > > New Revision: 252835 > > URL: http://svnweb.freebsd.org/changeset/base/252835 > >=20 > > Log: > > MFC r226433: > > =20 > > Update the comment and description of tcp_sendspace and tcp_recvspace > > to better reflect their purpose. > > =20 > > MFC r226437: > > =20 > > VNET virtualize tcp_sendspace/tcp_recvspace and change the > > type to INT. A long is not necessary as the TCP window is > > limited to 2**30. A larger initial window isn't useful. > > =20 > > MFC r226448: > > =20 > > Move the tcp_sendspace and tcp_recvspace sysctl's from > > the middle of tcp_usrreq.c to the top of tcp_output.c > > and tcp_input.c respectively next to the socket buffer > > autosizing controls. > > =20 > > MFC r227034: > > =20 > > Restore sysctl names for tcp_sendspace/tcp_recvspace. > > =20 > > They seem to be changed unintentionally in r226437, and there were no > > any mentions of renaming in commit log message. > > =20 > > Reported by: Anton Yuzhaninov > >=20 > > Modified: > > stable/9/sys/netinet/tcp_input.c > > stable/9/sys/netinet/tcp_output.c > > stable/9/sys/netinet/tcp_usrreq.c > > stable/9/sys/netinet/tcp_var.h > > Directory Properties: > > stable/9/sys/ (props changed) > >=20 > > Modified: stable/9/sys/netinet/tcp_input.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) > > +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) > > @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, > > &VNET_NAME(tcp_insecure_rst), 0, > > "Follow the old (insecure) criteria for accepting RST packets"); > > =20 > > +VNET_DEFINE(int, tcp_recvspace) =3D 1024*64 > > +#define V_tcp_recvspace VNET(tcp_recvspace) > > +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, > > + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"= ); > > + > > VNET_DEFINE(int, tcp_do_autorcvbuf) =3D 1; > > #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) > > SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, >=20 > I think this breaks the LINT build. >=20 > cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=3Dc99 -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. -I/src/sys > -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D8000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -DGPROF > -falign-functions=3D16 -DGPROF4 -DGUPROF -fno-builtin > -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse > -msoft-float -fno-asynchronous-unwind-tables -ffreestanding > -fstack-protector -Werror -pg -mprofiler-epilogue > /src/sys/netinet/tcp_input.c > /src/sys/netinet/tcp_input.c:199: error: expected ',' or ';' before 'stat= ic' > /src/sys/netinet/tcp_input.c:199: error: > 'sysctl___net_inet_tcp_recvspace' undeclared here (not in a function) > *** Error code 1 >=20 > Stop in /obj/amd64.amd64/src/sys/LINT-VIMAGE. > *** Error code 1 Hopefully fixed by r252893. --UXNJ9ANe8MmuJ4dV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR2HotAAoJEJDCuSvBvK1B5RsP/3+4hQr5+Wa8fTyg2v1UgY3U DdzKN5utaR/xZuv2TRWOHmGhBqPLwPhkVRV1tPl5+w4pQccsjIQxoKsN/WZNGx9M H3XD2nNzaXUdWZoeAeho0XBTsp/xywTcJkrGoM9D7VLZFCUGSNEiG4y68E2V3MV2 Dm3R6fq9iq/mTAARC3jw0N2VF6XODrtOGmyKHSshBfiXOSfIfnnS2ydd6JFaTt/d wOBLPphlDDWPZK1ef6rH5QMZc38jOtT9nIK1DqReH9X/mQGzB3GZlqG/riMpcLDp ff3TUTjgkFgfT8fuQx8Ho/4INEjcPWTb5zS8OYrTLEum8Q6MRod+vwJ9911ShUl7 LRazLLmcBlRNYhAX0ji1ycvkNkXClIXR3AE2MHLWIjE0Tu8e4pSwcaJ+LqUoqcx2 rHUQUabiJtj64Rr1czqG/Q1QU+2TJJkJSPQ9wDx9p9GUxEl8HL2IQeU3LYijUCew 0w2qcLJHwFLSnCvy9w5vjxaUUqKpHkF4/6gbFqzlnrHVOPBg2Pn/AyxbwoXBWmDG TPI/nCTA5V1YXSCyl1/39G+7Z2s6OGeEHOGMoI1i1KBZRU8Dj3hcyDYjgDYieFa4 cwDVAXlp+mCx2SiSmeXXO+c0yX4XeZdEUQ1FuR8y7xw4mddl1/XKOGoW1EJyJJ/z 070mUWbClTCSv54pID5g =5X+i -----END PGP SIGNATURE----- --UXNJ9ANe8MmuJ4dV-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:21:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9D7A7712; Sat, 6 Jul 2013 20:21:35 +0000 (UTC) (envelope-from markj@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 8F0DD1350; Sat, 6 Jul 2013 20:21:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KLZkA096327; Sat, 6 Jul 2013 20:21:35 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KLZTw096326; Sat, 6 Jul 2013 20:21:35 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307062021.r66KLZTw096326@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 20:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252894 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:21:35 -0000 Author: markj Date: Sat Jul 6 20:21:35 2013 New Revision: 252894 URL: http://svnweb.freebsd.org/changeset/base/252894 Log: Add SDT_PROBE_DEFINE0 for consistency with SDT_PROBE0. MFC after: 1 week Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Sat Jul 6 20:10:39 2013 (r252893) +++ head/sys/sys/sdt.h Sat Jul 6 20:21:35 2013 (r252894) @@ -210,6 +210,9 @@ struct sdt_provider { SI_SUB_KDTRACE, SI_ORDER_SECOND + 2, sdt_argtype_deregister, \ sdt_##prov##_##mod##_##func##_##name##num ) +#define SDT_PROBE_DEFINE0(prov, mod, func, name, sname) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname) + #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0) From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:31:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB89F8F9; Sat, 6 Jul 2013 20:31:22 +0000 (UTC) (envelope-from markj@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 AC0CF1390; Sat, 6 Jul 2013 20:31:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KVMcj099131; Sat, 6 Jul 2013 20:31:22 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KVMt8099129; Sat, 6 Jul 2013 20:31:22 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307062031.r66KVMt8099129@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 20:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252895 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:31:22 -0000 Author: markj Date: Sat Jul 6 20:31:22 2013 New Revision: 252895 URL: http://svnweb.freebsd.org/changeset/base/252895 Log: Add a man page for the SDT_* macros, which can be used to define new static DTrace probes and providers in kernel code. MFC after: 1 week Added: head/share/man/man9/SDT.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Jul 6 20:21:35 2013 (r252894) +++ head/share/man/man9/Makefile Sat Jul 6 20:31:22 2013 (r252895) @@ -236,6 +236,7 @@ MAN= accept_filter.9 \ rwlock.9 \ sbuf.9 \ scheduler.9 \ + SDT.9 \ securelevel_gt.9 \ selrecord.9 \ sema.9 \ @@ -1147,6 +1148,11 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 sched_setup.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 +MLINKS+=SDT.9 SDT_PROVIDER_DECLARE.9 \ + SDT.9 SDT_PROVIDER_DEFINE.9 \ + SDT.9 SDT_PROBE_DECLARE.9 \ + SDT.9 SDT_PROBE_DEFINE.9 \ + SDT.9 SDT_PROBE.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 MLINKS+=selrecord.9 seldrain.9 \ selrecord.9 selwakeup.9 Added: head/share/man/man9/SDT.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/SDT.9 Sat Jul 6 20:31:22 2013 (r252895) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2013 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 3, 2013 +.Dt SDT 9 +.Os +.Sh NAME +.Nm SDT +.Nd a DTrace framework for adding statically-defined tracing probes +.Sh SYNOPSIS +.In sys/sdt.h +.Fn SDT_PROVIDER_DECLARE prov +.Fn SDT_PROVIDER_DEFINE prov +.Fn SDT_PROBE_DECLARE prov mod func name +.Fn SDT_PROBE_DEFINE prov mod func name sname +.Fn SDT_PROBE_DEFINE0 prov mod func name sname +.Fn SDT_PROBE_DEFINE1 prov mod func name sname arg0 +.Fn SDT_PROBE_DEFINE2 prov mod func name sname arg0 arg1 +.Fn SDT_PROBE_DEFINE3 prov mod func name sname arg0 arg1 arg2 +.Fn SDT_PROBE_DEFINE4 prov mod func name sname arg0 arg1 arg2 arg3 +.Fn SDT_PROBE_DEFINE5 prov mod func name sname arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ + arg6 +.Fn SDT_PROBE0 prov mod func name +.Fn SDT_PROBE1 prov mod func name arg0 +.Fn SDT_PROBE2 prov mod func name arg0 arg1 +.Fn SDT_PROBE3 prov mod func name arg0 arg1 arg2 +.Fn SDT_PROBE4 prov mod func name arg0 arg1 arg2 arg3 +.Fn SDT_PROBE5 prov mod func name arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6 +.Sh DESCRIPTION +.Pp +The +.Nm +macros allow programmers to define static trace points in kernel code. +These trace points are used by the +.Nm +framework to create DTrace probes, allowing the code to be instrumented +using +.Xr dtrace 1 . +By default, +.Nm +trace points are disabled and have no effect on the surrounding code. +When a DTrace probe corresponding to a given trace point is enabled, threads +that execute the trace point will call a handler and cause the probe to fire. +Moreover, trace points can take arguments, making it possible to pass data +to the DTrace framework when an enabled probe fires. +.Pp +Multiple trace points may correspond to a single DTrace probe, allowing +programmers to create DTrace probes that correspond to logical system events +rather than tying probes to specific code execution paths. +For instance, a DTrace probe corresponding to the arrival of an IP packet into +the network stack may be defined using two +.Nm +trace points: one for IPv4 packets and one for IPv6 packets. +.Pp +In addition to defining DTrace probes, the +.Nm +macros allow programmers to define new DTrace providers, making it possible to +namespace logically-related probes. +An example is FreeBSD's sctp provider, which contains +.Nm +probes for FreeBSD's +.Xr sctp 4 +implementation. +.Pp +The +.Fn SDT_PROVIDER_DECLARE +and +.Fn SDT_PROVIDER_DEFINE +macros are used respectively to declare and define a DTrace provider named +.Ar prov +with the +.Nm +framework. +A provider need only be defined once; however, the provider must be declared +before defining any +.Nm +probes belonging to that provider. +.Pp +Similarly, the +.Fn SDT_PROBE_DECLARE +and +.Fn SDT_PROBE_DEFINE* +macros are used to declare and define DTrace probes using the +.Nm +framework. +Once a probe has been defined, trace points for that probe may be added to +kernel code. +DTrace probe identifiers consist of a provider, module, function and name, all +of which may be specified in the +.Nm +probe definition. +Note that probes should not specify a module name: the module name of a probe is +used to determine whether or not it should be destroyed when a kernel module is +unloaded. +See the +.Sx BUGS +section. +Note in particular that probes must not be defined across multiple kernel +modules. +The +.Fn SDT_PROBE_DEFINE* +macros also take an extra +.Ar sname +parameter. +This is used to allow the creation of probes with names containing the +.Ql - +character. +Specifically, the +.Ar name +argument should contain the probe name with all dashes converted to underscores, +and the +.Ar sname +argument should be the probe name as it will be referenced by D scripts. +.Pp +The +.Fn SDT_PROBE_DEFINE* +macros also allow programmers to declare the types of the arguments that are +passed to probes. +This is optional; if the argument types are omitted (through use of the +.Fn SDT_PROBE_DEFINE +macro), users wishing to make use of the arguments will have to manually cast +them to the correct types in their D scripts. +It is strongly recommended that probe definitions include a declaration of their +argument types. +.Pp +The +.Fn SDT_PROBE* +macros are used to create +.Nm +trace points. +They are meant to be added to executable code and can be used to instrument the +code in which they are called. +.Sh EXAMPLES +.Pp +The following probe definition will create a DTrace probe called +.Ql icmp::unreach:pkt-receive , +which would hypothetically be triggered when the kernel receives an ICMP packet +of type Destination Unreachable: +.Bd -literal -offset indent +SDT_PROVIDER_DECLARE(icmp); + +SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, + "struct mbuf *", "struct icmp *"); + +.Ed +This particular probe would take two arguments: a pointer to the +.Xr mbuf 9 +containing the incoming packet, and a pointer to the ICMP header for the packet. +Note that the module name of this probe is not specified. +.Pp +Consider a DTrace probe which fires when the network stack receives an IP +packet. +Such a probe would be defined by multiple tracepoints: +.Bd -literal -offset indent +SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + +int +ip_input(struct mbuf *m) +{ + struct ip *ip; + ... + ip = mtod(m, struct ip *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + ... +} + +int +ip6_input(struct mbuf *m) +{ + struct ip6_hdr *ip6; + ... + ip6 = mtod(m, struct ip6_hdr *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + ... +} + +.Ed +In particular, the probe should fire when the kernel receives either an IPv4 +packet or an IPv6 packet. +.Sh SEE ALSO +.Xr dtrace 1 +.Sh AUTHORS +.An -nosplit +DTrace and the +.Nm +framework were originally ported to FreeBSD from Solaris by +.An John Birrell Aq jb@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq markj@FreeBSD.org . +.Sh BUGS +.Pp +The +.Nm +macros allow the module name of a probe to be specified as part of a probe +definition. +However, the DTrace framework uses the module name of probes to determine +which probes should be destroyed when a kernel module is unloaded, so the module +name of a probe should match the name of the module in which its defined. +.Nm +will set the module name properly if it is left unspecified in the probe +definition; see the +.Sx EXAMPLES +section. +.Pp +One of the goals of the original +.Nm +implementation (and by extension, of FreeBSD's port) is that inactive +.Nm +probes should have no performance impact. +This is unfortunately not the case; +.Nm +trace points will add a small but non-zero amount of latency to the code +in which they are defined. +A more sophisticated implementation of the probes will help alleviate this +problem. From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:35:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E580A67; Sat, 6 Jul 2013 20:35:22 +0000 (UTC) (envelope-from tuexen@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 3EB8B13A6; Sat, 6 Jul 2013 20:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KZMLR099691; Sat, 6 Jul 2013 20:35:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KZLY3099688; Sat, 6 Jul 2013 20:35:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307062035.r66KZLY3099688@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 20:35:21 +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: r252896 - in stable/9/sys: netinet 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:35:22 -0000 Author: tuexen Date: Sat Jul 6 20:35:21 2013 New Revision: 252896 URL: http://svnweb.freebsd.org/changeset/base/252896 Log: MFC r238003, r239091: Move common code parts to sctp_common_input_processing(). Fix a bug found by dim@: Don't use an uninitilized variable, if INVARIANTS is on and an illegal packet with destination 0 is received. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:35:21 2013 (r252896) @@ -5588,26 +5588,141 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint8_t ecn_bits, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t compute_crc, +#endif + uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - /* - * Control chunk processing - */ uint32_t high_tsn; int fwd_tsn_seen = 0, data_processed = 0; struct mbuf *m = *mm; int un_sent; int cnt_ctrl_ready = 0; + struct sctp_inpcb *inp = NULL, *inp_decr = NULL; + struct sctp_tcb *stcb = NULL; + struct sctp_nets *net; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif +#if !defined(SCTP_WITH_NO_CSUM) + if (compute_crc != 0) { + uint32_t check, calc_check; + check = sh->checksum; + sh->checksum = 0; + calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; + if (calc_check != check) { + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if ((inp != NULL) && (stcb != NULL)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { + inp_decr = inp; + } + SCTP_STAT_INCR(sctps_badsum); + SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); + goto out; + } + } +#endif + /* Destination port of 0 is illegal, based on RFC4960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if (inp == NULL) { + SCTP_STAT_INCR(sctps_noport); + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { + sctp_send_shutdown_complete2(src, dst, sh, + use_mflowid, mflowid, + vrf_id, port); + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { + goto out; + } + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, src, dst, + sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); + } + } + goto out; + } else if (stcb == NULL) { + inp_decr = inp; + } +#ifdef IPSEC + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. + */ + if (inp != NULL) { + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec4stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif + default: + break; + } + } +#endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", m, iphlen, offset, length, stcb); if (stcb) { @@ -5626,10 +5741,11 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); + stcb = NULL; sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } } if (IS_SCTP_CONTROL(ch)) { @@ -5669,21 +5785,19 @@ sctp_common_input_processing(struct mbuf sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { /* v_tag mismatch! */ SCTP_STAT_INCR(sctps_badvtag); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } } @@ -5693,7 +5807,7 @@ sctp_common_input_processing(struct mbuf * packet while processing control, or we're done with this * packet (done or skip rest of data), so we drop it... */ - goto out_now; + goto out; } /* * DATA chunk processing @@ -5747,8 +5861,7 @@ sctp_common_input_processing(struct mbuf sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_EMPTY: /* should not happen */ @@ -5756,8 +5869,7 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ case SCTP_STATE_SHUTDOWN_ACK_SENT: default: - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_OPEN: @@ -5775,7 +5887,8 @@ sctp_common_input_processing(struct mbuf * The association aborted, NO UNLOCK needed since * the association is destroyed. */ - goto out_now; + stcb = NULL; + goto out; } data_processed = 1; /* @@ -5832,10 +5945,20 @@ trigger_send: sctp_audit_log(0xE0, 3); sctp_auditing(2, inp, stcb, net); #endif - SCTP_TCB_UNLOCK(stcb); -out_now: +out: + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (inp_decr != NULL) { + /* reduce ref-count */ + SCTP_INP_WLOCK(inp_decr); + SCTP_INP_DECR_REF(inp_decr); + SCTP_INP_WUNLOCK(inp_decr); + } #ifdef INVARIANTS - sctp_validate_no_locks(inp); + if (inp != NULL) { + sctp_validate_no_locks(inp); + } #endif return; } @@ -5865,18 +5988,14 @@ sctp_input_with_port(struct mbuf *i_pak, struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { @@ -5901,6 +6020,11 @@ sctp_input_with_port(struct mbuf *i_pak, sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -5934,161 +6058,42 @@ sctp_input_with_port(struct mbuf *i_pak, dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { - goto bad; + goto out; } if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ip->ip_tos; #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec4stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return; -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet/sctp_input.h Sat Jul 6 20:35:21 2013 (r252896) @@ -41,8 +41,10 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, - struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint8_t, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t, +#endif + uint8_t, uint8_t, uint32_t, uint32_t, uint16_t); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 20:35:21 2013 (r252896) @@ -70,24 +70,20 @@ sctp6_input(struct mbuf **i_pak, int *of { struct mbuf *m; int iphlen; - uint32_t vrf_id = 0; + uint32_t vrf_id; uint8_t ecn_bits; struct sockaddr_in6 src, dst; struct ip6_hdr *ip6; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; uint16_t port = 0; iphlen = *offp; @@ -113,6 +109,11 @@ sctp6_input(struct mbuf **i_pak, int *of sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -123,8 +124,8 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip6 = mtod(m, struct ip6_hdr *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { @@ -139,7 +140,7 @@ sctp6_input(struct mbuf **i_pak, int *of src.sin6_port = sh->src_port; src.sin6_addr = ip6->ip6_src; if (in6_setscope(&src.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } memset(&dst, 0, sizeof(struct sockaddr_in6)); dst.sin6_family = AF_INET6; @@ -147,165 +148,46 @@ sctp6_input(struct mbuf **i_pak, int *of dst.sin6_port = sh->dest_port; dst.sin6_addr = ip6->ip6_dst; if (in6_setscope(&dst.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } if (faithprefix_p != NULL && (*faithprefix_p) (&dst.sin6_addr)) { /* XXX send icmp6 host/port unreach? */ - goto bad; + goto out; } length = ntohs(ip6->ip6_plen) + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(*i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec6stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return (IPPROTO_DONE); -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 20:39:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D95BCCC; Sat, 6 Jul 2013 20:39:45 +0000 (UTC) (envelope-from tuexen@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 5E1DD1453; Sat, 6 Jul 2013 20:39:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Kdjk4000292; Sat, 6 Jul 2013 20:39:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KdjNw000291; Sat, 6 Jul 2013 20:39:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307062039.r66KdjNw000291@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 20:39: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: r252897 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 20:39:45 -0000 Author: tuexen Date: Sat Jul 6 20:39:44 2013 New Revision: 252897 URL: http://svnweb.freebsd.org/changeset/base/252897 Log: MFC r238087: Initialize a variable. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:35:21 2013 (r252896) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:39:44 2013 (r252897) @@ -5602,7 +5602,7 @@ sctp_common_input_processing(struct mbuf int cnt_ctrl_ready = 0; struct sctp_inpcb *inp = NULL, *inp_decr = NULL; struct sctp_tcb *stcb = NULL; - struct sctp_nets *net; + struct sctp_nets *net = NULL; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 21:38:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC54759D; Sat, 6 Jul 2013 21:38:56 +0000 (UTC) (envelope-from jfv@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 BBE7816C1; Sat, 6 Jul 2013 21:38:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Lcucg017940; Sat, 6 Jul 2013 21:38:56 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66LctDh017933; Sat, 6 Jul 2013 21:38:55 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201307062138.r66LctDh017933@svn.freebsd.org> From: Jack F Vogel Date: Sat, 6 Jul 2013 21:38:55 +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: r252898 - in stable/9/sys: conf dev/ixgbe modules/ixgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 21:38:56 -0000 Author: jfv Date: Sat Jul 6 21:38:55 2013 New Revision: 252898 URL: http://svnweb.freebsd.org/changeset/base/252898 Log: MFC ixgbe driver revisions 248901, 250108, and 251964 Added: stable/9/sys/dev/ixgbe/ixgbe_dcb.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb.c stable/9/sys/dev/ixgbe/ixgbe_dcb.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb.h stable/9/sys/dev/ixgbe/ixgbe_dcb_82598.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82598.c stable/9/sys/dev/ixgbe/ixgbe_dcb_82598.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82598.h stable/9/sys/dev/ixgbe/ixgbe_dcb_82599.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82599.c stable/9/sys/dev/ixgbe/ixgbe_dcb_82599.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82599.h Modified: stable/9/sys/conf/files stable/9/sys/dev/ixgbe/README stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixgbe.h stable/9/sys/dev/ixgbe/ixgbe_82598.c stable/9/sys/dev/ixgbe/ixgbe_82599.c stable/9/sys/dev/ixgbe/ixgbe_api.c stable/9/sys/dev/ixgbe/ixgbe_api.h stable/9/sys/dev/ixgbe/ixgbe_common.c stable/9/sys/dev/ixgbe/ixgbe_common.h stable/9/sys/dev/ixgbe/ixgbe_osdep.h stable/9/sys/dev/ixgbe/ixgbe_phy.c stable/9/sys/dev/ixgbe/ixgbe_phy.h stable/9/sys/dev/ixgbe/ixgbe_type.h stable/9/sys/dev/ixgbe/ixgbe_vf.c stable/9/sys/dev/ixgbe/ixgbe_x540.c stable/9/sys/dev/ixgbe/ixgbe_x540.h stable/9/sys/modules/ixgbe/Makefile Directory Properties: stable/9/sys/conf/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/conf/files Sat Jul 6 21:38:55 2013 (r252898) @@ -1463,6 +1463,12 @@ dev/ixgbe/ixgbe_82599.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_x540.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb_82598.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb_82599.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa Modified: stable/9/sys/dev/ixgbe/README ============================================================================== --- stable/9/sys/dev/ixgbe/README Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/README Sat Jul 6 21:38:55 2013 (r252898) @@ -2,7 +2,7 @@ FreeBSD Driver for Intel(R) Ethernet 10 ============================================================================ /*$FreeBSD$*/ -November 12, 2010 +Jun 18, 2013 Contents @@ -18,8 +18,8 @@ Contents Overview ======== -This file describes the FreeBSD* driver for the Intel(R) Ethernet 10 Gigabit -Family of Adapters. Driver has been developed for use with FreeBSD 7.2 or later. +This file describes the FreeBSD* driver for the +Intel(R) Ethernet 10 Gigabit Family of Adapters. For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. All hardware requirements listed @@ -42,7 +42,7 @@ optics, or is an Intel(R) Ethernet Serve Intel optics and/or the direct attach cables listed below. When 82599-based SFP+ devices are connected back to back, they should be set to -the same Speed setting via Ethtool. Results may vary if you mix speed settings. +the same Speed setting. Results may vary if you mix speed settings. Supplier Type Part Numbers @@ -70,7 +70,12 @@ Finisar DUAL RATE 1G/10G SFP+ LR (No Avago DUAL RATE 1G/10G SFP+ LR (No Bail) AFCT-701SDZ-IN1 Finistar 1000BASE-T SFP FCLF8522P2BTL Avago 1000BASE-T SFP ABCU-5710RZ - + +NOTE: As of driver version 2.5.13 it is possible to allow the operation +of unsupported modules by setting the static variable 'allow_unsupported_sfp' +to TRUE and rebuilding the driver. If problems occur please assure that they +can be reproduced with fully supported optics first. + 82599-based adapters support all passive and active limiting direct attach cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. @@ -224,14 +229,7 @@ all 10 Gigabit adapters. When there is a choice run on a 64bit OS rather than 32, it makes a significant difference in improvement. - The default scheduler SCHED_4BSD is not smart about SMP locality issues. - Significant improvement can be achieved by switching to the ULE scheduler. - - This is done by changing the entry in the config file from SCHED_4BSD to - SCHED_ULE. Note that this is only advisable on FreeBSD 7, on 6.X there have - been stability problems with ULE. - - The interface can generate high number of interrupts. To avoid running + The interface can generate a high number of interrupts. To avoid running into the limit set by the kernel, adjust hw.intr_storm_threshold setting using sysctl: @@ -242,12 +240,10 @@ all 10 Gigabit adapters. hw.intr_storm_threshold=9000 If you still see Interrupt Storm detected messages, increase the limit to a - higher number. - - Best throughput results are seen with a large MTU; use 9000 if possible. + higher number, or the detection can be disabled by setting it to 0. - The default number of descriptors is 1024, increasing this to 2K or even - 4K may improve performance in some workloads, but change carefully. + The default number of descriptors is 2048, increasing or descreasing + may improve performance in some workloads, but change carefully. Known Limitations @@ -284,7 +280,7 @@ issues download your adapter's user guid ---------------------------------------------------------- Some PCI-E x8 slots are actually configured as x4 slots. These slots have insufficient bandwidth for full 10Gbe line rate with dual port 10GbE devices. - The driver can detect this situation and will write the following message in + The driver will detect this situation and will write the following message in the system log: "PCI-Express bandwidth available for this card is not sufficient for optimal performance. For optimal performance a x8 PCI-Express slot is required." Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe.c Sat Jul 6 21:38:55 2013 (r252898) @@ -32,6 +32,7 @@ ******************************************************************************/ /*$FreeBSD$*/ + #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_inet.h" #include "opt_inet6.h" @@ -47,7 +48,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.7 - STABLE/9"; +char ixgbe_driver_version[] = "2.5.13"; /********************************************************************* * PCI Device ID Table @@ -109,8 +110,7 @@ static void ixgbe_start(struct ifnet static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); #else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); -static int ixgbe_mq_start_locked(struct ifnet *, - struct tx_ring *, struct mbuf *); +static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *); static void ixgbe_qflush(struct ifnet *); static void ixgbe_deferred_mq_start(void *, int); #endif /* IXGBE_LEGACY_TX */ @@ -122,6 +122,7 @@ static void ixgbe_media_status(struc static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); static int ixgbe_allocate_pci_resources(struct adapter *); +static void ixgbe_get_slot_info(struct ixgbe_hw *); static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_allocate_queues(struct adapter *); @@ -149,7 +150,7 @@ static void ixgbe_setup_hw_rsc(struct rx static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); -static bool ixgbe_txeof(struct tx_ring *); +static void ixgbe_txeof(struct tx_ring *); static bool ixgbe_rxeof(struct ix_queue *); static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); @@ -206,6 +207,9 @@ static void ixgbe_atr(struct tx_ring *, static void ixgbe_reinit_fdir(void *, int); #endif +/* Missing shared code prototype */ +extern void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw); + /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -291,6 +295,13 @@ static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* +** Defining this on will allow the use +** of unsupported SFP+ modules, note that +** doing so you are on your own :) +*/ +static int allow_unsupported_sfp = FALSE; + +/* ** HW RSC control: ** this feature only works with ** IPv4, and only on 82599 and later. @@ -507,6 +518,7 @@ ixgbe_attach(device_t dev) } /* Initialize the shared code */ + hw->allow_unsupported_sfp = allow_unsupported_sfp; error = ixgbe_init_shared_code(hw); if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* @@ -576,24 +588,10 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); - /* Print PCIE bus type/speed/width info */ - ixgbe_get_bus_info(hw); - device_printf(dev,"PCI Express Bus: Speed %s %s\n", - ((hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0Gb/s": - (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5Gb/s":"Unknown"), - (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : - (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : - (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : - ("Unknown")); - - if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && - (hw->bus.speed == ixgbe_bus_speed_2500)) { - device_printf(dev, "PCI-Express bandwidth available" - " for this card\n is not sufficient for" - " optimal performance.\n"); - device_printf(dev, "For optimal performance a x8 " - "PCIE, or x4 PCIE 2 slot is required.\n"); - } + /* + ** Check PCIE slot type/speed/width + */ + ixgbe_get_slot_info(hw); /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; @@ -797,7 +795,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct struct adapter *adapter = ifp->if_softc; struct ix_queue *que; struct tx_ring *txr; - int i = 0, err = 0; + int i, err = 0; /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) @@ -808,40 +806,37 @@ ixgbe_mq_start(struct ifnet *ifp, struct txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; + err = drbr_enqueue(ifp, txr->br, m); + if (err) + return (err); if (IXGBE_TX_TRYLOCK(txr)) { - err = ixgbe_mq_start_locked(ifp, txr, m); + err = ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); - } else { - err = drbr_enqueue(ifp, txr->br, m); + } else taskqueue_enqueue(que->tq, &txr->txq_task); - } return (err); } static int -ixgbe_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m) +ixgbe_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr) { struct adapter *adapter = txr->adapter; struct mbuf *next; - int enqueued, err = 0; + int enqueued = 0, err = 0; if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || - adapter->link_active == 0) { - if (m != NULL) - err = drbr_enqueue(ifp, txr->br, m); - return (err); - } - - enqueued = 0; - if (m != NULL) { - err = drbr_enqueue(ifp, txr->br, m); - if (err) { - return (err); - } - } + adapter->link_active == 0) + return (ENETDOWN); /* Process the queue */ +#if __FreeBSD_version < 901504 + next = drbr_dequeue(ifp, txr->br); + while (next != NULL) { + if ((err = ixgbe_xmit(txr, &next)) != 0) { + if (next != NULL) + err = drbr_enqueue(ifp, txr->br, next); +#else while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = ixgbe_xmit(txr, &next)) != 0) { if (next == NULL) { @@ -849,16 +844,20 @@ ixgbe_mq_start_locked(struct ifnet *ifp, } else { drbr_putback(ifp, txr->br, next); } +#endif break; } +#if __FreeBSD_version >= 901504 drbr_advance(ifp, txr->br); +#endif enqueued++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) - ixgbe_txeof(txr); +#if __FreeBSD_version < 901504 + next = drbr_dequeue(ifp, txr->br); +#endif } if (enqueued > 0) { @@ -885,7 +884,7 @@ ixgbe_deferred_mq_start(void *arg, int p IXGBE_TX_LOCK(txr); if (!drbr_empty(ifp, txr->br)) - ixgbe_mq_start_locked(ifp, txr, NULL); + ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); } @@ -1418,20 +1417,19 @@ ixgbe_handle_que(void *context, int pend ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX if (!drbr_empty(ifp, txr->br)) - ixgbe_mq_start_locked(ifp, txr, NULL); + ixgbe_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more) { - taskqueue_enqueue(que->tq, &que->que_task); - return; - } } /* Reenable this interrupt */ - ixgbe_enable_queue(adapter, que->msix); + if (que->res != NULL) + ixgbe_enable_queue(adapter, que->msix); + else + ixgbe_enable_intr(adapter); return; } @@ -1448,9 +1446,10 @@ ixgbe_legacy_irq(void *arg) struct ix_queue *que = arg; struct adapter *adapter = que->adapter; struct ixgbe_hw *hw = &adapter->hw; + struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; - bool more_tx, more_rx; - u32 reg_eicr, loop = MAX_LOOP; + bool more; + u32 reg_eicr; reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); @@ -1461,17 +1460,19 @@ ixgbe_legacy_irq(void *arg) return; } - more_rx = ixgbe_rxeof(que); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); - do { - more_tx = ixgbe_txeof(txr); - } while (loop-- && more_tx); + ixgbe_txeof(txr); +#ifdef IXGBE_LEGACY_TX + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + ixgbe_start_locked(txr, ifp); +#else + if (!drbr_empty(ifp, txr->br)) + ixgbe_mq_start_locked(ifp, txr); +#endif IXGBE_TX_UNLOCK(txr); - if (more_rx || more_tx) - taskqueue_enqueue(que->tq, &que->que_task); - /* Check for fan failure */ if ((hw->phy.media_type == ixgbe_media_type_copper) && (reg_eicr & IXGBE_EICR_GPI_SDP1)) { @@ -1484,7 +1485,10 @@ ixgbe_legacy_irq(void *arg) if (reg_eicr & IXGBE_EICR_LSC) taskqueue_enqueue(adapter->tq, &adapter->link_task); - ixgbe_enable_intr(adapter); + if (more) + taskqueue_enqueue(que->tq, &que->que_task); + else + ixgbe_enable_intr(adapter); return; } @@ -1499,29 +1503,26 @@ ixgbe_msix_que(void *arg) { struct ix_queue *que = arg; struct adapter *adapter = que->adapter; + struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = que->txr; struct rx_ring *rxr = que->rxr; - bool more_tx, more_rx; + bool more; u32 newitr = 0; ixgbe_disable_queue(adapter, que->msix); ++que->irqs; - more_rx = ixgbe_rxeof(que); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); - more_tx = ixgbe_txeof(txr); - /* - ** Make certain that if the stack - ** has anything queued the task gets - ** scheduled to handle it. - */ + ixgbe_txeof(txr); #ifdef IXGBE_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd)) + if (!IFQ_DRV_IS_EMPTY(ifp->if_snd)) + ixgbe_start_locked(txr, ifp); #else - if (!drbr_empty(adapter->ifp, txr->br)) + if (!drbr_empty(ifp, txr->br)) + ixgbe_mq_start_locked(ifp, txr); #endif - more_tx = 1; IXGBE_TX_UNLOCK(txr); /* Do AIM now? */ @@ -1575,9 +1576,9 @@ ixgbe_msix_que(void *arg) rxr->packets = 0; no_calc: - if (more_tx || more_rx) + if (more) taskqueue_enqueue(que->tq, &que->que_task); - else /* Reenable this interrupt */ + else ixgbe_enable_queue(adapter, que->msix); return; } @@ -1639,11 +1640,11 @@ ixgbe_msix_link(void *arg) /* Check for over temp condition */ if ((hw->mac.type == ixgbe_mac_X540) && - (reg_eicr & IXGBE_EICR_GPI_SDP0)) { + (reg_eicr & IXGBE_EICR_TS)) { device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " "PHY IS SHUT DOWN!!\n"); device_printf(adapter->dev, "System shutdown required\n"); - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); @@ -1892,10 +1893,34 @@ ixgbe_set_promisc(struct adapter *adapte { u_int32_t reg_rctl; struct ifnet *ifp = adapter->ifp; + int mcnt = 0; reg_rctl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); reg_rctl &= (~IXGBE_FCTRL_UPE); - reg_rctl &= (~IXGBE_FCTRL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~IXGBE_FCTRL_MPE); IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, reg_rctl); if (ifp->if_flags & IFF_PROMISC) { @@ -2038,7 +2063,7 @@ ixgbe_local_timer(void *arg) (paused == 0)) ++hung; else if (txr->queue_status == IXGBE_QUEUE_WORKING) - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } /* Only truely watchdog if all queues show hung */ if (hung == adapter->num_queues) @@ -2125,9 +2150,14 @@ ixgbe_stop(void *arg) ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); - /* Turn off the laser */ - if (hw->phy.multispeed_fiber) - ixgbe_disable_tx_laser(hw); + if (hw->mac.type == ixgbe_mac_82599EB) + ixgbe_stop_mac_link_on_d3_82599(hw); + /* Turn off the laser - noop with no optics */ + ixgbe_disable_tx_laser(hw); + + /* Update the stack */ + adapter->link_up = FALSE; + ixgbe_update_link_status(adapter); /* reprogram the RAR[0] in case user changed it. */ ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); @@ -2579,7 +2609,11 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); +#if __FreeBSD_version < 1000025 ifp->if_baudrate = 1000000000; +#else + if_initbaudrate(ifp, IF_Gbps(10)); +#endif ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -2590,6 +2624,8 @@ ixgbe_setup_interface(device_t dev, stru #else ifp->if_start = ixgbe_start; IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 2); + ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 2; + IFQ_SET_READY(&ifp->if_snd); #endif ether_ifattach(ifp, adapter->hw.mac.addr); @@ -3533,7 +3569,7 @@ ixgbe_atr(struct tx_ring *txr, struct mb * tx_buffer is put back on the free queue. * **********************************************************************/ -static bool +static void ixgbe_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; @@ -3576,13 +3612,13 @@ ixgbe_txeof(struct tx_ring *txr) netmap_tx_irq(ifp, txr->me | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); } - return FALSE; + return; } #endif /* DEV_NETMAP */ if (txr->tx_avail == txr->num_desc) { txr->queue_status = IXGBE_QUEUE_IDLE; - return FALSE; + return; } /* Get work starting point */ @@ -3676,12 +3712,10 @@ ixgbe_txeof(struct tx_ring *txr) if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) txr->queue_status = IXGBE_QUEUE_HUNG; - if (txr->tx_avail == txr->num_desc) { + if (txr->tx_avail == txr->num_desc) txr->queue_status = IXGBE_QUEUE_IDLE; - return (FALSE); - } - return TRUE; + return; } /********************************************************************* @@ -4363,6 +4397,7 @@ ixgbe_rxeof(struct ix_queue *que) if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) return (FALSE); #endif /* DEV_NETMAP */ + for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mp; u32 rsc, ptype; @@ -4552,15 +4587,12 @@ next_desc: IXGBE_RX_UNLOCK(rxr); /* - ** We still have cleaning to do? - ** Schedule another interrupt if so. + ** Still have cleaning to do? */ - if ((staterr & IXGBE_RXD_STAT_DD) != 0) { - ixgbe_rearm_queues(adapter, (u64)(1 << que->msix)); + if ((staterr & IXGBE_RXD_STAT_DD) != 0) return (TRUE); - } - - return (FALSE); + else + return (FALSE); } @@ -4715,11 +4747,11 @@ ixgbe_setup_vlan_hw_support(struct adapt static void ixgbe_enable_intr(struct adapter *adapter) { - struct ixgbe_hw *hw = &adapter->hw; - struct ix_queue *que = adapter->queues; - u32 mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); - + struct ixgbe_hw *hw = &adapter->hw; + struct ix_queue *que = adapter->queues; + u32 mask, fwsm; + mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); /* Enable Fan Failure detection */ if (hw->device_id == IXGBE_DEV_ID_82598AT) mask |= IXGBE_EIMS_GPI_SDP1; @@ -4736,6 +4768,10 @@ ixgbe_enable_intr(struct adapter *adapte break; case ixgbe_mac_X540: mask |= IXGBE_EIMS_ECC; + /* Detect if Thermal Sensor is enabled */ + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM); + if (fwsm & IXGBE_FWSM_TS_ENABLED) + mask |= IXGBE_EIMS_TS; #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif @@ -4805,6 +4841,111 @@ ixgbe_write_pci_cfg(struct ixgbe_hw *hw, } /* +** Get the width and transaction speed of +** the slot this adapter is plugged into. +*/ +static void +ixgbe_get_slot_info(struct ixgbe_hw *hw) +{ + device_t dev = ((struct ixgbe_osdep *)hw->back)->dev; + struct ixgbe_mac_info *mac = &hw->mac; + u16 link; + u32 offset; + + /* For most devices simply call the shared code routine */ + if (hw->device_id != IXGBE_DEV_ID_82599_SFP_SF_QP) { + ixgbe_get_bus_info(hw); + goto display; + } + + /* + ** For the Quad port adapter we need to parse back + ** up the PCI tree to find the speed of the expansion + ** slot into which this adapter is plugged. A bit more work. + */ + dev = device_get_parent(device_get_parent(dev)); +#ifdef IXGBE_DEBUG + device_printf(dev, "parent pcib = %x,%x,%x\n", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); +#endif + dev = device_get_parent(device_get_parent(dev)); +#ifdef IXGBE_DEBUG + device_printf(dev, "slot pcib = %x,%x,%x\n", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); +#endif + /* Now get the PCI Express Capabilities offset */ + pci_find_cap(dev, PCIY_EXPRESS, &offset); + /* ...and read the Link Status Register */ + link = pci_read_config(dev, offset + PCIER_LINK_STA, 2); + switch (link & IXGBE_PCI_LINK_WIDTH) { + case IXGBE_PCI_LINK_WIDTH_1: + hw->bus.width = ixgbe_bus_width_pcie_x1; + break; + case IXGBE_PCI_LINK_WIDTH_2: + hw->bus.width = ixgbe_bus_width_pcie_x2; + break; + case IXGBE_PCI_LINK_WIDTH_4: + hw->bus.width = ixgbe_bus_width_pcie_x4; + break; + case IXGBE_PCI_LINK_WIDTH_8: + hw->bus.width = ixgbe_bus_width_pcie_x8; + break; + default: + hw->bus.width = ixgbe_bus_width_unknown; + break; + } + + switch (link & IXGBE_PCI_LINK_SPEED) { + case IXGBE_PCI_LINK_SPEED_2500: + hw->bus.speed = ixgbe_bus_speed_2500; + break; + case IXGBE_PCI_LINK_SPEED_5000: + hw->bus.speed = ixgbe_bus_speed_5000; + break; + case IXGBE_PCI_LINK_SPEED_8000: + hw->bus.speed = ixgbe_bus_speed_8000; + break; + default: + hw->bus.speed = ixgbe_bus_speed_unknown; + break; + } + + mac->ops.set_lan_id(hw); + +display: + device_printf(dev,"PCI Express Bus: Speed %s %s\n", + ((hw->bus.speed == ixgbe_bus_speed_8000) ? "8.0GT/s": + (hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0GT/s": + (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5GT/s":"Unknown"), + (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : + (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : + (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : + ("Unknown")); + + if ((hw->device_id != IXGBE_DEV_ID_82599_SFP_SF_QP) && + ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && + (hw->bus.speed == ixgbe_bus_speed_2500))) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCIE, or x4 PCIE Gen2 slot is required.\n"); + } + if ((hw->device_id == IXGBE_DEV_ID_82599_SFP_SF_QP) && + ((hw->bus.width <= ixgbe_bus_width_pcie_x8) && + (hw->bus.speed < ixgbe_bus_speed_8000))) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCIE Gen3 slot is required.\n"); + } + + return; +} + + +/* ** Setup the correct IVAR register for a particular MSIX interrupt ** (yes this is all very magic and confusing :) ** - entry is the register array entry @@ -5605,6 +5746,7 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) /* ** Thermal Shutdown Trigger ** - cause a Thermal Overtemp IRQ +** - this now requires firmware enabling */ static int ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS) Modified: stable/9/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.h Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe.h Sat Jul 6 21:38:55 2013 (r252898) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -213,6 +213,7 @@ #define IXGBE_BULK_LATENCY 1200 #define IXGBE_LINK_ITR 2000 + /* ***************************************************************************** * vendor_info_array @@ -230,6 +231,7 @@ typedef struct _ixgbe_vendor_info_t { unsigned int index; } ixgbe_vendor_info_t; + /* This is used to get SFP+ module data */ struct ixgbe_i2c_req { u8 dev_addr; @@ -456,6 +458,7 @@ struct adapter { /* Multicast array memory */ u8 *mta; + /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_defrag_failed; @@ -467,6 +470,7 @@ struct adapter { struct ixgbe_hw_stats stats; }; + /* Precision Time Sync (IEEE 1588) defines */ #define ETHERTYPE_IEEE1588 0x88F7 #define PICOSECS_PER_TICK 20833 @@ -489,6 +493,10 @@ struct adapter { #define IXGBE_CORE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->core_mtx, MA_OWNED) #define IXGBE_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) +/* For backward compatibility */ +#if !defined(PCIER_LINK_STA) +#define PCIER_LINK_STA PCIR_EXPRESS_LINK_STA +#endif static inline bool ixgbe_is_sfp(struct ixgbe_hw *hw) Modified: stable/9/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82598.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe_82598.c Sat Jul 6 21:38:55 2013 (r252898) @@ -166,6 +166,8 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw /* Manageability interface */ mac->ops.set_fw_drv_ver = NULL; + mac->ops.get_rtrup2tc = NULL; + return ret_val; } @@ -1115,10 +1117,19 @@ static s32 ixgbe_read_i2c_phy_82598(stru u16 sfp_addr = 0; u16 sfp_data = 0; u16 sfp_stat = 0; + u16 gssr; u32 i; DEBUGFUNC("ixgbe_read_i2c_phy_82598"); + if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1) + gssr = IXGBE_GSSR_PHY1_SM; + else + gssr = IXGBE_GSSR_PHY0_SM; + + if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != IXGBE_SUCCESS) + return IXGBE_ERR_SWFW_SYNC; + if (hw->phy.type == ixgbe_phy_nl) { /* * NetLogic phy SDA/SCL registers are at addresses 0xC30A to @@ -1127,17 +1138,17 @@ static s32 ixgbe_read_i2c_phy_82598(stru */ sfp_addr = (dev_addr << 8) + byte_offset; sfp_addr = (sfp_addr | IXGBE_I2C_EEPROM_READ_MASK); - hw->phy.ops.write_reg(hw, - IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, - sfp_addr); + hw->phy.ops.write_reg_mdi(hw, + IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, + sfp_addr); /* Poll status */ for (i = 0; i < 100; i++) { - hw->phy.ops.read_reg(hw, - IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, - &sfp_stat); + hw->phy.ops.read_reg_mdi(hw, + IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, + &sfp_stat); sfp_stat = sfp_stat & IXGBE_I2C_EEPROM_STATUS_MASK; if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS) break; @@ -1151,8 +1162,8 @@ static s32 ixgbe_read_i2c_phy_82598(stru } /* Read data */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, &sfp_data); + hw->phy.ops.read_reg_mdi(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, &sfp_data); *eeprom_data = (u8)(sfp_data >> 8); } else { @@ -1160,6 +1171,7 @@ static s32 ixgbe_read_i2c_phy_82598(stru } out: + hw->mac.ops.release_swfw_sync(hw, gssr); return status; } Modified: stable/9/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82599.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe_82599.c Sat Jul 6 21:38:55 2013 (r252898) @@ -77,7 +77,7 @@ void ixgbe_init_mac_link_ops_82599(struc * and MNG not enabled */ if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) && - !(ixgbe_mng_enabled(hw))) { + !hw->mng_fw_enabled) { mac->ops.disable_tx_laser = &ixgbe_disable_tx_laser_multispeed_fiber; mac->ops.enable_tx_laser = @@ -180,11 +180,13 @@ s32 ixgbe_setup_sfp_modules_82599(struct goto setup_sfp_out; } - hw->eeprom.ops.read(hw, ++data_offset, &data_value); + if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) + goto setup_sfp_err; while (data_value != 0xffff) { IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value); IXGBE_WRITE_FLUSH(hw); - hw->eeprom.ops.read(hw, ++data_offset, &data_value); + if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) + goto setup_sfp_err; } /* Release the semaphore */ @@ -229,6 +231,15 @@ s32 ixgbe_setup_sfp_modules_82599(struct setup_sfp_out: return ret_val; + +setup_sfp_err: + /* Release the semaphore */ + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); + /* Delay obtaining semaphore again to allow FW access */ + msec_delay(hw->eeprom.semaphore_delay); + ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE, + "eeprom read at offset %d failed", data_offset); + return IXGBE_ERR_PHY; } /** @@ -314,6 +325,11 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.set_fw_drv_ver = &ixgbe_set_fw_drv_ver_generic; + mac->ops.get_rtrup2tc = &ixgbe_dcb_get_rtrup2tc_generic; + + /* Cache if MNG FW is up */ + hw->mng_fw_enabled = ixgbe_mng_enabled(hw); + return ret_val; } @@ -479,6 +495,29 @@ out: } /** + * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 + * @hw: pointer to hardware structure + * + * Disables link during D3 power down sequence. + * + **/ +void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) +{ + u32 autoc2_reg; + u16 ee_ctrl_2 = 0; + + DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599"); + ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); + + if (!hw->mng_fw_enabled && !hw->wol_enabled && + ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) { + autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); + autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2_reg); + } +} + +/** * ixgbe_start_mac_link_82599 - Setup MAC link settings * @hw: pointer to hardware structure * @autoneg_wait_to_complete: TRUE when waiting for completion is needed @@ -1122,7 +1161,8 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw { ixgbe_link_speed link_speed; s32 status; - u32 ctrl, i, autoc, autoc2; + u32 ctrl, i, autoc2; + u32 curr_lms; bool link_up = FALSE; DEBUGFUNC("ixgbe_reset_hw_82599"); @@ -1156,6 +1196,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw if (hw->phy.reset_disable == FALSE && hw->phy.ops.reset != NULL) hw->phy.ops.reset(hw); + /* remember AUTOC from before we reset */ + if (hw->mac.cached_autoc) + curr_lms = hw->mac.cached_autoc & IXGBE_AUTOC_LMS_MASK; + else + curr_lms = IXGBE_READ_REG(hw, IXGBE_AUTOC) & + IXGBE_AUTOC_LMS_MASK; + mac_reset_top: /* * Issue global reset to the MAC. Needs to be SW reset if link is up. @@ -1204,7 +1251,7 @@ mac_reset_top: * stored off yet. Otherwise restore the stored original * values since the reset operation sets back to defaults. */ - autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + hw->mac.cached_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); /* Enable link if disabled in NVM */ @@ -1215,12 +1262,24 @@ mac_reset_top: } if (hw->mac.orig_link_settings_stored == FALSE) { - hw->mac.orig_autoc = autoc; + hw->mac.orig_autoc = hw->mac.cached_autoc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 22:34:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03A24D1B; Sat, 6 Jul 2013 22:34:44 +0000 (UTC) (envelope-from jfv@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 E8FA41828; Sat, 6 Jul 2013 22:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MYhqb035054; Sat, 6 Jul 2013 22:34:43 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66MYgcn035048; Sat, 6 Jul 2013 22:34:42 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201307062234.r66MYgcn035048@svn.freebsd.org> From: Jack F Vogel Date: Sat, 6 Jul 2013 22:34:42 +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: r252899 - stable/9/sys/dev/e1000 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 22:34:44 -0000 Author: jfv Date: Sat Jul 6 22:34:42 2013 New Revision: 252899 URL: http://svnweb.freebsd.org/changeset/base/252899 Log: MFC e1000 driver revisions: 248906,248908,249074,249339,249509 250108,250109,250168,250413,250414 Modified: stable/9/sys/dev/e1000/README stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_igb.h stable/9/sys/dev/e1000/if_lem.c Directory Properties: stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/sys/dev/e1000/README ============================================================================== --- stable/9/sys/dev/e1000/README Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/README Sat Jul 6 22:34:42 2013 (r252899) @@ -389,7 +389,7 @@ For general information and support, go http://support.intel.com If an issue is identified, support is through email only at: -freebsdnic@mailbox.intel.com +freebsd@intel.com License Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_em.c Sat Jul 6 22:34:42 2013 (r252899) @@ -94,7 +94,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.3.7"; +char em_driver_version[] = "7.3.8"; /********************************************************************* * PCI Device ID Table @@ -2141,12 +2141,37 @@ em_set_promisc(struct adapter *adapter) static void em_disable_promisc(struct adapter *adapter) { - u32 reg_rctl; + struct ifnet *ifp = adapter->ifp; + u32 reg_rctl; + int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - reg_rctl &= (~E1000_RCTL_UPE); - reg_rctl &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~E1000_RCTL_MPE); reg_rctl &= (~E1000_RCTL_SBP); E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); } @@ -4295,11 +4320,12 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RFCTL, E1000_RFCTL_ACK_DIS); } - if (ifp->if_capenable & IFCAP_RXCSUM) { - rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); - rxcsum |= (E1000_RXCSUM_IPOFL | E1000_RXCSUM_TUOFL); - E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); - } + rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); + if (ifp->if_capenable & IFCAP_RXCSUM) + rxcsum |= E1000_RXCSUM_TUOFL; + else + rxcsum &= ~E1000_RXCSUM_TUOFL; + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); /* ** XXX TEMPORARY WORKAROUND: on some systems with 82573 @@ -4603,31 +4629,23 @@ em_fixup_rx(struct rx_ring *rxr) static void em_receive_checksum(struct e1000_rx_desc *rx_desc, struct mbuf *mp) { + mp->m_pkthdr.csum_flags = 0; + /* Ignore Checksum bit is set */ - if (rx_desc->status & E1000_RXD_STAT_IXSM) { - mp->m_pkthdr.csum_flags = 0; + if (rx_desc->status & E1000_RXD_STAT_IXSM) return; - } - - if (rx_desc->status & E1000_RXD_STAT_IPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_IPE)) { - /* IP Checksum Good */ - mp->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mp->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } else { - mp->m_pkthdr.csum_flags = 0; - } - } + if (rx_desc->errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) + return; - if (rx_desc->status & E1000_RXD_STAT_TCPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_TCPE)) { - mp->m_pkthdr.csum_flags |= - (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - mp->m_pkthdr.csum_data = htons(0xffff); - } + /* IP Checksum Good? */ + if (rx_desc->status & E1000_RXD_STAT_IPCS) + mp->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* TCP or UDP checksum */ + if (rx_desc->status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { + mp->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + mp->m_pkthdr.csum_data = htons(0xffff); } } Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_igb.c Sat Jul 6 22:34:42 2013 (r252899) @@ -42,7 +42,7 @@ #include #include -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX #include #endif #include @@ -100,7 +100,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.3.9"; +char igb_driver_version[] = "version - 2.3.10"; /********************************************************************* @@ -179,7 +179,7 @@ static int igb_detach(device_t); static int igb_shutdown(device_t); static int igb_suspend(device_t); static int igb_resume(device_t); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX static int igb_mq_start(struct ifnet *, struct mbuf *); static int igb_mq_start_locked(struct ifnet *, struct tx_ring *); static void igb_qflush(struct ifnet *); @@ -374,9 +374,9 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_spl "Enable receive mbuf header split"); /* -** This will autoconfigure based on -** the number of CPUs and max supported MSI-X messages -** if left at 0. +** This will autoconfigure based on the +** number of CPUs and max supported +** MSIX messages if left at 0. */ static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); @@ -851,7 +851,7 @@ igb_resume(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { IGB_TX_LOCK(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -869,7 +869,7 @@ igb_resume(device_t dev) } -#if __FreeBSD_version < 800000 +#ifdef IGB_LEGACY_TX /********************************************************************* * Transmit entry point @@ -947,7 +947,7 @@ igb_start(struct ifnet *ifp) return; } -#else /* __FreeBSD_version >= 800000 */ +#else /* ~IGB_LEGACY_TX */ /* ** Multiqueue Transmit Entry: @@ -1062,7 +1062,7 @@ igb_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version >= 800000 */ +#endif /* ~IGB_LEGACY_TX */ /********************************************************************* * Ioctl entry point @@ -1388,7 +1388,7 @@ igb_handle_que(void *context, int pendin IGB_TX_LOCK(txr); igb_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -1439,7 +1439,7 @@ igb_handle_link_locked(struct adapter *a if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { IGB_TX_LOCK(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -1541,7 +1541,7 @@ igb_poll(struct ifnet *ifp, enum poll_cm do { more = igb_txeof(txr); } while (loop-- && more); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX if (!drbr_empty(ifp, txr->br)) igb_mq_start_locked(ifp, txr); #else @@ -1576,7 +1576,7 @@ igb_msix_que(void *arg) IGB_TX_LOCK(txr); igb_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -2096,7 +2096,9 @@ static void igb_disable_promisc(struct adapter *adapter) { struct e1000_hw *hw = &adapter->hw; + struct ifnet *ifp = adapter->ifp; u32 reg; + int mcnt = 0; if (adapter->vf_ifp) { e1000_promisc_set_vf(hw, e1000_promisc_disabled); @@ -2104,7 +2106,31 @@ igb_disable_promisc(struct adapter *adap } reg = E1000_READ_REG(hw, E1000_RCTL); reg &= (~E1000_RCTL_UPE); - reg &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg &= (~E1000_RCTL_MPE); E1000_WRITE_REG(hw, E1000_RCTL, reg); } @@ -2448,7 +2474,6 @@ igb_allocate_legacy(struct adapter *adap { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; - struct tx_ring *txr = adapter->tx_rings; int error, rid = 0; /* Turn off all interrupts */ @@ -2467,8 +2492,8 @@ igb_allocate_legacy(struct adapter *adap return (ENXIO); } -#if __FreeBSD_version >= 800000 - TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr); +#ifndef IGB_LEGACY_TX + TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, que->txr); #endif /* @@ -2551,7 +2576,7 @@ igb_allocate_msix(struct adapter *adapte i,igb_last_bind_cpu); igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu); } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, que->txr); #endif @@ -2777,7 +2802,7 @@ igb_free_pci_resources(struct adapter *a for (int i = 0; i < adapter->num_queues; i++, que++) { if (que->tq != NULL) { -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX taskqueue_drain(que->tq, &que->txr->txq_task); #endif taskqueue_drain(que->tq, &que->que_task); @@ -3087,7 +3112,7 @@ igb_setup_interface(device_t dev, struct ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = igb_ioctl; -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX ifp->if_transmit = igb_mq_start; ifp->if_qflush = igb_qflush; #else @@ -3331,7 +3356,7 @@ igb_allocate_queues(struct adapter *adap error = ENOMEM; goto err_tx_desc; } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Allocate a buf ring */ txr->br = buf_ring_alloc(igb_buf_ring_size, M_DEVBUF, M_WAITOK, &txr->tx_mtx); @@ -3392,7 +3417,7 @@ err_tx_desc: igb_dma_free(adapter, &txr->txdma); free(adapter->rx_rings, M_DEVBUF); rx_fail: -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX buf_ring_free(txr->br, M_DEVBUF); #endif free(adapter->tx_rings, M_DEVBUF); @@ -3650,7 +3675,7 @@ igb_free_transmit_buffers(struct tx_ring tx_buffer->map = NULL; } } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX if (txr->br != NULL) buf_ring_free(txr->br, M_DEVBUF); #endif @@ -4854,7 +4879,7 @@ igb_rxeof(struct igb_queue *que, int cou rxr->fmp->m_pkthdr.ether_vtag = vtag; rxr->fmp->m_flags |= M_VLANTAG; } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX rxr->fmp->m_pkthdr.flowid = que->msix; rxr->fmp->m_flags |= M_FLOWID; #endif Modified: stable/9/sys/dev/e1000/if_igb.h ============================================================================== --- stable/9/sys/dev/e1000/if_igb.h Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_igb.h Sat Jul 6 22:34:42 2013 (r252899) @@ -297,7 +297,7 @@ struct tx_ring { u32 next_to_clean; volatile u16 tx_avail; struct igb_tx_buffer *tx_buffers; -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX struct buf_ring *br; struct task txq_task; #endif Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_lem.c Sat Jul 6 22:34:42 2013 (r252899) @@ -85,7 +85,7 @@ /********************************************************************* * Legacy Em Driver version: *********************************************************************/ -char lem_driver_version[] = "1.0.5"; +char lem_driver_version[] = "1.0.6"; /********************************************************************* * PCI Device ID Table @@ -1868,12 +1868,37 @@ lem_set_promisc(struct adapter *adapter) static void lem_disable_promisc(struct adapter *adapter) { - u32 reg_rctl; + struct ifnet *ifp = adapter->ifp; + u32 reg_rctl; + int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - reg_rctl &= (~E1000_RCTL_UPE); - reg_rctl &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~E1000_RCTL_MPE); reg_rctl &= (~E1000_RCTL_SBP); E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 22:39:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE962E87; Sat, 6 Jul 2013 22:39:17 +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 B0287184E; Sat, 6 Jul 2013 22:39:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MdHtr035600; Sat, 6 Jul 2013 22:39:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66MdHaO035599; Sat, 6 Jul 2013 22:39:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307062239.r66MdHaO035599@svn.freebsd.org> From: Dimitry Andric Date: Sat, 6 Jul 2013 22:39:17 +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: r252900 - stable/9/contrib/llvm/tools/clang/lib/Basic X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 22:39:17 -0000 Author: dim Date: Sat Jul 6 22:39:17 2013 New Revision: 252900 URL: http://svnweb.freebsd.org/changeset/base/252900 Log: Fix minor mis-merge in contrib/llvm/tools/clang/lib/Basic/Targets.cpp, reducing the diff against the file in head. Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Jul 6 22:34:42 2013 (r252899) +++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Jul 6 22:39:17 2013 (r252900) @@ -249,11 +249,10 @@ protected: unsigned Release = Triple.getOSMajorVersion(); if (Release == 0U) - Release = 8U; + Release = 8; - Builder.defineMacro("__FreeBSD__", llvm::Twine(Release)); - Builder.defineMacro("__FreeBSD_cc_version", - llvm::Twine(Release * 100000U + 1U)); + Builder.defineMacro("__FreeBSD__", Twine(Release)); + Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U)); Builder.defineMacro("__KPRINTF_ATTRIBUTE__"); DefineStd(Builder, "unix", Opts); Builder.defineMacro("__ELF__"); From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 22:51:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95875185; Sat, 6 Jul 2013 22:51:56 +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 8711C189D; Sat, 6 Jul 2013 22:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MpuYq040336; Sat, 6 Jul 2013 22:51:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Mpuhn040335; Sat, 6 Jul 2013 22:51:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307062251.r66Mpuhn040335@svn.freebsd.org> From: Dimitry Andric Date: Sat, 6 Jul 2013 22:51:56 +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: r252901 - stable/9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 22:51:56 -0000 Author: dim Date: Sat Jul 6 22:51:56 2013 New Revision: 252901 URL: http://svnweb.freebsd.org/changeset/base/252901 Log: MFC r252587: Pull in r185446 from clang trunk: Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout. Reported by: glebius Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jul 6 22:39:17 2013 (r252900) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jul 6 22:51:56 2013 (r252901) @@ -10296,7 +10296,8 @@ void Sema::ActOnTagFinishDefinition(Scop Tag->setTopLevelDeclInObjCContainer(); // Notify the consumer that we've defined a tag. - Consumer.HandleTagDeclDefinition(Tag); + if (!Tag->isInvalidDecl()) + Consumer.HandleTagDeclDefinition(Tag); } void Sema::ActOnObjCContainerFinishDefinition() { From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 23:05:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3796B835; Sat, 6 Jul 2013 23:05:00 +0000 (UTC) (envelope-from delphij@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 2972E191E; Sat, 6 Jul 2013 23:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66N50k4043913; Sat, 6 Jul 2013 23:05:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66N4xek043897; Sat, 6 Jul 2013 23:04:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062304.r66N4xek043897@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252902 - stable/9/sys/dev/hpt27xx X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 23:05:00 -0000 Author: delphij Date: Sat Jul 6 23:04:59 2013 New Revision: 252902 URL: http://svnweb.freebsd.org/changeset/base/252902 Log: MFC r252852: Update hpt27xx(4) driver to address a problem reported by FreeNAS user, where when more than one hpt27xx adapters are being used, the "unit number" stays at 0. Many thanks to HighPoint for providing this driver update. (This changeset have not included change found in 249468) Modified: stable/9/sys/dev/hpt27xx/hpt27xx_config.c stable/9/sys/dev/hpt27xx/osm_bsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hpt27xx/hpt27xx_config.c ============================================================================== --- stable/9/sys/dev/hpt27xx/hpt27xx_config.c Sat Jul 6 22:51:56 2013 (r252901) +++ stable/9/sys/dev/hpt27xx/hpt27xx_config.c Sat Jul 6 23:04:59 2013 (r252902) @@ -60,7 +60,7 @@ int init_config(void) const char driver_name[] = "hpt27xx"; const char driver_name_long[] = "RocketRAID 27xx controller driver"; -const char driver_ver[] = "v1.0"; +const char driver_ver[] = "v1.1"; int osm_max_targets = 0xff; Modified: stable/9/sys/dev/hpt27xx/osm_bsd.c ============================================================================== --- stable/9/sys/dev/hpt27xx/osm_bsd.c Sat Jul 6 22:51:56 2013 (r252901) +++ stable/9/sys/dev/hpt27xx/osm_bsd.c Sat Jul 6 23:04:59 2013 (r252902) @@ -944,7 +944,6 @@ static void hpt_stop_tasks(PVBUS_EXT vbu static d_open_t hpt_open; static d_close_t hpt_close; static d_ioctl_t hpt_ioctl; -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb); static int hpt_rescan_bus(void); static struct cdevsw hpt_cdevsw = { @@ -974,7 +973,7 @@ static struct intr_config_hook hpt_ich; */ static void hpt_final_init(void *dummy) { - int i; + int i,unit_number=0; PVBUS_EXT vbus_ext; PVBUS vbus; PHBA hba; @@ -1058,12 +1057,12 @@ static void hpt_final_init(void *dummy) #if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, &Giant, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, &Giant, os_max_queue_comm, /*tagged*/8, devq); #else vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); #endif - + unit_number++; if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); cam_simq_free(devq); @@ -1337,44 +1336,26 @@ invalid: static int hpt_rescan_bus(void) { - struct cam_path *path; union ccb *ccb; PVBUS vbus; PVBUS_EXT vbus_ext; -#if (__FreeBSD_version >= 500000) mtx_lock(&Giant); -#endif ldm_for_each_vbus(vbus, vbus_ext) { - if (xpt_create_path(&path, xpt_periph, cam_sim_path(vbus_ext->sim), + if ((ccb = xpt_alloc_ccb()) == NULL) + { + return(ENOMEM); + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) + { + xpt_free_ccb(ccb); return(EIO); - if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL) - return(ENOMEM); - bzero(ccb, sizeof(union ccb)); - xpt_setup_ccb(&ccb->ccb_h, path, 5); - ccb->ccb_h.func_code = XPT_SCAN_BUS; - ccb->ccb_h.cbfcnp = hpt_bus_scan_cb; - ccb->crcn.flags = CAM_FLAG_NONE; - xpt_action(ccb); + } + xpt_rescan(ccb); } - -#if (__FreeBSD_version >= 500000) mtx_unlock(&Giant); -#endif - return(0); } -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb) -{ - if (ccb->ccb_h.status != CAM_REQ_CMP) - KdPrint(("cam_scan_callback: failure status = %x",ccb->ccb_h.status)); - else - KdPrint(("Scan bus successfully!")); - - xpt_free_path(ccb->ccb_h.path); - free(ccb, M_TEMP); - return; -} From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 23:11:30 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC82B9A8; Sat, 6 Jul 2013 23:11:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 45BBB1938; Sat, 6 Jul 2013 23:11:27 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 66BCE479; Sun, 7 Jul 2013 01:06:41 +0200 (CEST) Date: Sun, 7 Jul 2013 01:11:45 +0200 From: Pawel Jakub Dawidek To: Jilles Tjoelker Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol Message-ID: <20130706231145.GL25842@garage.freebsd.pl> References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> <20130706195108.GA34684@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LJm8egi4vkexsie5" Content-Disposition: inline In-Reply-To: <20130706195108.GA34684@stack.nl> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 23:11:30 -0000 --LJm8egi4vkexsie5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 06, 2013 at 09:51:08PM +0200, Jilles Tjoelker wrote: > [...] Firstly, in some application areas like mail delivery, it is > conventional and documented to use and interpret sysexits codes. (So if > HAST uses sysexits, it should document that fact.) [...] The hastd daemon checks for EX_TEMPFAIL when internal process exits. That's not something user-visible, so nothing to document. Just FYI. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --LJm8egi4vkexsie5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHYpDEACgkQForvXbEpPzShVACg0o2UBhqD2es1rF8grLDtXoTJ e+sAnAquR+KlIlUvfBJ9OcKZ/wdh9OZx =DXXP -----END PGP SIGNATURE----- --LJm8egi4vkexsie5-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 23:26:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3313C4C; Sat, 6 Jul 2013 23:26:38 +0000 (UTC) (envelope-from delphij@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 A5018197E; Sat, 6 Jul 2013 23:26:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66NQcAR050198; Sat, 6 Jul 2013 23:26:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66NQaJS050189; Sat, 6 Jul 2013 23:26:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062326.r66NQaJS050189@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:26: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: r252903 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/hpt27xx sys/dev/hptnr sys/i386/conf sys/modules sys/modules/hpt27xx sys/modules/hptnr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 23:26:38 -0000 Author: delphij Date: Sat Jul 6 23:26:36 2013 New Revision: 252903 URL: http://svnweb.freebsd.org/changeset/base/252903 Log: MFC r252867: Import HighPoint DC Series Data Center HBA (DC7280 and R750) driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. (This changeset have not included changes found in 249468 and 246713) Added: stable/9/share/man/man4/hptnr.4 - copied unchanged from r252867, head/share/man/man4/hptnr.4 stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c - copied unchanged from r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c - copied unchanged from r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c stable/9/sys/dev/hptnr/ - copied from r252867, head/sys/dev/hptnr/ stable/9/sys/modules/hptnr/ - copied from r252867, head/sys/modules/hptnr/ Deleted: stable/9/sys/dev/hpt27xx/os_bsd.c stable/9/sys/dev/hpt27xx/osm_bsd.c Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/GENERIC stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/WITHOUT_SOURCELESS_HOST stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/dev/hptnr/hptnr_osm_bsd.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/NOTES stable/9/sys/i386/conf/PAE stable/9/sys/i386/conf/XEN stable/9/sys/modules/Makefile stable/9/sys/modules/hpt27xx/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/share/man/man4/Makefile Sat Jul 6 23:26:36 2013 (r252903) @@ -157,6 +157,7 @@ MAN= aac.4 \ ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ + ${_hptnr.4} \ ${_hptrr.4} \ hwpmc.4 \ ichsmb.4 \ @@ -720,6 +721,7 @@ _dpms.4= dpms.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 +_hptnr.4= hptnr.4 _hptrr.4= hptrr.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 Copied: stable/9/share/man/man4/hptnr.4 (from r252867, head/share/man/man4/hptnr.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/hptnr.4 Sat Jul 6 23:26:36 2013 (r252903, copy of r252867, head/share/man/man4/hptnr.4) @@ -0,0 +1,92 @@ +.\"- +.\" Copyright (c) 2013 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 5, 2013 +.Dt HPTNR 4 +.Os +.Sh NAME +.Nm hptnr +.Nd "HighPoint DC Series Data Center HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hptnr" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hptnr_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's DC Series Data Center HBA card. +.Sh HARDWARE +The +.Nm +driver supports the following SATA +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's DC7280 series +.It +HighPoint's Rocket R750 series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/amd64/conf/GENERIC Sat Jul 6 23:26:36 2013 (r252903) @@ -134,6 +134,7 @@ device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/amd64/conf/NOTES Sat Jul 6 23:26:36 2013 (r252903) @@ -419,6 +419,10 @@ device hpt27xx device hptmv # +# Highpoint DC7280 and R750. +device hptnr + +# # Highpoint RocketRAID. Supports RR172x, RR222x, RR2240, RR232x, RR2340, # RR2210, RR174x, RR2522, RR231x, RR230x. device hptrr Modified: stable/9/sys/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- stable/9/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 23:26:36 2013 (r252903) @@ -6,5 +6,6 @@ nodevice hpt27xx nodevice hptmv +nodevice hptnr nodevice hptrr nodevice nve Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/files.amd64 Sat Jul 6 23:26:36 2013 (r252903) @@ -62,10 +62,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ no-implicit-rule +# +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ @@ -191,14 +198,17 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/files.i386 Sat Jul 6 23:26:36 2013 (r252903) @@ -61,11 +61,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ no-implicit-rule # +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ @@ -179,14 +185,17 @@ dev/fe/if_fe_isa.c optional fe isa dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Copied: stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c (from r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jul 6 23:26:36 2013 (r252903, copy of r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include + +/* hardware access */ +HPT_U8 os_inb (void *port) { return inb((unsigned)(HPT_UPTR)port); } +HPT_U16 os_inw (void *port) { return inw((unsigned)(HPT_UPTR)port); } +HPT_U32 os_inl (void *port) { return inl((unsigned)(HPT_UPTR)port); } + +void os_outb (void *port, HPT_U8 value) { outb((unsigned)(HPT_UPTR)port, (value)); } +void os_outw (void *port, HPT_U16 value) { outw((unsigned)(HPT_UPTR)port, (value)); } +void os_outl (void *port, HPT_U32 value) { outl((unsigned)(HPT_UPTR)port, (value)); } + +void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count) +{ insw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count) +{ outsw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +HPT_U32 __dummy_reg = 0; + +/* PCI configuration space */ +HPT_U8 os_pci_readb (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 1); +} + +HPT_U16 os_pci_readw (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 2); +} + +HPT_U32 os_pci_readl (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 4); +} + +void os_pci_writeb (void *osext, HPT_U8 offset, HPT_U8 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 1); +} + +void os_pci_writew (void *osext, HPT_U8 offset, HPT_U16 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 2); +} + +void os_pci_writel (void *osext, HPT_U8 offset, HPT_U32 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 4); +} + +#if __FreeBSD_version < 500043 +/* PCI space access */ +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U8 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 1); + return v; +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U32 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 4); + return v; +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 4); +}/* PCI space access */ +#else +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U8)pci_cfgregread(bus, dev, func, reg, 1); +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4); +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 4); +}/* PCI space access */ +#endif + +void *os_map_pci_bar( + void *osext, + int index, + HPT_U32 offset, + HPT_U32 length +) +{ + PHBA hba = (PHBA)osext; + HPT_U32 base; + + hba->pcibar[index].rid = 0x10 + index * 4; + base = pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4); + + if (base & 1) { + hba->pcibar[index].type = SYS_RES_IOPORT; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); + } else { + hba->pcibar[index].type = SYS_RES_MEMORY; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; + } + + return hba->pcibar[index].base; +} + +void os_unmap_pci_bar(void *osext, void *base) +{ + PHBA hba = (PHBA)osext; + int index; + + for (index=0; index<6; index++) { + if (hba->pcibar[index].base==base) { + bus_release_resource(hba->pcidev, hba->pcibar[index].type, + hba->pcibar[index].rid, hba->pcibar[index].res); + hba->pcibar[index].base = 0; + return; + } + } +} + +void freelist_reserve(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_head; + vbus_ext->freelist_head = list; + list->dma = 0; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get(struct freelist *list) +{ + void * result; + if (list->count) { + HPT_ASSERT(list->head); + result = list->head; + list->head = *(void **)result; + list->count--; + return result; + } + return 0; +} + +void freelist_put(struct freelist * list, void *p) +{ + HPT_ASSERT(list->dma==0); + list->count++; + *(void **)p = list->head; + list->head = p; +} + +void freelist_reserve_dma(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT alignment, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_dma_head; + vbus_ext->freelist_dma_head = list; + list->dma = 1; + list->alignment = alignment; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get_dma(struct freelist *list, BUS_ADDRESS *busaddr) +{ + void *result; + HPT_ASSERT(list->dma); + result = freelist_get(list); + if (result) + *busaddr = *(BUS_ADDRESS *)((void **)result+1); + return result; +} + +void freelist_put_dma(struct freelist *list, void *p, BUS_ADDRESS busaddr) +{ + HPT_ASSERT(list->dma); + list->count++; + *(void **)p = list->head; + *(BUS_ADDRESS *)((void **)p+1) = busaddr; + list->head = p; +} + +HPT_U32 os_get_stamp(void) +{ + HPT_U32 stamp; + do { stamp = random(); } while (stamp==0); + return stamp; +} + +void os_stallexec(HPT_U32 microseconds) +{ + DELAY(microseconds); +} + +static void os_timer_for_ldm(void *arg) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)arg; + ldm_on_timer((PVBUS)vbus_ext->vbus); +} + +void os_request_timer(void * osext, HPT_U32 interval) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); + + untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); + vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); +} + +HPT_TIME os_query_time(void) +{ + return ticks * (1000000 / hz); +} + +void os_schedule_task(void *osext, OSM_TASK *task) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(task->next==0); + + if (vbus_ext->tasks==0) + vbus_ext->tasks = task; + else { + OSM_TASK *t = vbus_ext->tasks; + while (t->next) t = t->next; + t->next = task; + } + + if (vbus_ext->worker.ta_context) + TASK_ENQUEUE(&vbus_ext->worker); +} + +int os_revalidate_device(void *osext, int id) +{ + + return 0; +} + +int os_query_remove_device(void *osext, int id) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; + struct cam_periph *periph = NULL; + struct cam_path *path; + int status,retval = 0; + + status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); + if (status == CAM_REQ_CMP) { + if((periph = cam_periph_find(path, "da")) != NULL){ + if(periph->refcount >= 1) + retval = -1; + } + xpt_free_path(path); + } + + return retval; +} + +HPT_U8 os_get_vbus_seq(void *osext) +{ + return ((PVBUS_EXT)osext)->sim->path_id; +} + +int os_printk(char *fmt, ...) +{ + va_list args; + static char buf[512]; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + return printf("%s: %s\n", driver_name, buf); +} + +#if DBG +void os_check_stack(const char *location, int size){} + +void __os_dbgbreak(const char *file, int line) +{ + printf("*** break at %s:%d ***", file, line); + while (1); +} + +int hpt_dbg_level = 1; +#endif Copied: stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c (from r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jul 6 23:26:36 2013 (r252903, copy of r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c) @@ -0,0 +1,1361 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include + +static int hpt_probe(device_t dev) +{ + PCI_ID pci_id; + HIM *him; + int i; + PHBA hba; + + for (him = him_list; him; him = him->next) { + for (i=0; him->get_supported_device_id(i, &pci_id); i++) { + if (him->get_controller_count) + him->get_controller_count(&pci_id,0,0); + if ((pci_get_vendor(dev) == pci_id.vid) && + (pci_get_device(dev) == pci_id.did)){ + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + hba = (PHBA)device_get_softc(dev); + memset(hba, 0, sizeof(HBA)); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; + return 0; + } + } + } + + return (ENXIO); +} + +static int hpt_attach(device_t dev) +{ + PHBA hba = (PHBA)device_get_softc(dev); + HIM *him = hba->ldm_adapter.him; + PCI_ID pci_id; + HPT_UINT size; + PVBUS vbus; + PVBUS_EXT vbus_ext; + + KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); + +#if __FreeBSD_version >=440000 + pci_enable_busmaster(dev); +#endif + + pci_id.vid = pci_get_vendor(dev); + pci_id.did = pci_get_device(dev); + pci_id.rev = pci_get_revid(dev); + pci_id.subsys = (HPT_U32)(pci_get_subdevice(dev)) << 16 | pci_get_subvendor(dev); + + size = him->get_adapter_size(&pci_id); + hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); + if (!hba->ldm_adapter.him_handle) + return ENXIO; + + hba->pcidev = dev; + hba->pciaddr.tree = 0; + hba->pciaddr.bus = pci_get_bus(dev); + hba->pciaddr.device = pci_get_slot(dev); + hba->pciaddr.function = pci_get_function(dev); + + if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + + os_printk("adapter at PCI %d:%d:%d, IRQ %d", + hba->pciaddr.bus, hba->pciaddr.device, hba->pciaddr.function, pci_get_irq(dev)); + + if (!ldm_register_adapter(&hba->ldm_adapter)) { + size = ldm_get_vbus_size(); + vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); + if (!vbus_ext) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + memset(vbus_ext, 0, sizeof(VBUS_EXT)); + vbus_ext->ext_type = EXT_TYPE_VBUS; + ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); + ldm_register_adapter(&hba->ldm_adapter); + } + + ldm_for_each_vbus(vbus, vbus_ext) { + if (hba->ldm_adapter.vbus==vbus) { + hba->vbus_ext = vbus_ext; + hba->next = vbus_ext->hba_list; + vbus_ext->hba_list = hba; + break; + } + } + return 0; +} + +/* + * Maybe we'd better to use the bus_dmamem_alloc to alloc DMA memory, + * but there are some problems currently (alignment, etc). + */ +static __inline void *__get_free_pages(int order) +{ + /* don't use low memory - other devices may get starved */ + return contigmalloc(PAGE_SIZE<hba_list; hba; hba = hba->next) + hba->ldm_adapter.him->get_meminfo(hba->ldm_adapter.him_handle); + + ldm_get_mem_info((PVBUS)vbus_ext->vbus, 0); + + for (f=vbus_ext->freelist_head; f; f=f->next) { + KdPrint(("%s: %d*%d=%d bytes", + f->tag, f->count, f->size, f->count*f->size)); + for (i=0; icount; i++) { + p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); + if (!p) return (ENXIO); + *p = f->head; + f->head = p; + } + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size, j; + + HPT_ASSERT((f->size & (f->alignment-1))==0); + + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) + ; + + KdPrint(("%s: %d*%d=%d bytes, order %d", + f->tag, f->count, f->size, f->count*f->size, order)); + HPT_ASSERT(f->alignment<=PAGE_SIZE); + + for (i=0; icount;) { + p = (void **)__get_free_pages(order); + if (!p) return -1; + for (j = size/f->size; j && icount; i++,j--) { + *p = f->head; + *(BUS_ADDRESS *)(p+1) = (BUS_ADDRESS)vtophys(p); + f->head = p; + p = (void **)((unsigned long)p + f->size); + } + } + } + + HPT_ASSERT(PAGE_SIZE==DMAPOOL_PAGE_SIZE); + + for (i=0; ivbus, p, (BUS_ADDRESS)vtophys(p)); + } + + return 0; +} + +static void hpt_free_mem(PVBUS_EXT vbus_ext) +{ + struct freelist *f; + void *p; + int i; + BUS_ADDRESS bus; + + for (f=vbus_ext->freelist_head; f; f=f->next) { +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + while ((p=freelist_get(f))) + free(p, M_DEVBUF); + } + + for (i=0; ivbus, &bus); + HPT_ASSERT(p); + free_pages(p, 0); + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size; +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for dma freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; + + while ((p=freelist_get_dma(f, &bus))) { + if (order) + free_pages(p, order); + else { + /* can't free immediately since other blocks in this page may still be in the list */ + if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) + dmapool_put_page((PVBUS)vbus_ext->vbus, p, bus); + } + } + } + + while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) + free_pages(p, 0); +} + +static int hpt_init_vbus(PVBUS_EXT vbus_ext) +{ + PHBA hba; + + for (hba = vbus_ext->hba_list; hba; hba = hba->next) + if (!hba->ldm_adapter.him->initialize(hba->ldm_adapter.him_handle)) { + KdPrint(("fail to initialize %p", hba)); + return -1; + } + + ldm_initialize_vbus((PVBUS)vbus_ext->vbus, &vbus_ext->hba_list->ldm_adapter); + return 0; +} + +static void hpt_flush_done(PCOMMAND pCmd) +{ + PVDEV vd = pCmd->target; + + if (mIsArray(vd->type) && vd->u.array.transform && vd!=vd->u.array.transform->target) { + vd = vd->u.array.transform->target; + HPT_ASSERT(vd); + pCmd->target = vd; + pCmd->Result = RETURN_PENDING; + vdev_queue_cmd(pCmd); + return; + } + + *(int *)pCmd->priv = 1; + wakeup(pCmd); +} + +/* + * flush a vdev (without retry). + */ +static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) +{ + PCOMMAND pCmd; + int result = 0, done; + HPT_UINT count; + + KdPrint(("flusing dev %p", vd)); + + hpt_lock_vbus(vbus_ext); + + if (mIsArray(vd->type) && vd->u.array.transform) + count = MAX(vd->u.array.transform->source->cmds_per_request, + vd->u.array.transform->target->cmds_per_request); + else + count = vd->cmds_per_request; + + pCmd = ldm_alloc_cmds(vd->vbus, count); + + if (!pCmd) { + hpt_unlock_vbus(vbus_ext); + return -1; + } + + pCmd->type = CMD_TYPE_FLUSH; + pCmd->flags.hard_flush = 1; + pCmd->target = vd; + pCmd->done = hpt_flush_done; + done = 0; + pCmd->priv = &done; + + ldm_queue_cmd(pCmd); + + if (!done) { + while (hpt_sleep(vbus_ext, pCmd, PPAUSE, "hptfls", HPT_OSM_TIMEOUT)) { + ldm_reset_vbus(vd->vbus); + } + } + + KdPrint(("flush result %d", pCmd->Result)); + + if (pCmd->Result!=RETURN_SUCCESS) + result = -1; + + ldm_free_cmds(pCmd); + + hpt_unlock_vbus(vbus_ext); + + return result; +} + +static void hpt_stop_tasks(PVBUS_EXT vbus_ext); +static void hpt_shutdown_vbus(PVBUS_EXT vbus_ext, int howto) +{ + PVBUS vbus = (PVBUS)vbus_ext->vbus; + PHBA hba; + int i; + + KdPrint(("hpt_shutdown_vbus")); + + /* stop all ctl tasks and disable the worker taskqueue */ + hpt_stop_tasks(vbus_ext); + vbus_ext->worker.ta_context = 0; + + /* flush devices */ + for (i=0; ihba_list; hba; hba=hba->next) + bus_teardown_intr(hba->pcidev, hba->irq_res, hba->irq_handle); + + hpt_free_mem(vbus_ext); + + while ((hba=vbus_ext->hba_list)) { + vbus_ext->hba_list = hba->next; + free(hba->ldm_adapter.him_handle, M_DEVBUF); + } + + free(vbus_ext, M_DEVBUF); + KdPrint(("hpt_shutdown_vbus done")); +} + +static void __hpt_do_tasks(PVBUS_EXT vbus_ext) +{ + OSM_TASK *tasks; + + tasks = vbus_ext->tasks; + vbus_ext->tasks = 0; + + while (tasks) { + OSM_TASK *t = tasks; + tasks = t->next; + t->next = 0; + t->func(vbus_ext->vbus, t->data); + } +} + +static void hpt_do_tasks(PVBUS_EXT vbus_ext, int pending) +{ + if(vbus_ext){ + hpt_lock_vbus(vbus_ext); + __hpt_do_tasks(vbus_ext); + hpt_unlock_vbus(vbus_ext); + } +} + +static void hpt_action(struct cam_sim *sim, union ccb *ccb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 23:46:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85EA2E2A; Sat, 6 Jul 2013 23:46:24 +0000 (UTC) (envelope-from delphij@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 7742119DA; Sat, 6 Jul 2013 23:46:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66NkNWk055768; Sat, 6 Jul 2013 23:46:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66NkNQj055764; Sat, 6 Jul 2013 23:46:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062346.r66NkNQj055764@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:46: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: r252904 - stable/9/sys/dev/arcmsr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 23:46:24 -0000 Author: delphij Date: Sat Jul 6 23:46:23 2013 New Revision: 252904 URL: http://svnweb.freebsd.org/changeset/base/252904 Log: MFC r252857: Refresh vendor driver version which fixes command queue full issue with ARC-1214 and ARC-1224. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Sat Jul 6 23:26:36 2013 (r252903) +++ stable/9/sys/dev/arcmsr/arcmsr.c Sat Jul 6 23:46:23 2013 (r252904) @@ -35,44 +35,45 @@ ******************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support -** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, -** firmware version check -** and firmware update notify for hardware bug fix -** handling if none zero high part physical address -** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy -** add iop message xfer -** with scsi pass-through command -** add new device id of sas raid adapters -** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report -** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x -** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic -** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start -** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed -** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command -** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition -** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** clean unused function +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** firmware version check +** and firmware update notify for hardware bug fix +** handling if none zero high part physical address +** of srb resource +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** add iop message xfer +** with scsi pass-through command +** add new device id of sas raid adapters +** code fit for SPARC64 & PPC +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** and cause g_vfs_done() read write error +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** bus_dmamem_alloc() with BUS_DMA_ZERO +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 +** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ****************************************************************************************** */ @@ -144,7 +145,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06" #include /* ************************************************************************** @@ -753,7 +754,7 @@ static void arcmsr_srb_complete(struct C if(stand_flag == 1) { atomic_subtract_int(&acb->srboutstandingcount, 1); if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < (acb->firm_numbers_queue -10))) { + acb->srboutstandingcount < (acb->maxOutstanding -10))) { acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } @@ -1939,11 +1940,11 @@ static void arcmsr_hbc_postqueue_isr(str /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); + throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); - break; + throttling = 0; } - throttling++; } /*drain reply FIFO*/ } /* @@ -2686,7 +2687,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= acb->firm_numbers_queue) { + if(acb->srboutstandingcount >= acb->maxOutstanding) { if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) == 0) { xpt_freeze_simq(acb->psim, 1); @@ -3430,6 +3431,10 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3476,6 +3481,10 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBB_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBB_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3523,6 +3532,10 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3571,6 +3584,10 @@ static void arcmsr_get_hbd_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** Modified: stable/9/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.h Sat Jul 6 23:26:36 2013 (r252903) +++ stable/9/sys/dev/arcmsr/arcmsr.h Sat Jul 6 23:46:23 2013 (r252904) @@ -1182,6 +1182,7 @@ struct AdapterControlBlock { u_int32_t pktReturnCount; u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; + u_int32_t maxOutstanding; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 23:57:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D18B9B; Sat, 6 Jul 2013 23:57:00 +0000 (UTC) (envelope-from delphij@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 2CCAD19F8; Sat, 6 Jul 2013 23:57:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Nv0Fs058648; Sat, 6 Jul 2013 23:57:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Nuxm1058634; Sat, 6 Jul 2013 23:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062356.r66Nuxm1058634@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252905 - in stable/9: share/man/man4 sys/dev/oce X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 23:57:00 -0000 Author: delphij Date: Sat Jul 6 23:56:58 2013 New Revision: 252905 URL: http://svnweb.freebsd.org/changeset/base/252905 Log: MFC r252869: Update driver with recent vendor improvements, most notably support of Skyhawk adapters. Many thanks to Emulex for their continued support of FreeBSD. Submitted by: "Duvvuru,Venkat Kumar" Modified: stable/9/share/man/man4/oce.4 stable/9/sys/dev/oce/oce_hw.c stable/9/sys/dev/oce/oce_hw.h stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/oce/oce_mbox.c stable/9/sys/dev/oce/oce_queue.c stable/9/sys/dev/oce/oce_sysctl.c stable/9/sys/dev/oce/oce_util.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/oce.4 ============================================================================== --- stable/9/share/man/man4/oce.4 Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/share/man/man4/oce.4 Sat Jul 6 23:56:58 2013 (r252905) @@ -1,4 +1,4 @@ -.\" Copyright (C) 2012 Emulex +.\" Copyright (C) 2013 Emulex .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/dev/oce/oce_hw.c ============================================================================== --- stable/9/sys/dev/oce/oce_hw.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_hw.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,12 +53,12 @@ oce_POST(POCE_SOFTC sc) int tmo = 60000; /* read semaphore CSR */ - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); /* if host is ready then wait for fw ready else send POST */ if (post_status.bits.stage <= POST_STAGE_AWAITING_HOST_RDY) { post_status.bits.stage = POST_STAGE_CHIP_RESET; - OCE_WRITE_REG32(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); } /* wait for FW ready */ @@ -68,7 +68,7 @@ oce_POST(POCE_SOFTC sc) DELAY(1000); - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); if (post_status.bits.error) { device_printf(sc->dev, "POST failed: %x\n", post_status.dw0); @@ -129,7 +129,7 @@ oce_hw_init(POCE_SOFTC sc) if (rc) goto error; - if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) { + if ((IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) || IS_SH(sc)) { rc = oce_mbox_check_native_mode(sc); if (rc) goto error; @@ -258,7 +258,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) rr = PCIR_BAR(pci_cfg_barnum); - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) sc->devcfg_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); @@ -298,7 +298,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) sc->flags |= OCE_FLAGS_VIRTUAL_PORT; /* Lancer has one BAR (CFG) but BE3 has three (CFG, CSR, DB) */ - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /* set up CSR region */ rr = PCIR_BAR(OCE_PCI_CSR_BAR); sc->csr_res = bus_alloc_resource_any(sc->dev, @@ -387,7 +387,7 @@ oce_create_nw_interface(POCE_SOFTC sc) } /* enable capabilities controlled via driver startup parameters */ - if (sc->rss_enable) + if (is_rss_enabled(sc)) capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; else { capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS; @@ -447,9 +447,9 @@ oce_pci_soft_reset(POCE_SOFTC sc) int rc; mpu_ep_control_t ctrl; - ctrl.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_CONTROL); + ctrl.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_CONTROL); ctrl.bits.cpu_reset = 1; - OCE_WRITE_REG32(sc, csr, MPU_EP_CONTROL, ctrl.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_CONTROL, ctrl.dw0); DELAY(50); rc=oce_POST(sc); Modified: stable/9/sys/dev/oce/oce_hw.h ============================================================================== --- stable/9/sys/dev/oce/oce_hw.h Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_hw.h Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,8 +63,7 @@ #define MPU_EP_CONTROL 0 #define MPU_EP_SEMAPHORE_BE3 0xac #define MPU_EP_SEMAPHORE_XE201 0x400 -#define MPU_EP_SEMAPHORE(sc) \ - ((IS_BE(sc)) ? MPU_EP_SEMAPHORE_BE3 : MPU_EP_SEMAPHORE_XE201) +#define MPU_EP_SEMAPHORE_SH 0x94 #define PCICFG_INTR_CTRL 0xfc #define HOSTINTR_MASK (1 << 29) #define HOSTINTR_PFUNC_SHIFT 26 @@ -1998,6 +1997,79 @@ struct mbx_lowlevel_set_loopback_mode { } rsp; } params; }; +#define MAX_RESC_DESC 256 +#define RESC_DESC_SIZE 88 +#define ACTIVE_PROFILE 2 +#define NIC_RESC_DESC_TYPE_V0 0x41 +#define NIC_RESC_DESC_TYPE_V1 0x51 +/* OPCODE_COMMON_GET_FUNCTION_CONFIG */ +struct mbx_common_get_func_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + + +/* OPCODE_COMMON_GET_PROFILE_CONFIG */ + +struct mbx_common_get_profile_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + +struct oce_nic_resc_desc { + uint8_t desc_type; + uint8_t desc_len; + uint8_t rsvd1; + uint8_t flags; + uint8_t vf_num; + uint8_t rsvd2; + uint8_t pf_num; + uint8_t rsvd3; + uint16_t unicast_mac_count; + uint8_t rsvd4[6]; + uint16_t mcc_count; + uint16_t vlan_count; + uint16_t mcast_mac_count; + uint16_t txq_count; + uint16_t rq_count; + uint16_t rssq_count; + uint16_t lro_count; + uint16_t cq_count; + uint16_t toe_conn_count; + uint16_t eq_count; + uint32_t rsvd5; + uint32_t cap_flags; + uint8_t link_param; + uint8_t rsvd6[3]; + uint32_t bw_min; + uint32_t bw_max; + uint8_t acpi_params; + uint8_t wol_param; + uint16_t rsvd7; + uint32_t rsvd8[7]; + +}; + struct flash_file_hdr { uint8_t sign[52]; Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_if.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ static void update_queues_got(POCE_SOFTC static void process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe); static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static void oce_get_config(POCE_SOFTC sc); static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); /* IP specific */ @@ -146,6 +147,7 @@ static uint32_t supportedDevices[] = { (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_BE3, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201_VF, + (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_SH }; @@ -189,6 +191,9 @@ oce_probe(device_t dev) case PCI_PRODUCT_XE201_VF: sc->flags |= OCE_FLAGS_XE201; break; + case PCI_PRODUCT_SH: + sc->flags |= OCE_FLAGS_SH; + break; default: return ENXIO; } @@ -213,7 +218,6 @@ oce_attach(device_t dev) if (rc) return rc; - sc->rss_enable = oce_enable_rss; sc->tx_ring_size = OCE_TX_RING_SIZE; sc->rx_ring_size = OCE_RX_RING_SIZE; sc->rq_frag_size = OCE_RQ_BUF_SIZE; @@ -228,6 +232,8 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; + oce_get_config(sc); + setup_max_queues_want(sc); rc = oce_setup_intr(sc); @@ -485,17 +491,18 @@ oce_multiq_start(struct ifnet *ifp, stru int queue_index = 0; int status = 0; + if (!sc->link_status) + return ENXIO; + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; - + wq = sc->wq[queue_index]; - if (TRY_LOCK(&wq->tx_lock)) { - status = oce_multiq_transmit(ifp, m, wq); - UNLOCK(&wq->tx_lock); - } else { - status = drbr_enqueue(ifp, wq->br, m); - } + LOCK(&wq->tx_lock); + status = oce_multiq_transmit(ifp, m, wq); + UNLOCK(&wq->tx_lock); + return status; } @@ -578,7 +585,7 @@ oce_setup_intr(POCE_SOFTC sc) int rc = 0, use_intx = 0; int vector = 0, req_vectors = 0; - if (sc->rss_enable) + if (is_rss_enabled(sc)) req_vectors = MAX((sc->nrqs - 1), sc->nwqs); else req_vectors = 1; @@ -777,7 +784,6 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct mbuf *m, *m_temp; struct oce_wq *wq = sc->wq[wq_index]; struct oce_packet_desc *pd; - uint32_t out; struct oce_nic_hdr_wqe *nichdr; struct oce_nic_frag_wqe *nicfrag; int num_wqes; @@ -815,20 +821,14 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } } - out = wq->packets_out + 1; - if (out == OCE_WQ_PACKET_ARRAY_SIZE) - out = 0; - if (out == wq->packets_in) - return EBUSY; - - pd = &wq->pckts[wq->packets_out]; + pd = &wq->pckts[wq->pkt_desc_head]; retry: rc = bus_dmamap_load_mbuf_sg(wq->tag, pd->map, m, segs, &pd->nsegs, BUS_DMA_NOWAIT); if (rc == 0) { num_wqes = pd->nsegs + 1; - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /*Dummy required only for BE3.*/ if (num_wqes & 1) num_wqes++; @@ -837,10 +837,11 @@ retry: bus_dmamap_unload(wq->tag, pd->map); return EBUSY; } - + atomic_store_rel_int(&wq->pkt_desc_head, + (wq->pkt_desc_head + 1) % \ + OCE_WQ_PACKET_ARRAY_SIZE); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_PREWRITE); pd->mbuf = m; - wq->packets_out = out; nichdr = RING_GET_PRODUCER_ITEM_VA(wq->ring, struct oce_nic_hdr_wqe); @@ -869,12 +870,12 @@ retry: nichdr->u0.s.lso = 1; nichdr->u0.s.lso_mss = m->m_pkthdr.tso_segsz; } - if (!IS_BE(sc)) + if (!IS_BE(sc) || !IS_SH(sc)) nichdr->u0.s.ipcs = 1; } RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); for (i = 0; i < pd->nsegs; i++) { nicfrag = @@ -886,7 +887,7 @@ retry: nicfrag->u0.s.frag_len = segs[i].ds_len; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); } if (num_wqes > (pd->nsegs + 1)) { nicfrag = @@ -898,7 +899,7 @@ retry: nicfrag->u0.dw[3] = 0; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); pd->nsegs++; } @@ -911,7 +912,7 @@ retry: bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; - OCE_WRITE_REG32(sc, db, PD_TXULP_DB, reg_value); + OCE_WRITE_REG32(sc, db, wq->db_offset, reg_value); } else if (rc == EFBIG) { if (retry_cnt == 0) { @@ -928,7 +929,7 @@ retry: return rc; else goto free_ret; - + return 0; free_ret: @@ -941,21 +942,14 @@ free_ret: static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status) { - uint32_t in; struct oce_packet_desc *pd; POCE_SOFTC sc = (POCE_SOFTC) wq->parent; struct mbuf *m; - if (wq->packets_out == wq->packets_in) - device_printf(sc->dev, "WQ transmit descriptor missing\n"); - - in = wq->packets_in + 1; - if (in == OCE_WQ_PACKET_ARRAY_SIZE) - in = 0; - - pd = &wq->pckts[wq->packets_in]; - wq->packets_in = in; - wq->ring->num_used -= (pd->nsegs + 1); + pd = &wq->pckts[wq->pkt_desc_tail]; + atomic_store_rel_int(&wq->pkt_desc_tail, + (wq->pkt_desc_tail + 1) % OCE_WQ_PACKET_ARRAY_SIZE); + atomic_subtract_int(&wq->ring->num_used, pd->nsegs + 1); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(wq->tag, pd->map); @@ -963,6 +957,7 @@ oce_tx_complete(struct oce_wq *wq, uint3 m_freem(m); pd->mbuf = NULL; + if (sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) { if (wq->ring->num_used < (wq->ring->num_items / 2)) { sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); @@ -1065,16 +1060,15 @@ oce_tx_task(void *arg, int npending) POCE_SOFTC sc = wq->parent; struct ifnet *ifp = sc->ifp; int rc = 0; - + #if __FreeBSD_version >= 800000 - if (TRY_LOCK(&wq->tx_lock)) { - rc = oce_multiq_transmit(ifp, NULL, wq); - if (rc) { - device_printf(sc->dev, - "TX[%d] restart failed\n", wq->queue_index); - } - UNLOCK(&wq->tx_lock); + LOCK(&wq->tx_lock); + rc = oce_multiq_transmit(ifp, NULL, wq); + if (rc) { + device_printf(sc->dev, + "TX[%d] restart failed\n", wq->queue_index); } + UNLOCK(&wq->tx_lock); #else oce_start(ifp); #endif @@ -1133,7 +1127,6 @@ oce_wq_handler(void *arg) struct oce_nic_tx_cqe *cqe; int num_cqes = 0; - LOCK(&wq->tx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_tx_cqe); @@ -1157,7 +1150,6 @@ oce_wq_handler(void *arg) if (num_cqes) oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE); - UNLOCK(&wq->tx_lock); return 0; } @@ -1234,7 +1226,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } /* Get vlan_tag value */ - if(IS_BE(sc)) + if(IS_BE(sc) || IS_SH(sc)) vtag = BSWAP_16(cqe->u0.s.vlan_tag); else vtag = cqe->u0.s.vlan_tag; @@ -1295,7 +1287,10 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.rcvif = sc->ifp; #if __FreeBSD_version >= 800000 - m->m_pkthdr.flowid = rq->queue_index; + if (rq->queue_index) + m->m_pkthdr.flowid = (rq->queue_index - 1); + else + m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif /* This deternies if vlan tag is Valid */ @@ -1402,7 +1397,7 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru struct oce_nic_rx_cqe_v1 *cqe_v1; int port_id = 0; - if (sc->be3_native && IS_BE(sc)) { + if (sc->be3_native && (IS_BE(sc) || IS_SH(sc))) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; port_id = cqe_v1->u0.s.port; if (sc->port_id != port_id) @@ -1548,7 +1543,6 @@ oce_rq_handler(void *arg) int num_cqes = 0, rq_buffers_used = 0; - LOCK(&rq->rx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_rx_cqe); @@ -1595,8 +1589,6 @@ oce_rq_handler(void *arg) oce_alloc_rx_bufs(rq, (rq_buffers_used - 1)); } - UNLOCK(&rq->rx_lock); - return 0; } @@ -1890,7 +1882,7 @@ oce_local_timer(void *arg) oce_tx_restart(sc, sc->wq[i]); /* calculate and set the eq delay for optimal interrupt rate */ - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) oce_eqd_set_periodic(sc); callout_reset(&sc->timer, hz, oce_local_timer, sc); @@ -2081,38 +2073,22 @@ oce_mq_handler(void *arg) static void setup_max_queues_want(POCE_SOFTC sc) { - int max_rss = 0; - /* Check if it is FLEX machine. Is so dont use RSS */ if ((sc->function_mode & FNM_FLEX10_MODE) || (sc->function_mode & FNM_UMC_MODE) || (sc->function_mode & FNM_VNIC_MODE) || - (!sc->rss_enable) || + (!is_rss_enabled(sc)) || (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; - sc->rss_enable = 0; - } else { - /* For multiq, our deisgn is to have TX rings equal to - RSS rings. So that we can pair up one RSS ring and TX - to a single intr, which improves CPU cache efficiency. - */ - if (IS_BE(sc) && (!sc->be3_native)) - max_rss = OCE_LEGACY_MODE_RSS; - else - max_rss = OCE_MAX_RSS; - - sc->nrqs = MIN(OCE_NCPUS, max_rss) + 1; /* 1 for def RX */ - sc->nwqs = MIN(OCE_NCPUS, max_rss); } - } static void update_queues_got(POCE_SOFTC sc) { - if (sc->rss_enable) { + if (is_rss_enabled(sc)) { sc->nrqs = sc->intr_count + 1; sc->nwqs = sc->intr_count; } else { @@ -2197,3 +2173,31 @@ oce_tx_asic_stall_verify(POCE_SOFTC sc, } return FALSE; } + +static void +oce_get_config(POCE_SOFTC sc) +{ + int rc = 0; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + if (!IS_BE(sc)) { + rc = oce_get_func_config(sc); + if (rc) { + sc->nwqs = OCE_MAX_WQ; + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + } + } + else { + rc = oce_get_profile_config(sc); + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + if (rc) + sc->nwqs = OCE_MAX_WQ; + } +} Modified: stable/9/sys/dev/oce/oce_if.h ============================================================================== --- stable/9/sys/dev/oce/oce_if.h Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_if.h Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,11 +97,21 @@ #define PCI_PRODUCT_BE3 0x0710 /* BE3 network adapter */ #define PCI_PRODUCT_XE201 0xe220 /* XE201 network adapter */ #define PCI_PRODUCT_XE201_VF 0xe228 /* XE201 with VF in Lancer */ +#define PCI_PRODUCT_SH 0x0720 /* Skyhawk network adapter */ #define IS_BE(sc) (((sc->flags & OCE_FLAGS_BE3) | \ (sc->flags & OCE_FLAGS_BE2))? 1:0) +#define IS_BE3(sc) (sc->flags & OCE_FLAGS_BE3) +#define IS_BE2(sc) (sc->flags & OCE_FLAGS_BE2) #define IS_XE201(sc) ((sc->flags & OCE_FLAGS_XE201) ? 1:0) #define HAS_A0_CHIP(sc) ((sc->flags & OCE_FLAGS_HAS_A0_CHIP) ? 1:0) +#define IS_SH(sc) ((sc->flags & OCE_FLAGS_SH) ? 1 : 0) + +#define is_be_mode_mc(sc) ((sc->function_mode & FNM_FLEX10_MODE) || \ + (sc->function_mode & FNM_UMC_MODE) || \ + (sc->function_mode & FNM_VNIC_MODE)) +#define OCE_FUNCTION_CAPS_SUPER_NIC 0x40 +#define IS_PROFILE_SUPER_NIC(sc) (sc->function_caps & OCE_FUNCTION_CAPS_SUPER_NIC) /* proportion Service Level Interface queues */ @@ -113,8 +123,9 @@ extern int mp_ncpus; /* system's total #define OCE_NCPUS mp_ncpus /* This should be powers of 2. Like 2,4,8 & 16 */ -#define OCE_MAX_RSS 4 /* TODO: 8*/ +#define OCE_MAX_RSS 8 #define OCE_LEGACY_MODE_RSS 4 /* For BE3 Legacy mode*/ +#define is_rss_enabled(sc) ((sc->function_caps & FNC_RSS) && !is_be_mode_mc(sc)) #define OCE_MIN_RQ 1 #define OCE_MIN_WQ 1 @@ -149,6 +160,7 @@ extern int mp_ncpus; /* system's total #define RSS_ENABLE_IPV6 0x4 #define RSS_ENABLE_TCP_IPV6 0x8 +#define INDIRECTION_TABLE_ENTRIES 128 /* flow control definitions */ #define OCE_FC_NONE 0x00000000 @@ -194,6 +206,9 @@ extern int mp_ncpus; /* system's total for (i = 0, wq = sc->wq[0]; i < sc->nwqs; i++, wq = sc->wq[i]) #define for_all_rq_queues(sc, rq, i) \ for (i = 0, rq = sc->rq[0]; i < sc->nrqs; i++, rq = sc->rq[i]) +#define for_all_rss_queues(sc, rq, i) \ + for (i = 0, rq = sc->rq[i + 1]; i < (sc->nrqs - 1); \ + i++, rq = sc->rq[i + 1]) #define for_all_evnt_queues(sc, eq, i) \ for (i = 0, eq = sc->eq[0]; i < sc->neqs; i++, eq = sc->eq[i]) #define for_all_cq_queues(sc, cq, i) \ @@ -671,8 +686,8 @@ struct oce_wq { struct oce_cq *cq; bus_dma_tag_t tag; struct oce_packet_desc pckts[OCE_WQ_PACKET_ARRAY_SIZE]; - uint32_t packets_in; - uint32_t packets_out; + uint32_t pkt_desc_tail; + uint32_t pkt_desc_head; uint32_t wqm_used; boolean_t resched; uint32_t wq_free; @@ -685,6 +700,7 @@ struct oce_wq { struct oce_tx_queue_stats tx_stats; struct buf_ring *br; struct task txtask; + uint32_t db_offset; }; struct rq_config { @@ -765,6 +781,7 @@ struct link_status { #define OCE_FLAGS_BE3 0x00000200 #define OCE_FLAGS_XE201 0x00000400 #define OCE_FLAGS_BE2 0x00000800 +#define OCE_FLAGS_SH 0x00001000 #define OCE_DEV_BE2_CFG_BAR 1 #define OCE_DEV_CFG_BAR 0 @@ -833,11 +850,11 @@ typedef struct oce_softc { uint32_t ncqs; uint32_t nrqs; uint32_t nwqs; + uint32_t nrssqs; uint32_t tx_ring_size; uint32_t rx_ring_size; uint32_t rq_frag_size; - uint32_t rss_enable; uint32_t if_id; /* interface ID */ uint32_t nifs; /* number of adapter interfaces, 0 or 1 */ @@ -873,37 +890,47 @@ typedef struct oce_softc { * BE3: accesses three BAR spaces (CFG, CSR, DB) * Lancer: accesses one BAR space (CFG) **************************************************/ -#define OCE_READ_REG32(sc, space, o) \ +#define OCE_READ_CSR_MPU(sc, space, o) \ ((IS_BE(sc)) ? (bus_space_read_4((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) +#define OCE_READ_REG32(sc, space, o) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG16(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_2((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_2((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG8(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_1((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_1((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) -#define OCE_WRITE_REG32(sc, space, o, v) \ +#define OCE_WRITE_CSR_MPU(sc, space, o, v) \ ((IS_BE(sc)) ? (bus_space_write_4((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) +#define OCE_WRITE_REG32(sc, space, o, v) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o,v)) \ + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG16(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_2((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_2((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG8(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_1((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_1((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) /*********************************************************** @@ -1024,6 +1051,8 @@ int oce_mbox_cq_create(struct oce_cq *cq int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num); void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd, int num); +int oce_get_profile_config(POCE_SOFTC sc); +int oce_get_func_config(POCE_SOFTC sc); void mbx_common_req_hdr_init(struct mbx_hdr *hdr, uint8_t dom, uint8_t port, @@ -1072,6 +1101,9 @@ extern uint32_t oce_max_rsp_handled; /* #define LE_64(x) htole64(x) #define LE_32(x) htole32(x) #define LE_16(x) htole16(x) +#define HOST_64(x) le64toh(x) +#define HOST_32(x) le32toh(x) +#define HOST_16(x) le16toh(x) #define DW_SWAP(x, l) #define IS_ALIGNED(x,a) ((x % a) == 0) #define ADDR_HI(x) ((uint32_t)((uint64_t)(x) >> 32)) @@ -1104,6 +1136,16 @@ static inline uint32_t oce_highbit(uint3 return 0; } +static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc) +{ + if (IS_BE(sc)) + return MPU_EP_SEMAPHORE_BE3; + else if (IS_SH(sc)) + return MPU_EP_SEMAPHORE_SH; + else + return MPU_EP_SEMAPHORE_XE201; +} + #define TRANSCEIVER_DATA_NUM_ELE 64 #define TRANSCEIVER_DATA_SIZE 256 #define TRANSCEIVER_A0_SIZE 128 Modified: stable/9/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/9/sys/dev/oce/oce_mbox.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_mbox.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -727,12 +727,14 @@ oce_rss_itbl_init(POCE_SOFTC sc, struct { int i = 0, j = 0, rc = 0; uint8_t *tbl = fwcmd->params.req.cputable; + struct oce_rq *rq = NULL; - for (j = 0; j < sc->nrqs; j++) { - if (sc->rq[j]->cfg.is_rss_queue) { - tbl[i] = sc->rq[j]->rss_cpuid; - i = i + 1; + for (j = 0; j < INDIRECTION_TABLE_ENTRIES ; j += (sc->nrqs - 1)) { + for_all_rss_queues(sc, rq, i) { + if ((j + i) >= INDIRECTION_TABLE_ENTRIES) + break; + tbl[j + i] = rq->rss_cpuid; } } if (i == 0) { @@ -766,7 +768,7 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 bzero(&mbx, sizeof(struct oce_mbx)); - if (IS_XE201(sc)) { + if (IS_XE201(sc) || IS_SH(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.enable_rss = RSS_ENABLE_UDP_IPV4 | RSS_ENABLE_UDP_IPV6; @@ -1674,8 +1676,11 @@ oce_mbox_create_wq(struct oce_wq *wq) if (IS_XE201(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.if_id = sc->if_id; - } else - version = OCE_MBX_VER_V0; + } else if(IS_BE(sc)) + IS_PROFILE_SUPER_NIC(sc) ? (version = OCE_MBX_VER_V2) + : (version = OCE_MBX_VER_V0); + else + version = OCE_MBX_VER_V2; mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, @@ -1703,6 +1708,10 @@ oce_mbox_create_wq(struct oce_wq *wq) goto error; } wq->wq_id = LE_16(fwcmd->params.rsp.wq_id); + if (version == OCE_MBX_VER_V2) + wq->db_offset = LE_32(fwcmd->params.rsp.db_offset); + else + wq->db_offset = PD_TXULP_DB; error: return rc; @@ -1874,7 +1883,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC /* command post */ rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) { device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); @@ -1894,6 +1903,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC TRANSCEIVER_A2_SIZE); } error: + oce_dma_free(sc, &dma); return rc; } @@ -1935,10 +1945,193 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); } +int +oce_get_profile_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_profile_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + + if (IS_BE2(sc)) + return -1; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_profile_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_profile_config); + bzero(fwcmd, sizeof(struct mbx_common_get_profile_config)); + + if (IS_BE3(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_PROFILE_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_profile_config), + version); + /* fill rest of mbx */ + mbx.u0.s.embedded = 0; + mbx.payload_length = sizeof(struct mbx_common_get_profile_config); + mbx.u0.s.sge_count = 1; + sgl = &mbx.payload.u0.u1.sgl[0]; + sgl->pa_hi = htole32(upper_32_bits(dma.paddr)); + sgl->pa_lo = htole32((dma.paddr) & 0xFFFFFFFF); + sgl->length = htole32(mbx.payload_length); + DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); + + fwcmd->params.req.type = ACTIVE_PROFILE; + + /* command post */ + rc = oce_mbox_post(sc, &mbx, NULL); + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); + goto error; + } + + nic_desc = (struct oce_nic_resc_desc *) fwcmd->params.rsp.resources; + desc_count = HOST_32(fwcmd->params.rsp.desc_count); + for (i = 0; i < desc_count; i++) { + if ((nic_desc->desc_type == NIC_RESC_DESC_TYPE_V0) || + (nic_desc->desc_type == NIC_RESC_DESC_TYPE_V1)) { + nic_desc_valid = TRUE; + break; + } + nic_desc = (struct oce_nic_resc_desc *) \ + ((char *)nic_desc + nic_desc->desc_len); + } + if (!nic_desc_valid) { + rc = -1; + goto error; + } + else { + sc->nwqs = HOST_32(nic_desc->txq_count); + if (sc->nwqs) + sc->nwqs = MIN(sc->nwqs, OCE_MAX_WQ); + else + sc->nwqs = OCE_MAX_WQ; + + } +error: + oce_dma_free(sc, &dma); + return rc; + +} + +int +oce_get_func_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_func_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_func_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_func_config); + bzero(fwcmd, sizeof(struct mbx_common_get_func_config)); + + if (IS_SH(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_FUNCTION_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_func_config), + version); + /* fill rest of mbx */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***