From owner-svn-src-head@FreeBSD.ORG Sun Jun 30 00:42:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 01:05:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 01:21:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 05:10:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 05:12:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 05:25:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 05:56:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 06:04:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 06:05:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 07:37:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 07:46:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 08:54:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 08:59:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 10:38:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 11:10:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 13:14:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 13:17:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 13:23:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 15:00:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 17:59:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 18:42:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:08:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:33:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:36:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:44:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:52:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:52:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 19:53:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 20:09:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 20:27:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 20:29:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 20:51:16 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 21:06:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 23:14:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Jun 30 23:29:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 00:14:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 01:56:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 02:07:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 02:48:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 03:00:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 03:15:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 03:27:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 03:31:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 04:06:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 05:01:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 05:01:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 05:02:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 06:32:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 06:33:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 07:00:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 07:07:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 07:25:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 07:37:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 08:06:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 08:14:44 2013 Return-Path: Delivered-To: svn-src-head@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 9ABA26F9 for ; Mon, 1 Jul 2013 08:14:44 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [IPv6:2607:f8b0:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD2C15DA for ; Mon, 1 Jul 2013 08:14:44 +0000 (UTC) Received: by mail-vc0-f173.google.com with SMTP id ht10so1779361vcb.18 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=f0QU5eQ0gvVcmz6svfZNquNsq0xhJrL89EZm9hqSWcvzQELpgKWvAD8cUtMNiYhXJj waviFwobcOiyL53c8NPiWhTUCJWVo5Ss0mnAcp+z1w2lCRS+3dy/vy5EAjBGhSKT8GAk xYXxWEAMBqrK2dh33sq9E7yqVpE/Q5SnQRAl+vUsMFj4F2w9DpBl2ItQXa+7tMUjFPpr BzjeRnjnW73uHhzAggAdMEcgwwOIqDuasGM0gCsdNY22KYzkOx08RP2vde4BijY8C57C 5rDLzsEeREsWxaCA5H0DsMuFIEoqZBgyb4IKtMtRlHdA5Aw2QIwosu+yAgCL4wpMkpNd ILSA== 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: ALoCoQncHiHuEYcTyksGgDEIQpllIMySReSR7DG54vJ3KGguv7OyXDwUJNj8gw+H0Kyi80AmU+1C X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 08:38:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 13:53:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4BA2C17 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 899121CEA for ; Mon, 1 Jul 2013 13:53:51 +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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 14:49:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 17:06:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 17:23:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 17:31:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 17:32:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 17:57:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 18:41:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 18:45:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 18:59:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 19:17:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A8896192 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 60C8E1CDC for ; Mon, 1 Jul 2013 19:17:05 +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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 20:05:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:16:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:18:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:20:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:33:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:41:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:43:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:49:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 21:58:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 22:21:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 22:38:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 23:13:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Jul 1 23:53:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 05:08:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 05:47:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 06:49:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 06:59:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 07:17:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 07:35:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 07:36:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 07:59:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 08:04:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 08:44:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 10:36:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 13:24:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 14:48:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 15:51:29 2013 Return-Path: Delivered-To: svn-src-head@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 68166BAF for ; Tue, 2 Jul 2013 15:51:29 +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 E3E1C16C2 for ; Tue, 2 Jul 2013 15:51:28 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fs12so5693032lab.26 for ; Tue, 02 Jul 2013 08:51:22 -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=Z+3bpq+nSJFRnT/XXFyCSQRkb0K5aK9cusx3A2xyhIu5KdwuCK6/dy24nhUuiNdRIl N8aVKcWkCti0L7cdA0QhekIFBk77VTTAd0LTyg1v7H+WzaVSTzrQBCFJ+dfjzb94LwKs khfzaPeVThzI8nAFaRzr4ny+72j+baENCa5F0vyhOXJllb1TM0TAxcRREo7JLQyuWb5f OIT1I9s+AQLZrimLyP1kF9EqVnCziiZZrSzV5/sCZn6WfBes7AheGEjVq1IG3ma9HL6q El/K0lszdROz2SN+kHVvkUkcMNA4CVtBrLqbhpOZyO6O0UCFOX3T7eSXCqCCpvh5d/In G6Uw== 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: ALoCoQm992DTbcMbEXcnCq7Z9/0x6FDXqHkWDUOdyaZaYpHjOLXl7uGSWQHnn5ssBAtbPvATMzrJ Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Pedro F. Giffuni" , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 15:51:29 -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-head@FreeBSD.ORG Tue Jul 2 16:00:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 16:33:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 16:39:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 16:49:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 16:58:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:09:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:12:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:17:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:25:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:34:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:52:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 17:59:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 18:09:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 18:12:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 18:45:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 18:54:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 19:35:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 19:42:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 20:17:53 2013 Return-Path: Delivered-To: svn-src-head@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 84F19457 for ; Tue, 2 Jul 2013 20:17:53 +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 09BC81322 for ; Tue, 2 Jul 2013 20:17:52 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id 13so3686053lba.2 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=IgvFfx3JwFG3XvflXHwJNHIZzUi669/dPefacsC9RynJRDTykDolupzfFijywL2JLF 13ZJ8ahpNGdEIlOKTBwkJL1Yz/qlpT0XYlj/u+deqNBMjX6wXdFZoRYino+/RTKAwSgS uY5jkIAbGysrxJeGme2R60RsiwxOODSBWLCr7Y1ewgr8Tc0yEPkCIM7YJ5rmq9wssbUs RNk46VJyT589acVTOFP/RudgcZW/fechN1jV4Ju2w2K5RlMbeTSy9XKu/6YgzgJ6wjTd azgTN8bWX/cuzi7eH/3WnGiunrnRYD/55ntrZQXcSuvZjFhBMX3omAAiTaHwa19R9iRE vFig== 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: ALoCoQnZDD4VaSOAf6evhwlQDxRwrNWCnVBzrp/2Lcn6fOTLAYBDFQEb1H1/44BAPLNpCrDG++Q2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 20:25:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 21:07:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Jul 2 21:41:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 00:19:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 02:24:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 04:11:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 04:40:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 04:44:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 05:54:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 05:57:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 06:08:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 07:03:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 07:31:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 08:24:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 09:23:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 09:28:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 09:48:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 09:51:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 10:31:45 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 10:33:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 10:36:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 12:36:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 12:51:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 12:53:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 12:58:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 14:58:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:26:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:27:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:28:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:35:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:37:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 17:57:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 18:25:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 18:27:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 18:35:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 18:48:45 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 18:53:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 19:08:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:19:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:21:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:22:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:28:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:29:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:42:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:44:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 20:58:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:04:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:07:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:21:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:41:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:45:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:49:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:53:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:57:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 21:58:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:01:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:03:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:05:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:07:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:09:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:12:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:16:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:17:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:18:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:19:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:21:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:22:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:23:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:44:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 22:46:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:05:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:21:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:27:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:38:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:38:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:46:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Jul 3 23:52:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 00:02:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 00:26:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 00:34:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 00:54:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 01:44:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 01:48:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 02:48:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 03:24:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 03:35:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F418C37 for ; Thu, 4 Jul 2013 03:35:31 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by mx1.freebsd.org (Postfix) with ESMTP id DB5FE196C for ; Thu, 4 Jul 2013 03:35:30 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id z5so789926lbh.7 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=SgjHm0HOspatPzHp+jLQHStv8tEiA4AKMb1hw08TFGMttYIN0i/3KQBKakM097ldv/ VtwCDRr47cU/aF3O3oKCoDtBJle5+WhCCi4bGW+lmPHiq2pQy4P3Tmsouf4bewxOY+ex SoPxt6zFrHFvWtxJjzhMrbGyX5WDw8OxB/LCpjiqoGYUlmdVJL46DGY/oJFh3qnbN+G6 OCMA0ppDvC8OpWdfk466SC/R2w4UkMm5yWc8MAcYQ6bmjqoS1rzsNPWGtXQBw7hr9BL2 hnyEXsm/pTxI66EQbicZ3ddcaIih3CnQkYUk8foaNm/Nq3ZWujO3SuZ+cC+k7JjmyWhB DEoQ== 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: ALoCoQmPj1wn3n46uFY3FdO/1d/sII4opT+mK4SKL0dczWCe+lnIAW2JFc81RFdsZyTzSBqU63Nn Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 05:35:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 05:53:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 05:58:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 07:01:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 07:32:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 07:59:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 08:09:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 08:13:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 08:42:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 10:38:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 10:40:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 11:43:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 70B8477 for ; Thu, 4 Jul 2013 11:43:11 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx1.freebsd.org (Postfix) with ESMTP id EBEED1FEE for ; Thu, 4 Jul 2013 11:43:10 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id d10so1144622lbj.0 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=c5CBtcWC8e+zOhG2HJ87R6CRyaY0arf68Xv2K44g/Vv0nKofTQumM22vKglzQKphsd +D5BOBZUk37kzmREIQmyQxv7Hcq/xRegHtj79BdrxIfcpg8X+qpWMDaDGuzwvUbh6gb9 2kklemQpoVkryr6JQWHBWwjUX4NCcWvUT2wQgUmvhleNP8TWkvN4wbB33WK5Ua42p3S7 drna8q9bFOF7bQPBa2vSdfsdlALoo43BRIVaqzVYOGzuSKuZ3DYlOePEox16K/UQA7X8 T1KK7rnDFfga2z+hE1XqOo92y8bnSNDRqXiXkj0yO/r0ZNt6H6KfYFqnRKIo6Rxeo9W8 6vkA== 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: ALoCoQlN7OnXgTHx0KOD0vajfH1CoRvmF3YMsPnZgV2vCOq+1CfNRU4EeafLLA3ISKjAbW2gv7/B Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 11:43:11 -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-head@FreeBSD.ORG Thu Jul 4 12:24:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 12:27:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 12:30:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 12:35:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 13:05:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D712BB75 for ; Thu, 4 Jul 2013 13:05:03 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB2913C6 for ; Thu, 4 Jul 2013 13:05:02 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id d10so1210335lbj.14 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=nZ1jZ7dbKp28n5m0etwMG1b1fsmhHdCB9KKmRT++Om5V3IpRkPIa3v0A1lX9JFBqZQ SpF9PHoBAfCXDxJb0+WTrNx6sv/36gTacMQRplIAD4WpWF7c8W9MYMuXuRQzKXxGDE23 RbqKzjqmEwgVhkCaQBsmD8bgY1mQ4wUsvqvyOroIlBr2HzSk8cEQHR/v7So3VDMj995t 2OpgeMorWYu8vbb39+y88/Ie5q2LU+nABB/FXlw7JbsCnX4Pg5vP2nmzUutCiAXe0piy q+T6XV7M+ZiQW/X8NwVl0IVK+y7Pk5mBCi9flGztMpCTpHB+iUmLh+yJDaxwv7jSUw0R ehwA== 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: ALoCoQljAK4yD7RisVGB7ZLX9WOcMMTMoXVxhr10TMdCmcbHD5sN0hYhTzqjAJMgfwXNrPmj+1x4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 13:05:03 -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-head@FreeBSD.ORG Thu Jul 4 17:50:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:53:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:54:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:55:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:55:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:57:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 17:59:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 18:00:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 18:38:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 18:41:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 18:59:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:01:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:03:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:15:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:44:31 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:45:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 19:47:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:08:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:10:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:12:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:13:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:17:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:40:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 20:57:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 21:12:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 21:16:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 21:19:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 21:31:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 22:26:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 23:01:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Jul 4 23:05:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 00:03:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 00:19:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 00:24:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 00:44:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:18:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:21:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:28:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:30:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:32:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:34:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:37:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:38:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:45:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:49:21 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 01:53:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 03:12:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 06:20:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 06:22:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 06:24:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 06:46:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 06:52:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 08:59:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 10:08:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 13:37:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 14:16:04 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 14:39:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:00:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:08:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:21:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:45:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:47:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 16:49:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:21:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:22:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:23:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:27:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:31:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:35:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:38:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:44:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:45:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:54:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 17:56:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 18:03:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 18:29:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 18:30:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 18:31:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 18:50:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 19:26:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 19:57:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:01:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:13:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:22:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:24:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:37:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 20:51:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 21:30:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 21:31:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 21:32:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 21:40:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 21:41:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 22:04:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 22:10:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 22:24:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 22:25:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 22:42:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 23:10:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 23:13:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 23:16:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Jul 5 23:40:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 00:10:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 00:13:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 01:46:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 04:13:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 04:18:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 04:46:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 07:49:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 08:30:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 08:40:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 18:28:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 18:42:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 19:51:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 19:59:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 20:21:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 20:31:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Jul 6 23:11:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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--