From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 00:30:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2E06B9A; Sun, 4 Nov 2012 00:30:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6DF08FC0A; Sun, 4 Nov 2012 00:30:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA40Ugqv076788; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA40Ug3D076777; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040030.qA40Ug3D076777@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 00:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242537 - stable/8/etc/root X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:30:43 -0000 Author: eadler Date: Sun Nov 4 00:30:42 2012 New Revision: 242537 URL: http://svn.freebsd.org/changeset/base/242537 Log: MFC r242452: The test fails with "exit 1" if /usr/games/fortune doesn't actually exist. Fix that. PR: conf/71994 Approved by: cperciva (implicit) Modified: stable/8/etc/root/dot.login Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/root/dot.login ============================================================================== --- stable/8/etc/root/dot.login Sat Nov 3 23:32:32 2012 (r242536) +++ stable/8/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242537) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# if ( -x /usr/games/fortune ) /usr/games/fortune -s From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 00:30:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0124DB9B; Sun, 4 Nov 2012 00:30:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0C48FC0C; Sun, 4 Nov 2012 00:30:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA40UgD3076791; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA40UgWM076789; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040030.qA40UgWM076789@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 00:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242538 - stable/7/etc/root X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:30:43 -0000 Author: eadler Date: Sun Nov 4 00:30:42 2012 New Revision: 242538 URL: http://svn.freebsd.org/changeset/base/242538 Log: MFC r242452: The test fails with "exit 1" if /usr/games/fortune doesn't actually exist. Fix that. PR: conf/71994 Approved by: cperciva (implicit) Modified: stable/7/etc/root/dot.login Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/root/dot.login ============================================================================== --- stable/7/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242537) +++ stable/7/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242538) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# if ( -x /usr/games/fortune ) /usr/games/fortune -s From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 00:30:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB80B9C; Sun, 4 Nov 2012 00:30:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 037F28FC12; Sun, 4 Nov 2012 00:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA40Ug3V076797; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA40UgXO076793; Sun, 4 Nov 2012 00:30:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040030.qA40UgXO076793@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 00:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242539 - stable/9/etc/root X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:30:43 -0000 Author: eadler Date: Sun Nov 4 00:30:42 2012 New Revision: 242539 URL: http://svn.freebsd.org/changeset/base/242539 Log: MFC r242452: The test fails with "exit 1" if /usr/games/fortune doesn't actually exist. Fix that. PR: conf/71994 Approved by: cperciva (implicit) Modified: stable/9/etc/root/dot.login Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/root/dot.login ============================================================================== --- stable/9/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242538) +++ stable/9/etc/root/dot.login Sun Nov 4 00:30:42 2012 (r242539) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# if ( -x /usr/games/fortune ) /usr/games/fortune -s From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 00:46:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6B7C44F; Sun, 4 Nov 2012 00:46:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D91E8FC08; Sun, 4 Nov 2012 00:46:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA40k2n4079120; Sun, 4 Nov 2012 00:46:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA40k20q079118; Sun, 4 Nov 2012 00:46:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211040046.qA40k20q079118@svn.freebsd.org> From: Adrian Chadd Date: Sun, 4 Nov 2012 00:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242540 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 00:46:02 -0000 Author: adrian Date: Sun Nov 4 00:46:01 2012 New Revision: 242540 URL: http://svn.freebsd.org/changeset/base/242540 Log: Oops - conditionalise that. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sun Nov 4 00:30:42 2012 (r242539) +++ head/sys/dev/ath/if_ath_tx_edma.c Sun Nov 4 00:46:01 2012 (r242540) @@ -449,7 +449,9 @@ ath_edma_tx_proc(void *arg, int npending ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); +#ifdef ATH_DEBUG ath_hal_gettxrawtxdesc(ah, txstatus); +#endif ATH_TXSTATUS_UNLOCK(sc); #ifdef ATH_DEBUG From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 01:00:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 196DA9A8; Sun, 4 Nov 2012 01:00:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01ADD8FC12; Sun, 4 Nov 2012 01:00:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA410ZJt081390; Sun, 4 Nov 2012 01:00:35 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA410ZDj081387; Sun, 4 Nov 2012 01:00:35 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211040100.qA410ZDj081387@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 4 Nov 2012 01:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242541 - in head: etc/root share/skel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 01:00:36 -0000 Author: bapt Date: Sun Nov 4 01:00:35 2012 New Revision: 242541 URL: http://svn.freebsd.org/changeset/base/242541 Log: Change default prompt to show ~ again for the home directory Submitted by: flo Approved by: eadler Modified: head/etc/root/dot.cshrc head/share/skel/dot.cshrc Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Sun Nov 4 00:46:01 2012 (r242540) +++ head/etc/root/dot.cshrc Sun Nov 4 01:00:35 2012 (r242541) @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Sun Nov 4 00:46:01 2012 (r242540) +++ head/share/skel/dot.cshrc Sun Nov 4 01:00:35 2012 (r242541) @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 01:20:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C63B2EE7; Sun, 4 Nov 2012 01:20:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55B98FC08; Sun, 4 Nov 2012 01:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA41K1dA084337; Sun, 4 Nov 2012 01:20:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA41K1mk084324; Sun, 4 Nov 2012 01:20:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040120.qA41K1mk084324@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 01:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242542 - in stable/7: lib/libc/net lib/libdwarf lib/libpam/modules/pam_krb5 sbin/ddb sbin/natd sys/dev/cxgb sys/dev/e1000 tools/regression/lib/libc/nss tools/regression/sockets/unix_cm... X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 01:20:01 -0000 Author: eadler Date: Sun Nov 4 01:20:00 2012 New Revision: 242542 URL: http://svn.freebsd.org/changeset/base/242542 Log: MFC r241844: remove duplicate semicolons where possible. Approved by: cperciva (implicit) Modified: stable/7/lib/libc/net/ip6opt.c stable/7/lib/libdwarf/dwarf_init.c stable/7/lib/libpam/modules/pam_krb5/pam_krb5.c stable/7/sbin/ddb/ddb.c stable/7/sbin/natd/natd.c stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/e1000/if_lem.c stable/7/tools/regression/lib/libc/nss/test-gethostby.c stable/7/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/7/usr.sbin/diskinfo/diskinfo.c stable/7/usr.sbin/ppp/radius.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libdwarf/ (props changed) stable/7/lib/libpam/ (props changed) stable/7/sbin/ddb/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/sys/ (props changed) stable/7/tools/regression/lib/libc/ (props changed) stable/7/tools/regression/sockets/ (props changed) stable/7/usr.sbin/diskinfo/ (props changed) stable/7/usr.sbin/ppp/ (props changed) Modified: stable/7/lib/libc/net/ip6opt.c ============================================================================== --- stable/7/lib/libc/net/ip6opt.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/lib/libc/net/ip6opt.c Sun Nov 4 01:20:00 2012 (r242542) @@ -478,7 +478,7 @@ inet6_opt_append(void *extbuf, socklen_t int inet6_opt_finish(void *extbuf, socklen_t extlen, int offset) { - int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;; + int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0; if (extbuf) { u_int8_t *padp; Modified: stable/7/lib/libdwarf/dwarf_init.c ============================================================================== --- stable/7/lib/libdwarf/dwarf_init.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/lib/libdwarf/dwarf_init.c Sun Nov 4 01:20:00 2012 (r242542) @@ -551,7 +551,7 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E Dwarf_Attribute at; Dwarf_Die die; uint64_t abnum; - uint64_t die_offset = offset;; + uint64_t die_offset = offset; abnum = dwarf_read_uleb128(&d, &offset); Modified: stable/7/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- stable/7/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:20:00 2012 (r242542) @@ -626,7 +626,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int if (krbret != 0) { PAM_LOG("Error krb5_cc_get_principal(): %s", krb5_get_err_text(pam_context, krbret)); - retval = PAM_PERM_DENIED;; + retval = PAM_PERM_DENIED; goto cleanup; } Modified: stable/7/sbin/ddb/ddb.c ============================================================================== --- stable/7/sbin/ddb/ddb.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/sbin/ddb/ddb.c Sun Nov 4 01:20:00 2012 (r242542) @@ -80,7 +80,7 @@ ddb_readfile(char *filename) argc++; spn = strcspn(argv[0], WHITESP); - argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP);; + argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP); argv[0][spn] = '\0'; if (*argv[1] != '\0') argc++; Modified: stable/7/sbin/natd/natd.c ============================================================================== --- stable/7/sbin/natd/natd.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/sbin/natd/natd.c Sun Nov 4 01:20:00 2012 (r242542) @@ -1471,7 +1471,7 @@ static void ParseOption (const char* opt break; case LogIpfwDenied: - logIpfwDenied = yesNoValue;; + logIpfwDenied = yesNoValue; break; case PidFile: Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:20:00 2012 (r242542) @@ -3124,7 +3124,7 @@ cxgb_extension_ioctl(struct cdev *dev, u break; } case CHELSIO_SET_FILTER: { - struct ch_filter *f = (struct ch_filter *)data;; + struct ch_filter *f = (struct ch_filter *)data; struct filter_info *p; unsigned int nfilters = sc->params.mc5.nfilters; Modified: stable/7/sys/dev/e1000/if_lem.c ============================================================================== --- stable/7/sys/dev/e1000/if_lem.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/sys/dev/e1000/if_lem.c Sun Nov 4 01:20:00 2012 (r242542) @@ -3381,7 +3381,7 @@ lem_free_receive_structures(struct adapt static bool lem_rxeof(struct adapter *adapter, int count, int *done) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status = 0, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/7/tools/regression/lib/libc/nss/test-gethostby.c ============================================================================== --- stable/7/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:20:00 2012 (r242542) @@ -565,7 +565,7 @@ hostent_read_snapshot_addr(char *addr, u static int hostent_read_snapshot_func(struct hostent *ht, char *line) { - StringList *sl1, *sl2;; + StringList *sl1, *sl2; char *s, *ps, *ts; int i, rv; Modified: stable/7/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/7/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:20:00 2012 (r242542) @@ -1513,7 +1513,7 @@ t_timestamp_server(int fd1) msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_control = control_un.control; - msg.msg_controllen = sizeof control_un.control;; + msg.msg_controllen = sizeof control_un.control; msg.msg_flags = 0; if (recvmsg_timeout(fd2, &msg, sizeof buf) < 0) Modified: stable/7/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/7/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:20:00 2012 (r242542) @@ -325,7 +325,7 @@ speeddisk(int fd, off_t mediasize, u_int TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; rdsect(fd, b0, sectorsize); T0(); for (i = 0; i < bulk; i++) { Modified: stable/7/usr.sbin/ppp/radius.c ============================================================================== --- stable/7/usr.sbin/ppp/radius.c Sun Nov 4 01:00:35 2012 (r242541) +++ stable/7/usr.sbin/ppp/radius.c Sun Nov 4 01:20:00 2012 (r242542) @@ -784,7 +784,7 @@ radius_Init(struct radius *r) r->mppe.recvkeylen = 0; r->mppe.sendkey = NULL; r->mppe.sendkeylen = 0; - *r->cfg.file = '\0';; + *r->cfg.file = '\0'; log_Printf(LogDEBUG, "Radius: radius_Init\n"); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 01:20:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F8B8D5; Sun, 4 Nov 2012 01:20:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030BF8FC0C; Sun, 4 Nov 2012 01:20:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA41Kv0E084493; Sun, 4 Nov 2012 01:20:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA41KvQc084475; Sun, 4 Nov 2012 01:20:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040120.qA41KvQc084475@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 01:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242543 - in stable/8: lib/libc/net lib/libdwarf lib/libpam/modules/pam_krb5 sbin/ddb sbin/natd sys/dev/cxgb sys/dev/e1000 sys/dev/hpt27xx sys/dev/mps sys/dev/oce sys/dev/sound/pci/hda ... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 01:20:58 -0000 Author: eadler Date: Sun Nov 4 01:20:57 2012 New Revision: 242543 URL: http://svn.freebsd.org/changeset/base/242543 Log: MFC r241844: remove duplicate semicolons where possible. Approved by: cperciva (implicit) Modified: stable/8/lib/libc/net/ip6opt.c stable/8/lib/libdwarf/dwarf_init.c stable/8/lib/libpam/modules/pam_krb5/pam_krb5.c stable/8/sbin/ddb/ddb.c stable/8/sbin/natd/natd.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/e1000/if_lem.c stable/8/sys/dev/hpt27xx/os_bsd.c stable/8/sys/dev/mps/mps_sas.c stable/8/sys/dev/mps/mps_user.c stable/8/sys/dev/oce/oce_if.c stable/8/sys/dev/sound/pci/hda/hdaa.c stable/8/sys/kern/sched_ule.c stable/8/tools/regression/lib/libc/nss/test-gethostby.c stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/8/usr.sbin/diskinfo/diskinfo.c stable/8/usr.sbin/ppp/radius.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sys/ (props changed) stable/8/sys/arm/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/cxgb/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/hpt27xx/ (props changed) stable/8/sys/dev/mps/ (props changed) stable/8/sys/dev/oce/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/usb/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/mips/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/sockets/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/lib/libc/net/ip6opt.c ============================================================================== --- stable/8/lib/libc/net/ip6opt.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/lib/libc/net/ip6opt.c Sun Nov 4 01:20:57 2012 (r242543) @@ -461,7 +461,7 @@ inet6_opt_append(void *extbuf, socklen_t int inet6_opt_finish(void *extbuf, socklen_t extlen, int offset) { - int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;; + int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0; if (extbuf) { u_int8_t *padp; Modified: stable/8/lib/libdwarf/dwarf_init.c ============================================================================== --- stable/8/lib/libdwarf/dwarf_init.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/lib/libdwarf/dwarf_init.c Sun Nov 4 01:20:57 2012 (r242543) @@ -551,7 +551,7 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E Dwarf_Attribute at; Dwarf_Die die; uint64_t abnum; - uint64_t die_offset = offset;; + uint64_t die_offset = offset; abnum = dwarf_read_uleb128(&d, &offset); Modified: stable/8/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- stable/8/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:20:57 2012 (r242543) @@ -633,7 +633,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int if (krbret != 0) { PAM_LOG("Error krb5_cc_get_principal(): %s", krb5_get_err_text(pam_context, krbret)); - retval = PAM_PERM_DENIED;; + retval = PAM_PERM_DENIED; goto cleanup; } Modified: stable/8/sbin/ddb/ddb.c ============================================================================== --- stable/8/sbin/ddb/ddb.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sbin/ddb/ddb.c Sun Nov 4 01:20:57 2012 (r242543) @@ -80,7 +80,7 @@ ddb_readfile(char *filename) argc++; spn = strcspn(argv[0], WHITESP); - argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP);; + argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP); argv[0][spn] = '\0'; if (*argv[1] != '\0') argc++; Modified: stable/8/sbin/natd/natd.c ============================================================================== --- stable/8/sbin/natd/natd.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sbin/natd/natd.c Sun Nov 4 01:20:57 2012 (r242543) @@ -1509,7 +1509,7 @@ static void ParseOption (const char* opt break; case LogIpfwDenied: - logIpfwDenied = yesNoValue;; + logIpfwDenied = yesNoValue; break; case PidFile: Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:20:57 2012 (r242543) @@ -3052,7 +3052,7 @@ cxgb_extension_ioctl(struct cdev *dev, u break; } case CHELSIO_SET_FILTER: { - struct ch_filter *f = (struct ch_filter *)data;; + struct ch_filter *f = (struct ch_filter *)data; struct filter_info *p; unsigned int nfilters = sc->params.mc5.nfilters; Modified: stable/8/sys/dev/e1000/if_lem.c ============================================================================== --- stable/8/sys/dev/e1000/if_lem.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/e1000/if_lem.c Sun Nov 4 01:20:57 2012 (r242543) @@ -3390,7 +3390,7 @@ lem_free_receive_structures(struct adapt static bool lem_rxeof(struct adapter *adapter, int count, int *done) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status = 0, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/8/sys/dev/hpt27xx/os_bsd.c ============================================================================== --- stable/8/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:20:57 2012 (r242543) @@ -133,7 +133,7 @@ HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT } 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);; + 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) { Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/mps/mps_sas.c Sun Nov 4 01:20:57 2012 (r242543) @@ -2020,7 +2020,7 @@ mpssas_scsiio_complete(struct mps_softc if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); } Modified: stable/8/sys/dev/mps/mps_user.c ============================================================================== --- stable/8/sys/dev/mps/mps_user.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/mps/mps_user.c Sun Nov 4 01:20:57 2012 (r242543) @@ -1000,7 +1000,7 @@ mps_user_pass_thru(struct mps_softc *sc, if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); Modified: stable/8/sys/dev/oce/oce_if.c ============================================================================== --- stable/8/sys/dev/oce/oce_if.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/oce/oce_if.c Sun Nov 4 01:20:57 2012 (r242543) @@ -256,7 +256,7 @@ oce_attach(device_t dev) rc = oce_hw_start(sc); if (rc) - goto lro_free;; + goto lro_free; sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:20:57 2012 (r242543) @@ -1148,7 +1148,7 @@ hdaa_widget_parse(struct hdaa_widget *w) w->wclass.pin.config = hda_command(dev, HDA_CMD_GET_CONFIGURATION_DEFAULT(0, w->nid)); w->wclass.pin.cap = hda_command(dev, - HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP));; + HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/sys/kern/sched_ule.c Sun Nov 4 01:20:57 2012 (r242543) @@ -200,7 +200,7 @@ static struct td_sched td_sched0; */ static int sched_interact = SCHED_INTERACT_THRESH; static int realstathz = 127; -static int tickincr = 8 << SCHED_TICK_SHIFT;; +static int tickincr = 8 << SCHED_TICK_SHIFT; static int sched_slice = 12; #ifdef PREEMPTION #ifdef FULL_PREEMPTION Modified: stable/8/tools/regression/lib/libc/nss/test-gethostby.c ============================================================================== --- stable/8/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:20:57 2012 (r242543) @@ -565,7 +565,7 @@ hostent_read_snapshot_addr(char *addr, u static int hostent_read_snapshot_func(struct hostent *ht, char *line) { - StringList *sl1, *sl2;; + StringList *sl1, *sl2; char *s, *ps, *ts; int i, rv; Modified: stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:20:57 2012 (r242543) @@ -1513,7 +1513,7 @@ t_timestamp_server(int fd1) msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_control = control_un.control; - msg.msg_controllen = sizeof control_un.control;; + msg.msg_controllen = sizeof control_un.control; msg.msg_flags = 0; if (recvmsg_timeout(fd2, &msg, sizeof buf) < 0) Modified: stable/8/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:20:57 2012 (r242543) @@ -332,7 +332,7 @@ speeddisk(int fd, off_t mediasize, u_int TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; rdsect(fd, b0, sectorsize); T0(); for (i = 0; i < bulk; i++) { Modified: stable/8/usr.sbin/ppp/radius.c ============================================================================== --- stable/8/usr.sbin/ppp/radius.c Sun Nov 4 01:20:00 2012 (r242542) +++ stable/8/usr.sbin/ppp/radius.c Sun Nov 4 01:20:57 2012 (r242543) @@ -784,7 +784,7 @@ radius_Init(struct radius *r) r->mppe.recvkeylen = 0; r->mppe.sendkey = NULL; r->mppe.sendkeylen = 0; - *r->cfg.file = '\0';; + *r->cfg.file = '\0'; log_Printf(LogDEBUG, "Radius: radius_Init\n"); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 01:21:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48717249; Sun, 4 Nov 2012 01:21:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 282028FC12; Sun, 4 Nov 2012 01:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA41LoOp084673; Sun, 4 Nov 2012 01:21:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA41LnGS084649; Sun, 4 Nov 2012 01:21:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211040121.qA41LnGS084649@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 01:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242544 - in stable/9: lib/libc/net lib/libdwarf lib/libpam/modules/pam_krb5 sbin/ddb sbin/natd sys/cam/ctl sys/dev/cxgb sys/dev/e1000 sys/dev/hpt27xx sys/dev/mps sys/dev/oce sys/dev/so... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 01:21:50 -0000 Author: eadler Date: Sun Nov 4 01:21:49 2012 New Revision: 242544 URL: http://svn.freebsd.org/changeset/base/242544 Log: MFC r241844: remove duplicate semicolons where possible. Approved by: cperciva (implicit) Modified: stable/9/lib/libc/net/ip6opt.c stable/9/lib/libdwarf/dwarf_init.c stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c stable/9/sbin/ddb/ddb.c stable/9/sbin/natd/natd.c stable/9/sys/cam/ctl/ctl.c stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/hpt27xx/os_bsd.c stable/9/sys/dev/mps/mps_sas.c stable/9/sys/dev/mps/mps_user.c stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/sound/pci/hda/hdaa.c stable/9/sys/kern/sched_ule.c stable/9/sys/mips/rmi/xlr_i2c.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/tools/regression/lib/libc/nss/test-gethostby.c stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c stable/9/usr.sbin/diskinfo/diskinfo.c stable/9/usr.sbin/ppp/radius.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libdwarf/ (props changed) stable/9/lib/libpam/ (props changed) stable/9/sbin/ddb/ (props changed) stable/9/sbin/natd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/fs/ (props changed) stable/9/tools/regression/lib/libc/ (props changed) stable/9/tools/regression/sockets/ (props changed) stable/9/usr.sbin/diskinfo/ (props changed) stable/9/usr.sbin/ppp/ (props changed) Modified: stable/9/lib/libc/net/ip6opt.c ============================================================================== --- stable/9/lib/libc/net/ip6opt.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libc/net/ip6opt.c Sun Nov 4 01:21:49 2012 (r242544) @@ -461,7 +461,7 @@ inet6_opt_append(void *extbuf, socklen_t int inet6_opt_finish(void *extbuf, socklen_t extlen, int offset) { - int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;; + int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0; if (extbuf) { u_int8_t *padp; Modified: stable/9/lib/libdwarf/dwarf_init.c ============================================================================== --- stable/9/lib/libdwarf/dwarf_init.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libdwarf/dwarf_init.c Sun Nov 4 01:21:49 2012 (r242544) @@ -551,7 +551,7 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E Dwarf_Attribute at; Dwarf_Die die; uint64_t abnum; - uint64_t die_offset = offset;; + uint64_t die_offset = offset; abnum = dwarf_read_uleb128(&d, &offset); Modified: stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c ============================================================================== --- stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/lib/libpam/modules/pam_krb5/pam_krb5.c Sun Nov 4 01:21:49 2012 (r242544) @@ -633,7 +633,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int if (krbret != 0) { PAM_LOG("Error krb5_cc_get_principal(): %s", krb5_get_err_text(pam_context, krbret)); - retval = PAM_PERM_DENIED;; + retval = PAM_PERM_DENIED; goto cleanup; } Modified: stable/9/sbin/ddb/ddb.c ============================================================================== --- stable/9/sbin/ddb/ddb.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sbin/ddb/ddb.c Sun Nov 4 01:21:49 2012 (r242544) @@ -80,7 +80,7 @@ ddb_readfile(char *filename) argc++; spn = strcspn(argv[0], WHITESP); - argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP);; + argv[1] = argv[0] + spn + strspn(argv[0] + spn, WHITESP); argv[0][spn] = '\0'; if (*argv[1] != '\0') argc++; Modified: stable/9/sbin/natd/natd.c ============================================================================== --- stable/9/sbin/natd/natd.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sbin/natd/natd.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1509,7 +1509,7 @@ static void ParseOption (const char* opt break; case LogIpfwDenied: - logIpfwDenied = yesNoValue;; + logIpfwDenied = yesNoValue; break; case PidFile: Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/cam/ctl/ctl.c Sun Nov 4 01:21:49 2012 (r242544) @@ -480,7 +480,7 @@ ctl_isc_handler_finish_xfer(struct ctl_s memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data, sizeof(ctsio->sense_data)); memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));; + &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen)); STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); ctl_wakeup_thread(); } @@ -12681,7 +12681,7 @@ ctl_process_done(union ctl_io *io, int h */ memcpy(&msg.scsi.lbalen, &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(msg.scsi.lbalen));; + sizeof(msg.scsi.lbalen)); if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, sizeof(msg), 0) > CTL_HA_STATUS_SUCCESS) { Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/cxgb/cxgb_main.c Sun Nov 4 01:21:49 2012 (r242544) @@ -2984,7 +2984,7 @@ cxgb_extension_ioctl(struct cdev *dev, u break; } case CHELSIO_SET_FILTER: { - struct ch_filter *f = (struct ch_filter *)data;; + struct ch_filter *f = (struct ch_filter *)data; struct filter_info *p; unsigned int nfilters = sc->params.mc5.nfilters; Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/e1000/if_lem.c Sun Nov 4 01:21:49 2012 (r242544) @@ -3455,7 +3455,7 @@ lem_free_receive_structures(struct adapt static bool lem_rxeof(struct adapter *adapter, int count, int *done) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status = 0, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/9/sys/dev/hpt27xx/os_bsd.c ============================================================================== --- stable/9/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/hpt27xx/os_bsd.c Sun Nov 4 01:21:49 2012 (r242544) @@ -133,7 +133,7 @@ HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT } 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);; + 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) { Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/mps/mps_sas.c Sun Nov 4 01:21:49 2012 (r242544) @@ -2020,7 +2020,7 @@ mpssas_scsiio_complete(struct mps_softc if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); } Modified: stable/9/sys/dev/mps/mps_user.c ============================================================================== --- stable/9/sys/dev/mps/mps_user.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/mps/mps_user.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1000,7 +1000,7 @@ mps_user_pass_thru(struct mps_softc *sc, if (cm->cm_flags & MPS_CM_FLAGS_DATAIN) dir = BUS_DMASYNC_POSTREAD; else if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) - dir = BUS_DMASYNC_POSTWRITE;; + dir = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap); Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/oce/oce_if.c Sun Nov 4 01:21:49 2012 (r242544) @@ -256,7 +256,7 @@ oce_attach(device_t dev) rc = oce_hw_start(sc); if (rc) - goto lro_free;; + goto lro_free; sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, Modified: stable/9/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/dev/sound/pci/hda/hdaa.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1148,7 +1148,7 @@ hdaa_widget_parse(struct hdaa_widget *w) w->wclass.pin.config = hda_command(dev, HDA_CMD_GET_CONFIGURATION_DEFAULT(0, w->nid)); w->wclass.pin.cap = hda_command(dev, - HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP));; + HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/kern/sched_ule.c Sun Nov 4 01:21:49 2012 (r242544) @@ -202,7 +202,7 @@ static struct td_sched td_sched0; */ static int sched_interact = SCHED_INTERACT_THRESH; static int realstathz = 127; -static int tickincr = 8 << SCHED_TICK_SHIFT;; +static int tickincr = 8 << SCHED_TICK_SHIFT; static int sched_slice = 12; #ifdef PREEMPTION #ifdef FULL_PREEMPTION Modified: stable/9/sys/mips/rmi/xlr_i2c.c ============================================================================== --- stable/9/sys/mips/rmi/xlr_i2c.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/mips/rmi/xlr_i2c.c Sun Nov 4 01:21:49 2012 (r242544) @@ -332,7 +332,7 @@ retry: continue; if (pos >= len) - break;; + break; } *sent = len - 1; return 0; Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sun Nov 4 01:21:49 2012 (r242544) @@ -723,7 +723,7 @@ void ipoib_mcast_restart_task(struct wor void ipoib_mcast_restart(struct ipoib_dev_priv *priv) { struct ifnet *dev = priv->dev; - struct ifmultiaddr *ifma;; + struct ifmultiaddr *ifma; struct ipoib_mcast *mcast, *tmcast; LIST_HEAD(remove_list); struct ib_sa_mcmember_rec rec; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Nov 4 01:21:49 2012 (r242544) @@ -101,7 +101,7 @@ u64 mlx4_en_mac_to_u64(u8 *addr) static int mlx4_en_cache_mclist(struct net_device *dev, u64 **mcaddrp) { - struct ifmultiaddr *ifma;; + struct ifmultiaddr *ifma; u64 *mcaddr; int cnt; int i; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Sun Nov 4 01:21:49 2012 (r242544) @@ -405,7 +405,7 @@ static inline int invalid_cqe(struct mlx } if (unlikely(cqe->badfcs_enc & MLX4_CQE_BAD_FCS)) { en_dbg(RX_ERR, priv, "Accepted frame with bad FCS\n"); - return 1;; + return 1; } return 0; Modified: stable/9/tools/regression/lib/libc/nss/test-gethostby.c ============================================================================== --- stable/9/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/tools/regression/lib/libc/nss/test-gethostby.c Sun Nov 4 01:21:49 2012 (r242544) @@ -565,7 +565,7 @@ hostent_read_snapshot_addr(char *addr, u static int hostent_read_snapshot_func(struct hostent *ht, char *line) { - StringList *sl1, *sl2;; + StringList *sl1, *sl2; char *s, *ps, *ts; int i, rv; Modified: stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/tools/regression/sockets/unix_cmsg/unix_cmsg.c Sun Nov 4 01:21:49 2012 (r242544) @@ -1513,7 +1513,7 @@ t_timestamp_server(int fd1) msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_control = control_un.control; - msg.msg_controllen = sizeof control_un.control;; + msg.msg_controllen = sizeof control_un.control; msg.msg_flags = 0; if (recvmsg_timeout(fd2, &msg, sizeof buf) < 0) Modified: stable/9/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/9/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/usr.sbin/diskinfo/diskinfo.c Sun Nov 4 01:21:49 2012 (r242544) @@ -335,7 +335,7 @@ speeddisk(int fd, off_t mediasize, u_int TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; rdsect(fd, b0, sectorsize); T0(); for (i = 0; i < bulk; i++) { Modified: stable/9/usr.sbin/ppp/radius.c ============================================================================== --- stable/9/usr.sbin/ppp/radius.c Sun Nov 4 01:20:57 2012 (r242543) +++ stable/9/usr.sbin/ppp/radius.c Sun Nov 4 01:21:49 2012 (r242544) @@ -784,7 +784,7 @@ radius_Init(struct radius *r) r->mppe.recvkeylen = 0; r->mppe.sendkey = NULL; r->mppe.sendkeylen = 0; - *r->cfg.file = '\0';; + *r->cfg.file = '\0'; log_Printf(LogDEBUG, "Radius: radius_Init\n"); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 03:19:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C2F361B; Sun, 4 Nov 2012 03:19:08 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 106BB8FC0A; Sun, 4 Nov 2012 03:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA43J7Rv002629; Sun, 4 Nov 2012 03:19:07 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA43J7NL002627; Sun, 4 Nov 2012 03:19:07 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211040319.qA43J7NL002627@svn.freebsd.org> From: Warren Block Date: Sun, 4 Nov 2012 03:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242546 - head/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 03:19:08 -0000 Author: wblock (doc committer) Date: Sun Nov 4 03:19:07 2012 New Revision: 242546 URL: http://svn.freebsd.org/changeset/base/242546 Log: Add an example showing the use of gnop(8) to skip over header data. PR: kern/145999 Reviewed by: mjg MFC after: 1 week Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sun Nov 4 02:52:03 2012 (r242545) +++ head/sbin/mdconfig/mdconfig.8 Sun Nov 4 03:19:07 2012 (r242546) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd November 3, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -267,6 +267,18 @@ are implied device, and then mount the new memory disk: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt +.Pp +.Ed +Create a file-backed device from a hard disk image that begins +with 512K of raw header information. +.Xr gnop 8 +is used to skip over the header information, positioning +.Pa md1.nop +to the start of the filesystem in the image. +.Bd -literal -offset indent +mdconfig -f diskimage.img -u 1 +gnop create -o 512K md1 +mount /dev/md1.nop /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 06:35:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D68F345A; Sun, 4 Nov 2012 06:35:08 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD6018FC08; Sun, 4 Nov 2012 06:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA46Z8ke010234; Sun, 4 Nov 2012 06:35:08 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA46Z8Y8010232; Sun, 4 Nov 2012 06:35:08 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211040635.qA46Z8Y8010232@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 06:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242548 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 06:35:09 -0000 Author: peter Date: Sun Nov 4 06:35:08 2012 New Revision: 242548 URL: http://svn.freebsd.org/changeset/base/242548 Log: MFC r242089: limit of 15 -> 63 logical volumes Modified: stable/9/sys/dev/ciss/cissvar.h Modified: stable/9/sys/dev/ciss/cissvar.h ============================================================================== --- stable/9/sys/dev/ciss/cissvar.h Sun Nov 4 06:24:13 2012 (r242547) +++ stable/9/sys/dev/ciss/cissvar.h Sun Nov 4 06:35:08 2012 (r242548) @@ -46,7 +46,7 @@ typedef STAILQ_HEAD(, ciss_request) cr_q /* * Maximum number of logical drives we support. */ -#define CISS_MAX_LOGICAL 15 +#define CISS_MAX_LOGICAL 63 /* * Maximum number of physical devices we support. From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 07:09:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02D7C78F; Sun, 4 Nov 2012 07:09:40 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 065408FC08; Sun, 4 Nov 2012 07:09:38 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-47-18.lns20.adl2.internode.on.net [118.210.47.18]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id qA473iXZ076670 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 4 Nov 2012 17:33:51 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: svn commit: r242520 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20121103211518.GH73505@kib.kiev.ua> Date: Sun, 4 Nov 2012 17:33:43 +1030 Content-Transfer-Encoding: 7bit Message-Id: <3CC9C9A8-20F2-41E6-A7AC-C829AB595D6B@gsoft.com.au> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121103210818.GY70741@FreeBSD.org> <20121103211518.GH73505@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1499) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 07:09:40 -0000 On 04/11/2012, at 7:45, Konstantin Belousov wrote: > On Sun, Nov 04, 2012 at 01:08:18AM +0400, Gleb Smirnoff wrote: >> On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: >> A> Author: alfred >> A> Date: Sat Nov 3 18:21:40 2012 >> A> New Revision: 242520 >> A> URL: http://svn.freebsd.org/changeset/base/242520 >> A> >> A> Log: >> A> Retire MAXUSERS. >> A> >> A> Approved by: peter, meetBSD >> >> This mechanical rename to meaningless (from viewpoint of average >> operating system user) name is not a retirement. It is just a stupid >> rename. >> >> FreeBSD source tree isn't a place for stupid jokes. Please back this >> out. > > Seconded. Unfortunately, this cannot be reverted. At least r242520 shall > stay as is in repo. r242520 is actually.. Author: mckusick Date: Sat Nov 3 18:55:55 2012 UTC (12 hours, 6 minutes ago) Changed paths: 2 Log Message: When a file is first being written, the dynamic block reallocation (implemented by ffs_reallocblks_ufs[12]) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. This change compensates for this problem by noting that the first indirect block should be left immediately following the last direct block. It then tries to start a new cluster of contiguous blocks (referenced by the indirect block) immediately following the indirect block. We should also do this for other indirect block boundaries, but it is only important for the first one. Suggested by: Bruce Evans MFC: 2 weeks ie it is a joke :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 08:47:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F4894DB; Sun, 4 Nov 2012 08:47:42 +0000 (UTC) (envelope-from gblach@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF80A8FC12; Sun, 4 Nov 2012 08:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA48lf80035893; Sun, 4 Nov 2012 08:47:41 GMT (envelope-from gblach@svn.freebsd.org) Received: (from gblach@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA48lftR035890; Sun, 4 Nov 2012 08:47:41 GMT (envelope-from gblach@svn.freebsd.org) Message-Id: <201211040847.qA48lftR035890@svn.freebsd.org> From: Grzegorz Blach Date: Sun, 4 Nov 2012 08:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242549 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 08:47:42 -0000 Author: gblach (ports committer) Date: Sun Nov 4 08:47:41 2012 New Revision: 242549 URL: http://svn.freebsd.org/changeset/base/242549 Log: - Add my mentor relationships to committers-ports.dot - Add myself to calendar.freebsd Approved by: tabthorpe (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Nov 4 06:35:08 2012 (r242548) +++ head/share/misc/committers-ports.dot Sun Nov 4 08:47:41 2012 (r242549) @@ -94,6 +94,7 @@ flz [label="Florent Thoumie\nflz@FreeBSD gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2006/12/05"] gahr [label="Pietro Cerutti\ngahr@FreeBSD.org\n2008/02/20"] garga [label="Renato Botelho\ngarga@FreeBSD.org\n2005/07/11"] +gblach [label="Grzegorz Blach\ngblach@FreeBSD.org\n2012/11/03"] gerald [label="Gerald Pfeifer\ngerald@FreeBSD.org\n2002/04/03"] gjb [label="Glen Barber\ngjb@FreeBSD.org\n2012/06/19"] glarkin [label="Greg Larkin\nglarkin@FreeBSD.org\n2008/07/17"] @@ -255,6 +256,7 @@ clsung -> tabthorpe crees -> gjb crees -> jgh crees -> madpilot +crees -> gblach culot -> jase @@ -476,6 +478,7 @@ tabthorpe -> madpilot tabthorpe -> pgj tabthorpe -> rene tabthorpe -> zi +tabthorpe -> gblach thierry -> jadawin Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Nov 4 06:35:08 2012 (r242548) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Nov 4 08:47:41 2012 (r242549) @@ -297,6 +297,7 @@ 09/30 Hiten M. Pandya born in Dar-es-Salaam, Tanzania, East Africa, 1986 09/30 Third quarter status reports are due on 10/15 10/02 Beat Gaetzi born in Zurich, Switzerland, 1980 +10/02 Grzegorz Blach born in Starachowice, Poland, 1985 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 09:08:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C3C7C64; Sun, 4 Nov 2012 09:08:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 014E88FC0A; Sun, 4 Nov 2012 09:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA498HMY040741; Sun, 4 Nov 2012 09:08:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA498HAl040739; Sun, 4 Nov 2012 09:08:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211040908.qA498HAl040739@svn.freebsd.org> From: Joel Dahl Date: Sun, 4 Nov 2012 09:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242550 - head/usr.bin/du X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 09:08:18 -0000 Author: joel (doc committer) Date: Sun Nov 4 09:08:17 2012 New Revision: 242550 URL: http://svn.freebsd.org/changeset/base/242550 Log: Add a few basic examples. Modified: head/usr.bin/du/du.1 Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Sun Nov 4 08:47:41 2012 (r242549) +++ head/usr.bin/du/du.1 Sun Nov 4 09:08:17 2012 (r242550) @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd July 18, 2012 +.Dd November 4, 2012 .Dt DU 1 .Os .Sh NAME @@ -191,6 +191,24 @@ or options are not specified, the block counts will be displayed in 512-byte blocks. .El +.Sh EXAMPLES +Show disk usage for all files in the current directory. Output is in +human-readable form: +.Pp +.Dl # du -ah +.Pp +Summarize disk usage in the current directory: +.Pp +.Dl # du -hs +.Pp +Summarize disk usage for a specific directory: +.Pp +.Dl # du -hs /home +.Pp +Show name and size of all C files in a specific directory. Also display a +grand total at the end: +.Pp +.Dl # du -ch /usr/src/sys/kern/*.c .Sh SEE ALSO .Xr df 1 , .Xr chflags 2 , From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 09:27:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEA0418B; Sun, 4 Nov 2012 09:27:01 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6AAE8FC0A; Sun, 4 Nov 2012 09:27:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA49R1vJ045147; Sun, 4 Nov 2012 09:27:01 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA49R1OS045145; Sun, 4 Nov 2012 09:27:01 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211040927.qA49R1OS045145@svn.freebsd.org> From: Joel Dahl Date: Sun, 4 Nov 2012 09:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242551 - head/usr.bin/du X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 09:27:01 -0000 Author: joel (doc committer) Date: Sun Nov 4 09:27:01 2012 New Revision: 242551 URL: http://svn.freebsd.org/changeset/base/242551 Log: New sentence, new line. Submitted by: brueffer Modified: head/usr.bin/du/du.1 Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Sun Nov 4 09:08:17 2012 (r242550) +++ head/usr.bin/du/du.1 Sun Nov 4 09:27:01 2012 (r242551) @@ -192,8 +192,8 @@ options are not specified, the block cou blocks. .El .Sh EXAMPLES -Show disk usage for all files in the current directory. Output is in -human-readable form: +Show disk usage for all files in the current directory. +Output is in human-readable form: .Pp .Dl # du -ah .Pp @@ -205,8 +205,8 @@ Summarize disk usage for a specific dire .Pp .Dl # du -hs /home .Pp -Show name and size of all C files in a specific directory. Also display a -grand total at the end: +Show name and size of all C files in a specific directory. +Also display a grand total at the end: .Pp .Dl # du -ch /usr/src/sys/kern/*.c .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 11:46:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECDB5189; Sun, 4 Nov 2012 11:46:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D304F8FC08; Sun, 4 Nov 2012 11:46:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4BkHeJ076715; Sun, 4 Nov 2012 11:46:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4BkHjL076713; Sun, 4 Nov 2012 11:46:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211041146.qA4BkHjL076713@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Nov 2012 11:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242552 - stable/9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 11:46:18 -0000 Author: dim Date: Sun Nov 4 11:46:17 2012 New Revision: 242552 URL: http://svn.freebsd.org/changeset/base/242552 Log: MFC r236258: For clang, similar to r236137, enable gnu hash generation for dynamic ELF binaries on x86. MFC r238863: Similar to r238472, let clang pass --enable-new-dtags to the linker invocation by default. Also make sure --hash-style=both is passed for the same arches as gcc, e.g. arm, sparc and x86. Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 09:27:01 2012 (r242551) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 11:46:17 2012 (r242552) @@ -4760,6 +4760,11 @@ void freebsd::Link::ConstructJob(Compila CmdArgs.push_back("-dynamic-linker"); CmdArgs.push_back("/libexec/ld-elf.so.1"); } + llvm::Triple::ArchType Arch = getToolChain().getArch(); + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || + Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) + CmdArgs.push_back("--hash-style=both"); + CmdArgs.push_back("--enable-new-dtags"); } // When building 32-bit code on FreeBSD/amd64, we have to explicitly From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 12:05:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 583EE70E; Sun, 4 Nov 2012 12:05:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4E38FC15; Sun, 4 Nov 2012 12:05:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4C5tEQ080771; Sun, 4 Nov 2012 12:05:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4C5tGE080769; Sun, 4 Nov 2012 12:05:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211041205.qA4C5tGE080769@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Nov 2012 12:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242553 - stable/9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 12:05:55 -0000 Author: dim Date: Sun Nov 4 12:05:54 2012 New Revision: 242553 URL: http://svn.freebsd.org/changeset/base/242553 Log: MFC r238864: Similar to what is already done for Linux, make clang not complain about unused -g, -emit-llvm or -w arguments when doing linking. E.g. invoking "clang -g foo.o -o foo" will now be silent. Reported by: Jakub Lach Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 11:46:17 2012 (r242552) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sun Nov 4 12:05:54 2012 (r242553) @@ -4745,6 +4745,14 @@ void freebsd::Link::ConstructJob(Compila const Driver &D = getToolChain().getDriver(); ArgStringList CmdArgs; + // Silence warning for "clang -g foo.o -o foo" + Args.ClaimAllArgs(options::OPT_g_Group); + // and "clang -emit-llvm foo.o -o foo" + Args.ClaimAllArgs(options::OPT_emit_llvm); + // and for "clang -w foo.o -o foo". Other warning options are already + // handled somewhere else. + Args.ClaimAllArgs(options::OPT_w); + if (!D.SysRoot.empty()) CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 12:48:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D058474; Sun, 4 Nov 2012 12:48:00 +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 6D3108FC0A; Sun, 4 Nov 2012 12:47:59 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 91898AC5; Sun, 4 Nov 2012 13:46:27 +0100 (CET) Date: Sun, 4 Nov 2012 13:48:43 +0100 From: Pawel Jakub Dawidek To: Jaakko Heinonen Subject: Re: svn commit: r242511 - head/sbin/fsck_msdosfs Message-ID: <20121104124843.GR1399@garage.freebsd.pl> References: <201211030918.qA39IcH6030403@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RpDyejMaDGJhP2PU" Content-Disposition: inline In-Reply-To: <201211030918.qA39IcH6030403@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 12:48:00 -0000 --RpDyejMaDGJhP2PU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 03, 2012 at 09:18:38AM +0000, Jaakko Heinonen wrote: > Author: jh > Date: Sat Nov 3 09:18:37 2012 > New Revision: 242511 > URL: http://svn.freebsd.org/changeset/base/242511 >=20 > Log: > Print a newline after the error message. > =20 > PR: bin/168447 > Submitted by: Boris Kochergin >=20 > Modified: > head/sbin/fsck_msdosfs/check.c >=20 > Modified: head/sbin/fsck_msdosfs/check.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/fsck_msdosfs/check.c Sat Nov 3 04:56:08 2012 (r242510) > +++ head/sbin/fsck_msdosfs/check.c Sat Nov 3 09:18:37 2012 (r242511) > @@ -68,6 +68,7 @@ checkfilesys(const char *fname) > =20 > if (dosfs < 0) { > perr("Can't open `%s'", fname); > + printf("\n"); Why not just add \n to perr()? Doesn't perr() print at stderr, not stdout? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --RpDyejMaDGJhP2PU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCWZCsACgkQForvXbEpPzSpfwCdEnH+/G6EAlerUlCQL6i6nEOn MHEAoOL+Pq9GgudAUtl1lmwElOh5++Lq =+1JO -----END PGP SIGNATURE----- --RpDyejMaDGJhP2PU-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 12:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 742365EA; Sun, 4 Nov 2012 12:49:37 +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 30D878FC0A; Sun, 4 Nov 2012 12:49:37 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BE763AC7; Sun, 4 Nov 2012 13:48:05 +0100 (CET) Date: Sun, 4 Nov 2012 13:50:22 +0100 From: Pawel Jakub Dawidek To: Michael Tuexen Subject: Re: svn commit: r242512 - head/lib/libc/net Message-ID: <20121104125021.GS1399@garage.freebsd.pl> References: <201211031322.qA3DMQPg072355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZcSDOt7TZFizttpn" Content-Disposition: inline In-Reply-To: <201211031322.qA3DMQPg072355@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 12:49:37 -0000 --ZcSDOt7TZFizttpn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 03, 2012 at 01:22:26PM +0000, Michael Tuexen wrote: > Author: tuexen > Date: Sat Nov 3 13:22:25 2012 > New Revision: 242512 > URL: http://svn.freebsd.org/changeset/base/242512 >=20 > Log: > Fix errno in a couple of error cases. > =20 > MFC after: 3 days >=20 > Modified: > head/lib/libc/net/sctp_sys_calls.c >=20 > Modified: head/lib/libc/net/sctp_sys_calls.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/lib/libc/net/sctp_sys_calls.c Sat Nov 3 09:18:37 2012 (r242511) > +++ head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 13:22:25 2012 (r242512) > @@ -449,6 +449,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id,=20 > opt_len =3D (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses= )); > addrs =3D calloc(1, (size_t)opt_len); > if (addrs =3D=3D NULL) { > + errno =3D ENOMEM; > return (-1); > } > addrs->sget_assoc_id =3D id; > @@ -777,6 +778,7 @@ sctp_sendx(int sd, const void *msg, size > } > buf =3D malloc(len); > if (buf =3D=3D NULL) { > + errno =3D ENOMEM; > return (-1); > } > aa =3D (int *)buf; > @@ -1052,7 +1054,7 @@ sctp_sendv(int sd, > CMSG_SPACE(sizeof(struct sctp_authinfo)) + > (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); > if (cmsgbuf =3D=3D NULL) { > - errno =3D ENOBUFS; > + errno =3D ENOMEM; > return (-1); > } Both calloc(3) and malloc(3) should set errno to ENOMEM for you, so all those three are redundant. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ZcSDOt7TZFizttpn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCWZIwACgkQForvXbEpPzSJ+ACeKYY0NnH1FrVKW50/j7MWWaYJ YisAoJS6rQ1ttw+0/rD2UhPrGIU6rIwG =nf7n -----END PGP SIGNATURE----- --ZcSDOt7TZFizttpn-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:29:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4380F95; Sun, 4 Nov 2012 13:29:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217088FC0C; Sun, 4 Nov 2012 13:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DTmR4097283; Sun, 4 Nov 2012 13:29:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DTl4V097278; Sun, 4 Nov 2012 13:29:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041329.qA4DTl4V097278@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242554 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:29:48 -0000 Author: avg Date: Sun Nov 4 13:29:47 2012 New Revision: 242554 URL: http://svn.freebsd.org/changeset/base/242554 Log: MFC r241286,r242135: zfs_mount: taste geom providers for root pool config Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 13:29:47 2012 (r242554) @@ -3167,8 +3167,8 @@ spa_create(const char *pool, nvlist_t *n return (0); } -#if defined(sun) #ifdef _KERNEL +#if defined(sun) /* * Get the root pool information from the root disk, then import the root pool * during the system boot up time. @@ -3370,8 +3370,115 @@ out: return (error); } -#endif +#else + +extern int +vdev_geom_read_pool_label(const char *name, nvlist_t **config); + +static nvlist_t * +spa_generate_rootconf(const char *name) +{ + nvlist_t *config; + nvlist_t *nvtop, *nvroot; + uint64_t pgid; + + if (vdev_geom_read_pool_label(name, &config) != 0) + return (NULL); + + /* + * Add this top-level vdev to the child array. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, + &pgid) == 0); + + /* + * Put this pool's top-level vdevs into a root vdev. + */ + VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0); + VERIFY(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE, + VDEV_TYPE_ROOT) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_GUID, pgid) == 0); + VERIFY(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, + &nvtop, 1) == 0); + + /* + * Replace the existing vdev_tree with the new root vdev in + * this pool's configuration (remove the old, add the new). + */ + VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + nvlist_free(nvroot); + return (config); +} + +int +spa_import_rootpool(const char *name) +{ + spa_t *spa; + vdev_t *rvd, *bvd, *avd = NULL; + nvlist_t *config, *nvtop; + uint64_t txg; + char *pname; + int error; + + /* + * Read the label from the boot device and generate a configuration. + */ + config = spa_generate_rootconf(name); + if (config == NULL) { + cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", + name); + return (EIO); + } + + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); + + mutex_enter(&spa_namespace_lock); + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so that we + * can replace it with the correct config we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + spa->spa_is_root = B_TRUE; + spa->spa_import_flags = ZFS_IMPORT_VERBATIM; + + /* + * Build up a vdev tree based on the boot device's label config. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + error = spa_config_parse(spa, &rvd, nvtop, NULL, 0, + VDEV_ALLOC_ROOTPOOL); + spa_config_exit(spa, SCL_ALL, FTAG); + if (error) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); + cmn_err(CE_NOTE, "Can not parse the config for pool '%s'", + pname); + return (error); + } + + error = 0; + spa_history_log_version(spa, LOG_POOL_IMPORT); +out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + vdev_free(rvd); + spa_config_exit(spa, SCL_ALL, FTAG); + mutex_exit(&spa_namespace_lock); + + return (error); +} + #endif /* sun */ +#endif /* * Import a non-root pool into the system. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 13:29:47 2012 (r242554) @@ -419,7 +419,11 @@ extern int spa_get_stats(const char *poo char *altroot, size_t buflen); extern int spa_create(const char *pool, nvlist_t *config, nvlist_t *props, const char *history_str, nvlist_t *zplprops); +#if defined(sun) extern int spa_import_rootpool(char *devpath, char *devid); +#else +extern int spa_import_rootpool(const char *name); +#endif extern int spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags); extern nvlist_t *spa_tryimport(nvlist_t *tryconfig); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 13:29:47 2012 (r242554) @@ -175,17 +175,11 @@ vdev_geom_detach(void *arg, int flag __u static uint64_t nvlist_get_guid(nvlist_t *list) { - nvpair_t *elem = NULL; uint64_t value; - while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { - if (nvpair_type(elem) == DATA_TYPE_UINT64 && - strcmp(nvpair_name(elem), "guid") == 0) { - VERIFY(nvpair_value_uint64(elem, &value) == 0); - return (value); - } - } - return (0); + value = 0; + nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, &value); + return (value); } static int @@ -223,8 +217,16 @@ vdev_geom_io(struct g_consumer *cp, int return (error); } -static uint64_t -vdev_geom_read_guid(struct g_consumer *cp) +static void +vdev_geom_taste_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while tasting %s.", __func__, + cp->provider->name)); +} + +static int +vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { struct g_provider *pp; vdev_label_t *label; @@ -232,13 +234,13 @@ vdev_geom_read_guid(struct g_consumer *c size_t buflen; uint64_t psize; off_t offset, size; - uint64_t guid; + uint64_t guid, state, txg; int error, l, len; g_topology_assert_not(); pp = cp->provider; - ZFS_LOG(1, "Reading guid from %s...", pp->name); + ZFS_LOG(1, "Reading config from %s...", pp->name); psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); @@ -250,8 +252,8 @@ vdev_geom_read_guid(struct g_consumer *c label = kmem_alloc(size, KM_SLEEP); buflen = sizeof(label->vl_vdev_phys.vp_nvlist); + *config = NULL; for (l = 0; l < VDEV_LABELS; l++) { - nvlist_t *config = NULL; offset = vdev_label_offset(psize, l, 0); if ((offset % pp->sectorsize) != 0) @@ -261,27 +263,151 @@ vdev_geom_read_guid(struct g_consumer *c continue; buf = label->vl_vdev_phys.vp_nvlist; - if (nvlist_unpack(buf, buflen, &config, 0) != 0) + if (nvlist_unpack(buf, buflen, config, 0) != 0) continue; - guid = nvlist_get_guid(config); - nvlist_free(config); - if (guid != 0) - break; + if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, + &state) != 0 || state == POOL_STATE_DESTROYED || + state > POOL_STATE_L2CACHE) { + nvlist_free(*config); + *config = NULL; + continue; + } + + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, + &txg) != 0 || txg == 0)) { + nvlist_free(*config); + *config = NULL; + continue; + } + + break; } kmem_free(label, size); - if (guid != 0) - ZFS_LOG(1, "guid for %s is %ju", pp->name, (uintmax_t)guid); - return (guid); + return (*config == NULL ? ENOENT : 0); +} + +static int +vdev_geom_check_config(nvlist_t *config, const char *name, uint64_t *best_txg) +{ + uint64_t vdev_guid; + uint64_t txg; + char *pname; + + if (nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 || + strcmp(pname, name) != 0) + return (ENOENT); + + ZFS_LOG(1, "found pool: %s", pname); + + txg = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg); + if (txg <= *best_txg) + return (ENOENT); + *best_txg = txg; + ZFS_LOG(1, "txg: %ju", (uintmax_t)*best_txg); + + return (0); +} + +static int +vdev_geom_attach_taster(struct g_consumer *cp, struct g_provider *pp) +{ + int error; + + if (pp->flags & G_PF_WITHER) + return (EINVAL); + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + return (EINVAL); + g_attach(cp, pp); + error = g_access(cp, 1, 0, 0); + if (error != 0) + g_detach(cp); + return (error); } static void -vdev_geom_taste_orphan(struct g_consumer *cp) +vdev_geom_dettach_taster(struct g_consumer *cp) { + g_access(cp, -1, 0, 0); + g_detach(cp); +} - KASSERT(1 == 0, ("%s called while tasting %s.", __func__, - cp->provider->name)); +int +vdev_geom_read_pool_label(const char *name, nvlist_t **config) +{ + struct g_class *mp; + struct g_geom *gp, *zgp; + struct g_provider *pp; + struct g_consumer *zcp; + nvlist_t *vdev_cfg; + uint64_t best_txg; + int error; + + DROP_GIANT(); + g_topology_lock(); + + zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); + /* This orphan function should be never called. */ + zgp->orphan = vdev_geom_taste_orphan; + zcp = g_new_consumer(zgp); + + best_txg = 0; + *config = NULL; + LIST_FOREACH(mp, &g_classes, class) { + if (mp == &zfs_vdev_class) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (gp->flags & G_GEOM_WITHER) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (pp->flags & G_PF_WITHER) + continue; + if (vdev_geom_attach_taster(zcp, pp) != 0) + continue; + g_topology_unlock(); + error = vdev_geom_read_config(zcp, &vdev_cfg); + g_topology_lock(); + vdev_geom_dettach_taster(zcp); + if (error) + continue; + ZFS_LOG(1, "successfully read vdev config"); + + error = vdev_geom_check_config(vdev_cfg, name, + &best_txg); + if (error != 0) { + nvlist_free(vdev_cfg); + continue; + } + nvlist_free(*config); + *config = vdev_cfg; + } + } + } + + g_destroy_consumer(zcp); + g_destroy_geom(zgp); + g_topology_unlock(); + PICKUP_GIANT(); + return (*config == NULL ? ENOENT : 0); +} + +static uint64_t +vdev_geom_read_guid(struct g_consumer *cp) +{ + nvlist_t *config; + uint64_t guid; + + g_topology_assert_not(); + + guid = 0; + if (vdev_geom_read_config(cp, &config) == 0) { + guid = nvlist_get_guid(config); + nvlist_free(config); + } + return (guid); } static struct g_consumer * @@ -308,18 +434,12 @@ vdev_geom_attach_by_guid(uint64_t guid) if (gp->flags & G_GEOM_WITHER) continue; LIST_FOREACH(pp, &gp->provider, provider) { - if (pp->flags & G_PF_WITHER) - continue; - g_attach(zcp, pp); - if (g_access(zcp, 1, 0, 0) != 0) { - g_detach(zcp); + if (vdev_geom_attach_taster(zcp, pp) != 0) continue; - } g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - g_access(zcp, -1, 0, 0); - g_detach(zcp); + vdev_geom_dettach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 12:05:54 2012 (r242553) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 13:29:47 2012 (r242554) @@ -1523,6 +1523,25 @@ out: } #endif /* OPENSOLARIS_MOUNTROOT */ +static int +getpoolname(const char *osname, char *poolname) +{ + char *p; + + p = strchr(osname, '/'); + if (p == NULL) { + if (strlen(osname) >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strcpy(poolname, osname); + } else { + if (p - osname >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strncpy(poolname, osname, p - osname); + poolname[p - osname] = '\0'; + } + return (0); +} + /*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) @@ -1616,6 +1635,29 @@ zfs_mount(vfs_t *vfsp) goto out; } + /* Initial root mount: try hard to import the requested root pool. */ + if ((vfsp->vfs_flag & MNT_ROOTFS) != 0 && + (vfsp->vfs_flag & MNT_UPDATE) == 0) { + char pname[MAXNAMELEN]; + spa_t *spa; + int prefer_cache; + + error = getpoolname(osname, pname); + if (error) + goto out; + + prefer_cache = 1; + TUNABLE_INT_FETCH("vfs.zfs.rootpool.prefer_cached_config", + &prefer_cache); + mutex_enter(&spa_namespace_lock); + spa = spa_lookup(pname); + mutex_exit(&spa_namespace_lock); + if (!prefer_cache || spa == NULL) { + error = spa_import_rootpool(pname); + if (error) + goto out; + } + } DROP_GIANT(); error = zfs_domount(vfsp, osname); PICKUP_GIANT(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:30:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44C891B0; Sun, 4 Nov 2012 13:30:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 228938FC08; Sun, 4 Nov 2012 13:30:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DU5Uu097408; Sun, 4 Nov 2012 13:30:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DU483097401; Sun, 4 Nov 2012 13:30:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041330.qA4DU483097401@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242555 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:30:05 -0000 Author: avg Date: Sun Nov 4 13:30:04 2012 New Revision: 242555 URL: http://svn.freebsd.org/changeset/base/242555 Log: MFC r241286,r242135: zfs_mount: taste geom providers for root pool config Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 13:29:47 2012 (r242554) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 4 13:30:04 2012 (r242555) @@ -3167,8 +3167,8 @@ spa_create(const char *pool, nvlist_t *n return (0); } -#if defined(sun) #ifdef _KERNEL +#if defined(sun) /* * Get the root pool information from the root disk, then import the root pool * during the system boot up time. @@ -3370,8 +3370,115 @@ out: return (error); } -#endif +#else + +extern int +vdev_geom_read_pool_label(const char *name, nvlist_t **config); + +static nvlist_t * +spa_generate_rootconf(const char *name) +{ + nvlist_t *config; + nvlist_t *nvtop, *nvroot; + uint64_t pgid; + + if (vdev_geom_read_pool_label(name, &config) != 0) + return (NULL); + + /* + * Add this top-level vdev to the child array. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, + &pgid) == 0); + + /* + * Put this pool's top-level vdevs into a root vdev. + */ + VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0); + VERIFY(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE, + VDEV_TYPE_ROOT) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) == 0); + VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_GUID, pgid) == 0); + VERIFY(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, + &nvtop, 1) == 0); + + /* + * Replace the existing vdev_tree with the new root vdev in + * this pool's configuration (remove the old, add the new). + */ + VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + nvlist_free(nvroot); + return (config); +} + +int +spa_import_rootpool(const char *name) +{ + spa_t *spa; + vdev_t *rvd, *bvd, *avd = NULL; + nvlist_t *config, *nvtop; + uint64_t txg; + char *pname; + int error; + + /* + * Read the label from the boot device and generate a configuration. + */ + config = spa_generate_rootconf(name); + if (config == NULL) { + cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", + name); + return (EIO); + } + + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); + + mutex_enter(&spa_namespace_lock); + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so that we + * can replace it with the correct config we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + spa->spa_is_root = B_TRUE; + spa->spa_import_flags = ZFS_IMPORT_VERBATIM; + + /* + * Build up a vdev tree based on the boot device's label config. + */ + VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + error = spa_config_parse(spa, &rvd, nvtop, NULL, 0, + VDEV_ALLOC_ROOTPOOL); + spa_config_exit(spa, SCL_ALL, FTAG); + if (error) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); + cmn_err(CE_NOTE, "Can not parse the config for pool '%s'", + pname); + return (error); + } + + error = 0; + spa_history_log_version(spa, LOG_POOL_IMPORT); +out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); + vdev_free(rvd); + spa_config_exit(spa, SCL_ALL, FTAG); + mutex_exit(&spa_namespace_lock); + + return (error); +} + #endif /* sun */ +#endif /* * Import a non-root pool into the system. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 13:29:47 2012 (r242554) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sun Nov 4 13:30:04 2012 (r242555) @@ -419,7 +419,11 @@ extern int spa_get_stats(const char *poo char *altroot, size_t buflen); extern int spa_create(const char *pool, nvlist_t *config, nvlist_t *props, const char *history_str, nvlist_t *zplprops); +#if defined(sun) extern int spa_import_rootpool(char *devpath, char *devid); +#else +extern int spa_import_rootpool(const char *name); +#endif extern int spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags); extern nvlist_t *spa_tryimport(nvlist_t *tryconfig); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 13:29:47 2012 (r242554) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Nov 4 13:30:04 2012 (r242555) @@ -175,17 +175,11 @@ vdev_geom_detach(void *arg, int flag __u static uint64_t nvlist_get_guid(nvlist_t *list) { - nvpair_t *elem = NULL; uint64_t value; - while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { - if (nvpair_type(elem) == DATA_TYPE_UINT64 && - strcmp(nvpair_name(elem), "guid") == 0) { - VERIFY(nvpair_value_uint64(elem, &value) == 0); - return (value); - } - } - return (0); + value = 0; + nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, &value); + return (value); } static int @@ -223,8 +217,16 @@ vdev_geom_io(struct g_consumer *cp, int return (error); } -static uint64_t -vdev_geom_read_guid(struct g_consumer *cp) +static void +vdev_geom_taste_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while tasting %s.", __func__, + cp->provider->name)); +} + +static int +vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { struct g_provider *pp; vdev_label_t *label; @@ -232,13 +234,13 @@ vdev_geom_read_guid(struct g_consumer *c size_t buflen; uint64_t psize; off_t offset, size; - uint64_t guid; + uint64_t guid, state, txg; int error, l, len; g_topology_assert_not(); pp = cp->provider; - ZFS_LOG(1, "Reading guid from %s...", pp->name); + ZFS_LOG(1, "Reading config from %s...", pp->name); psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); @@ -250,8 +252,8 @@ vdev_geom_read_guid(struct g_consumer *c label = kmem_alloc(size, KM_SLEEP); buflen = sizeof(label->vl_vdev_phys.vp_nvlist); + *config = NULL; for (l = 0; l < VDEV_LABELS; l++) { - nvlist_t *config = NULL; offset = vdev_label_offset(psize, l, 0); if ((offset % pp->sectorsize) != 0) @@ -261,27 +263,151 @@ vdev_geom_read_guid(struct g_consumer *c continue; buf = label->vl_vdev_phys.vp_nvlist; - if (nvlist_unpack(buf, buflen, &config, 0) != 0) + if (nvlist_unpack(buf, buflen, config, 0) != 0) continue; - guid = nvlist_get_guid(config); - nvlist_free(config); - if (guid != 0) - break; + if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, + &state) != 0 || state == POOL_STATE_DESTROYED || + state > POOL_STATE_L2CACHE) { + nvlist_free(*config); + *config = NULL; + continue; + } + + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, + &txg) != 0 || txg == 0)) { + nvlist_free(*config); + *config = NULL; + continue; + } + + break; } kmem_free(label, size); - if (guid != 0) - ZFS_LOG(1, "guid for %s is %ju", pp->name, (uintmax_t)guid); - return (guid); + return (*config == NULL ? ENOENT : 0); +} + +static int +vdev_geom_check_config(nvlist_t *config, const char *name, uint64_t *best_txg) +{ + uint64_t vdev_guid; + uint64_t txg; + char *pname; + + if (nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 || + strcmp(pname, name) != 0) + return (ENOENT); + + ZFS_LOG(1, "found pool: %s", pname); + + txg = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg); + if (txg <= *best_txg) + return (ENOENT); + *best_txg = txg; + ZFS_LOG(1, "txg: %ju", (uintmax_t)*best_txg); + + return (0); +} + +static int +vdev_geom_attach_taster(struct g_consumer *cp, struct g_provider *pp) +{ + int error; + + if (pp->flags & G_PF_WITHER) + return (EINVAL); + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + return (EINVAL); + g_attach(cp, pp); + error = g_access(cp, 1, 0, 0); + if (error != 0) + g_detach(cp); + return (error); } static void -vdev_geom_taste_orphan(struct g_consumer *cp) +vdev_geom_dettach_taster(struct g_consumer *cp) { + g_access(cp, -1, 0, 0); + g_detach(cp); +} - KASSERT(1 == 0, ("%s called while tasting %s.", __func__, - cp->provider->name)); +int +vdev_geom_read_pool_label(const char *name, nvlist_t **config) +{ + struct g_class *mp; + struct g_geom *gp, *zgp; + struct g_provider *pp; + struct g_consumer *zcp; + nvlist_t *vdev_cfg; + uint64_t best_txg; + int error; + + DROP_GIANT(); + g_topology_lock(); + + zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); + /* This orphan function should be never called. */ + zgp->orphan = vdev_geom_taste_orphan; + zcp = g_new_consumer(zgp); + + best_txg = 0; + *config = NULL; + LIST_FOREACH(mp, &g_classes, class) { + if (mp == &zfs_vdev_class) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (gp->flags & G_GEOM_WITHER) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (pp->flags & G_PF_WITHER) + continue; + if (vdev_geom_attach_taster(zcp, pp) != 0) + continue; + g_topology_unlock(); + error = vdev_geom_read_config(zcp, &vdev_cfg); + g_topology_lock(); + vdev_geom_dettach_taster(zcp); + if (error) + continue; + ZFS_LOG(1, "successfully read vdev config"); + + error = vdev_geom_check_config(vdev_cfg, name, + &best_txg); + if (error != 0) { + nvlist_free(vdev_cfg); + continue; + } + nvlist_free(*config); + *config = vdev_cfg; + } + } + } + + g_destroy_consumer(zcp); + g_destroy_geom(zgp); + g_topology_unlock(); + PICKUP_GIANT(); + return (*config == NULL ? ENOENT : 0); +} + +static uint64_t +vdev_geom_read_guid(struct g_consumer *cp) +{ + nvlist_t *config; + uint64_t guid; + + g_topology_assert_not(); + + guid = 0; + if (vdev_geom_read_config(cp, &config) == 0) { + guid = nvlist_get_guid(config); + nvlist_free(config); + } + return (guid); } static struct g_consumer * @@ -308,18 +434,12 @@ vdev_geom_attach_by_guid(uint64_t guid) if (gp->flags & G_GEOM_WITHER) continue; LIST_FOREACH(pp, &gp->provider, provider) { - if (pp->flags & G_PF_WITHER) - continue; - g_attach(zcp, pp); - if (g_access(zcp, 1, 0, 0) != 0) { - g_detach(zcp); + if (vdev_geom_attach_taster(zcp, pp) != 0) continue; - } g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - g_access(zcp, -1, 0, 0); - g_detach(zcp); + vdev_geom_dettach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 13:29:47 2012 (r242554) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 13:30:04 2012 (r242555) @@ -1522,6 +1522,25 @@ out: } #endif /* OPENSOLARIS_MOUNTROOT */ +static int +getpoolname(const char *osname, char *poolname) +{ + char *p; + + p = strchr(osname, '/'); + if (p == NULL) { + if (strlen(osname) >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strcpy(poolname, osname); + } else { + if (p - osname >= MAXNAMELEN) + return (ENAMETOOLONG); + (void) strncpy(poolname, osname, p - osname); + poolname[p - osname] = '\0'; + } + return (0); +} + /*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) @@ -1612,6 +1631,29 @@ zfs_mount(vfs_t *vfsp) goto out; } + /* Initial root mount: try hard to import the requested root pool. */ + if ((vfsp->vfs_flag & MNT_ROOTFS) != 0 && + (vfsp->vfs_flag & MNT_UPDATE) == 0) { + char pname[MAXNAMELEN]; + spa_t *spa; + int prefer_cache; + + error = getpoolname(osname, pname); + if (error) + goto out; + + prefer_cache = 1; + TUNABLE_INT_FETCH("vfs.zfs.rootpool.prefer_cached_config", + &prefer_cache); + mutex_enter(&spa_namespace_lock); + spa = spa_lookup(pname); + mutex_exit(&spa_namespace_lock); + if (!prefer_cache || spa == NULL) { + error = spa_import_rootpool(pname); + if (error) + goto out; + } + } DROP_GIANT(); error = zfs_domount(vfsp, osname); PICKUP_GIANT(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:31:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71CB0368; Sun, 4 Nov 2012 13:31:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 559EA8FC08; Sun, 4 Nov 2012 13:31:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DVg0j097756; Sun, 4 Nov 2012 13:31:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DVggA097754; Sun, 4 Nov 2012 13:31:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211041331.qA4DVggA097754@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Nov 2012 13:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242556 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:31:42 -0000 Author: kib Date: Sun Nov 4 13:31:41 2012 New Revision: 242556 URL: http://svn.freebsd.org/changeset/base/242556 Log: Order the enumeration of the MNT_ flags to be the same as the order of their definitions. MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Nov 4 13:30:04 2012 (r242555) +++ head/sys/kern/vfs_subr.c Sun Nov 4 13:31:41 2012 (r242556) @@ -3033,11 +3033,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_SYNCHRONOUS); MNT_FLAG(MNT_NOEXEC); MNT_FLAG(MNT_NOSUID); + MNT_FLAG(MNT_NFS4ACLS); MNT_FLAG(MNT_UNION); MNT_FLAG(MNT_ASYNC); MNT_FLAG(MNT_SUIDDIR); MNT_FLAG(MNT_SOFTDEP); - MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_NOSYMFOLLOW); MNT_FLAG(MNT_GJOURNAL); MNT_FLAG(MNT_MULTILABEL); @@ -3045,7 +3045,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_NOATIME); MNT_FLAG(MNT_NOCLUSTERR); MNT_FLAG(MNT_NOCLUSTERW); - MNT_FLAG(MNT_NFS4ACLS); + MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_EXRDONLY); MNT_FLAG(MNT_EXPORTED); MNT_FLAG(MNT_DEFEXPORTED); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:32:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01DF647A; Sun, 4 Nov 2012 13:32:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D38118FC08; Sun, 4 Nov 2012 13:32:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DWGwG097907; Sun, 4 Nov 2012 13:32:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DWGEg097904; Sun, 4 Nov 2012 13:32:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041332.qA4DWGEg097904@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242557 - stable/9/sys/boot/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:32:17 -0000 Author: avg Date: Sun Nov 4 13:32:16 2012 New Revision: 242557 URL: http://svn.freebsd.org/changeset/base/242557 Log: MFC r241299: boot/console: handle consoles that fail to probe Modified: stable/9/sys/boot/common/bootstrap.h stable/9/sys/boot/common/console.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/common/bootstrap.h ============================================================================== --- stable/9/sys/boot/common/bootstrap.h Sun Nov 4 13:31:41 2012 (r242556) +++ stable/9/sys/boot/common/bootstrap.h Sun Nov 4 13:32:16 2012 (r242557) @@ -109,10 +109,10 @@ struct console const char *c_name; const char *c_desc; int c_flags; -#define C_PRESENTIN (1<<0) -#define C_PRESENTOUT (1<<1) -#define C_ACTIVEIN (1<<2) -#define C_ACTIVEOUT (1<<3) +#define C_PRESENTIN (1<<0) /* console can provide input */ +#define C_PRESENTOUT (1<<1) /* console can provide output */ +#define C_ACTIVEIN (1<<2) /* user wants input from console */ +#define C_ACTIVEOUT (1<<3) /* user wants output to console */ void (* c_probe)(struct console *cp); /* set c_flags to match hardware */ int (* c_init)(int arg); /* reinit XXX may need more args */ void (* c_out)(int c); /* emit c */ Modified: stable/9/sys/boot/common/console.c ============================================================================== --- stable/9/sys/boot/common/console.c Sun Nov 4 13:31:41 2012 (r242556) +++ stable/9/sys/boot/common/console.c Sun Nov 4 13:32:16 2012 (r242557) @@ -100,11 +100,12 @@ getchar(void) { int cons; int rv; - + /* Loop forever polling all active consoles */ for(;;) for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && ((rv = consoles[cons]->c_in()) != -1)) return(rv); } @@ -115,7 +116,8 @@ ischar(void) int cons; for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && (consoles[cons]->c_ready() != 0)) return(1); return(0); @@ -125,13 +127,14 @@ void putchar(int c) { int cons; - + /* Expand newlines */ if (c == '\n') putchar('\r'); - + for (cons = 0; consoles[cons] != NULL; cons++) - if (consoles[cons]->c_flags & C_ACTIVEOUT) + if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == + (C_PRESENTOUT | C_ACTIVEOUT)) consoles[cons]->c_out(c); } @@ -220,6 +223,10 @@ cons_change(const char *string) if (cons >= 0) { consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) != + (C_PRESENTIN | C_PRESENTOUT)) + printf("console %s failed to initialize\n", + consoles[cons]->c_name); } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75E34583; Sun, 4 Nov 2012 13:32:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D858FC12; Sun, 4 Nov 2012 13:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DWRlR097972; Sun, 4 Nov 2012 13:32:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DWRFR097969; Sun, 4 Nov 2012 13:32:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041332.qA4DWRFR097969@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242558 - stable/8/sys/boot/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:32:27 -0000 Author: avg Date: Sun Nov 4 13:32:26 2012 New Revision: 242558 URL: http://svn.freebsd.org/changeset/base/242558 Log: MFC r241299: boot/console: handle consoles that fail to probe Modified: stable/8/sys/boot/common/bootstrap.h stable/8/sys/boot/common/console.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/common/bootstrap.h ============================================================================== --- stable/8/sys/boot/common/bootstrap.h Sun Nov 4 13:32:16 2012 (r242557) +++ stable/8/sys/boot/common/bootstrap.h Sun Nov 4 13:32:26 2012 (r242558) @@ -109,10 +109,10 @@ struct console const char *c_name; const char *c_desc; int c_flags; -#define C_PRESENTIN (1<<0) -#define C_PRESENTOUT (1<<1) -#define C_ACTIVEIN (1<<2) -#define C_ACTIVEOUT (1<<3) +#define C_PRESENTIN (1<<0) /* console can provide input */ +#define C_PRESENTOUT (1<<1) /* console can provide output */ +#define C_ACTIVEIN (1<<2) /* user wants input from console */ +#define C_ACTIVEOUT (1<<3) /* user wants output to console */ void (* c_probe)(struct console *cp); /* set c_flags to match hardware */ int (* c_init)(int arg); /* reinit XXX may need more args */ void (* c_out)(int c); /* emit c */ Modified: stable/8/sys/boot/common/console.c ============================================================================== --- stable/8/sys/boot/common/console.c Sun Nov 4 13:32:16 2012 (r242557) +++ stable/8/sys/boot/common/console.c Sun Nov 4 13:32:26 2012 (r242558) @@ -100,11 +100,12 @@ getchar(void) { int cons; int rv; - + /* Loop forever polling all active consoles */ for(;;) for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && ((rv = consoles[cons]->c_in()) != -1)) return(rv); } @@ -115,7 +116,8 @@ ischar(void) int cons; for (cons = 0; consoles[cons] != NULL; cons++) - if ((consoles[cons]->c_flags & C_ACTIVEIN) && + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_ACTIVEIN)) == + (C_PRESENTIN | C_ACTIVEIN) && (consoles[cons]->c_ready() != 0)) return(1); return(0); @@ -125,13 +127,14 @@ void putchar(int c) { int cons; - + /* Expand newlines */ if (c == '\n') putchar('\r'); - + for (cons = 0; consoles[cons] != NULL; cons++) - if (consoles[cons]->c_flags & C_ACTIVEOUT) + if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == + (C_PRESENTOUT | C_ACTIVEOUT)) consoles[cons]->c_out(c); } @@ -220,6 +223,10 @@ cons_change(const char *string) if (cons >= 0) { consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) != + (C_PRESENTIN | C_PRESENTOUT)) + printf("console %s failed to initialize\n", + consoles[cons]->c_name); } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:32:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 009A5698; Sun, 4 Nov 2012 13:32:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C46318FC18; Sun, 4 Nov 2012 13:32:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DWj11098051; Sun, 4 Nov 2012 13:32:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DWjiv098049; Sun, 4 Nov 2012 13:32:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211041332.qA4DWjiv098049@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Nov 2012 13:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242559 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:32:46 -0000 Author: kib Date: Sun Nov 4 13:32:45 2012 New Revision: 242559 URL: http://svn.freebsd.org/changeset/base/242559 Log: Add decoding of the missed VI_ and VV_ flags to ddb "show vnode" command. MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Nov 4 13:32:26 2012 (r242558) +++ head/sys/kern/vfs_subr.c Sun Nov 4 13:32:45 2012 (r242559) @@ -2893,6 +2893,8 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_ISTTY", sizeof(buf)); if (vp->v_vflag & VV_NOSYNC) strlcat(buf, "|VV_NOSYNC", sizeof(buf)); + if (vp->v_vflag & VV_ETERNALDEV) + strlcat(buf, "|VV_ETERNALDEV", sizeof(buf)); if (vp->v_vflag & VV_CACHEDLABEL) strlcat(buf, "|VV_CACHEDLABEL", sizeof(buf)); if (vp->v_vflag & VV_TEXT) @@ -2909,9 +2911,11 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_DELETED", sizeof(buf)); if (vp->v_vflag & VV_MD) strlcat(buf, "|VV_MD", sizeof(buf)); - flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | + if (vp->v_vflag & VV_FORCEINSMQ) + strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); + flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | VV_CACHEDLABEL | VV_TEXT | VV_COPYONWRITE | VV_SYSTEM | VV_PROCDEP | - VV_NOKNOTE | VV_DELETED | VV_MD); + VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -2924,12 +2928,14 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VI_DOOMED", sizeof(buf)); if (vp->v_iflag & VI_FREE) strlcat(buf, "|VI_FREE", sizeof(buf)); + if (vp->v_iflag & VI_ACTIVE) + strlcat(buf, "|VI_ACTIVE", sizeof(buf)); if (vp->v_iflag & VI_DOINGINACT) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); flags = vp->v_iflag & ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE | - VI_DOINGINACT | VI_OWEINACT); + VI_ACTIVE | VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:33:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FE147E3; Sun, 4 Nov 2012 13:33:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27E308FC12; Sun, 4 Nov 2012 13:33:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DXEph098203; Sun, 4 Nov 2012 13:33:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DXDfr098201; Sun, 4 Nov 2012 13:33:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211041333.qA4DXDfr098201@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Nov 2012 13:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242560 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:33:14 -0000 Author: kib Date: Sun Nov 4 13:33:13 2012 New Revision: 242560 URL: http://svn.freebsd.org/changeset/base/242560 Log: Add decoding of the missed MNT_KERN_ flags to ddb "show mount" command. MFC after: 3 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Nov 4 13:32:45 2012 (r242559) +++ head/sys/kern/vfs_subr.c Sun Nov 4 13:33:13 2012 (r242560) @@ -3096,6 +3096,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); + MNT_KERN_FLAG(MNTK_NO_IOPF); + MNT_KERN_FLAG(MNTK_VGONE_UPPER); + MNT_KERN_FLAG(MNTK_VGONE_WAITER); + MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); + MNT_KERN_FLAG(MNTK_MARKER); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:33:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8355DA12; Sun, 4 Nov 2012 13:33:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3938FC08; Sun, 4 Nov 2012 13:33:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DXxZi098350; Sun, 4 Nov 2012 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DXxBY098348; Sun, 4 Nov 2012 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041333.qA4DXxBY098348@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242561 - stable/9/sys/boot/i386/libi386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:33:59 -0000 Author: avg Date: Sun Nov 4 13:33:59 2012 New Revision: 242561 URL: http://svn.freebsd.org/changeset/base/242561 Log: MFC r241300: i386 comconsole: don't loop forever if hardware doesn't respond Modified: stable/9/sys/boot/i386/libi386/comconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/9/sys/boot/i386/libi386/comconsole.c Sun Nov 4 13:33:13 2012 (r242560) +++ stable/9/sys/boot/i386/libi386/comconsole.c Sun Nov 4 13:33:59 2012 (r242561) @@ -63,7 +63,6 @@ static void comc_setup(int speed, int po static int comc_speed_set(struct env_var *ev, int flags, const void *value); -static int comc_started; static int comc_curspeed; static int comc_port = COMPORT; static uint32_t comc_locator; @@ -87,9 +86,6 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* @@ -137,18 +133,19 @@ comc_probe(struct console *cp) env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - if (comc_started && arg == 0) - return 0; - comc_started = 1; comc_setup(comc_curspeed, comc_port); - return(0); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void @@ -166,13 +163,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -185,7 +182,8 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if (comc_started && comc_curspeed != speed) + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -203,7 +201,8 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if (comc_started && comc_port != port) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_port != port) { comc_setup(comc_curspeed, port); set_hw_console_hint(); } @@ -305,7 +304,8 @@ comc_pcidev_set(struct env_var *ev, int printf("Invalid pcidev\n"); return (CMD_ERROR); } - if (comc_started && comc_locator != locator) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_locator != locator) { error = comc_pcidev_handle(locator); if (error != CMD_OK) return (error); @@ -317,6 +317,8 @@ comc_pcidev_set(struct env_var *ev, int static void comc_setup(int speed, int port) { + static int TRY_COUNT = 1000000; + int tries; comc_curspeed = speed; comc_port = port; @@ -327,9 +329,15 @@ comc_setup(int speed, int port) outb(comc_port + com_cfcr, COMC_FMT); outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + tries = 0; do inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + + if (tries < TRY_COUNT) + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:37:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A905C63; Sun, 4 Nov 2012 13:37:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4B448FC0A; Sun, 4 Nov 2012 13:37:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DbX5q098959; Sun, 4 Nov 2012 13:37:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DbXS4098952; Sun, 4 Nov 2012 13:37:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041337.qA4DbXS4098952@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242562 - in stable/9/sys/boot/i386: boot2 btx/btx gptboot zfsboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:37:34 -0000 Author: avg Date: Sun Nov 4 13:37:33 2012 New Revision: 242562 URL: http://svn.freebsd.org/changeset/base/242562 Log: MFC r241301: add detection of serial console presence to btx and boot2-like blocks Modified: stable/9/sys/boot/i386/boot2/boot2.c stable/9/sys/boot/i386/boot2/lib.h stable/9/sys/boot/i386/boot2/sio.S stable/9/sys/boot/i386/btx/btx/btx.S stable/9/sys/boot/i386/gptboot/gptboot.c stable/9/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/boot2.c Sun Nov 4 13:37:33 2012 (r242562) @@ -416,8 +416,10 @@ parse() } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/i386/boot2/lib.h ============================================================================== --- stable/9/sys/boot/i386/boot2/lib.h Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/lib.h Sun Nov 4 13:37:33 2012 (r242562) @@ -17,8 +17,8 @@ * $FreeBSD$ */ -void sio_init(int) __attribute__((regparm (3))); -void sio_flush(void); +int sio_init(int) __attribute__((regparm (3))); +int sio_flush(void); void sio_putc(int) __attribute__((regparm (3))); int sio_getc(void); int sio_ischar(void); Modified: stable/9/sys/boot/i386/boot2/sio.S ============================================================================== --- stable/9/sys/boot/i386/boot2/sio.S Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/boot2/sio.S Sun Nov 4 13:37:33 2012 (r242562) @@ -24,7 +24,7 @@ .globl sio_getc .globl sio_ischar -/* void sio_init(int div) */ +/* int sio_init(int div) */ sio_init: pushl %eax movw $SIO_PRT+0x3,%dx # Data format reg @@ -43,12 +43,16 @@ sio_init: pushl %eax call sio_flush ret -/* void sio_flush(void) */ +/* int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* void sio_putc(int c) */ Modified: stable/9/sys/boot/i386/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/i386/btx/btx/btx.S Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/btx/btx/btx.S Sun Nov 4 13:37:33 2012 (r242562) @@ -812,7 +812,7 @@ putstr: lodsb # Load char .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD /* - * void sio_init(void) + * int sio_init(void) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format @@ -828,14 +828,19 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_getc.1 # Get character /* - * void sio_flush(void) + * int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* * void sio_putc(int c) Modified: stable/9/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/9/sys/boot/i386/gptboot/gptboot.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/gptboot/gptboot.c Sun Nov 4 13:37:33 2012 (r242562) @@ -380,8 +380,10 @@ parse(char *cmdstr, int *dskupdated) } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Sun Nov 4 13:33:59 2012 (r242561) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Sun Nov 4 13:37:33 2012 (r242562) @@ -785,8 +785,10 @@ parse(void) } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } if (c == '?') { dnode_phys_t dn; From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:42:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99E09E06; Sun, 4 Nov 2012 13:42:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C09D8FC14; Sun, 4 Nov 2012 13:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DgJHv099798; Sun, 4 Nov 2012 13:42:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DgJ2t099796; Sun, 4 Nov 2012 13:42:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041342.qA4DgJ2t099796@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242563 - stable/9/sys/dev/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:42:19 -0000 Author: avg Date: Sun Nov 4 13:42:19 2012 New Revision: 242563 URL: http://svn.freebsd.org/changeset/base/242563 Log: MFC r241538: acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on Modified: stable/9/sys/dev/acpica/acpi_thermal.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:37:33 2012 (r242562) +++ stable/9/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:42:19 2012 (r242563) @@ -121,6 +121,8 @@ struct acpi_tz_softc { int tz_cooling_saved_freq; }; +#define TZ_ACTIVE_LEVEL(act) ((act) >= 0 ? (act) : TZ_NUMLEVELS) + #define CPUFREQ_MAX_LEVELS 64 /* XXX cpufreq should export this */ static int acpi_tz_probe(device_t dev); @@ -565,18 +567,21 @@ acpi_tz_monitor(void *Context) } if (newactive != sc->tz_active) { - /* Turn off the cooling devices that are on, if any are */ - if (sc->tz_active != TZ_ACTIVE_NONE) + /* Turn off unneeded cooling devices that are on, if any are */ + for (i = TZ_ACTIVE_LEVEL(sc->tz_active); + i < TZ_ACTIVE_LEVEL(newactive); i++) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[sc->tz_active].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_off, sc); - + } /* Turn on cooling devices that are required, if any are */ - if (newactive != TZ_ACTIVE_NONE) { + for (i = TZ_ACTIVE_LEVEL(sc->tz_active) - 1; + i >= TZ_ACTIVE_LEVEL(newactive); i--) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[newactive].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_on, sc); } + ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "switched from %s to %s: %d.%dC\n", acpi_tz_aclevel_string(sc->tz_active), From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:42:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14BBAF5D; Sun, 4 Nov 2012 13:42:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F084B8FC08; Sun, 4 Nov 2012 13:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DgYqF099871; Sun, 4 Nov 2012 13:42:34 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DgYBO099869; Sun, 4 Nov 2012 13:42:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041342.qA4DgYBO099869@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242564 - stable/8/sys/dev/acpica X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:42:35 -0000 Author: avg Date: Sun Nov 4 13:42:34 2012 New Revision: 242564 URL: http://svn.freebsd.org/changeset/base/242564 Log: MFC r241538: acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on Modified: stable/8/sys/dev/acpica/acpi_thermal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/acpica/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:42:19 2012 (r242563) +++ stable/8/sys/dev/acpica/acpi_thermal.c Sun Nov 4 13:42:34 2012 (r242564) @@ -122,6 +122,8 @@ struct acpi_tz_softc { int tz_cooling_saved_freq; }; +#define TZ_ACTIVE_LEVEL(act) ((act) >= 0 ? (act) : TZ_NUMLEVELS) + #define CPUFREQ_MAX_LEVELS 64 /* XXX cpufreq should export this */ static int acpi_tz_probe(device_t dev); @@ -565,18 +567,21 @@ acpi_tz_monitor(void *Context) } if (newactive != sc->tz_active) { - /* Turn off the cooling devices that are on, if any are */ - if (sc->tz_active != TZ_ACTIVE_NONE) + /* Turn off unneeded cooling devices that are on, if any are */ + for (i = TZ_ACTIVE_LEVEL(sc->tz_active); + i < TZ_ACTIVE_LEVEL(newactive); i++) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[sc->tz_active].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_off, sc); - + } /* Turn on cooling devices that are required, if any are */ - if (newactive != TZ_ACTIVE_NONE) { + for (i = TZ_ACTIVE_LEVEL(sc->tz_active) - 1; + i >= TZ_ACTIVE_LEVEL(newactive); i--) { acpi_ForeachPackageObject( - (ACPI_OBJECT *)sc->tz_zone.al[newactive].Pointer, + (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, acpi_tz_switch_cooler_on, sc); } + ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "switched from %s to %s: %d.%dC\n", acpi_tz_aclevel_string(sc->tz_active), From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:46:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC4AD26D; Sun, 4 Nov 2012 13:46:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 941B48FC12; Sun, 4 Nov 2012 13:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4DkSqX000617; Sun, 4 Nov 2012 13:46:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DkSRa000615; Sun, 4 Nov 2012 13:46:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041346.qA4DkSRa000615@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242565 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:46:28 -0000 Author: avg Date: Sun Nov 4 13:46:28 2012 New Revision: 242565 URL: http://svn.freebsd.org/changeset/base/242565 Log: cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call ... instead of whatever random value may happen to be in the register. ecx is important to some cpuid leaves. To do: extend cpuctl interface to provide for ecx value parameter. MFC after: 5 days Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Sun Nov 4 13:42:34 2012 (r242564) +++ head/sys/dev/cpuctl/cpuctl.c Sun Nov 4 13:46:28 2012 (r242565) @@ -204,7 +204,7 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - do_cpuid(data->level, data->data); + cpuid_count(data->level, 0, data->data); restore_cpu(oldcpu, is_bound, td); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:48:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08D1157F; Sun, 4 Nov 2012 13:48:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E30A38FC12; Sun, 4 Nov 2012 13:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4Dmnv7001096; Sun, 4 Nov 2012 13:48:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4DmnoT001093; Sun, 4 Nov 2012 13:48:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041348.qA4DmnoT001093@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242566 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:48:50 -0000 Author: avg Date: Sun Nov 4 13:48:48 2012 New Revision: 242566 URL: http://svn.freebsd.org/changeset/base/242566 Log: zfs_freebsd_close: call zfs_close with count=1 instead of count=0 Otherwise we may be leaking z_sync_cnt, which may lead to unnecessary ZIL sync-ing. MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 4 13:46:28 2012 (r242565) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 4 13:48:48 2012 (r242566) @@ -5661,7 +5661,7 @@ zfs_freebsd_close(ap) } */ *ap; { - return (zfs_close(ap->a_vp, ap->a_fflag, 0, 0, ap->a_cred, NULL)); + return (zfs_close(ap->a_vp, ap->a_fflag, 1, 0, ap->a_cred, NULL)); } static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 13:50:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2EA36F4; Sun, 4 Nov 2012 13:50:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA7798FC08; Sun, 4 Nov 2012 13:50:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4Do8TX001354; Sun, 4 Nov 2012 13:50:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4Do8Bs001352; Sun, 4 Nov 2012 13:50:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041350.qA4Do8Bs001352@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 13:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242567 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 13:50:09 -0000 Author: avg Date: Sun Nov 4 13:50:08 2012 New Revision: 242567 URL: http://svn.freebsd.org/changeset/base/242567 Log: zfs_mount: drop vfs.zfs.rootpool.prefer_cached_config tunable It turned out to be not that useful, because its default value may lead to a problem when a root pool is present in zpool.cache, but its on-disk status is 'exported'. This may happen if the pool was imported in a different environment with -f flag and then exported. MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c 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 Nov 4 13:48:48 2012 (r242566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 13:50:08 2012 (r242567) @@ -1655,24 +1655,12 @@ zfs_mount(vfs_t *vfsp) if ((vfsp->vfs_flag & MNT_ROOTFS) != 0 && (vfsp->vfs_flag & MNT_UPDATE) == 0) { char pname[MAXNAMELEN]; - spa_t *spa; - int prefer_cache; error = getpoolname(osname, pname); + if (error == 0) + error = spa_import_rootpool(pname); if (error) goto out; - - prefer_cache = 1; - TUNABLE_INT_FETCH("vfs.zfs.rootpool.prefer_cached_config", - &prefer_cache); - mutex_enter(&spa_namespace_lock); - spa = spa_lookup(pname); - mutex_exit(&spa_namespace_lock); - if (!prefer_cache || spa == NULL) { - error = spa_import_rootpool(pname); - if (error) - goto out; - } } DROP_GIANT(); error = zfs_domount(vfsp, osname); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:15:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C64D657; Sun, 4 Nov 2012 14:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 442198FC12; Sun, 4 Nov 2012 14:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EFE8b005524; Sun, 4 Nov 2012 14:15:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EFEY3005522; Sun, 4 Nov 2012 14:15:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041415.qA4EFEY3005522@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242568 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:15:14 -0000 Author: avg Date: Sun Nov 4 14:15:13 2012 New Revision: 242568 URL: http://svn.freebsd.org/changeset/base/242568 Log: zfs_vnode_lock: no need to double-guess caller's intentions here vn_lock should do the right thing with respect to given vnode lock flags. If a caller doesn't mind a doomed vnode, then zfs should deliver. Reviewed by: kib MFC after: 19 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c 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 Nov 4 13:50:08 2012 (r242567) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 14:15:13 2012 (r242568) @@ -1744,15 +1744,7 @@ zfs_vnode_lock(vnode_t *vp, int flags) ASSERT(vp != NULL); - /* - * Check if the file system wasn't forcibly unmounted in the meantime. - */ error = vn_lock(vp, flags); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) { - VOP_UNLOCK(vp, 0); - error = ENOENT; - } - return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:16:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 591717C9; Sun, 4 Nov 2012 14:16:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FCBE8FC08; Sun, 4 Nov 2012 14:16:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EGJYS005731; Sun, 4 Nov 2012 14:16:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EGJWf005729; Sun, 4 Nov 2012 14:16:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041416.qA4EGJWf005729@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242569 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:16:19 -0000 Author: avg Date: Sun Nov 4 14:16:18 2012 New Revision: 242569 URL: http://svn.freebsd.org/changeset/base/242569 Log: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT ... to ensure that we have a valid mountpoint during the call. Reviewed by: kib MFC after: 19 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sun Nov 4 14:15:13 2012 (r242568) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sun Nov 4 14:16:18 2012 (r242569) @@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype) vfsp = vn_mountedvfs(cvp); if (vfsp == NULL) break; + error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ @@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype) vput(cvp); else vrele(cvp); + if (error) + return (error); /* * The read lock must be held across the call to VFS_ROOT() to * prevent a concurrent unmount from destroying the vfs. */ error = VFS_ROOT(vfsp, lktype, &tvp); + vfs_unbusy(vfsp); if (error != 0) return (error); cvp = tvp; From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:22:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE067BA0; Sun, 4 Nov 2012 14:22:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18028FC12; Sun, 4 Nov 2012 14:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EMP9P006862; Sun, 4 Nov 2012 14:22:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EMPmF006860; Sun, 4 Nov 2012 14:22:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041422.qA4EMPmF006860@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242570 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:22:25 -0000 Author: avg Date: Sun Nov 4 14:22:25 2012 New Revision: 242570 URL: http://svn.freebsd.org/changeset/base/242570 Log: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount handles that Reviewed by: kib MFC after: 19 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c 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 Nov 4 14:16:18 2012 (r242569) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 14:22:25 2012 (r242570) @@ -1970,10 +1970,6 @@ zfs_umount(vfs_t *vfsp, int fflag) zfsvfs->z_ctldir->v_count > 1) return (EBUSY); } - } else { - MNT_ILOCK(vfsp); - vfsp->mnt_kern_flag |= MNTK_UNMOUNTF; - MNT_IUNLOCK(vfsp); } VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:24:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9250D15; Sun, 4 Nov 2012 14:24:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0A528FC08; Sun, 4 Nov 2012 14:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EO0sp007135; Sun, 4 Nov 2012 14:24:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EO0cA007133; Sun, 4 Nov 2012 14:24:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041424.qA4EO0cA007133@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242571 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:24:00 -0000 Author: avg Date: Sun Nov 4 14:24:00 2012 New Revision: 242571 URL: http://svn.freebsd.org/changeset/base/242571 Log: zfs_vnode_forget: dispose of larvae vnode using public vfs api (mostly) Reviewed by: kib MFC after: 19 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Nov 4 14:22:25 2012 (r242570) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Nov 4 14:24:00 2012 (r242571) @@ -633,12 +633,11 @@ static void zfs_vnode_forget(vnode_t *vp) { - VOP_UNLOCK(vp, 0); - VI_LOCK(vp); - vp->v_usecount--; - vp->v_iflag |= VI_DOOMED; + /* copied from insmntque_stddtr */ vp->v_data = NULL; - vdropl(vp); + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:27:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A6EBEBC; Sun, 4 Nov 2012 14:27:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1238B8FC16; Sun, 4 Nov 2012 14:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4ERVnG007726; Sun, 4 Nov 2012 14:27:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4ERVA5007724; Sun, 4 Nov 2012 14:27:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041427.qA4ERVA5007724@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242572 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:27:32 -0000 Author: avg Date: Sun Nov 4 14:27:31 2012 New Revision: 242572 URL: http://svn.freebsd.org/changeset/base/242572 Log: opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails To do: investigate if it would be possible to use normal vfs_domount here. Reviewed by: kib MFC after: 19 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sun Nov 4 14:24:00 2012 (r242571) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sun Nov 4 14:27:31 2012 (r242572) @@ -191,6 +191,9 @@ mount_snapshot(kthread_t *td, vnode_t ** td->td_ucred = cr; if (error != 0) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:36:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1595A265; Sun, 4 Nov 2012 14:36:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1C4F8FC14; Sun, 4 Nov 2012 14:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EaBsM009115; Sun, 4 Nov 2012 14:36:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EaBeO009113; Sun, 4 Nov 2012 14:36:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041436.qA4EaBeO009113@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242573 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:36:12 -0000 Author: avg Date: Sun Nov 4 14:36:11 2012 New Revision: 242573 URL: http://svn.freebsd.org/changeset/base/242573 Log: zfs: set MNTK_EXTENDED_SHARED flag Discussed with: kib MFC after: 20 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c 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 Nov 4 14:27:31 2012 (r242572) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Nov 4 14:36:11 2012 (r242573) @@ -1135,6 +1135,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; + vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; /* * The fsid is 64 bits, composed of an 8-bit fs type, which From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:43:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C50189E0; Sun, 4 Nov 2012 14:43:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC77C8FC12; Sun, 4 Nov 2012 14:43:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4EhF6r010523; Sun, 4 Nov 2012 14:43:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4EhFos010521; Sun, 4 Nov 2012 14:43:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041443.qA4EhFos010521@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242574 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:43:15 -0000 Author: avg Date: Sun Nov 4 14:43:15 2012 New Revision: 242574 URL: http://svn.freebsd.org/changeset/base/242574 Log: zfsctl_snapdir_lookup: obtain a snapname in the remount case ... which is triggered if somebody did regular umount on a snapshot mount. Reviewed by: Matthew Ahrens MFC after: 20 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Nov 4 14:36:11 2012 (r242573) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Nov 4 14:43:15 2012 (r242574) @@ -1002,6 +1002,7 @@ zfsctl_snapdir_lookup(ap) * The snapshot was unmounted behind our backs, * try to remount it. */ + VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; } else { /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 14:50:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71CD3F84; Sun, 4 Nov 2012 14:50:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59C268FC14; Sun, 4 Nov 2012 14:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4Eo9eb011908; Sun, 4 Nov 2012 14:50:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4Eo9L1011906; Sun, 4 Nov 2012 14:50:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211041450.qA4Eo9L1011906@svn.freebsd.org> From: Andriy Gapon Date: Sun, 4 Nov 2012 14:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242575 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 14:50:09 -0000 Author: avg Date: Sun Nov 4 14:50:08 2012 New Revision: 242575 URL: http://svn.freebsd.org/changeset/base/242575 Log: zfs_dirlook: bailout early if directory is unlinked Otherwise we could fail with an incorrect error if e.g. parent object id is removed too or we can even return a wrong vnode if parent object has been already re-used. Discussed with: pjd Also see: http://article.gmane.org/gmane.os.freebsd.devel.file-systems/13863 MFC after: 26 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c 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 Nov 4 14:43:15 2012 (r242574) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sun Nov 4 14:50:08 2012 (r242575) @@ -374,8 +374,15 @@ zfs_dirlook(znode_t *dzp, char *name, vn znode_t *zp; int error = 0; uint64_t parent; + int unlinked; if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + *vpp = ZTOV(dzp); VN_HOLD(*vpp); } else if (name[0] == '.' && name[1] == '.' && name[2] == 0) { @@ -394,6 +401,13 @@ zfs_dirlook(znode_t *dzp, char *name, vn NULL, NULL, NULL); return (error); } + + mutex_enter(&dzp->z_lock); + unlinked = dzp->z_unlinked; + mutex_exit(&dzp->z_lock); + if (unlinked) + return (ENOENT); + rw_enter(&dzp->z_parent_lock, RW_READER); error = zfs_zget(zfsvfs, parent, &zp); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 15:15:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB159A65; Sun, 4 Nov 2012 15:15:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3EC38FC16; Sun, 4 Nov 2012 15:15:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4FFhet015876; Sun, 4 Nov 2012 15:15:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4FFh7c015874; Sun, 4 Nov 2012 15:15:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211041515.qA4FFh7c015874@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 15:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242576 - head/games/fortune/fortune X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 15:15:43 -0000 Author: eadler Date: Sun Nov 4 15:15:43 2012 New Revision: 242576 URL: http://svn.freebsd.org/changeset/base/242576 Log: Prefer the use of stdbool to custom defines. Approved by: cperciva (from discussion) MFC after: 3 days Modified: head/games/fortune/fortune/fortune.c Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Sun Nov 4 14:50:08 2012 (r242575) +++ head/games/fortune/fortune/fortune.c Sun Nov 4 15:15:43 2012 (r242576) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,9 +63,8 @@ __FBSDID("$FreeBSD$"); #include "strfile.h" #include "pathnames.h" -#define TRUE 1 -#define FALSE 0 -#define bool short +#define TRUE true +#define FALSE false #define MINW 6 /* minimum wait if desired */ #define CPERS 20 /* # of chars for each sec */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 15:15:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B42F6A68; Sun, 4 Nov 2012 15:15:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9155C8FC17; Sun, 4 Nov 2012 15:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA4FFlvM015914; Sun, 4 Nov 2012 15:15:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA4FFl9T015910; Sun, 4 Nov 2012 15:15:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211041515.qA4FFl9T015910@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 15:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242577 - head/games/fortune/fortune X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 15:15:47 -0000 Author: eadler Date: Sun Nov 4 15:15:47 2012 New Revision: 242577 URL: http://svn.freebsd.org/changeset/base/242577 Log: Make OK_TO_WRITE_TO_DISK an envrionment variable instead of a compile time option. While here, don't differ based on the existence of LOCK_EX which doesn't seem to have ever made a difference on FreeBSD. Approved by: cperciva (from discussion) MFC after: 3 days Modified: head/games/fortune/fortune/fortune.6 head/games/fortune/fortune/fortune.c Modified: head/games/fortune/fortune/fortune.6 ============================================================================== --- head/games/fortune/fortune/fortune.6 Sun Nov 4 15:15:43 2012 (r242576) +++ head/games/fortune/fortune/fortune.6 Sun Nov 4 15:15:47 2012 (r242577) @@ -170,6 +170,9 @@ looks for data files. If not set it will default to .Pa /usr/games/fortune . If none of the directories specified exist, it will print a warning and exit. +.It Ev FORTUNE_SAVESTATE +If set, fortune will save some state about what fortune +it was up to on disk. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/games/fortune/*" Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Sun Nov 4 15:15:43 2012 (r242576) +++ head/games/fortune/fortune/fortune.c Sun Nov 4 15:15:47 2012 (r242577) @@ -107,6 +107,7 @@ static bool Offend = FALSE; /* offensiv static bool All_forts = FALSE; /* any fortune allowed */ static bool Equal_probs = FALSE; /* scatter un-allocted prob equally */ static bool Match = FALSE; /* dump fortunes matching a pattern */ +static bool WriteToDisk = false; /* use files on disk to save state */ #ifdef DEBUG static bool Debug = FALSE; /* print debug messages */ #endif @@ -168,9 +169,10 @@ static regex_t Re_pat; int main(int argc, char *argv[]) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ + + if (getenv("FORTUNE_SAVESTATE") != NULL) + WriteToDisk = true; (void) setlocale(LC_ALL, ""); @@ -188,26 +190,22 @@ main(int argc, char *argv[]) display(Fortfile); -#ifdef OK_TO_WRITE_DISK - if ((fd = creat(Fortfile->posfile, 0666)) < 0) { - perror(Fortfile->posfile); - exit(1); + if (WriteToDisk) { + if ((fd = creat(Fortfile->posfile, 0666)) < 0) { + perror(Fortfile->posfile); + exit(1); + } + /* + * if we can, we exclusive lock, but since it isn't very + * important, we just punt if we don't have easy locking + * available. + */ + flock(fd, LOCK_EX); + write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); + if (!Fortfile->was_pos_file) + chmod(Fortfile->path, 0666); + flock(fd, LOCK_UN); } -#ifdef LOCK_EX - /* - * if we can, we exclusive lock, but since it isn't very - * important, we just punt if we don't have easy locking - * available. - */ - (void) flock(fd, LOCK_EX); -#endif /* LOCK_EX */ - write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); - if (!Fortfile->was_pos_file) - (void) chmod(Fortfile->path, 0666); -#ifdef LOCK_EX - (void) flock(fd, LOCK_UN); -#endif /* LOCK_EX */ -#endif /* OK_TO_WRITE_DISK */ if (Wait) { if (Fort_len == 0) (void) fortlen(); @@ -585,9 +583,8 @@ over: fp->next = *head; *head = fp; } -#ifdef OK_TO_WRITE_DISK - fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) + fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); return (TRUE); } @@ -689,10 +686,9 @@ all_forts(FILEDESC *fp, char *offensive) obscene->name = ++sp; obscene->datfile = datfile; obscene->posfile = posfile; - obscene->read_tbl = FALSE; -#ifdef OK_TO_WRITE_DISK - obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + obscene->read_tbl = false; + if (WriteToDisk) + obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); } /* @@ -822,12 +818,13 @@ is_fortfile(const char *file, char **dat else free(datfile); if (posp != NULL) { -#ifdef OK_TO_WRITE_DISK - *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ - (void) strcat(*posp, ".pos"); -#else - *posp = NULL; -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) { + *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ + strcat(*posp, ".pos"); + } + else { + *posp = NULL; + } } DPRINTF(2, (stderr, "TRUE\n")); @@ -1108,23 +1105,21 @@ open_dat(FILEDESC *fp) static void get_pos(FILEDESC *fp) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ assert(fp->read_tbl); if (fp->pos == POS_UNKNOWN) { -#ifdef OK_TO_WRITE_DISK - if ((fd = open(fp->posfile, O_RDONLY)) < 0 || - read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + if (WriteToDisk) { + if ((fd = open(fp->posfile, O_RDONLY)) < 0 || + read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + fp->pos = arc4random_uniform(fp->tbl.str_numstr); + else if (fp->pos >= fp->tbl.str_numstr) + fp->pos %= fp->tbl.str_numstr; + if (fd >= 0) + close(fd); + } + else fp->pos = arc4random_uniform(fp->tbl.str_numstr); - else if (fp->pos >= fp->tbl.str_numstr) - fp->pos %= fp->tbl.str_numstr; - if (fd >= 0) - (void) close(fd); -#else - fp->pos = arc4random_uniform(fp->tbl.str_numstr); -#endif /* OK_TO_WRITE_DISK */ } if (++(fp->pos) >= fp->tbl.str_numstr) fp->pos -= fp->tbl.str_numstr; From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 15:40:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 277AEE84; Sun, 4 Nov 2012 15:40:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC098FC0A; Sun, 4 Nov 2012 15:40:38 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA4FeSK2017922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Nov 2012 02:40:29 +1100 Date: Mon, 5 Nov 2012 02:40:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek Subject: Re: svn commit: r242511 - head/sbin/fsck_msdosfs In-Reply-To: <20121104124843.GR1399@garage.freebsd.pl> Message-ID: <20121105000450.B4726@besplex.bde.org> References: <201211030918.qA39IcH6030403@svn.freebsd.org> <20121104124843.GR1399@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eJBLFwV1 c=1 sm=1 a=8cLHmhZKkUMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=cikS2bn0enQA:10 a=4PVSkj5MNWfP__btyhoA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 15:40:39 -0000 On Sun, 4 Nov 2012, Pawel Jakub Dawidek wrote: > On Sat, Nov 03, 2012 at 09:18:38AM +0000, Jaakko Heinonen wrote: >> Log: >> Print a newline after the error message. >> >> PR: bin/168447 >> Submitted by: Boris Kochergin >> >> Modified: >> head/sbin/fsck_msdosfs/check.c >> >> Modified: head/sbin/fsck_msdosfs/check.c >> ============================================================================== >> --- head/sbin/fsck_msdosfs/check.c Sat Nov 3 04:56:08 2012 (r242510) >> +++ head/sbin/fsck_msdosfs/check.c Sat Nov 3 09:18:37 2012 (r242511) >> @@ -68,6 +68,7 @@ checkfilesys(const char *fname) >> >> if (dosfs < 0) { >> perr("Can't open `%s'", fname); >> + printf("\n"); > > Why not just add \n to perr()? Doesn't perr() print at stderr, not > stdout? Because perr() has horrible API. Among other bugs, it depends on the global variable `preen', and when this is set, it does the following: - first, it always prints the message in format %s. The message must be a string literal, since this API hasn't caught up with the existence of vfprintf() yet. This bug is shared with perror(3). - next, it prints strerror(errno) in format " (%s)". This bug is shared with perror(3), except the format is gratuitously different (for perror(3), the format is ": %s\n"). (Actually, it no longer does this. So its reason for existence is broken. See below.) - then if (preen), it prints a newline - then if (preen), it prints a message with the device name and the program name, in that unusual order, and exits - the code has plenty of style bugs associated with this. For example, the previous 2 checks of (preen) are done in separate if statements though the condition for each is identical, and these closely-related statements are sseparated by a newline. Almost the whole vmsg() function is double-spaced. So a newline in the message would be even wronger than for perror(3) -- it would first give a newline before the ' (%s)' for strerror(errno). Then in the !preen case, there would still be no newline after the messages. Dependency on the global makes it hard to see what happens. No, perr() doesn't print on stderr. These bugs were a little different until 2 weeks ago when perr() was named from perror() and its API was changed significantly. These bugs were much smaller in 4.4BSD. Note that perr() is an fsck utility function that is used by fsck_msdosfs though it is not used by fsck_ffs where it was derived from. In 4.4BSD, fsck_ffs was named fsck and it had the the current utility functions pwarn(), pfatal() and panic() with slightly different semantics, but not the current utility function perr() which is more broken then the old ones. Some of the differences are: - in 4.4BSD, the 3 functions printed to the correct stream (stderr), but other parts of fsck printed to stdout and stderr quite randomly. This was "fixed" by printing more to stdout, but there are still places that print to stderr. - in 4.4BSD, none of the 3 functions printed strerror(errno) - the 4.4BSD code is quite readable except for STDC ifdefs. Now there is a vmsg() function to obfuscate all of this and add style bugs. pfatal() is now vmsg() with fatal = 1 and pwarn() is now vmsg() with fatal = 0. To add to the confusion, pfatal() is only actually fatal if (preen). panic() is now the same as pfatal() followed by exit(8) (it has to go through vmsg() and not pfatal() for technical reasons). These end result of these 3 functions hasn't changed significantly. Another insignficant difference is that the program name is now not hard-coded as "fsck". - the above is out of date for perr(). When its name was changed from perror(), its action was changed to not print strerror(errno). Now it is identical to pfatal() except for its name. It has even caught up with the existence of vfprintf(), so it now accepts an arg list like the other 3 functions. A newline in the message would no longer break the formatting of strerror(errno). It would just give a doubled newline in the actually-fatal (preen) case. Clearly the existence of perr() is a bug, but it has to remain in fsck/fs_utility.c for compatibility until its callers are changed. Most of its callers are wrong anyway: - fsck_ffs knows better than to call it. But fsck_ffs is broken in another way, by mixing streams using lots of errx() and err() calls. There were lots of errx() calls in 4.4BSD too. Last time I checked, this stream mixing was not too bad -- mostly the errx() calls are for up-front error checking where there has probably been no previous output to stdout. - fsck (the driver utility) used to call perror() just once outside of the utilities functions. It now calls perr() there. This call is because it is for a malloc() failure which will cause a null pointer dereference soon if perr() returns. And of course the message is missing a newline. fsck used to call perror() in the utilities functions, but these calls were changed to simply call perr(). This made them more broken than before. They are implemented next to the bad API so they should know what it is. They used to know, so they were careful about the newline, but they no longer are: % Index: fsutil.c % =================================================================== % RCS file: /home/ncvs/src/sbin/fsck/fsutil.c,v % retrieving revision 1.8 % retrieving revision 1.9 % diff -u -2 -r1.8 -r1.9 % --- fsutil.c 9 Apr 2004 19:58:28 -0000 1.8 % +++ fsutil.c 21 Oct 2012 12:01:11 -0000 1.9 % @@ -133,16 +137,13 @@ % % if (stat("/", &stslash) < 0) { % - perror("/"); % - printf("Can't stat root\n"); % + perr("Can't stat `/'"); % return (origname); % } perror(3) is hard to use, so there the message may have to be partly in the perror() arg and partly in another line after perror() returns. This works even better if perror() is not perror(3) and doesn't print a newline. This care has been lost, and the above now doesn't print the newline if perr() returns. % if (stat(origname, &stchar) < 0) { % - perror(origname); % - printf("Can't stat %s\n", origname); % + perr("Can't stat %s\n", origname); % return (origname); % } % if (!S_ISCHR(stchar.st_mode)) { % - perror(origname); % - printf("%s is not a char device\n", origname); % + perr("%s is not a char device\n", origname); % } % return (origname); % Now the newline is in the message, so it gives the opposite problem -- an extra newline if perr() doesn't return. - fsck_msdosfs. This uses perr() a lot. But it doesn't actually understand fsck's perror(), so it almost never printed a newline after calling it. After the recent commit, it now prints a newline after calling it in 1 more place. It still thinks that fsck's perror() is bug for bug compatible with perror(3), so it is careful to not put newlines in its messages. The result is that the calls work iff they are fatal (if (preen)), except they are now missing strerror(errno) which is useful in some cases. fsck_msdosfs also uses pwarn() and pfatal() a lot, but never panic(). It knows to supply the newline in or after the message for pwarn() and pfatal(). The distinction is apparently that perror() is used when strerror(errno) is wanted and pwarn() when an exit is not wanted, but there are a few cases where perror() is used when strerror(errno) is not wanted. It knows that pfatal() is often not actually has fatal, and has strange-looking code like: pfatal("whatever\n"); return FSFATAL; It mostly puts the newline in the message like this. fsck_ffs often dances in a more complicated way with this newline formatting. It does things like: @ pfatal("lost+found IS NOT A DIRECTORY"); @ if (reply("REALLOCATE") == 0) @ return (0); It's good to have the question on the same line as the pfatal() message. It can be hard to keep track of the number of newlines that your subroutines printed in code like this. @ oldlfdir = lfdir; @ if ((lfdir = allocdir(ROOTINO, (ino_t)0, lfmode)) == 0) { @ pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n"); @ return (0); @ } I don't like the doubled newlines. They only occur in dir.c (with 3 instances, 2 quoted here. I didn't choose these as especially bad examples) At least they aren't tripled due to pfatal() adding another one, since this case is interactive so it must be !preen. @ ... @ if (makeentry(lfdir, orphan, (name ? name : tempname)) == 0) { @ pfatal("SORRY. NO SPACE IN lost+found DIRECTORY"); @ printf("\n\n"); @ return (0); @ } No message here, and the doubled newline separate from the message, unlike in the above. Another difference between fsck_msdosfs and fsck_ffs in use of these functions is that the latter more often uses reply() after pfatal() than the former uses ask() after pfatal(). It only makes sense to ask after pwarn(). In the !preen case where asking is done, pfatal() is not actually fatal and is identical to pwarn(). Except, oops, I was looking in the wrong place for fsck_ffs's functions for this. The general ones are so unusable that fsck_ffs never uses any of them -- it has its own set in fsck_ffs/fsutils.c. Except for pfatal(), these are essentially(?) just the old ones from 4.4BSD, with the STDC ifdefs removed and a style bug (missing blank line after declarations) added where they were. pfatal() now does much more than printing and possibly not actually being fatal -- it now handles starting and recovering from background fsck. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 15:42:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F34EFF6; Sun, 4 Nov 2012 15:42:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0308FC0C; Sun, 4 Nov 2012 15:42:00 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA4Ffwd9019104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Nov 2012 02:41:59 +1100 Date: Mon, 5 Nov 2012 02:41:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kirk McKusick Subject: Re: svn commit: r242520 - head/sys/ufs/ffs In-Reply-To: <201211031855.qA3Ituxr024809@svn.freebsd.org> Message-ID: <20121105024038.J4726@besplex.bde.org> References: <201211031855.qA3Ituxr024809@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=It1G68Dg c=1 sm=1 a=v5L2lxYZMu8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Nw6HGA-A-RMA:10 a=ijvR74UKk4OuKKc3sxkA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 15:42:01 -0000 On Sat, 3 Nov 2012, Kirk McKusick wrote: > Log: > When a file is first being written, the dynamic block reallocation > (implemented by ffs_reallocblks_ufs[12]) relocates the file's blocks > so as to cluster them together into a contiguous set of blocks on > the disk. > > When the cluster crosses the boundary into the first indirect block, > the first indirect block is initially allocated in a position > immediately following the last direct block. Block reallocation > would usually destroy locality by moving the indirect block out of > the way to keep the data blocks contiguous. This change compensates > for this problem by noting that the first indirect block should be > left immediately following the last direct block. It then tries > to start a new cluster of contiguous blocks (referenced by the > indirect block) immediately following the indirect block. > > We should also do this for other indirect block boundaries, but it > is only important for the first one. > > Suggested by: Bruce Evans > MFC: 2 weeks Thanks. Sorry I haven't got around to testing your version of this. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:43:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC2E3D5D; Sun, 4 Nov 2012 20:43:53 +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 BF4BB8FC12; Sun, 4 Nov 2012 20:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KhrbP048598; Sun, 4 Nov 2012 20:43:53 GMT (envelope-from peter@svn.freebsd.org) Received: (from svn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4Khr3r048596; Sun, 4 Nov 2012 20:43:53 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042043.qA4Khr3r048596@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: svn set sender to peter@svn.freebsd.org using -f From: Peter Wemm Date: Sun, 4 Nov 2012 20:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242579 - svnadmin/tools/svnssh X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:43:54 -0000 Author: peter Date: Sun Nov 4 20:36:10 2012 New Revision: 242579 URL: http://svn.freebsd.org/changeset/base/242579 Log: Spell BINDIR correctly Modified: svnadmin/tools/svnssh/Makefile Modified: svnadmin/tools/svnssh/Makefile ============================================================================== --- svnadmin/tools/svnssh/Makefile Sun Nov 4 18:28:54 2012 (r242578) +++ svnadmin/tools/svnssh/Makefile Sun Nov 4 20:36:10 2012 (r242579) @@ -4,7 +4,7 @@ PROG= svnssh NO_MAN= too bad NO_SHARED=yes BINMODE=4555 -DESTDIR=/usr/local/bin +BINDIR=/usr/local/bin BINOWN=root BINGRP=wheel STRIP= From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:45:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0502EC4; Sun, 4 Nov 2012 20:45:31 +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 82D708FC0C; Sun, 4 Nov 2012 20:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KjVlP048902; Sun, 4 Nov 2012 20:45:31 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KjV4L048900; Sun, 4 Nov 2012 20:45:31 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042045.qA4KjV4L048900@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 20:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242580 - svnadmin/tools/checkacl X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:45:31 -0000 Author: peter Date: Sun Nov 4 20:45:31 2012 New Revision: 242580 URL: http://svn.freebsd.org/changeset/base/242580 Log: Spell BINDIR correcty (test commit) Modified: svnadmin/tools/checkacl/Makefile Modified: svnadmin/tools/checkacl/Makefile ============================================================================== --- svnadmin/tools/checkacl/Makefile Sun Nov 4 20:36:10 2012 (r242579) +++ svnadmin/tools/checkacl/Makefile Sun Nov 4 20:45:31 2012 (r242580) @@ -4,7 +4,7 @@ PROG= checkacl-base SRCS= checkacl.c NO_MAN= too bad NO_SHARED=yes -DESTDIR=/usr/local/bin +BINDIR=/usr/local/bin BINOWN=root BINGRP=wheel STRIP= From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:47:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64BDEE5; Sun, 4 Nov 2012 20:47:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 487648FC0A; Sun, 4 Nov 2012 20:47:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4Kleuj049447; Sun, 4 Nov 2012 20:47:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KleKc049435; Sun, 4 Nov 2012 20:47:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211042047.qA4KleKc049435@svn.freebsd.org> From: Xin LI Date: Sun, 4 Nov 2012 20:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242581 - vendor/less/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:47:40 -0000 Author: delphij Date: Sun Nov 4 20:47:39 2012 New Revision: 242581 URL: http://svn.freebsd.org/changeset/base/242581 Log: Vendor import of less v453 (beta). Modified: vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/configure vendor/less/dist/configure.ac vendor/less/dist/defines.ds vendor/less/dist/defines.h.in vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/option.c vendor/less/dist/output.c vendor/less/dist/position.c vendor/less/dist/screen.c vendor/less/dist/version.c Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/NEWS Sun Nov 4 20:47:39 2012 (r242581) @@ -11,6 +11,22 @@ ====================================================================== + Major changes between "less" versions 451 and 453 + +* Allow backslash escaping of metacharacters in LESS environment variable. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/README Sun Nov 4 20:47:39 2012 (r242581) @@ -1,7 +1,7 @@ - Less, version 451 + Less, version 453 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 453, released 27 Oct 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: vendor/less/dist/configure ============================================================================== --- vendor/less/dist/configure Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/configure Sun Nov 4 20:47:39 2012 (r242581) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: vendor/less/dist/configure.ac ============================================================================== --- vendor/less/dist/configure.ac Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/configure.ac Sun Nov 4 20:47:39 2012 (r242581) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: vendor/less/dist/defines.ds ============================================================================== --- vendor/less/dist/defines.ds Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/defines.ds Sun Nov 4 20:47:39 2012 (r242581) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: vendor/less/dist/defines.h.in ============================================================================== --- vendor/less/dist/defines.h.in Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/defines.h.in Sun Nov 4 20:47:39 2012 (r242581) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: vendor/less/dist/defines.o2 ============================================================================== --- vendor/less/dist/defines.o2 Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/defines.o2 Sun Nov 4 20:47:39 2012 (r242581) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: vendor/less/dist/defines.o9 ============================================================================== --- vendor/less/dist/defines.o9 Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/defines.o9 Sun Nov 4 20:47:39 2012 (r242581) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: vendor/less/dist/defines.wn ============================================================================== --- vendor/less/dist/defines.wn Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/defines.wn Sun Nov 4 20:47:39 2012 (r242581) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: vendor/less/dist/less.man ============================================================================== --- vendor/less/dist/less.man Sun Nov 4 20:45:31 2012 (r242580) +++ vendor/less/dist/less.man Sun Nov 4 20:47:39 2012 (r242581) @@ -437,63 +437,69 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, - like this: + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a space, + tab, dash or dollar sign ($) is found. For example, to set two -D + options on MS-DOS, you can separate them with a dollar sign, like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + or a space like this: + + LESS="Dn9.1 Ds4.1" + + Any character may be included literally in an option string by preced- + ing it with a backslash. -? or --help - This option displays a summary of the commands accepted by less - (the same as the h command). (Depending on how your shell - interprets the question mark, it may be necessary to quote the + This option displays a summary of the commands accepted by less + (the same as the h command). (Depending on how your shell + interprets the question mark, it may be necessary to quote the question mark, thus: "-\?".) -a or --search-skip-screen - By default, forward searches start at the top of the displayed - screen and backwards searches start at the bottom of the dis- - played screen (except for repeated searches invoked by the n or - N commands, which start after or before the "target" line + By default, forward searches start at the top of the displayed + screen and backwards searches start at the bottom of the dis- + played screen (except for repeated searches invoked by the n or + N commands, which start after or before the "target" line respectively; see the -j option for more about the target line). - The -a option causes forward searches to instead start at the - bottom of the screen and backward searches to start at the top + The -a option causes forward searches to instead start at the + bottom of the screen and backward searches to start at the top of the screen, thus skipping all lines displayed on the screen. -A or --SEARCH-SKIP-SCREEN - Causes all forward searches (not just non-repeated searches) to - start just after the target line, and all backward searches to - start just before the target line. Thus, forward searches will + Causes all forward searches (not just non-repeated searches) to + start just after the target line, and all backward searches to + start just before the target line. Thus, forward searches will skip part of the displayed screen (from the first line up to and - including the target line). Similarly backwards searches will + including the target line). Similarly backwards searches will skip the displayed screen from the last line up to and including the target line. This was the default behavior in less versions prior to 441. -bn or --buffers=n - Specifies the amount of buffer space less will use for each - file, in units of kilobytes (1024 bytes). By default 64K of - buffer space is used for each file (unless the file is a pipe; - see the -B option). The -b option specifies instead that n + Specifies the amount of buffer space less will use for each + file, in units of kilobytes (1024 bytes). By default 64K of + buffer space is used for each file (unless the file is a pipe; + see the -B option). The -b option specifies instead that n kilobytes of buffer space should be used for each file. If n is - -1, buffer space is unlimited; that is, the entire file can be + -1, buffer space is unlimited; that is, the entire file can be read into memory. -B or --auto-buffers By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from - the pipe, this can cause a large amount of memory to be allo- + the pipe, this can cause a large amount of memory to be allo- cated. The -B option disables this automatic allocation of buf- - fers for pipes, so that only 64K (or the amount of space speci- + fers for pipes, so that only 64K (or the amount of space speci- fied by the -b option) is used for the pipe. Warning: use of -B - can result in erroneous display, since only the most recently - viewed part of the piped data is kept in memory; any earlier + can result in erroneous display, since only the most recently + viewed part of the piped data is kept in memory; any earlier data is lost. -c or --clear-screen - Causes full screen repaints to be painted from the top line - down. By default, full screen repaints are done by scrolling + Causes full screen repaints to be painted from the top line + down. By default, full screen repaints are done by scrolling from the bottom of the screen. -C or --CLEAR-SCREEN @@ -501,24 +507,24 @@ LESS(1) -d or --dumb The -d option suppresses the error message normally displayed if - the terminal is dumb; that is, lacks some important capability, + the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The - -d option does not otherwise change the behavior of less on a + -d option does not otherwise change the behavior of less on a dumb terminal. -Dxcolor or --color=xcolor [MS-DOS only] Sets the color of the text displayed. x is a sin- - gle character which selects the type of text whose color is - being set: n=normal, s=standout, d=bold, u=underlined, k=blink. - color is a pair of numbers separated by a period. The first - number selects the foreground color and the second selects the - background color of the text. A single number N is the same as + gle character which selects the type of text whose color is + being set: n=normal, s=standout, d=bold, u=underlined, k=blink. + color is a pair of numbers separated by a period. The first + number selects the foreground color and the second selects the + background color of the text. A single number N is the same as N.M, where M is the normal background color. -e or --quit-at-eof - Causes less to automatically exit the second time it reaches - end-of-file. By default, the only way to exit less is via the + Causes less to automatically exit the second time it reaches + end-of-file. By default, the only way to exit less is via the "q" command. -E or --QUIT-AT-EOF @@ -527,7 +533,7 @@ LESS(1) -f or --force Forces non-regular files to be opened. (A non-regular file is a - directory or a device special file.) Also suppresses the warn- + directory or a device special file.) Also suppresses the warn- ing message when a binary file is opened. By default, less will refuse to open non-regular files. Note that some operating sys- tems will not allow directories to be read, even if -f is set. @@ -537,236 +543,236 @@ LESS(1) played on the first screen. -g or --hilite-search - Normally, less will highlight ALL strings which match the last - search command. The -g option changes this behavior to high- - light only the particular string which was found by the last + Normally, less will highlight ALL strings which match the last + search command. The -g option changes this behavior to high- + light only the particular string which was found by the last search command. This can cause less to run somewhat faster than the default. -G or --HILITE-SEARCH - The -G option suppresses all highlighting of strings found by + The -G option suppresses all highlighting of strings found by search commands. -hn or --max-back-scroll=n - Specifies a maximum number of lines to scroll backward. If it + Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.) -i or --ignore-case Causes searches to ignore case; that is, uppercase and lowercase - are considered identical. This option is ignored if any upper- - case letters appear in the search pattern; in other words, if a - pattern contains uppercase letters, then that search does not + are considered identical. This option is ignored if any upper- + case letters appear in the search pattern; in other words, if a + pattern contains uppercase letters, then that search does not ignore case. -I or --IGNORE-CASE - Like -i, but searches ignore case even if the pattern contains + Like -i, but searches ignore case even if the pattern contains uppercase letters. -jn or --jump-target=n - Specifies a line on the screen where the "target" line is to be - positioned. The target line is the line specified by any com- - mand to search for a pattern, jump to a line number, jump to a + Specifies a line on the screen where the "target" line is to be + positioned. The target line is the line specified by any com- + mand to search for a pattern, jump to a line number, jump to a file percentage or jump to a tag. The screen line may be speci- - fied by a number: the top line on the screen is 1, the next is + fied by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line rel- ative to the bottom of the screen: the bottom line on the screen - is -1, the second to the bottom is -2, and so on. Alternately, - the screen line may be specified as a fraction of the height of - the screen, starting with a decimal point: .5 is in the middle - of the screen, .3 is three tenths down from the first line, and - so on. If the line is specified as a fraction, the actual line - number is recalculated if the terminal window is resized, so - that the target line remains at the specified fraction of the - screen height. If any form of the -j option is used, forward - searches begin at the line immediately after the target line, - and backward searches begin at the target line, unless changed - by -a or -A. For example, if "-j4" is used, the target line is - the fourth line on the screen, so forward searches begin at the + is -1, the second to the bottom is -2, and so on. Alternately, + the screen line may be specified as a fraction of the height of + the screen, starting with a decimal point: .5 is in the middle + of the screen, .3 is three tenths down from the first line, and + so on. If the line is specified as a fraction, the actual line + number is recalculated if the terminal window is resized, so + that the target line remains at the specified fraction of the + screen height. If any form of the -j option is used, forward + searches begin at the line immediately after the target line, + and backward searches begin at the target line, unless changed + by -a or -A. For example, if "-j4" is used, the target line is + the fourth line on the screen, so forward searches begin at the fifth line on the screen. -J or --status-column - Displays a status column at the left edge of the screen. The - status column shows the lines that matched the current search. - The status column is also used if the -w or -W option is in + Displays a status column at the left edge of the screen. The + status column shows the lines that matched the current search. + The status column is also used if the -w or -W option is in effect. -kfilename or --lesskey-file=filename - Causes less to open and interpret the named file as a lesskey + Causes less to open and interpret the named file as a lesskey (1) file. Multiple -k options may be specified. If the LESSKEY - or LESSKEY_SYSTEM environment variable is set, or if a lesskey + or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file. -K or --quit-on-intr - Causes less to exit immediately (with status 2) when an inter- - rupt character (usually ^C) is typed. Normally, an interrupt + Causes less to exit immediately (with status 2) when an inter- + rupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to - its command prompt. Note that use of this option makes it + its command prompt. Note that use of this option makes it impossible to return to the command prompt from the "F" command. -L or --no-lessopen - Ignore the LESSOPEN environment variable (see the INPUT PRE- - PROCESSOR section below). This option can be set from within - less, but it will apply only to files opened subsequently, not + Ignore the LESSOPEN environment variable (see the INPUT PRE- + PROCESSOR section below). This option can be set from within + less, but it will apply only to files opened subsequently, not to the file which is currently open. -m or --long-prompt - Causes less to prompt verbosely (like more), with the percent + Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon. -M or --LONG-PROMPT Causes less to prompt even more verbosely than more. -n or --line-numbers - Suppresses line numbers. The default (to use line numbers) may - cause less to run more slowly in some cases, especially with a - very large input file. Suppressing line numbers with the -n - option will avoid this problem. Using line numbers means: the + Suppresses line numbers. The default (to use line numbers) may + cause less to run more slowly in some cases, especially with a + very large input file. Suppressing line numbers with the -n + option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = - command, and the v command will pass the current line number to - the editor (see also the discussion of LESSEDIT in PROMPTS + command, and the v command will pass the current line number to + the editor (see also the discussion of LESSEDIT in PROMPTS below). -N or --LINE-NUMBERS - Causes a line number to be displayed at the beginning of each + Causes a line number to be displayed at the beginning of each line in the display. -ofilename or --log-file=filename - Causes less to copy its input to the named file as it is being + Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an - ordinary file. If the file already exists, less will ask for + ordinary file. If the file already exists, less will ask for confirmation before overwriting it. -Ofilename or --LOG-FILE=filename The -O option is like -o, but it will overwrite an existing file without asking for confirmation. - If no log file has been specified, the -o and -O options can be - used from within less to specify a log file. Without a file + If no log file has been specified, the -o and -O options can be + used from within less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying -o from within less. -ppattern or --pattern=pattern - The -p option on the command line is equivalent to specifying - +/pattern; that is, it tells less to start at the first occur- + The -p option on the command line is equivalent to specifying + +/pattern; that is, it tells less to start at the first occur- rence of pattern in the file. -Pprompt or --prompt=prompt - Provides a way to tailor the three prompt styles to your own + Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS envi- ronment variable, rather than being typed in with each less com- mand. Such an option must either be the last option in the LESS - variable, or be terminated by a dollar sign. -Ps followed by a - string changes the default (short) prompt to that string. -Pm - changes the medium (-m) prompt. -PM changes the long (-M) - prompt. -Ph changes the prompt for the help screen. -P= - changes the message printed by the = command. -Pw changes the - message printed while waiting for data (in the F command). All - prompt strings consist of a sequence of letters and special + variable, or be terminated by a dollar sign. -Ps followed by a + string changes the default (short) prompt to that string. -Pm + changes the medium (-m) prompt. -PM changes the long (-M) + prompt. -Ph changes the prompt for the help screen. -P= + changes the message printed by the = command. -Pw changes the + message printed while waiting for data (in the F command). All + prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. -q or --quiet or --silent - Causes moderately "quiet" operation: the terminal bell is not + Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual - bell", it is used instead. The bell will be rung on certain - other errors, such as typing an invalid character. The default + bell", it is used instead. The bell will be rung on certain + other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. -Q or --QUIET or --SILENT - Causes totally "quiet" operation: the terminal bell is never + Causes totally "quiet" operation: the terminal bell is never rung. -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is - to display control characters using the caret notation; for + to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual - appearance of the screen (since this depends on how the screen + appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various dis- - play problems may result, such as long lines being split in the + play problems may result, such as long lines being split in the wrong place. -R or --RAW-CONTROL-CHARS - Like -r, but only ANSI "color" escape sequences are output in + Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor- rectly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [ ... m - where the "..." is zero or more color specification characters - For the purpose of keeping track of screen appearance, ANSI - color escape sequences are assumed to not move the cursor. You - can make less think that characters other than "m" can end ANSI - color escape sequences by setting the environment variable + where the "..." is zero or more color specification characters + For the purpose of keeping track of screen appearance, ANSI + color escape sequences are assumed to not move the cursor. You + can make less think that characters other than "m" can end ANSI + color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color - escape sequence. And you can make less think that characters - other than the standard ones may appear between the ESC and the - m by setting the environment variable LESSANSIMIDCHARS to the + escape sequence. And you can make less think that characters + other than the standard ones may appear between the ESC and the + m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. -s or --squeeze-blank-lines - Causes consecutive blank lines to be squeezed into a single + Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing nroff output. -S or --chop-long-lines - Causes lines longer than the screen width to be chopped (trun- + Causes lines longer than the screen width to be chopped (trun- cated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not shown. The default - is to wrap long lines; that is, display the remainder on the + is to wrap long lines; that is, display the remainder on the next line. -ttag or --tag=tag The -t option, followed immediately by a TAG, will edit the file - containing that tag. For this to work, tag information must be - available; for example, there may be a file in the current + containing that tag. For this to work, tag information must be + available; for example, there may be a file in the current directory called "tags", which was previously built by ctags (1) or an equivalent command. If the environment variable LESSGLOB- - ALTAGS is set, it is taken to be the name of a command compati- - ble with global (1), and that command is executed to find the + ALTAGS is set, it is taken to be the name of a command compati- + ble with global (1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The - -t option may also be specified from within less (using the - - command) as a way of examining a new file. The command ":t" is + -t option may also be specified from within less (using the - + command) as a way of examining a new file. The command ":t" is equivalent to specifying -t from within less. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:48:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E123D245; Sun, 4 Nov 2012 20:48:26 +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 AD1518FC12; Sun, 4 Nov 2012 20:48:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KmQX4049692; Sun, 4 Nov 2012 20:48:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KmQhI049691; Sun, 4 Nov 2012 20:48:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211042048.qA4KmQhI049691@svn.freebsd.org> From: Xin LI Date: Sun, 4 Nov 2012 20:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242582 - vendor/less/v453 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:48:27 -0000 Author: delphij Date: Sun Nov 4 20:48:26 2012 New Revision: 242582 URL: http://svn.freebsd.org/changeset/base/242582 Log: Tag less v453. Added: vendor/less/v453/ - copied from r242581, vendor/less/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:50:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E10F55C; Sun, 4 Nov 2012 20:50:23 +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 512628FC0C; Sun, 4 Nov 2012 20:50:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KoNix050275; Sun, 4 Nov 2012 20:50:23 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KoND5050274; Sun, 4 Nov 2012 20:50:23 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211042050.qA4KoND5050274@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 20:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242583 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:50:23 -0000 Author: eadler Date: Sun Nov 4 20:50:23 2012 New Revision: 242583 URL: http://svn.freebsd.org/changeset/base/242583 Log: Add support for a few more devices: PNP0510 and FUJ02E5 for a "Wacom Tablet at FuS Lifebook T" PNP0502 and PNP0511 for some other generic devices. PR: kern/173357 Submitted by: Andrey Zakharchenko Approved by: cperciva (implicit) MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_acpi.c Modified: head/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- head/sys/dev/uart/uart_bus_acpi.c Sun Nov 4 20:48:26 2012 (r242582) +++ head/sys/dev/uart/uart_bus_acpi.c Sun Nov 4 20:50:23 2012 (r242583) @@ -59,7 +59,11 @@ static driver_t uart_acpi_driver = { static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ + {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ + {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ + {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ {0} }; From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:52:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC8ED6EA; Sun, 4 Nov 2012 20:52:26 +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 BED348FC0A; Sun, 4 Nov 2012 20:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KqQWv050836; Sun, 4 Nov 2012 20:52:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KqQKY050824; Sun, 4 Nov 2012 20:52:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211042052.qA4KqQKY050824@svn.freebsd.org> From: Xin LI Date: Sun, 4 Nov 2012 20:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242584 - in head: contrib/less usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:52:27 -0000 Author: delphij Date: Sun Nov 4 20:52:26 2012 New Revision: 242584 URL: http://svn.freebsd.org/changeset/base/242584 Log: MFV: less v453. Modified: head/contrib/less/NEWS head/contrib/less/README head/contrib/less/configure head/contrib/less/configure.ac head/contrib/less/defines.ds head/contrib/less/defines.h.in head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/less.man head/contrib/less/less.nro head/contrib/less/lessecho.man head/contrib/less/lessecho.nro head/contrib/less/lesskey.man head/contrib/less/lesskey.nro head/contrib/less/option.c head/contrib/less/output.c head/contrib/less/position.c head/contrib/less/screen.c head/contrib/less/version.c head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/NEWS Sun Nov 4 20:52:26 2012 (r242584) @@ -11,6 +11,22 @@ ====================================================================== + Major changes between "less" versions 451 and 453 + +* Allow backslash escaping of metacharacters in LESS environment variable. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/README Sun Nov 4 20:52:26 2012 (r242584) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 453 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 453, released 27 Oct 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: head/contrib/less/configure ============================================================================== --- head/contrib/less/configure Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/configure Sun Nov 4 20:52:26 2012 (r242584) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: head/contrib/less/configure.ac ============================================================================== --- head/contrib/less/configure.ac Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/configure.ac Sun Nov 4 20:52:26 2012 (r242584) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: head/contrib/less/defines.ds ============================================================================== --- head/contrib/less/defines.ds Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/defines.ds Sun Nov 4 20:52:26 2012 (r242584) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: head/contrib/less/defines.h.in ============================================================================== --- head/contrib/less/defines.h.in Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/defines.h.in Sun Nov 4 20:52:26 2012 (r242584) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: head/contrib/less/defines.o2 ============================================================================== --- head/contrib/less/defines.o2 Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/defines.o2 Sun Nov 4 20:52:26 2012 (r242584) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: head/contrib/less/defines.o9 ============================================================================== --- head/contrib/less/defines.o9 Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/defines.o9 Sun Nov 4 20:52:26 2012 (r242584) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: head/contrib/less/defines.wn ============================================================================== --- head/contrib/less/defines.wn Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/defines.wn Sun Nov 4 20:52:26 2012 (r242584) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: head/contrib/less/less.man ============================================================================== --- head/contrib/less/less.man Sun Nov 4 20:50:23 2012 (r242583) +++ head/contrib/less/less.man Sun Nov 4 20:52:26 2012 (r242584) @@ -437,63 +437,69 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, - like this: + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a space, + tab, dash or dollar sign ($) is found. For example, to set two -D + options on MS-DOS, you can separate them with a dollar sign, like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + or a space like this: + + LESS="Dn9.1 Ds4.1" + + Any character may be included literally in an option string by preced- + ing it with a backslash. -? or --help - This option displays a summary of the commands accepted by less - (the same as the h command). (Depending on how your shell - interprets the question mark, it may be necessary to quote the + This option displays a summary of the commands accepted by less + (the same as the h command). (Depending on how your shell + interprets the question mark, it may be necessary to quote the question mark, thus: "-\?".) -a or --search-skip-screen - By default, forward searches start at the top of the displayed - screen and backwards searches start at the bottom of the dis- - played screen (except for repeated searches invoked by the n or - N commands, which start after or before the "target" line + By default, forward searches start at the top of the displayed + screen and backwards searches start at the bottom of the dis- + played screen (except for repeated searches invoked by the n or + N commands, which start after or before the "target" line respectively; see the -j option for more about the target line). - The -a option causes forward searches to instead start at the - bottom of the screen and backward searches to start at the top + The -a option causes forward searches to instead start at the + bottom of the screen and backward searches to start at the top of the screen, thus skipping all lines displayed on the screen. -A or --SEARCH-SKIP-SCREEN - Causes all forward searches (not just non-repeated searches) to - start just after the target line, and all backward searches to - start just before the target line. Thus, forward searches will + Causes all forward searches (not just non-repeated searches) to + start just after the target line, and all backward searches to + start just before the target line. Thus, forward searches will skip part of the displayed screen (from the first line up to and - including the target line). Similarly backwards searches will + including the target line). Similarly backwards searches will skip the displayed screen from the last line up to and including the target line. This was the default behavior in less versions prior to 441. -bn or --buffers=n - Specifies the amount of buffer space less will use for each - file, in units of kilobytes (1024 bytes). By default 64K of - buffer space is used for each file (unless the file is a pipe; - see the -B option). The -b option specifies instead that n + Specifies the amount of buffer space less will use for each + file, in units of kilobytes (1024 bytes). By default 64K of + buffer space is used for each file (unless the file is a pipe; + see the -B option). The -b option specifies instead that n kilobytes of buffer space should be used for each file. If n is - -1, buffer space is unlimited; that is, the entire file can be + -1, buffer space is unlimited; that is, the entire file can be read into memory. -B or --auto-buffers By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from - the pipe, this can cause a large amount of memory to be allo- + the pipe, this can cause a large amount of memory to be allo- cated. The -B option disables this automatic allocation of buf- - fers for pipes, so that only 64K (or the amount of space speci- + fers for pipes, so that only 64K (or the amount of space speci- fied by the -b option) is used for the pipe. Warning: use of -B - can result in erroneous display, since only the most recently - viewed part of the piped data is kept in memory; any earlier + can result in erroneous display, since only the most recently + viewed part of the piped data is kept in memory; any earlier data is lost. -c or --clear-screen - Causes full screen repaints to be painted from the top line - down. By default, full screen repaints are done by scrolling + Causes full screen repaints to be painted from the top line + down. By default, full screen repaints are done by scrolling from the bottom of the screen. -C or --CLEAR-SCREEN @@ -501,24 +507,24 @@ LESS(1) -d or --dumb The -d option suppresses the error message normally displayed if - the terminal is dumb; that is, lacks some important capability, + the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The - -d option does not otherwise change the behavior of less on a + -d option does not otherwise change the behavior of less on a dumb terminal. -Dxcolor or --color=xcolor [MS-DOS only] Sets the color of the text displayed. x is a sin- - gle character which selects the type of text whose color is - being set: n=normal, s=standout, d=bold, u=underlined, k=blink. - color is a pair of numbers separated by a period. The first - number selects the foreground color and the second selects the - background color of the text. A single number N is the same as + gle character which selects the type of text whose color is + being set: n=normal, s=standout, d=bold, u=underlined, k=blink. + color is a pair of numbers separated by a period. The first + number selects the foreground color and the second selects the + background color of the text. A single number N is the same as N.M, where M is the normal background color. -e or --quit-at-eof - Causes less to automatically exit the second time it reaches - end-of-file. By default, the only way to exit less is via the + Causes less to automatically exit the second time it reaches + end-of-file. By default, the only way to exit less is via the "q" command. -E or --QUIT-AT-EOF @@ -527,7 +533,7 @@ LESS(1) -f or --force Forces non-regular files to be opened. (A non-regular file is a - directory or a device special file.) Also suppresses the warn- + directory or a device special file.) Also suppresses the warn- ing message when a binary file is opened. By default, less will refuse to open non-regular files. Note that some operating sys- tems will not allow directories to be read, even if -f is set. @@ -537,236 +543,236 @@ LESS(1) played on the first screen. -g or --hilite-search - Normally, less will highlight ALL strings which match the last - search command. The -g option changes this behavior to high- - light only the particular string which was found by the last + Normally, less will highlight ALL strings which match the last + search command. The -g option changes this behavior to high- + light only the particular string which was found by the last search command. This can cause less to run somewhat faster than the default. -G or --HILITE-SEARCH - The -G option suppresses all highlighting of strings found by + The -G option suppresses all highlighting of strings found by search commands. -hn or --max-back-scroll=n - Specifies a maximum number of lines to scroll backward. If it + Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.) -i or --ignore-case Causes searches to ignore case; that is, uppercase and lowercase - are considered identical. This option is ignored if any upper- - case letters appear in the search pattern; in other words, if a - pattern contains uppercase letters, then that search does not + are considered identical. This option is ignored if any upper- + case letters appear in the search pattern; in other words, if a + pattern contains uppercase letters, then that search does not ignore case. -I or --IGNORE-CASE - Like -i, but searches ignore case even if the pattern contains + Like -i, but searches ignore case even if the pattern contains uppercase letters. -jn or --jump-target=n - Specifies a line on the screen where the "target" line is to be - positioned. The target line is the line specified by any com- - mand to search for a pattern, jump to a line number, jump to a + Specifies a line on the screen where the "target" line is to be + positioned. The target line is the line specified by any com- + mand to search for a pattern, jump to a line number, jump to a file percentage or jump to a tag. The screen line may be speci- - fied by a number: the top line on the screen is 1, the next is + fied by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line rel- ative to the bottom of the screen: the bottom line on the screen - is -1, the second to the bottom is -2, and so on. Alternately, - the screen line may be specified as a fraction of the height of - the screen, starting with a decimal point: .5 is in the middle - of the screen, .3 is three tenths down from the first line, and - so on. If the line is specified as a fraction, the actual line - number is recalculated if the terminal window is resized, so - that the target line remains at the specified fraction of the - screen height. If any form of the -j option is used, forward - searches begin at the line immediately after the target line, - and backward searches begin at the target line, unless changed - by -a or -A. For example, if "-j4" is used, the target line is - the fourth line on the screen, so forward searches begin at the + is -1, the second to the bottom is -2, and so on. Alternately, + the screen line may be specified as a fraction of the height of + the screen, starting with a decimal point: .5 is in the middle + of the screen, .3 is three tenths down from the first line, and + so on. If the line is specified as a fraction, the actual line + number is recalculated if the terminal window is resized, so + that the target line remains at the specified fraction of the + screen height. If any form of the -j option is used, forward + searches begin at the line immediately after the target line, + and backward searches begin at the target line, unless changed + by -a or -A. For example, if "-j4" is used, the target line is + the fourth line on the screen, so forward searches begin at the fifth line on the screen. -J or --status-column - Displays a status column at the left edge of the screen. The - status column shows the lines that matched the current search. - The status column is also used if the -w or -W option is in + Displays a status column at the left edge of the screen. The + status column shows the lines that matched the current search. + The status column is also used if the -w or -W option is in effect. -kfilename or --lesskey-file=filename - Causes less to open and interpret the named file as a lesskey + Causes less to open and interpret the named file as a lesskey (1) file. Multiple -k options may be specified. If the LESSKEY - or LESSKEY_SYSTEM environment variable is set, or if a lesskey + or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file. -K or --quit-on-intr - Causes less to exit immediately (with status 2) when an inter- - rupt character (usually ^C) is typed. Normally, an interrupt + Causes less to exit immediately (with status 2) when an inter- + rupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to - its command prompt. Note that use of this option makes it + its command prompt. Note that use of this option makes it impossible to return to the command prompt from the "F" command. -L or --no-lessopen - Ignore the LESSOPEN environment variable (see the INPUT PRE- - PROCESSOR section below). This option can be set from within - less, but it will apply only to files opened subsequently, not + Ignore the LESSOPEN environment variable (see the INPUT PRE- + PROCESSOR section below). This option can be set from within + less, but it will apply only to files opened subsequently, not to the file which is currently open. -m or --long-prompt - Causes less to prompt verbosely (like more), with the percent + Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon. -M or --LONG-PROMPT Causes less to prompt even more verbosely than more. -n or --line-numbers - Suppresses line numbers. The default (to use line numbers) may - cause less to run more slowly in some cases, especially with a - very large input file. Suppressing line numbers with the -n - option will avoid this problem. Using line numbers means: the + Suppresses line numbers. The default (to use line numbers) may + cause less to run more slowly in some cases, especially with a + very large input file. Suppressing line numbers with the -n + option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = - command, and the v command will pass the current line number to - the editor (see also the discussion of LESSEDIT in PROMPTS + command, and the v command will pass the current line number to + the editor (see also the discussion of LESSEDIT in PROMPTS below). -N or --LINE-NUMBERS - Causes a line number to be displayed at the beginning of each + Causes a line number to be displayed at the beginning of each line in the display. -ofilename or --log-file=filename - Causes less to copy its input to the named file as it is being + Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an - ordinary file. If the file already exists, less will ask for + ordinary file. If the file already exists, less will ask for confirmation before overwriting it. -Ofilename or --LOG-FILE=filename The -O option is like -o, but it will overwrite an existing file without asking for confirmation. - If no log file has been specified, the -o and -O options can be - used from within less to specify a log file. Without a file + If no log file has been specified, the -o and -O options can be + used from within less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying -o from within less. -ppattern or --pattern=pattern - The -p option on the command line is equivalent to specifying - +/pattern; that is, it tells less to start at the first occur- + The -p option on the command line is equivalent to specifying + +/pattern; that is, it tells less to start at the first occur- rence of pattern in the file. -Pprompt or --prompt=prompt - Provides a way to tailor the three prompt styles to your own + Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS envi- ronment variable, rather than being typed in with each less com- mand. Such an option must either be the last option in the LESS - variable, or be terminated by a dollar sign. -Ps followed by a - string changes the default (short) prompt to that string. -Pm - changes the medium (-m) prompt. -PM changes the long (-M) - prompt. -Ph changes the prompt for the help screen. -P= - changes the message printed by the = command. -Pw changes the - message printed while waiting for data (in the F command). All - prompt strings consist of a sequence of letters and special + variable, or be terminated by a dollar sign. -Ps followed by a + string changes the default (short) prompt to that string. -Pm + changes the medium (-m) prompt. -PM changes the long (-M) + prompt. -Ph changes the prompt for the help screen. -P= + changes the message printed by the = command. -Pw changes the + message printed while waiting for data (in the F command). All + prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. -q or --quiet or --silent - Causes moderately "quiet" operation: the terminal bell is not + Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual - bell", it is used instead. The bell will be rung on certain - other errors, such as typing an invalid character. The default + bell", it is used instead. The bell will be rung on certain + other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. -Q or --QUIET or --SILENT - Causes totally "quiet" operation: the terminal bell is never + Causes totally "quiet" operation: the terminal bell is never rung. -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is - to display control characters using the caret notation; for + to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual - appearance of the screen (since this depends on how the screen + appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various dis- - play problems may result, such as long lines being split in the + play problems may result, such as long lines being split in the wrong place. -R or --RAW-CONTROL-CHARS - Like -r, but only ANSI "color" escape sequences are output in + Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor- rectly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [ ... m - where the "..." is zero or more color specification characters - For the purpose of keeping track of screen appearance, ANSI - color escape sequences are assumed to not move the cursor. You - can make less think that characters other than "m" can end ANSI - color escape sequences by setting the environment variable + where the "..." is zero or more color specification characters + For the purpose of keeping track of screen appearance, ANSI + color escape sequences are assumed to not move the cursor. You + can make less think that characters other than "m" can end ANSI + color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color - escape sequence. And you can make less think that characters - other than the standard ones may appear between the ESC and the - m by setting the environment variable LESSANSIMIDCHARS to the + escape sequence. And you can make less think that characters + other than the standard ones may appear between the ESC and the + m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. -s or --squeeze-blank-lines - Causes consecutive blank lines to be squeezed into a single + Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing nroff output. -S or --chop-long-lines - Causes lines longer than the screen width to be chopped (trun- + Causes lines longer than the screen width to be chopped (trun- cated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not shown. The default - is to wrap long lines; that is, display the remainder on the + is to wrap long lines; that is, display the remainder on the next line. -ttag or --tag=tag The -t option, followed immediately by a TAG, will edit the file - containing that tag. For this to work, tag information must be - available; for example, there may be a file in the current + containing that tag. For this to work, tag information must be + available; for example, there may be a file in the current directory called "tags", which was previously built by ctags (1) or an equivalent command. If the environment variable LESSGLOB- - ALTAGS is set, it is taken to be the name of a command compati- - ble with global (1), and that command is executed to find the + ALTAGS is set, it is taken to be the name of a command compati- + ble with global (1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The - -t option may also be specified from within less (using the - - command) as a way of examining a new file. The command ":t" is + -t option may also be specified from within less (using the - + command) as a way of examining a new file. The command ":t" is *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 20:58:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85602893; Sun, 4 Nov 2012 20:58:25 +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 6AAEA8FC08; Sun, 4 Nov 2012 20:58:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4KwPYH052230; Sun, 4 Nov 2012 20:58:25 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4KwPxJ052228; Sun, 4 Nov 2012 20:58:25 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042058.qA4KwPxJ052228@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 20:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242585 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 20:58:25 -0000 Author: peter Date: Sun Nov 4 20:58:25 2012 New Revision: 242585 URL: http://svn.freebsd.org/changeset/base/242585 Log: Change the "forever" URL from svn.freebsd.org to svnweb.freebsd.org since that's where the rewrite rule is being evaluated anyway. There is no http server on svn.freebsd.org at all, just a netcat redirect. Modified: svnadmin/conf/mailer.conf Modified: svnadmin/conf/mailer.conf ============================================================================== --- svnadmin/conf/mailer.conf Sun Nov 4 20:52:26 2012 (r242584) +++ svnadmin/conf/mailer.conf Sun Nov 4 20:58:25 2012 (r242585) @@ -201,8 +201,7 @@ generate_diffs = add copy modify # # The available substitution variable is: rev #commit_url = http://diffs.server.com/trac/software/changeset/%(rev)s -commit_url = http://svn.freebsd.org/changeset/base/%(rev)s -#commit_url = http://svn.freebsd.org/viewvc/svntest/?view=rev&rev=%(rev)s +commit_url = http://svnweb.freebsd.org/changeset/base/%(rev)s # Diff URL construction. For the configured diff URL types, the diff # section (which follows the message header) will include the URL From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 21:38:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59F34E2C; Sun, 4 Nov 2012 21:38: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 3E8658FC0A; Sun, 4 Nov 2012 21:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4LcSA7059861; Sun, 4 Nov 2012 21:38:28 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4LcSgm059859; Sun, 4 Nov 2012 21:38:28 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042138.qA4LcSgm059859@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 21:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242586 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 21:38:28 -0000 Author: peter Date: Sun Nov 4 21:38:27 2012 New Revision: 242586 URL: http://svn.freebsd.org/changeset/base/242586 Log: Test commit to verify that the svnroot updater scripts work. Modified: svnadmin/conf/authz Modified: svnadmin/conf/authz ============================================================================== --- svnadmin/conf/authz Sun Nov 4 20:58:25 2012 (r242585) +++ svnadmin/conf/authz Sun Nov 4 21:38:27 2012 (r242586) @@ -33,6 +33,7 @@ # $FreeBSD$ +# XXX We commit via ssh, not authz authentication. In theory this is irrelevant. [groups] # keep this sorted, and in sync with ncvs/CVSROOT/avail #committers = peter From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 21:42:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBB171E5; Sun, 4 Nov 2012 21:42:24 +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 96ACE8FC0C; Sun, 4 Nov 2012 21:42:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4LgOqK060594; Sun, 4 Nov 2012 21:42:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4LgOFn060591; Sun, 4 Nov 2012 21:42:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211042142.qA4LgOFn060591@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 4 Nov 2012 21:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242587 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 21:42:24 -0000 Author: jilles Date: Sun Nov 4 21:42:24 2012 New Revision: 242587 URL: http://svn.freebsd.org/changeset/base/242587 Log: rtld: Fix fd leak with parallel dlopen and fork/exec. Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore, such a file descriptor may be passed to a process created by another thread running in parallel to dlopen() or fdlopen(). No other threads are expected to be running during parsing of the hints and libmap files but the file descriptors need not be passed to child processes so add O_CLOEXEC there as well. This change will break fdlopen() (as used by OpenPAM) on kernels without F_DUPFD_CLOEXEC (added in July). Note that running new userland on old kernels is not supported. Reviewed by: kib Modified: head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sun Nov 4 21:38:27 2012 (r242586) +++ head/libexec/rtld-elf/libmap.c Sun Nov 4 21:42:24 2012 (r242587) @@ -121,7 +121,7 @@ lmc_parse_file(char *path) } } - fd = open(rpath, O_RDONLY); + fd = open(rpath, O_RDONLY | O_CLOEXEC); if (fd == -1) { dbg("lm_parse_file: open(\"%s\") failed, %s", rpath, rtld_strerror(errno)); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun Nov 4 21:38:27 2012 (r242586) +++ head/libexec/rtld-elf/rtld.c Sun Nov 4 21:42:24 2012 (r242587) @@ -1598,7 +1598,7 @@ gethints(bool nostdlib) /* Keep from trying again in case the hints file is bad. */ hints = ""; - if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1) + if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) == -1) return (NULL); if (read(fd, &hdr, sizeof hdr) != sizeof hdr || hdr.magic != ELFHINTS_MAGIC || @@ -2046,13 +2046,13 @@ load_object(const char *name, int fd_u, */ fd = -1; if (fd_u == -1) { - if ((fd = open(path, O_RDONLY)) == -1) { + if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) { _rtld_error("Cannot open \"%s\"", path); free(path); return (NULL); } } else { - fd = dup(fd_u); + fd = fcntl(fd_u, F_DUPFD_CLOEXEC, 0); if (fd == -1) { _rtld_error("Cannot dup fd"); free(path); From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 21:57:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3942D8C1; Sun, 4 Nov 2012 21:57:34 +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 1E4608FC14; Sun, 4 Nov 2012 21:57:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4LvXN8063072; Sun, 4 Nov 2012 21:57:33 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4LvXge063070; Sun, 4 Nov 2012 21:57:33 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042157.qA4LvXge063070@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 21:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242588 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 21:57:34 -0000 Author: peter Date: Sun Nov 4 21:57:33 2012 New Revision: 242588 URL: http://svnweb.freebsd.org/changeset/base/242588 Log: Add some debug code Modified: svnadmin/hooks/scripts/update-root.sh Modified: svnadmin/hooks/scripts/update-root.sh ============================================================================== --- svnadmin/hooks/scripts/update-root.sh Sun Nov 4 21:42:24 2012 (r242587) +++ svnadmin/hooks/scripts/update-root.sh Sun Nov 4 21:57:33 2012 (r242588) @@ -3,6 +3,10 @@ # check out/update SVN control files if needed REV="$2" REPO="$1" +echo "update-root.sh `date` $REV $REPO" 1>&2 +exec >> /tmp/update.log 2>&1 +echo "update-root.sh `date` $REV $REPO" +svnlook -r $REV dirs-changed $REPO if svnlook -r $REV dirs-changed $REPO | grep '^svnadmin/hooks/' > /dev/null then echo "Updating repository control files." 1>&2 From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 21:58:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F37BFB49; Sun, 4 Nov 2012 21:58:30 +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 D807F8FC17; Sun, 4 Nov 2012 21:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4LwU8K063258; Sun, 4 Nov 2012 21:58:30 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4LwUEu063256; Sun, 4 Nov 2012 21:58:30 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042158.qA4LwUEu063256@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 21:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242589 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 21:58:31 -0000 Author: peter Date: Sun Nov 4 21:58:30 2012 New Revision: 242589 URL: http://svnweb.freebsd.org/changeset/base/242589 Log: forced commit Modified: svnadmin/hooks/scripts/update-root.sh Modified: svnadmin/hooks/scripts/update-root.sh ============================================================================== --- svnadmin/hooks/scripts/update-root.sh Sun Nov 4 21:57:33 2012 (r242588) +++ svnadmin/hooks/scripts/update-root.sh Sun Nov 4 21:58:30 2012 (r242589) @@ -1,6 +1,6 @@ #! /bin/sh # $FreeBSD$ -# check out/update SVN control files if needed +# check out/update SVN control files if needed XX REV="$2" REPO="$1" echo "update-root.sh `date` $REV $REPO" 1>&2 From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 22:09:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65A54F8C; Sun, 4 Nov 2012 22:09:35 +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 49EB38FC08; Sun, 4 Nov 2012 22:09:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4M9Z10064955; Sun, 4 Nov 2012 22:09:35 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4M9Z7B064953; Sun, 4 Nov 2012 22:09:35 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042209.qA4M9Z7B064953@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 22:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242590 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 22:09:35 -0000 Author: peter Date: Sun Nov 4 22:09:34 2012 New Revision: 242590 URL: http://svnweb.freebsd.org/changeset/base/242590 Log: Force commit Modified: svnadmin/hooks/scripts/update-root.sh Modified: svnadmin/hooks/scripts/update-root.sh ============================================================================== --- svnadmin/hooks/scripts/update-root.sh Sun Nov 4 21:58:30 2012 (r242589) +++ svnadmin/hooks/scripts/update-root.sh Sun Nov 4 22:09:34 2012 (r242590) @@ -1,6 +1,6 @@ #! /bin/sh # $FreeBSD$ -# check out/update SVN control files if needed XX +# check out/update SVN control files if needed XXX REV="$2" REPO="$1" echo "update-root.sh `date` $REV $REPO" 1>&2 From owner-svn-src-all@FreeBSD.ORG Sun Nov 4 22:11:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7214716A; Sun, 4 Nov 2012 22:11: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 548648FC14; Sun, 4 Nov 2012 22:11:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4MBahL065330; Sun, 4 Nov 2012 22:11:36 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA4MBaY2065328; Sun, 4 Nov 2012 22:11:36 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211042211.qA4MBaY2065328@svn.freebsd.org> From: Peter Wemm Date: Sun, 4 Nov 2012 22:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242591 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 22:11:36 -0000 Author: peter Date: Sun Nov 4 22:11:35 2012 New Revision: 242591 URL: http://svnweb.freebsd.org/changeset/base/242591 Log: Remove test code. Migration problem was found - at one point I did a svn command with umask 022 and lost some required g+w permissions. Modified: svnadmin/hooks/scripts/update-root.sh Modified: svnadmin/hooks/scripts/update-root.sh ============================================================================== --- svnadmin/hooks/scripts/update-root.sh Sun Nov 4 22:09:34 2012 (r242590) +++ svnadmin/hooks/scripts/update-root.sh Sun Nov 4 22:11:35 2012 (r242591) @@ -3,10 +3,6 @@ # check out/update SVN control files if needed XXX REV="$2" REPO="$1" -echo "update-root.sh `date` $REV $REPO" 1>&2 -exec >> /tmp/update.log 2>&1 -echo "update-root.sh `date` $REV $REPO" -svnlook -r $REV dirs-changed $REPO if svnlook -r $REV dirs-changed $REPO | grep '^svnadmin/hooks/' > /dev/null then echo "Updating repository control files." 1>&2 From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 00:29:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C10CD4A; Mon, 5 Nov 2012 00:29:26 +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 506DB8FC08; Mon, 5 Nov 2012 00:29:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA50TQKe088032; Mon, 5 Nov 2012 00:29:26 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA50TQxi088030; Mon, 5 Nov 2012 00:29:26 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211050029.qA50TQxi088030@svn.freebsd.org> From: Peter Wemm Date: Mon, 5 Nov 2012 00:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r242592 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 00:29:26 -0000 Author: peter Date: Mon Nov 5 00:29:25 2012 New Revision: 242592 URL: http://svnweb.freebsd.org/changeset/base/242592 Log: Note the capabiity that indicates the client has the svn-1.7 feature that fixes the mergeinfo proliferation. Modified: svnadmin/hooks/scripts/checkcaps.sh Modified: svnadmin/hooks/scripts/checkcaps.sh ============================================================================== --- svnadmin/hooks/scripts/checkcaps.sh Sun Nov 4 22:11:35 2012 (r242591) +++ svnadmin/hooks/scripts/checkcaps.sh Mon Nov 5 00:29:25 2012 (r242592) @@ -8,6 +8,7 @@ IFS=":" set $CAPS IFS="$OIFS" +# atomic-revprops = 1.7+ client with improved mergeinfo handling found=0 for i in $* do From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 00:38:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF980F0D; Mon, 5 Nov 2012 00:38:14 +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 C4F4E8FC15; Mon, 5 Nov 2012 00:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA50cEVj089440; Mon, 5 Nov 2012 00:38:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA50cEVG089438; Mon, 5 Nov 2012 00:38:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211050038.qA50cEVG089438@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 5 Nov 2012 00:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242593 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 00:38:15 -0000 Author: pjd Date: Mon Nov 5 00:38:14 2012 New Revision: 242593 URL: http://svnweb.freebsd.org/changeset/base/242593 Log: Revert r228695. We use __func__ here as a format to distinguish between abort and assert. It would be cleaner to use NULL or "" here, but gcc complains in both cases. Modified: head/sbin/hastd/pjdlog.h Modified: head/sbin/hastd/pjdlog.h ============================================================================== --- head/sbin/hastd/pjdlog.h Mon Nov 5 00:29:25 2012 (r242592) +++ head/sbin/hastd/pjdlog.h Mon Nov 5 00:38:14 2012 (r242593) @@ -95,7 +95,7 @@ void pjdlog_abort(const char *func, cons #define PJDLOG_VERIFY(expr) do { \ if (!(expr)) { \ pjdlog_abort(__func__, __FILE__, __LINE__, #expr, \ - "%s", __func__); \ + __func__); \ } \ } while (0) #define PJDLOG_RVERIFY(expr, ...) do { \ From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 01:05:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 047EA3CC; Mon, 5 Nov 2012 01:05:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D94048FC0A; Mon, 5 Nov 2012 01:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA515E5j093539; Mon, 5 Nov 2012 01:05:14 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA515E2d093530; Mon, 5 Nov 2012 01:05:14 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211050105.qA515E2d093530@svn.freebsd.org> From: Sean Bruno Date: Mon, 5 Nov 2012 01:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242594 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 01:05:15 -0000 Author: sbruno Date: Mon Nov 5 01:05:14 2012 New Revision: 242594 URL: http://svnweb.freebsd.org/changeset/base/242594 Log: MFC r241745,241738,241741 Update hwpmc to support the Xeon class of Sandybridge processors. (Model 0x2D /* Per Intel document 253669-044US 08/2012. */) Update man page crossreferences to sandybridge xeon class Remove trailing whitespace. Added: stable/9/lib/libpmc/pmc.sandybridgexeon.3 - copied, changed from r241738, head/lib/libpmc/pmc.sandybridgexeon.3 Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgeuc.3 stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/Makefile Mon Nov 5 01:05:14 2012 (r242594) @@ -39,6 +39,7 @@ MAN+= pmc.corei7.3 MAN+= pmc.corei7uc.3 MAN+= pmc.sandybridge.3 MAN+= pmc.sandybridgeuc.3 +MAN+= pmc.sandybridgexeon.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 MAN+= pmc.tsc.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/libpmc.c Mon Nov 5 01:05:14 2012 (r242594) @@ -192,6 +192,11 @@ static const struct pmc_event_descr sand __PMC_EV_ALIAS_SANDYBRIDGE() }; +static const struct pmc_event_descr sandybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_SANDYBRIDGE_XEON() +}; + static const struct pmc_event_descr westmere_event_table[] = { __PMC_EV_ALIAS_WESTMERE() @@ -228,6 +233,7 @@ PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOF PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -265,6 +271,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); +PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); @@ -569,6 +576,8 @@ static struct pmc_event_alias core2_alia #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf +#define sandybridge_xeon_aliases core2_aliases +#define sandybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases #define westmere_aliases_without_iaf core2_aliases_without_iaf @@ -688,7 +697,7 @@ static struct pmc_masks iap_rsp_mask_i7_ NULLMASK }; -static struct pmc_masks iap_rsp_mask_sb_ib[] = { +static struct pmc_masks iap_rsp_mask_sb_sbx_ib[] = { PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), PMCMASK(REQ_DMND_RFO, (1ULL << 1)), PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), @@ -794,9 +803,10 @@ iap_allocate_pmc(enum pmc_event pe, char } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { - n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp); + n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); } else @@ -2667,6 +2677,10 @@ pmc_event_names_of_class(enum pmc_class ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; count = PMC_EVENT_TABLE_SIZE(westmere); @@ -2959,6 +2973,9 @@ pmc_init(void) pmc_class_table[n++] = &sandybridgeuc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &westmereuc_class_table_descr; @@ -3093,6 +3110,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); break; + case PMC_CPU_INTEL_SANDYBRIDGE_XEON: + ev = sandybridge_xeon_event_table; + evfence = sandybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(sandybridge_xeon); + break; case PMC_CPU_INTEL_WESTMERE: ev = westmere_event_table; evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2012 +.Dd October 19, 2012 .Dt PMC.IVYBRIDGE 3 .Os .Sh NAME @@ -856,6 +856,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.corei7uc 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.westmere 3 , .Xr pmc.westmereuc 3 , .Xr pmc.soft 3 , Modified: stable/9/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridge.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.sandybridge.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGE 3 .Os .Sh NAME @@ -932,6 +932,7 @@ Split locks in SQ. .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , Modified: stable/9/lib/libpmc/pmc.sandybridgeuc.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridgeuc.3 Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/lib/libpmc/pmc.sandybridgeuc.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2012 +.Dd October 19, 2012 .Dt PMC.SANDYBRIDGEUC 3 .Os .Sh NAME @@ -208,6 +208,7 @@ Counts the number of core-outgoing entri .Xr pmc.p5 3 , .Xr pmc.p6 3 , .Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgexeon 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , .Xr pmc.ucf 3 , Copied and modified: stable/9/lib/libpmc/pmc.sandybridgexeon.3 (from r241738, head/lib/libpmc/pmc.sandybridgexeon.3) ============================================================================== --- head/lib/libpmc/pmc.sandybridgexeon.3 Fri Oct 19 17:01:27 2012 (r241738, copy source) +++ stable/9/lib/libpmc/pmc.sandybridgexeon.3 Mon Nov 5 01:05:14 2012 (r242594) @@ -442,147 +442,147 @@ Set Cmask = 1 to count cycles. .It Li PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW .Pq Event 59H , Umask 0FH Cycles with at least one slow LEA uop allocated. -.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP +.It Li PARTIAL_RAT_STALLS.MUL_SINGLE_UOP .Pq Event 59H , Umask 40H Number of Multiply packed/scalar single precision uops allocated. -.It Li RESOURCE_STALLS2.ALL_FL_EMPTY +.It Li RESOURCE_STALLS2.ALL_FL_EMPTY .Pq Event 5BH , Umask 0CH -Cycles stalled due to free list empty. -.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL +Cycles stalled due to free list empty. +.It Li RESOURCE_STALLS2.ALL_PRF_CONTROL .Pq Event 5BH , Umask 0FH Cycles stalled due to control structures full for physical registers. -.It Li RESOURCE_STALLS2.BOB_FULL +.It Li RESOURCE_STALLS2.BOB_FULL .Pq Event 5BH , Umask 40H -Cycles Allocator is stalled due Branch Order Buffer. -.It Li RESOURCE_STALLS2.OOO_RSRC +Cycles Allocator is stalled due Branch Order Buffer. +.It Li RESOURCE_STALLS2.OOO_RSRC .Pq Event 5BH , Umask 4FH -Cycles stalled due to out of order resources full. -.It Li CPL_CYCLES.RING0 +Cycles stalled due to out of order resources full. +.It Li CPL_CYCLES.RING0 .Pq Event 5CH , Umask 01H -Unhalted core cycles when the thread is in ring 0. -.It Li CPL_CYCLES.RING123 +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 .Pq Event 5CH , Umask 02H Unhalted core cycles when the thread is not in ring 0. .It Li RS_EVENTS.EMPTY_CYCLES .Pq Event 5EH , Umask 01H -Cycles the RS is empty for the thread. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD .Pq Event 60H , Umask 01H Offcore outstanding Demand Data Read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO .Pq Event 60H , Umask 04H Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD .Pq Event 60H , Umask 08H Offcore outstanding cacheable data read transactions in SQ to uncore. Set Cmask=1 to count cycles. -.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION .Pq Event 63H , Umask 01H Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. -.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION .Pq Event 63H , Umask 02H -Cycles in which the L1D is locked. -.It Li IDQ.EMPTY +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY .Pq Event 79H , Umask 02H Counts cycles the IDQ is empty. -.It Li IDQ.MITE_UOPS +.It Li IDQ.MITE_UOPS .Pq Event 79H , Umask 04H Increment each cycle # of uops delivered to IDQ from MITE path. Set Cmask = 1 to count cycles. -.It Li IDQ.DSB_UOPS +.It Li IDQ.DSB_UOPS .Pq Event 79H , Umask 08H Increment each cycle. # of uops delivered to IDQ from DSB path. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_DSB_UOPS +.It Li IDQ.MS_DSB_UOPS .Pq Event 79H , Umask 10H Increment each cycle # of uops delivered to IDQ when MS busy by DSB. Set Cmask = 1 to count cycles MS is busy. Set Cmask=1 and Edge =1 to count MS activations. -.It Li IDQ.MS_MITE_UOPS +.It Li IDQ.MS_MITE_UOPS .Pq Event 79H , Umask 20H Increment each cycle # of uops delivered to IDQ when MS is busy by MITE. Set Cmask = 1 to count cycles. -.It Li IDQ.MS_UOPS +.It Li IDQ.MS_UOPS .Pq Event 79H , Umask 30H Increment each cycle # of uops delivered to IDQ from MS by either DSB or MITE. Set Cmask = 1 to count cycles. -.It Li ICACHE.MISSES +.It Li ICACHE.MISSES .Pq Event 80H , Umask 02H Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. Includes UC accesses. -.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK .Pq Event 85H , Umask 01H -Misses in all ITLB levels that cause page walks. -.It Li ITLB_MISSES.WALK_COMPLETED +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED .Pq Event 85H , Umask 02H Misses in all ITLB levels that cause completed page walks. -.It Li ITLB_MISSES.WALK_DURATION +.It Li ITLB_MISSES.WALK_DURATION .Pq Event 85H , Umask 04H -Cycle PMH is busy with a walk. -.It Li ITLB_MISSES.STLB_HIT +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT .Pq Event 85H , Umask 10H -Number of cache load STLB hits. No page walk. -.It Li ILD_STALL.LCP +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP .Pq Event 87H , Umask 01H Stalls caused by changing prefix length of the instruction. -.It Li ILD_STALL.IQ_FULL +.It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H -Stall cycles due to IQ is full. +Stall cycles due to IQ is full. .It Li BR_INST_EXEC.COND .Pq Event 88H , Umask 01H Qualify conditional near branch instructions executed, but not necessarily retired. -.It Li BR_INST_EXEC.DIRECT_JMP +.It Li BR_INST_EXEC.DIRECT_JMP .Pq Event 88H , Umask 02H Qualify all unconditional near branch instructions excluding calls and indirect branches. -.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 88H , Umask 04H Qualify executed indirect near branch instructions that are not calls nor returns. -.It Li BR_INST_EXEC.RETURN_NEAR +.It Li BR_INST_EXEC.RETURN_NEAR .Pq Event 88H , Umask 08H Qualify indirect near branches that have a return mnemonic. -.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL .Pq Event 88H , Umask 10H Qualify unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL .Pq Event 88H , Umask 20H Qualify indirect near calls, including both register and memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN +.It Li BR_INST_EXEC.NONTAKEN .Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN .Pq Event 88H , Umask 80H Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H. -.It Li BR_INST_EXE.ALL_BRANCHES +.It Li BR_INST_EXE.ALL_BRANCHES .Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND +.It Li BR_MISP_EXEC.COND .Pq Event 89H , Umask 01H Qualify conditional near branch instructions mispredicted. -.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET .Pq Event 89H , Umask 04H Qualify mispredicted indirect near branch instructions that are not calls nor returns. @@ -590,144 +590,144 @@ instructions that are not calls nor retu .Pq Event 89H , Umask 08H Qualify mispredicted indirect near branches that have a return mnemonic. -.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL .Pq Event 89H , Umask 10H Qualify mispredicted unconditional near call branch instructions, excluding non call branch, executed. -.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL .Pq Event 89H , Umask 20H Qualify mispredicted indirect near calls, including both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN +.It Li BR_MISP_EXEC.NONTAKEN .Pq Event 89H , Umask 40H Qualify mispredicted non-taken near branches executed,. -.It Li BR_MISP_EXEC.TAKEN +.It Li BR_MISP_EXEC.TAKEN .Pq Event 89H , Umask 80H Qualify mispredicted taken near branches executed. Must combine with 01H,02H, 04H, 08H, 10H, 20H -.It Li BR_MISP_EXEC.ALL_BRANCHES +.It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per thread. -.It Li UOPS_DISPATCHED_PORT.PORT_0 +.It Li UOPS_DISPATCHED_PORT.PORT_0 .Pq Event A1H , Umask 01H -Cycles which a Uop is dispatched on port 0. +Cycles which a Uop is dispatched on port 0. .It Li UOPS_DISPATCHED_PORT.PORT_1 .Pq Event A1H , Umask 02H -Cycles which a Uop is dispatched on port 1. -.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD .Pq Event A1H , Umask 04H -Cycles which a load uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA .Pq Event A1H , Umask 08H Cycles which a store address uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_2 +.It Li UOPS_DISPATCHED_PORT.PORT_2 .Pq Event A1H , Umask 0CH -Cycles which a Uop is dispatched on port 2. -.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD .Pq Event A1H , Umask 10H -Cycles which a load uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA .Pq Event A1H , Umask 20H Cycles which a store address uop is dispatched on port 3. -.It Li UOPS_DISPATCHED_PORT.PORT_3 +.It Li UOPS_DISPATCHED_PORT.PORT_3 .Pq Event A1H , Umask 30H -Cycles which a Uop is dispatched on port 3. +Cycles which a Uop is dispatched on port 3. .It Li UOPS_DISPATCHED_PORT.PORT_4 .Pq Event A1H , Umask 40H Cycles which a Uop is dispatched on port 4. -.It Li UOPS_DISPATCHED_PORT.PORT_5 +.It Li UOPS_DISPATCHED_PORT.PORT_5 .Pq Event A1H , Umask 80H -Cycles which a Uop is dispatched on port 5. -.It Li RESOURCE_STALLS.ANY +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY .Pq Event A2H , Umask 01H Cycles Allocation is stalled due to Resource Related reason. -.It Li RESOURCE_STALLS.LB +.It Li RESOURCE_STALLS.LB .Pq Event A2H , Umask 01H -Counts the cycles of stall due to lack of load buffers. -.It Li RESOURCE_STALLS.RS +Counts the cycles of stall due to lack of load buffers. +.It Li RESOURCE_STALLS.RS .Pq Event A2H , Umask 04H -Cycles stalled due to no eligible RS entry available. -.It Li RESOURCE_STALLS.SB +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB .Pq Event A2H , Umask 08H Cycles stalled due to no store buffers available. (not including draining form sync). -.It Li RESOURCE_STALLS.ROB +.It Li RESOURCE_STALLS.ROB .Pq Event A2H , Umask 10H -Cycles stalled due to re-order buffer full. -.It Li RESOURCE_STALLS.FCSW +Cycles stalled due to re-order buffer full. +.It Li RESOURCE_STALLS.FCSW .Pq Event A2H , Umask 20H -Cycles stalled due to writing the FPU control word. -.It Li RESOURCE_STALLS.MXCSR +Cycles stalled due to writing the FPU control word. +.It Li RESOURCE_STALLS.MXCSR .Pq Event A2H , Umask 40H Cycles stalled due to the MXCSR register rename occurring to close to a previous MXCSR rename. -.It Li RESOURCE_STALLS.OTHER +.It Li RESOURCE_STALLS.OTHER .Pq Event A2H , Umask 80H Cycles stalled while execution was stalled due to other resource issues. -.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING .Pq Event A3H , Umask 01H Cycles with pending L2 miss loads. Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING .Pq Event A3H , Umask 02H Cycles with pending L1 cache miss loads.Set AnyThread to count per core. -.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH +.It Li CYCLE_ACTIVITY.CYCLES_NO_DISPATCH .Pq Event A3H , Umask 04H -Cycles of dispatch stalls. Set AnyThread to count per +Cycles of dispatch stalls. Set AnyThread to count per core. -.It Li DSB2MITE_SWITCHES.COUNT +.It Li DSB2MITE_SWITCHES.COUNT .Pq Event ABH , Umask 01H -Number of DSB to MITE switches. -.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES .Pq Event ABH , Umask 02H -Cycles DSB to MITE switches caused delay. -.It Li DSB_FILL.OTHER_CANCEL +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.OTHER_CANCEL .Pq Event ACH , Umask 02H Cases of cancelling valid DSB fill not because of exceeding way limit. -.It Li DSB_FILL.EXCEED_DSB_LINES +.It Li DSB_FILL.EXCEED_DSB_LINES .Pq Event ACH , Umask 08H -DSB Fill encountered > 3 DSB lines. -.It Li DSB_FILL.ALL_CANCEL +DSB Fill encountered > 3 DSB lines. +.It Li DSB_FILL.ALL_CANCEL .Pq Event ACH , Umask 0AH Cases of cancelling valid Decode Stream Buffer (DSB) fill not because of exceeding way limit. -.It Li ITLB.ITLB_FLUSH +.It Li ITLB.ITLB_FLUSH .Pq Event AEH , Umask 01H Counts the number of ITLB flushes, includes 4k/2M/4M pages. -.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD .Pq Event B0H , Umask 01H Demand data read requests sent to uncore. -.It Li OFFCORE_REQUESTS.DEMAND_RFO +.It Li OFFCORE_REQUESTS.DEMAND_RFO .Pq Event B0H , Umask 04H Demand RFO read requests sent to uncore, including regular RFOs, locks, ItoM. -.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.It Li OFFCORE_REQUESTS.ALL_DATA_RD .Pq Event B0H , Umask 08H Data read requests sent to uncore (demand and prefetch). -.It Li UOPS_DISPATCHED.THREAD +.It Li UOPS_DISPATCHED.THREAD .Pq Event B1H , Umask 01H Counts total number of uops to be dispatched per- thread each cycle. Set Cmask = 1, INV =1 to count stall cycles. -.It Li UOPS_DISPATCHED.CORE +.It Li UOPS_DISPATCHED.CORE .Pq Event B1H , Umask 02H Counts total number of uops to be dispatched per- core each cycle. -.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL +.It Li OFFCORE_REQUESTS_BUFFER.SQ_FULL .Pq Event B2H , Umask 01H Offcore requests buffer cannot take more entries for this thread core. @@ -738,47 +738,47 @@ following traits: 1. addressing of the f offset], 2. the offset is between 1 and 2047, 3. the address specified in the base register is in one page and the address [base+offset] is in another page. -.It Li OFF_CORE_RESPONSE_0 +.It Li OFF_CORE_RESPONSE_0 .Pq Event B7H , Umask 01H (Event B7H, Umask 01H) Off-core Response Performance Monitoring; PMC0 only. Requires programming MSR 01A6H -.It Li OFF_CORE_RESPONSE_1 +.It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H (Event BBH, Umask 01H) Off-core Response Performance Monitoring; PMC3 only. Requires programming MSR 01A7H -.It Li TLB_FLUSH.DTLB_THREAD +.It Li TLB_FLUSH.DTLB_THREAD .Pq Event BDH , Umask 01H -DTLB flush attempts of the thread-specific entries. -.It Li TLB_FLUSH.STLB_ANY +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY .Pq Event BDH , Umask 20H -Count number of STLB flush attempts. -.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES +Count number of STLB flush attempts. +.It Li L1D_BLOCKS.BANK_CONFLICT_CYCLES .Pq Event BFH , Umask 05H Cycles when dispatched loads are cancelled due to L1D bank conflicts with other load ports. -.It Li INST_RETIRED.ANY_P +.It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -Number of instructions at retirement. -.It Li INST_RETIRED.ALL +Number of instructions at retirement. +.It Li INST_RETIRED.ALL .Pq Event C0H , Umask 01H Precise instruction retired event with HW to reduce effect of PEBS shadow in IP distribution. .It Li OTHER_ASSISTS.ITLB_MISS_RETIRED .Pq Event C1H , Umask 02H -Instructions that experienced an ITLB miss. -.It Li OTHER_ASSISTS.AVX_STORE +Instructions that experienced an ITLB miss. +.It Li OTHER_ASSISTS.AVX_STORE .Pq Event C1H , Umask 08H Number of assists associated with 256-bit AVX store operations. -.It Li OTHER_ASSISTS.AVX_TO_SSE +.It Li OTHER_ASSISTS.AVX_TO_SSE .Pq Event C1H , Umask 10H Number of transitions from AVX-256 to legacy SSE when penalty applicable. -.It Li OTHER_ASSISTS.SSE_TO_AVX +.It Li OTHER_ASSISTS.SSE_TO_AVX .Pq Event C1H , Umask 20H Number of transitions from SSE to AVX-256 when penalty applicable. -.It Li UOPS_RETIRED.ALL +.It Li UOPS_RETIRED.ALL .Pq Event C2H , Umask 01H Counts the number of micro-ops retired, Use cmask=1 and invert to count active cycles or stalled @@ -787,7 +787,7 @@ cycles. .Pq Event C2H , Umask 02H Counts the number of retirement slots used each cycle. -.It Li MACHINE_CLEARS.MEMORY_ORDERING +.It Li MACHINE_CLEARS.MEMORY_ORDERING .Pq Event C3H , Umask 02H Counts the number of machine clears due to memory order conflicts. @@ -795,25 +795,25 @@ memory order conflicts. .Pq Event C3H , Umask 04H Counts the number of times that a program writes to a code section. -.It Li MACHINE_CLEARS.MASKMOV +.It Li MACHINE_CLEARS.MASKMOV .Pq Event C3H , Umask 20H Counts the number of executed AVX masked load operations that refer to an illegal address range with the mask bits set to 0. -.It Li BR_INST_RETIRED.ALL_BRANCH +.It Li BR_INST_RETIRED.ALL_BRANCH .Pq Event C4H , Umask 00H -Branch instructions at retirement. -.It Li BR_INST_RETIRED.CONDITIONAL +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_CALL +.It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Direct and indirect near call instructions retired. -.It Li BR_INST_RETIRED.ALL_BRANCHES +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired. -.It Li BR_INST_RETIRED.NEAR_RETURN +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN .Pq Event C4H , Umask 08H Counts the number of near return instructions retired. @@ -823,16 +823,16 @@ Counts the number of not taken branch in retired. .It Li BR_INST_RETIRED.NEAR_TAKEN .Pq Event C4H , Umask 20H -Number of near taken branches retired. +Number of near taken branches retired. .It Li BR_INST_RETIRED.FAR_BRANCH .Pq Event C4H , Umask 40H -Number of far branches retired. +Number of far branches retired. .It Li BR_MISP_RETIRED.ALL_BRANCHES .Pq Event C5H , Umask 00H -Mispredicted branch instructions at retirement. +Mispredicted branch instructions at retirement. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H -Mispredicted conditional branch instructions retired. +Mispredicted conditional branch instructions retired. .It Li BR_MISP_RETIRED.NEAR_CALL .Pq Event C5H , Umask 02H Direct and indirect mispredicted near call @@ -842,25 +842,25 @@ instructions retired. Mispredicted macro branch instructions retired. .It Li BR_MISP_RETIRED.NOT_TAKEN .Pq Event C5H , Umask 10H -Mispredicted not taken branch instructions retired. +Mispredicted not taken branch instructions retired. .It Li BR_MISP_RETIRED.TAKEN .Pq Event C5H , Umask 20H -Mispredicted taken branch instructions retired. +Mispredicted taken branch instructions retired. .It Li FP_ASSIST.X87_OUTPUT .Pq Event CAH , Umask 02H -Number of X87 assists due to output value. +Number of X87 assists due to output value. .It Li FP_ASSIST.X87_INPUT .Pq Event CAH , Umask 04H -Number of X87 assists due to input value. +Number of X87 assists due to input value. .It Li FP_ASSIST.SIMD_OUTPUT .Pq Event CAH , Umask 08H - Number of SIMD FP assists due to output values. + Number of SIMD FP assists due to output values. .It Li FP_ASSIST.SIMD_INPUT .Pq Event CAH , Umask 10H -Number of SIMD FP assists due to input values. +Number of SIMD FP assists due to input values. .It Li FP_ASSIST.ANY 1EH .Pq Event CAH , Umask -Cycles with any input/output SSE* or FP assists. +Cycles with any input/output SSE* or FP assists. .It Li ROB_MISC_EVENTS.LBR_INSERTS .Pq Event CCH , Umask 20H Count cases of saving new LBR records by @@ -893,27 +893,27 @@ combine with umask 01H, 02H, to produce .Pq Event D0H , Umask Qualify retired memory uops with line split. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED_ALL +.It Li MEM_UOP_RETIRED_ALL .Pq Event D0H , Umask Qualify any retired memory uops. Must combine with umask 01H, 02H, to produce counts. -.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT .Pq Event D1H , Umask 02H Retired load uops with L2 cache hits as data sources. -.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT .Pq Event D1H , Umask 04H -Retired load uops which data sources were data hits +Retired load uops which data sources were data hits in LLC without snoops required. .It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS .Pq Event D1H , Umask 20H Retired load uops which data sources were data missed LLC (excluding unknown data source). -.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB .Pq Event D1H , Umask 40H Retired load uops which data sources were load uops missed L1 but hit FB due to preceding miss to @@ -930,58 +930,58 @@ correct prediction and this is corrected branch handling mechanisms at the front end. .It Li L2_TRANS.DEMAND_DATA_RD .Pq Event F0H , Umask 01H -Demand Data Read requests that access L2 cache. +Demand Data Read requests that access L2 cache. .It Li L2_TRANS.RFO .Pq Event F0H , Umask 02H -RFO requests that access L2 cache. +RFO requests that access L2 cache. .It Li L2_TRANS.CODE_RD .Pq Event F0H , Umask 04H -L2 cache accesses when fetching instructions. +L2 cache accesses when fetching instructions. .It Li L2_TRANS.ALL_PF .Pq Event F0H , Umask 08H -L2 or LLC HW prefetches that access L2 cache. +L2 or LLC HW prefetches that access L2 cache. .It Li L2_TRANS.L1D_WB .Pq Event F0H , Umask 10H -L1D writebacks that access L2 cache. +L1D writebacks that access L2 cache. .It Li L2_TRANS.L2_FILL .Pq Event F0H , Umask 20H -L2 fill requests that access L2 cache. +L2 fill requests that access L2 cache. .It Li L2_TRANS.L2_WB .Pq Event F0H , Umask 40H -L2 writebacks that access L2 cache. +L2 writebacks that access L2 cache. .It Li L2_TRANS.ALL_REQUESTS .Pq Event F0H , Umask 80H -Transactions accessing L2 pipe. +Transactions accessing L2 pipe. .It Li L2_LINES_IN.I .Pq Event F1H , Umask 01H -L2 cache lines in I state filling L2. +L2 cache lines in I state filling L2. .It Li L2_LINES_IN.S .Pq Event F1H , Umask 02H -L2 cache lines in S state filling L2. -.It Li L2_LINES_IN.E +L2 cache lines in S state filling L2. +.It Li L2_LINES_IN.E .Pq Event F1H , Umask 04H -L2 cache lines in E state filling L2. +L2 cache lines in E state filling L2. .It Li L2_LINES-IN.ALL .Pq Event F1H , Umask 07H -L2 cache lines filling L2. +L2 cache lines filling L2. .It Li L2_LINES_OUT.DEMAND_CLEAN .Pq Event F2H , Umask 01H -Clean L2 cache lines evicted by demand. +Clean L2 cache lines evicted by demand. .It Li L2_LINES_OUT.DEMAND_DIRTY .Pq Event F2H , Umask 02H -Dirty L2 cache lines evicted by demand. +Dirty L2 cache lines evicted by demand. .It Li L2_LINES_OUT.PF_CLEAN .Pq Event F2H , Umask 04H -Clean L2 cache lines evicted by L2 prefetch. +Clean L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.PF_DIRTY .Pq Event F2H , Umask 08H -Dirty L2 cache lines evicted by L2 prefetch. +Dirty L2 cache lines evicted by L2 prefetch. .It Li L2_LINES_OUT.DIRTY_ALL .Pq Event F2H , Umask 0AH -Dirty L2 cache lines filling the L2. +Dirty L2 cache lines filling the L2. .It Li SQ_MISC.SPLIT_LOCK .Pq Event F4H , Umask 10H -Split locks in SQ. +Split locks in SQ. .El .Sh SEE ALSO .Xr pmc 3 , Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_core.c Mon Nov 5 00:38:14 2012 (r242593) +++ stable/9/sys/dev/hwpmc/hwpmc_core.c Mon Nov 5 01:05:14 2012 (r242594) @@ -558,7 +558,8 @@ struct iap_event_descr { #define IAP_F_WM (1 << 5) /* CPU: Westmere */ #define IAP_F_SB (1 << 6) /* CPU: Sandy Bridge */ #define IAP_F_IB (1 << 7) /* CPU: Ivy Bridge */ -#define IAP_F_FM (1 << 8) /* Fixed mask */ +#define IAP_F_SBX (1 << 8) /* CPU: Sandy Bridge Xeon */ +#define IAP_F_FM (1 << 9) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ (IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA) @@ -598,12 +599,15 @@ static struct iap_event_descr iap_events IAPDESCR(02H_81H, 0x02, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(03H_00H, 0x03, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB), + IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | + IAP_F_SBX), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), - IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB), - IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB), + IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | + IAP_F_SBX), IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC), @@ -613,8 +617,10 @@ static struct iap_event_descr iap_events IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB), - IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | @@ -627,24 +633,26 @@ static struct iap_event_descr iap_events IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA), - IAPDESCR(07H_08H, 0x07, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_SB), + IAPDESCR(07H_08H, 0x07, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_SB | + IAP_F_SBX), IAPDESCR(08H_01H, 0x08, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_02H, 0x08, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_04H, 0x08, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB), + IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(08H_05H, 0x08, 0x05, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_06H, 0x08, 0x06, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_07H, 0x08, 0x07, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), - IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O), IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7), @@ -666,10 +674,11 @@ static struct iap_event_descr iap_events IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), - IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB), - IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB), + IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX), + IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB), IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB), @@ -684,19 +693,24 @@ static struct iap_event_descr iap_events IAPDESCR(10H_00H, 0x10, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(10H_01H, 0x10, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB), + IAP_F_WM | IAP_F_SB | IAP_F_SBX), IAPDESCR(10H_02H, 0x10, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_04H, 0x10, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(10H_08H, 0x10, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(10H_10H, 0x10, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_20H, 0x10, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_40H, 0x10, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), - IAPDESCR(10H_80H, 0x10, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(10H_10H, 0x10, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_20H, 0x10, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_40H, 0x10, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(10H_80H, 0x10, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(10H_81H, 0x10, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(11H_00H, 0x11, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), - IAPDESCR(11H_01H, 0x11, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_SB), - IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB), + IAPDESCR(11H_01H, 0x11, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_SB | + IAP_F_SBX), + IAPDESCR(11H_02H, 0x11, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(11H_81H, 0x11, 0x81, IAP_F_FM | IAP_F_CA), IAPDESCR(12H_00H, 0x12, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -718,10 +732,11 @@ static struct iap_event_descr iap_events IAPDESCR(14H_00H, 0x14, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX), IAPDESCR(14H_02H, 0x14, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB), + IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAP_F_SBX), IAPDESCR(18H_00H, 0x18, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(18H_01H, 0x18, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -743,18 +758,29 @@ static struct iap_event_descr iap_events IAPDESCR(23H, 0x23, IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(24H, 0x24, IAP_M_CORE | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), - IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), IAPDESCR(24H_02H, 0x24, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), - IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB), + IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_04H, 0x24, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_08H, 0x24, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_0CH, 0x24, 0x0C, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_10H, 0x24, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX), + IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 01:42:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FF3DAB2; Mon, 5 Nov 2012 01:42:57 +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 6A1E88FC12; Mon, 5 Nov 2012 01:42:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA51gvJB099120; Mon, 5 Nov 2012 01:42:57 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA51gvSo099118; Mon, 5 Nov 2012 01:42:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211050142.qA51gvSo099118@svn.freebsd.org> From: Kevin Lo Date: Mon, 5 Nov 2012 01:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242595 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 01:42:57 -0000 Author: kevlo Date: Mon Nov 5 01:42:57 2012 New Revision: 242595 URL: http://svnweb.freebsd.org/changeset/base/242595 Log: Catch up with r242520. s/maxusers/maxbikesheds Modified: head/share/man/man7/tuning.7 Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Mon Nov 5 01:05:14 2012 (r242594) +++ head/share/man/man7/tuning.7 Mon Nov 5 01:42:57 2012 (r242595) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2012 +.Dd November 5, 2012 .Dt TUNING 7 .Os .Sh NAME @@ -803,24 +803,22 @@ To change loader tunables, you must set .Xr loader.conf 5 and reboot the system. .Pp -.Va kern.maxusers +.Va kern.maxbikesheds controls the scaling of a number of static system tables, including defaults for the maximum number of open files, sizing of network memory resources, etc. -As of -.Fx 4.5 , -.Va kern.maxusers +.Va kern.maxbikesheds is automatically sized at boot based on the amount of memory available in the system, and may be determined at run-time by inspecting the value of the read-only -.Va kern.maxusers +.Va kern.maxbikesheds sysctl. Some sites will require larger or smaller values of -.Va kern.maxusers +.Va kern.maxbikesheds and may set it as a loader tunable; values of 64, 128, and 256 are not uncommon. We do not recommend going above 256 unless you need a huge number of file descriptors; many of the tunable values set to their defaults by -.Va kern.maxusers +.Va kern.maxbikesheds may be individually overridden at boot-time or run-time as described elsewhere in this document. Systems older than @@ -897,7 +895,7 @@ sysctl controls the number of file syste is allowed to use to perform its work. This parameter nominally scales with -.Va kern.maxusers +.Va kern.maxbikesheds so you should not need to modify this parameter except under extreme circumstances. See the From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 02:03:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 772B5FCF for ; Mon, 5 Nov 2012 02:03:51 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id DF3FE8FC16 for ; Mon, 5 Nov 2012 02:03:50 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4742263lag.13 for ; Sun, 04 Nov 2012 18:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=+i2TntVm/wzeYugCm9FGz9N08I0flozSeClIhWi+iOo=; b=hEXGahlVSymx7RL5/oJpbpgKNnO52R7DV/8JIdeYizjn4bYUy5cayC6P5G6jRCO591 3pqRP/41yuXO5T6bwFmtx/eC6677abiC+Jr3gbDAx+DC7YoMhIzfeB17VgXXBPAEZJUM cy7VWIe5mSe2JQ1QPT3UyVeCHYzBm7Jslmhok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=+i2TntVm/wzeYugCm9FGz9N08I0flozSeClIhWi+iOo=; b=TF8GX9oeIUJabUY9Ts+4M+V2fVUq4cJergd7TeTGrSFAkldDfXAYrjx4/CDMrML4yd DC+phCb+Ix3RRIAXDm5kVVQJLN2WnJf1mN2rtXlrpAOpa2WpdAFY+6+zgiOzZKfCkq/j fK6LBoBwKCUChlk8tbprDlhjUsNiYj7OWy18jsZoTTrF5/TBGTCc93zzRoc5USl/nRXq db45Yt71+23NHv4jmYIvweKB0ODjvr3F9b+20BQqAXUP+zsom9syC/0CfwrGMr9qv6rS c27ZZWYJ9qiQTinIaaDUkaYkCvgW9HMHsoPa+4eDWJlD05rD9Sj9SdW7WS7JlL/E6fYz JOaA== Received: by 10.112.100.102 with SMTP id ex6mr3456310lbb.130.1352081029422; Sun, 04 Nov 2012 18:03:49 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sun, 4 Nov 2012 18:03:19 -0800 (PST) In-Reply-To: <201211050142.qA51gvSo099118@svn.freebsd.org> References: <201211050142.qA51gvSo099118@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Nov 2012 21:03:19 -0500 X-Google-Sender-Auth: 5cAYeZxcf71l_422M960J5mhS_4 Message-ID: Subject: Re: svn commit: r242595 - head/share/man/man7 To: Kevin Lo Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk59y8e3VDW7xKjEVcFS7fpQyO8yr66yBdIda32L4T9TCAG/URN/i3iWUZPK1fvB6viLoTN Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 02:03:51 -0000 On 4 November 2012 20:42, Kevin Lo wrote: > Author: kevlo > Date: Mon Nov 5 01:42:57 2012 > New Revision: 242595 > URL: http://svnweb.freebsd.org/changeset/base/242595 > > Log: > Catch up with r242520. s/maxusers/maxbikesheds Please run %svn log -cr242520 and then revert. Thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 02:10:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23D0C3BF; Mon, 5 Nov 2012 02:10:04 +0000 (UTC) (envelope-from christian@brueffer.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mx1.freebsd.org (Postfix) with ESMTP id A58F08FC0A; Mon, 5 Nov 2012 02:10:03 +0000 (UTC) Received: from [172.20.135.88] (ip68-2-v122.bii.a-star.edu.sg [123.136.68.2]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0LvLnz-1TLo5A06BX-010gns; Mon, 05 Nov 2012 03:09:57 +0100 Message-ID: <50971FE3.6090105@brueffer.de> Date: Mon, 05 Nov 2012 10:09:39 +0800 From: Christian Brueffer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Kevin Lo Subject: Re: svn commit: r242595 - head/share/man/man7 References: <201211050142.qA51gvSo099118@svn.freebsd.org> In-Reply-To: <201211050142.qA51gvSo099118@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:NMVxS8fDU/FYvbt1Sh2gKR7oL12fZjvorf0MxF5tjGr q9RuWiBaGPhyEHVzp/TUK5mkvzec8bVGySBBqZlnhjyxvtUUsn GY1MyhSou3zMHkET/YIT2I69FOOj6BbDBGvexs9y2lWNzo/RSL xUP5+lNVeLZpidAfCgYbRF8l2PMYt3bEZejD0c5ybyVYaJqaHO RLz7MzXtdjQKvy0B5L88zyRxpr1+aqfPpSZ02gljLX7OSS4Jn+ PYvM1l0IQzs2LexzQKHTLiSYOkxfMa9uUbUXnUlWqr99QWdLWS 9Mnsh7nSUL9uSRN+ClxxgdKE8OXXqMJF9O4OvjeiIWd5j3/jei Je4wvn1dNJ4HIlJwhRJY= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 02:10:04 -0000 On 11/05/2012 09:42 AM, Kevin Lo wrote: > Author: kevlo > Date: Mon Nov 5 01:42:57 2012 > New Revision: 242595 > URL: http://svnweb.freebsd.org/changeset/base/242595 > > Log: > Catch up with r242520. s/maxusers/maxbikesheds > > Modified: > head/share/man/man7/tuning.7 > At first I thought this was a good followup joke, but considering it's real this time, you may want to check up on r242520 and revert this commit ;-) Cheers, Chris From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 02:34:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D9FA962; Mon, 5 Nov 2012 02:34:53 +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 DC5118FC0A; Mon, 5 Nov 2012 02:34:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA52YqH1006722; Mon, 5 Nov 2012 02:34:52 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA52Yq98006720; Mon, 5 Nov 2012 02:34:52 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211050234.qA52Yq98006720@svn.freebsd.org> From: Kevin Lo Date: Mon, 5 Nov 2012 02:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242596 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 02:34:53 -0000 Author: kevlo Date: Mon Nov 5 02:34:52 2012 New Revision: 242596 URL: http://svnweb.freebsd.org/changeset/base/242596 Log: Revert previous commit. Modified: head/share/man/man7/tuning.7 Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Mon Nov 5 01:42:57 2012 (r242595) +++ head/share/man/man7/tuning.7 Mon Nov 5 02:34:52 2012 (r242596) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2012 +.Dd May 11, 2012 .Dt TUNING 7 .Os .Sh NAME @@ -803,22 +803,24 @@ To change loader tunables, you must set .Xr loader.conf 5 and reboot the system. .Pp -.Va kern.maxbikesheds +.Va kern.maxusers controls the scaling of a number of static system tables, including defaults for the maximum number of open files, sizing of network memory resources, etc. -.Va kern.maxbikesheds +As of +.Fx 4.5 , +.Va kern.maxusers is automatically sized at boot based on the amount of memory available in the system, and may be determined at run-time by inspecting the value of the read-only -.Va kern.maxbikesheds +.Va kern.maxusers sysctl. Some sites will require larger or smaller values of -.Va kern.maxbikesheds +.Va kern.maxusers and may set it as a loader tunable; values of 64, 128, and 256 are not uncommon. We do not recommend going above 256 unless you need a huge number of file descriptors; many of the tunable values set to their defaults by -.Va kern.maxbikesheds +.Va kern.maxusers may be individually overridden at boot-time or run-time as described elsewhere in this document. Systems older than @@ -895,7 +897,7 @@ sysctl controls the number of file syste is allowed to use to perform its work. This parameter nominally scales with -.Va kern.maxbikesheds +.Va kern.maxusers so you should not need to modify this parameter except under extreme circumstances. See the From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 02:44:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EACB3F2; Mon, 5 Nov 2012 02:44:07 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 68AE58FC0C; Mon, 5 Nov 2012 02:44:06 +0000 (UTC) Received: from [127.0.0.1] (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id qA52hv8S004197; Mon, 5 Nov 2012 10:43:57 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <1352083438.2212.1.camel@nsl> Subject: Re: svn commit: r242595 - head/share/man/man7 From: Kevin Lo To: Eitan Adler Date: Mon, 05 Nov 2012 10:43:58 +0800 In-Reply-To: References: <201211050142.qA51gvSo099118@svn.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 02:44:08 -0000 Eitan Adler wrote: > On 4 November 2012 20:42, Kevin Lo wrote: > > Author: kevlo > > Date: Mon Nov 5 01:42:57 2012 > > New Revision: 242595 > > URL: http://svnweb.freebsd.org/changeset/base/242595 > > > > Log: > > Catch up with r242520. s/maxusers/maxbikesheds > > Please run > > %svn log -cr242520 > > and then revert. Err, I didn't notice that until you pointed it out. Reverted. Sorry for the noise. Kevin From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 02:53:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EB8F3A4 for ; Mon, 5 Nov 2012 02:53:22 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id E16708FC0C for ; Mon, 5 Nov 2012 02:53:21 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so4808710lbd.13 for ; Sun, 04 Nov 2012 18:53:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/erUkQysgKB5dZKaLYT0ShwOJWEYNvMkmj/3wanvOww=; b=dNgY6mGOVBKquhobr2q4NJQwKkYGlYG+GVkWtlH4QbOjLr2C731KsI3KBdwxFbWMo5 PZDwPSs6PY7FzhLlDoBjBVhlx4G/q7WVgfgUdvc+oaaw7o6p58+IoF7hI69mYgIli5Iy VLdMD7ZyZ+qapWtTldoVVGC6bQtjPWo8tEMEE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=/erUkQysgKB5dZKaLYT0ShwOJWEYNvMkmj/3wanvOww=; b=juDmdQleOm4NejLHvW8ebEkDwY6DILdpA3Cec+0SzuJrgFu8nbLI33V+Dd9PsARhpp rsJb7iLfFZlVr7Z7Vyq59DFGEjYUq1oXQa/Twm4RTRTP8neNQlTAXpaKZgX108QCu10w fI2p/TSLr2TKp53bmPS38ZZEvZZxxsLU1kkNREC0nH4OR+uFJ2+xw/IMH9PGaLbEKPnz RdC3TVhUWBjSVxUZD1EmUY7qocCD4J9c9LaWVMEiJ/6mKP5Jdtmy3tNQVrlBUNN5RUKs jGnIxahy2/e/bDK/YpAjY4iyrXW2MuDIl9y52BQh9kBVMaR2+SBO4mBXagVjt1X2Z3pa 8VTQ== Received: by 10.152.102.234 with SMTP id fr10mr7956784lab.28.1352084000432; Sun, 04 Nov 2012 18:53:20 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sun, 4 Nov 2012 18:52:50 -0800 (PST) In-Reply-To: <1352083438.2212.1.camel@nsl> References: <201211050142.qA51gvSo099118@svn.freebsd.org> <1352083438.2212.1.camel@nsl> From: Eitan Adler Date: Sun, 4 Nov 2012 21:52:50 -0500 X-Google-Sender-Auth: 79Zqz1LuI3Mz_ETqjrotD-0zRW0 Message-ID: Subject: Re: svn commit: r242595 - head/share/man/man7 To: Kevin Lo Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlefi3LH9eCu84NQzQtKMuiErg0U3i4RHlmT4Aql5Zj4WCe4tBS0RecWYFp48nEWKLz0CP7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 02:53:22 -0000 On 4 November 2012 21:43, Kevin Lo wrote: > Eitan Adler wrote: >> On 4 November 2012 20:42, Kevin Lo wrote: >> > Author: kevlo >> > Date: Mon Nov 5 01:42:57 2012 >> > New Revision: 242595 >> > URL: http://svnweb.freebsd.org/changeset/base/242595 >> > >> > Log: >> > Catch up with r242520. s/maxusers/maxbikesheds >> >> Please run >> >> %svn log -cr242520 >> >> and then revert. > > Err, I didn't notice that until you pointed it out. > Reverted. Sorry for the noise. Heh, happens to all of us at least once. :) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 03:08:28 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81111A27; Mon, 5 Nov 2012 03:08:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 1B67C8FC0A; Mon, 5 Nov 2012 03:08:27 +0000 (UTC) Received: from [127.0.0.1] (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id qA538DGA004331; Mon, 5 Nov 2012 11:08:13 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <1352084894.2212.4.camel@nsl> Subject: Re: svn commit: r242595 - head/share/man/man7 From: Kevin Lo To: Christian Brueffer Date: Mon, 05 Nov 2012 11:08:14 +0800 In-Reply-To: <50971FE3.6090105@brueffer.de> References: <201211050142.qA51gvSo099118@svn.freebsd.org> <50971FE3.6090105@brueffer.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 03:08:28 -0000 Christian Brueffer wrote: > On 11/05/2012 09:42 AM, Kevin Lo wrote: > > Author: kevlo > > Date: Mon Nov 5 01:42:57 2012 > > New Revision: 242595 > > URL: http://svnweb.freebsd.org/changeset/base/242595 > > > > Log: > > Catch up with r242520. s/maxusers/maxbikesheds > > > > Modified: > > head/share/man/man7/tuning.7 > > > > At first I thought this was a good followup joke, but considering it's > real this time, you may want to check up on r242520 and revert this > commit ;-) Reverted! It seems there are jokes around the src tree lately, I have to distinguish between a real and fake one... > Cheers, > > Chris Kevin From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 07:08:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0C4BB99; Mon, 5 Nov 2012 07:08:45 +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 96A158FC08; Mon, 5 Nov 2012 07:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA578jMI048994; Mon, 5 Nov 2012 07:08:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA578jBq048992; Mon, 5 Nov 2012 07:08:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211050708.qA578jBq048992@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 Nov 2012 07:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242599 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 07:08:45 -0000 Author: adrian Date: Mon Nov 5 07:08:45 2012 New Revision: 242599 URL: http://svnweb.freebsd.org/changeset/base/242599 Log: TX EDMA debugging fixes: * Do the calculation for each ath_buf, rather than just the first * Correct the calculation in the first place. Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Mon Nov 5 05:56:10 2012 (r242598) +++ head/sys/dev/ath/if_ath_debug.c Mon Nov 5 07:08:45 2012 (r242599) @@ -143,17 +143,18 @@ ath_printtxbuf_edma(struct ath_softc *sc const struct ath_desc_txedma *eds; int i, n; - /* - * Assume the TX map size is 4 for now and only walk - * the appropriate number of segments. - */ - n = (bf->bf_nseg / 4) + 1; - printf("Q%u[%3u] (nseg=%d)", qnum, ix, bf->bf_nseg); while (bf != NULL) { /* * XXX For now, assume the txmap size is 4. */ + + /* + * Assume the TX map size is 4 for now and only walk + * the appropriate number of segments. + */ + n = ((bf->bf_nseg - 1) / 4) + 1; + for (i = 0, ds = (const char *) bf->bf_desc; i < n; i ++, ds += sc->sc_tx_desclen) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 07:44:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4517BC; Mon, 5 Nov 2012 07:44:00 +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 C883A8FC08; Mon, 5 Nov 2012 07:44:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA57i0JO054115; Mon, 5 Nov 2012 07:44:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA57i0G5054113; Mon, 5 Nov 2012 07:44:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211050744.qA57i0G5054113@svn.freebsd.org> From: Dimitry Andric Date: Mon, 5 Nov 2012 07:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242600 - stable/9/lib/libc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 07:44:01 -0000 Author: dim Date: Mon Nov 5 07:44:00 2012 New Revision: 242600 URL: http://svnweb.freebsd.org/changeset/base/242600 Log: MFC r242472: Fix broken macro checking in the libc++ Makefile, introduced in r241909. This caused -std=c++0x not to be passed to the build by default. Pointy hat to: dim Modified: stable/9/lib/libc++/Makefile Directory Properties: stable/9/lib/libc++/ (props changed) Modified: stable/9/lib/libc++/Makefile ============================================================================== --- stable/9/lib/libc++/Makefile Mon Nov 5 07:08:45 2012 (r242599) +++ stable/9/lib/libc++/Makefile Mon Nov 5 07:44:00 2012 (r242600) @@ -53,7 +53,7 @@ cxxrt_${_S}: WARNS= 0 CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT -.if !defined(CXXFLAGS) || ${CXXFLAGS:M-std=*}" == "" +.if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++0x .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 09:13:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AABE788; Mon, 5 Nov 2012 09:13:07 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15AEC8FC16; Mon, 5 Nov 2012 09:13:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA59D6Ed067217; Mon, 5 Nov 2012 09:13:06 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA59D62X067215; Mon, 5 Nov 2012 09:13:06 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211050913.qA59D62X067215@svn.freebsd.org> From: Andre Oppermann Date: Mon, 5 Nov 2012 09:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242601 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 09:13:07 -0000 Author: andre Date: Mon Nov 5 09:13:06 2012 New Revision: 242601 URL: http://svnweb.freebsd.org/changeset/base/242601 Log: Back out r242262. The simplified window change/update logic wasn't complete and ready for production use. PR: kern/173309 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Nov 5 07:44:00 2012 (r242600) +++ head/sys/netinet/tcp_input.c Mon Nov 5 09:13:06 2012 (r242601) @@ -1727,7 +1727,7 @@ tcp_do_segment(struct mbuf *m, struct tc * Pull snd_wl1 up to prevent seq wrap relative to * th_seq. */ - tp->snd_wl1 = th->th_seq + tlen; + tp->snd_wl1 = th->th_seq; /* * Pull rcv_up up to prevent seq wrap relative to * rcv_nxt. @@ -2340,6 +2340,7 @@ tcp_do_segment(struct mbuf *m, struct tc if (tlen == 0 && (thflags & TH_FIN) == 0) (void) tcp_reass(tp, (struct tcphdr *)0, 0, (struct mbuf *)0); + tp->snd_wl1 = th->th_seq - 1; /* FALLTHROUGH */ /* @@ -2650,10 +2651,12 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { + tp->snd_wnd -= so->so_snd.sb_cc; sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { sbdrop_locked(&so->so_snd, acked); + tp->snd_wnd -= acked; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ @@ -2743,56 +2746,24 @@ step6: INP_WLOCK_ASSERT(tp->t_inpcb); /* - * Window update acceptance logic. We have to be careful not - * to accept window updates from old segments in the presence - * of reordering or duplication. - * - * A window update is valid when: - * - the segment ACK's new data. - * - the segment carries new data and its ACK is current. - * - the segment matches the current SEQ and ACK but increases - * the window. This is the escape from persist mode, if there - * data to be sent. - * - * XXXAO: The presence of new SACK information would allow to - * accept window updates during retransmits. We don't have an - * easy way to test for that the moment. - * - * NB: The other side isn't allowed to shrink the window when - * not sending or acking new data. This behavior is strongly - * discouraged by RFC793, section 3.7, page 42 anyways. - * - * XXXAO: tiwin >= minmss to avoid jitter? + * Update window information. + * Don't look at window if no ACK: TAC's send garbage on first SYN. */ - if ((thflags & TH_ACK) && tiwin != tp->snd_wnd && - (SEQ_GT(th->th_ack, tp->snd_wl2) || - (th->th_ack == tp->snd_wl2 && - (SEQ_GT(th->th_seq + tlen, tp->snd_wl1) || - (th->th_seq == tp->snd_wl1 && tlen == 0 && tiwin > tp->snd_wnd))))) { -#if 0 - char *s; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: window update %lu -> %lu\n", - s, __func__, tp->snd_wnd, tiwin); - free(s, M_TCPLOG); - } -#endif - /* Keep track of pure window updates. */ - if (th->th_seq == tp->snd_wl1 && tlen == 0 && - tiwin > tp->snd_wnd) + if ((thflags & TH_ACK) && + (SEQ_LT(tp->snd_wl1, th->th_seq) || + (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || + (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) { + /* keep track of pure window updates */ + if (tlen == 0 && + tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) TCPSTAT_INC(tcps_rcvwinupd); - /* - * When the new window is larger, nudge output - * as we may be able to send more data. - */ - if (tiwin > tp->snd_wnd) - needoutput = 1; tp->snd_wnd = tiwin; + tp->snd_wl1 = th->th_seq; + tp->snd_wl2 = th->th_ack; if (tp->snd_wnd > tp->max_sndwnd) tp->max_sndwnd = tp->snd_wnd; + needoutput = 1; } - if (SEQ_GT(th->th_ack, tp->snd_wl2)) - tp->snd_wl2 = th->th_ack; /* * Process segments with URG. @@ -2912,8 +2883,6 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (SEQ_GT(th->th_seq, tp->snd_wl1)) - tp->snd_wl1 = th->th_seq + tlen; if (tlen > 0 && (tp->t_flags & TF_SACK_PERMIT)) tcp_update_sack_list(tp, save_start, save_start + tlen); #if 0 From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 09:27:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87E04294; Mon, 5 Nov 2012 09:27:47 +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 6EB338FC1A; Mon, 5 Nov 2012 09:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA59Rl93069518; Mon, 5 Nov 2012 09:27:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA59RlSO069516; Mon, 5 Nov 2012 09:27:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211050927.qA59RlSO069516@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 Nov 2012 09:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242604 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 09:27:47 -0000 Author: adrian Date: Mon Nov 5 09:27:47 2012 New Revision: 242604 URL: http://svnweb.freebsd.org/changeset/base/242604 Log: Clear IFF_DRV_OACTIVE if any slots were completed. This unblocks TX EDMA under high load. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 5 09:26:27 2012 (r242603) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 5 09:27:47 2012 (r242604) @@ -602,6 +602,12 @@ ath_edma_tx_proc(void *arg, int npending sc->sc_wd_timer = 0; + if (idx > 0) { + IF_LOCK(&sc->sc_ifp->if_snd); + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&sc->sc_ifp->if_snd); + } + /* Kick software scheduler */ /* * XXX It's inefficient to do this if the FIFO queue is full, From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 09:45:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F167BE9; Mon, 5 Nov 2012 09:45:38 +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 4BE0E8FC12; Mon, 5 Nov 2012 09:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA59jbjh072262; Mon, 5 Nov 2012 09:45:37 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA59jbOj072260; Mon, 5 Nov 2012 09:45:37 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211050945.qA59jbOj072260@svn.freebsd.org> From: Kevin Lo Date: Mon, 5 Nov 2012 09:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242605 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 09:45:38 -0000 Author: kevlo Date: Mon Nov 5 09:45:37 2012 New Revision: 242605 URL: http://svnweb.freebsd.org/changeset/base/242605 Log: Sync with domain and protosw data structures. Reviewed by: glebius Modified: head/share/man/man9/domain.9 Modified: head/share/man/man9/domain.9 ============================================================================== --- head/share/man/man9/domain.9 Mon Nov 5 09:27:47 2012 (r242604) +++ head/share/man/man9/domain.9 Mon Nov 5 09:45:37 2012 (r242605) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2012 +.Dd November 5, 2012 .Dt DOMAIN 9 .Os .Sh NAME @@ -67,6 +67,8 @@ struct domain { char *dom_name; void (*dom_init) /* initialize domain data structures */ (void); + void (*dom_destroy) /* cleanup structures / state */ + (void); int (*dom_externalize) /* externalize access rights */ (struct mbuf *, struct mbuf **); void (*dom_dispose) /* dispose of internalized rights */ @@ -75,8 +77,13 @@ struct domain { struct domain *dom_next; int (*dom_rtattach) /* initialize routing table */ (void **, int); + int (*dom_rtdetach) /* clean up routing table */ + (void **, int); int dom_rtoffset; /* an arg to rtattach, in bits */ int dom_maxrtkey; /* for routing layer */ + void *(*dom_ifattach)(struct ifnet *); + void (*dom_ifdetach)(struct ifnet *, void *); + /* af-dependent data on ifnet */ }; .Ed .Pp @@ -96,6 +103,7 @@ struct protosw { pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* utility hooks */ pr_init_t *pr_init; + pr_destroy_t *pr_destroy; pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ pr_drain_t *pr_drain; /* flush any excess space possible */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 10:42:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ED69126; Mon, 5 Nov 2012 10:42:32 +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 12DC58FC0A; Mon, 5 Nov 2012 10:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5AgVgL081784; Mon, 5 Nov 2012 10:42:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5AgVNc081781; Mon, 5 Nov 2012 10:42:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051042.qA5AgVNc081781@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 10:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242606 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 10:42:32 -0000 Author: des Date: Mon Nov 5 10:42:31 2012 New Revision: 242606 URL: http://svnweb.freebsd.org/changeset/base/242606 Log: MFH (r240496): use libmd if and only if OpenSSL is not available Modified: stable/9/lib/libfetch/Makefile stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/Makefile ============================================================================== --- stable/9/lib/libfetch/Makefile Mon Nov 5 09:45:37 2012 (r242605) +++ stable/9/lib/libfetch/Makefile Mon Nov 5 10:42:31 2012 (r242606) @@ -16,8 +16,8 @@ CFLAGS+= -DINET6 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_SSL -DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD} -LDADD= -lssl -lcrypto -lmd +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto .else DPADD= ${LIBMD} LDADD= -lmd Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Mon Nov 5 09:45:37 2012 (r242605) +++ stable/9/lib/libfetch/http.c Mon Nov 5 10:42:31 2012 (r242606) @@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef WITH_SSL +#include +#define MD5Init(c) MD5_Init(c) +#define MD5Update(c, data, len) MD5_Update(c, data, len) +#define MD5Final(md, c) MD5_Final(md, c) +#else #include +#endif #include #include From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 10:45:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 653D22C7; Mon, 5 Nov 2012 10:45:38 +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 3E51F8FC08; Mon, 5 Nov 2012 10:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5AjcjF082312; Mon, 5 Nov 2012 10:45:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5Ajc9q082307; Mon, 5 Nov 2012 10:45:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051045.qA5Ajc9q082307@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 10:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242607 - stable/8/lib/libfetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 10:45:38 -0000 Author: des Date: Mon Nov 5 10:45:37 2012 New Revision: 242607 URL: http://svnweb.freebsd.org/changeset/base/242607 Log: MFH r225813, r233648: man page fixes MFH r234837: avoid busy-loop on slow connections MFH r234838: don't reuse credentials when redirected to another host MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/8/lib/libfetch/Makefile stable/8/lib/libfetch/common.c stable/8/lib/libfetch/fetch.3 stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/Makefile ============================================================================== --- stable/8/lib/libfetch/Makefile Mon Nov 5 10:42:31 2012 (r242606) +++ stable/8/lib/libfetch/Makefile Mon Nov 5 10:45:37 2012 (r242607) @@ -16,8 +16,8 @@ CFLAGS+= -DINET6 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_SSL -DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD} -LDADD= -lssl -lcrypto -lmd +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto .else DPADD= ${LIBMD} LDADD= -lmd Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Mon Nov 5 10:42:31 2012 (r242606) +++ stable/8/lib/libfetch/common.c Mon Nov 5 10:45:37 2012 (r242607) @@ -458,11 +458,9 @@ fetch_read(conn_t *conn, char *buf, size struct timeval now, timeout, delta; fd_set readfds; ssize_t rlen, total; - int r; char *start; - if (fetchTimeout) { - FD_ZERO(&readfds); + if (fetchTimeout > 0) { gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } @@ -526,23 +524,21 @@ fetch_read(conn_t *conn, char *buf, size return (-1); } // assert(rlen == FETCH_READ_WAIT); - while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) { + FD_ZERO(&readfds); + while (!FD_ISSET(conn->sd, &readfds)) { FD_SET(conn->sd, &readfds); - gettimeofday(&now, NULL); - delta.tv_sec = timeout.tv_sec - now.tv_sec; - delta.tv_usec = timeout.tv_usec - now.tv_usec; - if (delta.tv_usec < 0) { - delta.tv_usec += 1000000; - delta.tv_sec--; - } - if (delta.tv_sec < 0) { - errno = ETIMEDOUT; - fetch_syserr(); - return (-1); + if (fetchTimeout > 0) { + gettimeofday(&now, NULL); + if (!timercmp(&timeout, &now, >)) { + errno = ETIMEDOUT; + fetch_syserr(); + return (-1); + } + timersub(&timeout, &now, &delta); } errno = 0; - r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); - if (r == -1) { + if (select(conn->sd + 1, &readfds, NULL, NULL, + fetchTimeout > 0 ? &delta : NULL) < 0) { if (errno == EINTR) { if (fetchRestartCalls) continue; Modified: stable/8/lib/libfetch/fetch.3 ============================================================================== --- stable/8/lib/libfetch/fetch.3 Mon Nov 5 10:42:31 2012 (r242606) +++ stable/8/lib/libfetch/fetch.3 Mon Nov 5 10:45:37 2012 (r242607) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd September 27, 2011 .Dt FETCH 3 .Os .Sh NAME @@ -365,7 +365,7 @@ If the (if-modified-since) flag is specified, and the .Va ims_time -field is set in +field is set in .Vt "struct url" , then .Fn fetchXGetHTTP Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Mon Nov 5 10:42:31 2012 (r242606) +++ stable/8/lib/libfetch/http.c Mon Nov 5 10:45:37 2012 (r242607) @@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef WITH_SSL +#include +#define MD5Init(c) MD5_Init(c) +#define MD5Update(c, data, len) MD5_Update(c, data, len) +#define MD5Final(md, c) MD5_Final(md, c) +#else #include +#endif #include #include @@ -1793,7 +1801,9 @@ http_request(struct url *URL, const char DEBUG(fprintf(stderr, "failed to parse new URL\n")); goto ouch; } - if (!*new->user && !*new->pwd) { + + /* Only copy credentials if the host matches */ + if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) { strcpy(new->user, url->user); strcpy(new->pwd, url->pwd); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 10:54:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B77B7DF; Mon, 5 Nov 2012 10:54:15 +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 5EFDA8FC0A; Mon, 5 Nov 2012 10:54:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5AsFQF083777; Mon, 5 Nov 2012 10:54:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5AsF4A083767; Mon, 5 Nov 2012 10:54:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051054.qA5AsF4A083767@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 10:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242608 - stable/7/lib/libfetch X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 10:54:15 -0000 Author: des Date: Mon Nov 5 10:54:14 2012 New Revision: 242608 URL: http://svnweb.freebsd.org/changeset/base/242608 Log: MFH r221820, r221821, r221822: increase WARNS MFH r221830: mark all descriptors close-on-exec MFH r225813: man page fixes MFH r225814: adjust copyright statement MFH r226537: latin1 -> utf8 MFH r230307, r230478: fix SIGINFO infinite loop and data loss MFH r233648: man page fixes MFH r234138: support percent-encoded user and password MFH r234837: avoid busy-loop on slow connections MFH r234838: don't reuse credentials when redirected to another host MFH r236193: avoid SIGPIPE on network connections MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/7/lib/libfetch/Makefile stable/7/lib/libfetch/common.c stable/7/lib/libfetch/common.h stable/7/lib/libfetch/fetch.3 stable/7/lib/libfetch/fetch.c stable/7/lib/libfetch/fetch.h stable/7/lib/libfetch/file.c stable/7/lib/libfetch/ftp.c stable/7/lib/libfetch/http.c Directory Properties: stable/7/lib/libfetch/ (props changed) Modified: stable/7/lib/libfetch/Makefile ============================================================================== --- stable/7/lib/libfetch/Makefile Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/Makefile Mon Nov 5 10:54:14 2012 (r242608) @@ -16,8 +16,8 @@ CFLAGS+= -DINET6 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_SSL -DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD} -LDADD= -lssl -lcrypto -lmd +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto .else DPADD= ${LIBMD} LDADD= -lmd @@ -26,7 +26,7 @@ LDADD= -lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?= 2 +WARNS?= 4 SHLIB_MAJOR= 5 Modified: stable/7/lib/libfetch/common.c ============================================================================== --- stable/7/lib/libfetch/common.c Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/common.c Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -209,10 +209,13 @@ conn_t * fetch_reopen(int sd) { conn_t *conn; + int opt = 1; /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); + fcntl(sd, F_SETFD, FD_CLOEXEC); + setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof opt); conn->sd = sd; ++conn->ref; return (conn); @@ -403,6 +406,33 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -427,15 +457,32 @@ fetch_read(conn_t *conn, char *buf, size struct timeval now, timeout, delta; fd_set readfds; ssize_t rlen, total; - int r; + char *start; - if (fetchTimeout) { - FD_ZERO(&readfds); + if (fetchTimeout > 0) { gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* + * The last invocation of fetch_read was interrupted by a + * signal after some data had been read from the socket. Copy + * the cached data into the supplied buffer before trying to + * read from the socket again. + */ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf += total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -471,28 +518,32 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); - while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) { + FD_ZERO(&readfds); + while (!FD_ISSET(conn->sd, &readfds)) { FD_SET(conn->sd, &readfds); - gettimeofday(&now, NULL); - delta.tv_sec = timeout.tv_sec - now.tv_sec; - delta.tv_usec = timeout.tv_usec - now.tv_usec; - if (delta.tv_usec < 0) { - delta.tv_usec += 1000000; - delta.tv_sec--; - } - if (delta.tv_sec < 0) { - errno = ETIMEDOUT; - fetch_syserr(); - return (-1); + if (fetchTimeout > 0) { + gettimeofday(&now, NULL); + if (!timercmp(&timeout, &now, >)) { + errno = ETIMEDOUT; + fetch_syserr(); + return (-1); + } + timersub(&timeout, &now, &delta); } errno = 0; - r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); - if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (select(conn->sd + 1, &readfds, NULL, NULL, + fetchTimeout > 0 ? &delta : NULL) < 0) { + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -676,6 +727,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: stable/7/lib/libfetch/common.h ============================================================================== --- stable/7/lib/libfetch/common.h Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/common.h Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ + struct { /* data cached after an interrupted + read */ + char *buf; + size_t size; + size_t pos; + size_t len; + } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: stable/7/lib/libfetch/fetch.3 ============================================================================== --- stable/7/lib/libfetch/fetch.3 Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/fetch.3 Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd September 27, 2011 .Dt FETCH 3 .Os .Sh NAME @@ -365,7 +365,7 @@ If the (if-modified-since) flag is specified, and the .Va ims_time -field is set in +field is set in .Vt "struct url" , then .Fn fetchXGetHTTP Modified: stable/7/lib/libfetch/fetch.c ============================================================================== --- stable/7/lib/libfetch/fetch.c Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/fetch.c Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -289,6 +289,49 @@ fetchMakeURL(const char *scheme, const c } /* + * Return value of the given hex digit. + */ +static int +fetch_hexval(char ch) +{ + + if (ch >= '0' && ch <= '9') + return (ch - '0'); + else if (ch >= 'a' && ch <= 'f') + return (ch - 'a' + 10); + else if (ch >= 'A' && ch <= 'F') + return (ch - 'A' + 10); + return (-1); +} + +/* + * Decode percent-encoded URL component from src into dst, stopping at end + * of string, or at @ or : separators. Returns a pointer to the unhandled + * part of the input string (null terminator, @, or :). No terminator is + * written to dst (it is the caller's responsibility). + */ +static const char * +fetch_pctdecode(char *dst, const char *src, size_t dlen) +{ + int d1, d2; + char c; + const char *s; + + for (s = src; *s != '\0' && *s != '@' && *s != ':'; s++) { + if (s[0] == '%' && (d1 = fetch_hexval(s[1])) >= 0 && + (d2 = fetch_hexval(s[2])) >= 0 && (d1 > 0 || d2 > 0)) { + c = d1 << 4 | d2; + s += 2; + } else { + c = *s; + } + if (dlen-- > 0) + *dst++ = c; + } + return (s); +} + +/* * Split an URL into components. URL syntax is: * [method:/][/[user[:pwd]@]host[:port]/][document] * This almost, but not quite, RFC1738 URL syntax. @@ -329,15 +372,11 @@ fetchParseURL(const char *URL) p = strpbrk(URL, "/@"); if (p && *p == '@') { /* username */ - for (q = URL, i = 0; (*q != ':') && (*q != '@'); q++) - if (i < URL_USERLEN) - u->user[i++] = *q; + q = fetch_pctdecode(u->user, URL, URL_USERLEN); /* password */ if (*q == ':') - for (q++, i = 0; (*q != ':') && (*q != '@'); q++) - if (i < URL_PWDLEN) - u->pwd[i++] = *q; + q = fetch_pctdecode(u->pwd, ++q, URL_PWDLEN); p++; } else { Modified: stable/7/lib/libfetch/fetch.h ============================================================================== --- stable/7/lib/libfetch/fetch.h Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/fetch.h Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/7/lib/libfetch/file.c ============================================================================== --- stable/7/lib/libfetch/file.c Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/file.c Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -60,6 +61,7 @@ fetchXGetFile(struct url *u, struct url_ return (NULL); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -90,6 +92,7 @@ fetchPutFile(struct url *u, const char * return (NULL); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } Modified: stable/7/lib/libfetch/ftp.c ============================================================================== --- stable/7/lib/libfetch/ftp.c Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/ftp.c Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); * * Major Changelog: * - * Dag-Erling Coïdan Smørgrav + * Dag-Erling Smørgrav * 9 Jun 1998 * * Incorporated into libfetch @@ -127,7 +127,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + addr = *(u_int32_t *)(uintptr_t)&sin6->sin6_addr.s6_addr[12]; port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; Modified: stable/7/lib/libfetch/http.c ============================================================================== --- stable/7/lib/libfetch/http.c Mon Nov 5 10:45:37 2012 (r242607) +++ stable/7/lib/libfetch/http.c Mon Nov 5 10:54:14 2012 (r242608) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef WITH_SSL +#include +#define MD5Init(c) MD5_Init(c) +#define MD5Update(c, data, len) MD5_Update(c, data, len) +#define MD5Final(md, c) MD5_Final(md, c) +#else #include +#endif #include #include @@ -199,6 +207,8 @@ http_growbuf(struct httpio *io, size_t l static int http_fillbuf(struct httpio *io, size_t len) { + ssize_t nbytes; + if (io->error) return (-1); if (io->eof) @@ -207,10 +217,11 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->bufpos = 0; return (io->buflen); } @@ -230,10 +241,11 @@ http_fillbuf(struct httpio *io, size_t l len = io->chunksize; if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->chunksize -= io->buflen; if (io->chunksize == 0) { @@ -275,8 +287,11 @@ http_readfn(void *v, char *buf, int len) io->bufpos += l; } - if (!pos && io->error) + if (!pos && io->error) { + if (io->error == EINTR) + io->error = 0; return (-1); + } return (pos); } @@ -457,7 +472,7 @@ http_match(const char *str, const char * * Get the next header and return the appropriate symbolic code. We * need to read one line ahead for checking for a continuation line * belonging to the current header (continuation lines start with - * white space). + * white space). * * We get called with a fresh line already in the conn buffer, either * from the previous http_next_header() invocation, or, the first @@ -465,7 +480,7 @@ http_match(const char *str, const char * * * This stops when we encounter an empty line (we dont read beyond the header * area). - * + * * Note that the "headerbuf" is just a place to return the result. Its * contents are not used for the next call. This means that no cleanup * is needed when ie doing another connection, just call the cleanup when @@ -490,7 +505,7 @@ init_http_headerbuf(http_headerbuf_t *bu buf->buflen = 0; } -static void +static void clean_http_headerbuf(http_headerbuf_t *buf) { if (buf->buf) @@ -499,10 +514,10 @@ clean_http_headerbuf(http_headerbuf_t *b } /* Remove whitespace at the end of the buffer */ -static void +static void http_conn_trimright(conn_t *conn) { - while (conn->buflen && + while (conn->buflen && isspace((unsigned char)conn->buf[conn->buflen - 1])) conn->buflen--; conn->buf[conn->buflen] = '\0'; @@ -511,11 +526,11 @@ http_conn_trimright(conn_t *conn) static hdr_t http_next_header(conn_t *conn, http_headerbuf_t *hbuf, const char **p) { - int i, len; + unsigned int i, len; - /* + /* * Have to do the stripping here because of the first line. So - * it's done twice for the subsequent lines. No big deal + * it's done twice for the subsequent lines. No big deal */ http_conn_trimright(conn); if (conn->buflen == 0) @@ -530,19 +545,19 @@ http_next_header(conn_t *conn, http_head strcpy(hbuf->buf, conn->buf); hbuf->buflen = conn->buflen; - /* + /* * Fetch possible continuation lines. Stop at 1st non-continuation - * and leave it in the conn buffer - */ + * and leave it in the conn buffer + */ for (i = 0; i < HTTP_MAX_CONT_LINES; i++) { if (fetch_getln(conn) == -1) return (hdr_syserror); - /* + /* * Note: we carry on the idea from the previous version * that a pure whitespace line is equivalent to an empty * one (so it's not continuation and will be handled when - * we are called next) + * we are called next) */ http_conn_trimright(conn); if (conn->buf[0] != ' ' && conn->buf[0] != "\t"[0]) @@ -558,7 +573,7 @@ http_next_header(conn_t *conn, http_head } strcpy(hbuf->buf + hbuf->buflen, conn->buf); hbuf->buflen += conn->buflen; - } + } /* * We could check for malformed headers but we don't really care. @@ -577,12 +592,12 @@ http_next_header(conn_t *conn, http_head * [Proxy-]Authenticate header parsing */ -/* - * Read doublequote-delimited string into output buffer obuf (allocated +/* + * Read doublequote-delimited string into output buffer obuf (allocated * by caller, whose responsibility it is to ensure that it's big enough) * cp points to the first char after the initial '"' - * Handles \ quoting - * Returns pointer to the first char after the terminating double quote, or + * Handles \ quoting + * Returns pointer to the first char after the terminating double quote, or * NULL for error. */ static const char * @@ -623,7 +638,7 @@ typedef struct { int nc; /* Nonce count */ } http_auth_challenge_t; -static void +static void init_http_auth_challenge(http_auth_challenge_t *b) { b->scheme = HTTPAS_UNKNOWN; @@ -631,18 +646,18 @@ init_http_auth_challenge(http_auth_chall b->stale = b->nc = 0; } -static void +static void clean_http_auth_challenge(http_auth_challenge_t *b) { - if (b->realm) + if (b->realm) free(b->realm); - if (b->qop) + if (b->qop) free(b->qop); - if (b->nonce) + if (b->nonce) free(b->nonce); - if (b->opaque) + if (b->opaque) free(b->opaque); - if (b->algo) + if (b->algo) free(b->algo); init_http_auth_challenge(b); } @@ -655,7 +670,7 @@ typedef struct { int valid; /* We did parse an authenticate header */ } http_auth_challenges_t; -static void +static void init_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -664,7 +679,7 @@ init_http_auth_challenges(http_auth_chal cs->count = cs->valid = 0; } -static void +static void clean_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -678,19 +693,19 @@ clean_http_auth_challenges(http_auth_cha init_http_auth_challenges(cs); } -/* +/* * Enumeration for lexical elements. Separators will be returned as their own * ascii value */ typedef enum {HTTPHL_WORD=256, HTTPHL_STRING=257, HTTPHL_END=258, HTTPHL_ERROR = 259} http_header_lex_t; -/* +/* * Determine what kind of token comes next and return possible value * in buf, which is supposed to have been allocated big enough by - * caller. Advance input pointer and return element type. + * caller. Advance input pointer and return element type. */ -static int +static int http_header_lex(const char **cpp, char *buf) { size_t l; @@ -719,7 +734,7 @@ http_header_lex(const char **cpp, char * return (HTTPHL_WORD); } -/* +/* * Read challenges from http xxx-authenticate header and accumulate them * in the challenges list structure. * @@ -731,7 +746,7 @@ http_header_lex(const char **cpp, char * * * We support both approaches anyway */ -static int +static int http_parse_authenticate(const char *cp, http_auth_challenges_t *cs) { int ret = -1; @@ -755,7 +770,7 @@ http_parse_authenticate(const char *cp, /* Loop on challenges */ for (; cs->count < MAX_CHALLENGES; cs->count++) { - cs->challenges[cs->count] = + cs->challenges[cs->count] = malloc(sizeof(http_auth_challenge_t)); if (cs->challenges[cs->count] == NULL) { fetch_syserr(); @@ -768,14 +783,14 @@ http_parse_authenticate(const char *cp, cs->challenges[cs->count]->scheme = HTTPAS_DIGEST; } else { cs->challenges[cs->count]->scheme = HTTPAS_UNKNOWN; - /* - * Continue parsing as basic or digest may + /* + * Continue parsing as basic or digest may * follow, and the syntax is the same for * all. We'll just ignore this one when * looking at the list */ } - + /* Loop on attributes */ for (;;) { /* Key */ @@ -794,31 +809,31 @@ http_parse_authenticate(const char *cp, goto out; if (!strcasecmp(key, "realm")) - cs->challenges[cs->count]->realm = + cs->challenges[cs->count]->realm = strdup(value); else if (!strcasecmp(key, "qop")) - cs->challenges[cs->count]->qop = + cs->challenges[cs->count]->qop = strdup(value); else if (!strcasecmp(key, "nonce")) - cs->challenges[cs->count]->nonce = + cs->challenges[cs->count]->nonce = strdup(value); else if (!strcasecmp(key, "opaque")) - cs->challenges[cs->count]->opaque = + cs->challenges[cs->count]->opaque = strdup(value); else if (!strcasecmp(key, "algorithm")) - cs->challenges[cs->count]->algo = + cs->challenges[cs->count]->algo = strdup(value); else if (!strcasecmp(key, "stale")) - cs->challenges[cs->count]->stale = + cs->challenges[cs->count]->stale = strcasecmp(value, "no"); /* Else ignore unknown attributes */ /* Comma or Next challenge or End */ lex = http_header_lex(&cp, key); - /* - * If we get a word here, this is the beginning of the - * next challenge. Break the attributes loop - */ + /* + * If we get a word here, this is the beginning of the + * next challenge. Break the attributes loop + */ if (lex == HTTPHL_WORD) break; @@ -835,10 +850,10 @@ http_parse_authenticate(const char *cp, } /* End attributes loop */ } /* End challenge loop */ - /* - * Challenges max count exceeded. This really can't happen - * with normal data, something's fishy -> error - */ + /* + * Challenges max count exceeded. This really can't happen + * with normal data, something's fishy -> error + */ out: if (key) @@ -1014,16 +1029,16 @@ init_http_auth_params(http_auth_params_t s->scheme = s->realm = s->user = s->password = 0; } -static void +static void clean_http_auth_params(http_auth_params_t *s) { - if (s->scheme) + if (s->scheme) free(s->scheme); - if (s->realm) + if (s->realm) free(s->realm); - if (s->user) + if (s->user) free(s->user); - if (s->password) + if (s->password) free(s->password); init_http_auth_params(s); } @@ -1078,7 +1093,7 @@ http_authfromenv(const char *p, http_aut } ret = 0; out: - if (ret == -1) + if (ret == -1) clean_http_auth_params(parms); if (str) free(str); @@ -1086,11 +1101,11 @@ out: } -/* +/* * Digest response: the code to compute the digest is taken from the - * sample implementation in RFC2616 + * sample implementation in RFC2616 */ -#define IN +#define IN const #define OUT #define HASHLEN 16 @@ -1099,7 +1114,7 @@ typedef char HASH[HASHLEN]; typedef char HASHHEX[HASHHEXLEN+1]; static const char *hexchars = "0123456789abcdef"; -static void +static void CvtHex(IN HASH Bin, OUT HASHHEX Hex) { unsigned short i; @@ -1115,7 +1130,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) }; /* calculate H(A1) as per spec */ -static void +static void DigestCalcHA1( IN char * pszAlg, IN char * pszUserName, @@ -1150,7 +1165,7 @@ DigestCalcHA1( } /* calculate request-digest/response-digest as per HTTP Digest spec */ -static void +static void DigestCalcResponse( IN HASHHEX HA1, /* H(A1) */ IN char * pszNonce, /* nonce from server */ @@ -1163,7 +1178,7 @@ DigestCalcResponse( OUT HASHHEX Response /* request-digest or response-digest */ ) { -/* DEBUG(fprintf(stderr, +/* DEBUG(fprintf(stderr, "Calc: HA1[%s] Nonce[%s] qop[%s] method[%s] URI[%s]\n", HA1, pszNonce, pszQop, pszMethod, pszDigestUri));*/ MD5_CTX Md5Ctx; @@ -1202,8 +1217,8 @@ DigestCalcResponse( CvtHex(RespHash, Response); } -/* - * Generate/Send a Digest authorization header +/* + * Generate/Send a Digest authorization header * This looks like: [Proxy-]Authorization: credentials * * credentials = "Digest" digest-response @@ -1236,10 +1251,10 @@ http_digest_auth(conn_t *conn, const cha DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); return(-1); } - if (!c->algo) + if (!c->algo) c->algo = strdup(""); - if (asprintf(&options, "%s%s%s%s", + if (asprintf(&options, "%s%s%s%s", *c->algo? ",algorithm=" : "", c->algo, c->opaque? ",opaque=" : "", c->opaque?c->opaque:"")== -1) return (-1); @@ -1267,13 +1282,13 @@ http_digest_auth(conn_t *conn, const cha r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"," "qop=\"auth\", cnonce=\"%s\", nc=%s%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, cnonce, noncecount, options); } else { r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, options); } if (options) @@ -1304,7 +1319,7 @@ http_basic_auth(conn_t *conn, const char } /* - * Chose the challenge to answer and call the appropriate routine to + * Chose the challenge to answer and call the appropriate routine to * produce the header. */ static int @@ -1330,16 +1345,16 @@ http_authorize(conn_t *conn, const char } /* Error if "Digest" was specified and there is no Digest challenge */ - if (!digest && (parms->scheme && + if (!digest && (parms->scheme && !strcasecmp(parms->scheme, "digest"))) { - DEBUG(fprintf(stderr, + DEBUG(fprintf(stderr, "Digest auth in env, not supported by peer\n")); return (-1); } - /* - * If "basic" was specified in the environment, or there is no Digest + /* + * If "basic" was specified in the environment, or there is no Digest * challenge, do the basic thing. Don't need a challenge for this, - * so no need to check basic!=NULL + * so no need to check basic!=NULL */ if (!digest || (parms->scheme && !strcasecmp(parms->scheme,"basic"))) return (http_basic_auth(conn,hdr,parms->user,parms->password)); @@ -1495,7 +1510,7 @@ http_request(struct url *URL, const char http_auth_challenges_t proxy_challenges; /* The following calls don't allocate anything */ - init_http_headerbuf(&headerbuf); + init_http_headerbuf(&headerbuf); init_http_auth_challenges(&server_challenges); init_http_auth_challenges(&proxy_challenges); @@ -1580,65 +1595,65 @@ http_request(struct url *URL, const char /* virtual host */ http_cmd(conn, "Host: %s", host); - /* - * Proxy authorization: we only send auth after we received - * a 407 error. We do not first try basic anyway (changed - * when support was added for digest-auth) - */ + /* + * Proxy authorization: we only send auth after we received + * a 407 error. We do not first try basic anyway (changed + * when support was added for digest-auth) + */ if (purl && proxy_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*purl->user || *purl->pwd) { - aparams.user = purl->user ? + aparams.user = purl->user ? strdup(purl->user) : strdup(""); aparams.password = purl->pwd? strdup(purl->pwd) : strdup(""); - } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && + } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_PROXY_AUTH); goto ouch; } } - http_authorize(conn, "Proxy-Authorization", + http_authorize(conn, "Proxy-Authorization", &proxy_challenges, &aparams, url); clean_http_auth_params(&aparams); } - /* - * Server authorization: we never send "a priori" + /* + * Server authorization: we never send "a priori" * Basic auth, which used to be done if user/pass were * set in the url. This would be weird because we'd send the - * password in the clear even if Digest is finally to be + * password in the clear even if Digest is finally to be * used (it would have made more sense for the - * pre-digest version to do this when Basic was specified - * in the environment) - */ + * pre-digest version to do this when Basic was specified + * in the environment) + */ if (server_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*url->user || *url->pwd) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); - } else if ((p = getenv("HTTP_AUTH")) != NULL && + } else if ((p = getenv("HTTP_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_AUTH); goto ouch; } - } else if (fetchAuthMethod && + } else if (fetchAuthMethod && fetchAuthMethod(url) == 0) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); } else { http_seterr(HTTP_NEED_AUTH); goto ouch; } - http_authorize(conn, "Authorization", + http_authorize(conn, "Authorization", &server_challenges, &aparams, url); clean_http_auth_params(&aparams); } @@ -1786,7 +1801,9 @@ http_request(struct url *URL, const char DEBUG(fprintf(stderr, "failed to parse new URL\n")); goto ouch; } - if (!*new->user && !*new->pwd) { + + /* Only copy credentials if the host matches */ + if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) { strcpy(new->user, url->user); strcpy(new->pwd, url->pwd); } @@ -1818,12 +1835,12 @@ http_request(struct url *URL, const char } while (h > hdr_end); /* we need to provide authentication */ - if (conn->err == HTTP_NEED_AUTH || + if (conn->err == HTTP_NEED_AUTH || conn->err == HTTP_NEED_PROXY_AUTH) { e = conn->err; - if ((conn->err == HTTP_NEED_AUTH && - !server_challenges.valid) || - (conn->err == HTTP_NEED_PROXY_AUTH && + if ((conn->err == HTTP_NEED_AUTH && + !server_challenges.valid) || *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8818E26; Mon, 5 Nov 2012 12:41:55 +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 AE1238FC14; Mon, 5 Nov 2012 12:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Cftfa001129; Mon, 5 Nov 2012 12:41:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CftHF001127; Mon, 5 Nov 2012 12:41:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051241.qA5CftHF001127@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242609 - stable/9/usr.bin/fetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:41:55 -0000 Author: des Date: Mon Nov 5 12:41:55 2012 New Revision: 242609 URL: http://svnweb.freebsd.org/changeset/base/242609 Log: MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/9/usr.bin/fetch/Makefile Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/Makefile ============================================================================== --- stable/9/usr.bin/fetch/Makefile Mon Nov 5 10:54:14 2012 (r242608) +++ stable/9/usr.bin/fetch/Makefile Mon Nov 5 12:41:55 2012 (r242609) @@ -4,11 +4,12 @@ PROG= fetch CSTD?= c99 +.if ${MK_OPENSSL} != "no" +DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO} +LDADD= -lfetch -lssl -lcrypto +.else DPADD= ${LIBFETCH} ${LIBMD} LDADD= -lfetch -lmd -.if ${MK_OPENSSL} != "no" -DPADD+= ${LIBSSL} ${LIBCRYPTO} -LDADD+= -lssl -lcrypto .endif .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:42:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B545DF30; Mon, 5 Nov 2012 12:42:02 +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 9B00A8FC1A; Mon, 5 Nov 2012 12:42:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Cg2gb001197; Mon, 5 Nov 2012 12:42:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5Cg2Ii001195; Mon, 5 Nov 2012 12:42:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051242.qA5Cg2Ii001195@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242610 - stable/8/usr.bin/fetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:42:02 -0000 Author: des Date: Mon Nov 5 12:42:02 2012 New Revision: 242610 URL: http://svnweb.freebsd.org/changeset/base/242610 Log: MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/8/usr.bin/fetch/Makefile Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/Makefile ============================================================================== --- stable/8/usr.bin/fetch/Makefile Mon Nov 5 12:41:55 2012 (r242609) +++ stable/8/usr.bin/fetch/Makefile Mon Nov 5 12:42:02 2012 (r242610) @@ -5,11 +5,13 @@ PROG= fetch CSTD?= c99 WARNS?= 6 + +.if ${MK_OPENSSL} != "no" +DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO} +LDADD= -lfetch -lssl -lcrypto +.else DPADD= ${LIBFETCH} ${LIBMD} LDADD= -lfetch -lmd -.if ${MK_OPENSSL} != "no" -DPADD+= ${LIBSSL} ${LIBCRYPTO} -LDADD+= -lssl -lcrypto .endif .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:42:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C727115; Mon, 5 Nov 2012 12:42:25 +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 41D778FC17; Mon, 5 Nov 2012 12:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5CgPXk001291; Mon, 5 Nov 2012 12:42:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CgPF3001289; Mon, 5 Nov 2012 12:42:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051242.qA5CgPF3001289@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242611 - stable/7/usr.bin/fetch X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:42:25 -0000 Author: des Date: Mon Nov 5 12:42:24 2012 New Revision: 242611 URL: http://svnweb.freebsd.org/changeset/base/242611 Log: MFH r240496: use libmd if and only if OpenSSL is not available Modified: stable/7/usr.bin/fetch/Makefile Directory Properties: stable/7/usr.bin/fetch/ (props changed) Modified: stable/7/usr.bin/fetch/Makefile ============================================================================== --- stable/7/usr.bin/fetch/Makefile Mon Nov 5 12:42:02 2012 (r242610) +++ stable/7/usr.bin/fetch/Makefile Mon Nov 5 12:42:24 2012 (r242611) @@ -5,11 +5,13 @@ PROG= fetch CSTD?= c99 WARNS?= 6 + +.if ${MK_OPENSSL} != "no" +DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO} +LDADD= -lfetch -lssl -lcrypto +.else DPADD= ${LIBFETCH} ${LIBMD} LDADD= -lfetch -lmd -.if ${MK_OPENSSL} != "no" -DPADD+= ${LIBSSL} ${LIBCRYPTO} -LDADD+= -lssl -lcrypto .endif .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:46:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0B3A3A0; Mon, 5 Nov 2012 12:46:47 +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 80D698FC14; Mon, 5 Nov 2012 12:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5CklHU002014; Mon, 5 Nov 2012 12:46:47 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CklS5002012; Mon, 5 Nov 2012 12:46:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051246.qA5CklS5002012@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242612 - stable/9/usr.bin/fetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:46:47 -0000 Author: des Date: Mon Nov 5 12:46:47 2012 New Revision: 242612 URL: http://svnweb.freebsd.org/changeset/base/242612 Log: MFH r236110: revert unauthorized, unnecessary and incorrect commit Modified: stable/9/usr.bin/fetch/fetch.1 Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.1 ============================================================================== --- stable/9/usr.bin/fetch/fetch.1 Mon Nov 5 12:42:24 2012 (r242611) +++ stable/9/usr.bin/fetch/fetch.1 Mon Nov 5 12:46:47 2012 (r242612) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -214,11 +214,6 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp -.Ar URL -.Bd -literal - :(//((:)?@)?(:)?)?/()? -.Ed -.Pp If .Nm receives a From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:57:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78112960; Mon, 5 Nov 2012 12:57:07 +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 5D5A38FC0C; Mon, 5 Nov 2012 12:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Cv7Jq003946; Mon, 5 Nov 2012 12:57:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5Cv7Zn003943; Mon, 5 Nov 2012 12:57:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051257.qA5Cv7Zn003943@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242613 - stable/8/usr.bin/fetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:57:07 -0000 Author: des Date: Mon Nov 5 12:57:07 2012 New Revision: 242613 URL: http://svnweb.freebsd.org/changeset/base/242613 Log: MFH r225815 (partial): adjust copyright statement Modified: stable/8/usr.bin/fetch/fetch.1 stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/fetch.1 ============================================================================== --- stable/8/usr.bin/fetch/fetch.1 Mon Nov 5 12:46:47 2012 (r242612) +++ stable/8/usr.bin/fetch/fetch.1 Mon Nov 5 12:57:07 2012 (r242613) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2004 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. Modified: stable/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Mon Nov 5 12:46:47 2012 (r242612) +++ stable/8/usr.bin/fetch/fetch.c Mon Nov 5 12:57:07 2012 (r242613) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 12:58:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A5F6AE1; Mon, 5 Nov 2012 12:58:44 +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 5E9CF8FC08; Mon, 5 Nov 2012 12:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Cwitd004244; Mon, 5 Nov 2012 12:58:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5CwiTH004241; Mon, 5 Nov 2012 12:58:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051258.qA5CwiTH004241@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 12:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242614 - stable/7/usr.bin/fetch X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 12:58:44 -0000 Author: des Date: Mon Nov 5 12:58:44 2012 New Revision: 242614 URL: http://svnweb.freebsd.org/changeset/base/242614 Log: MFH r225815 (partial): adjust copyright statement Modified: stable/7/usr.bin/fetch/fetch.1 stable/7/usr.bin/fetch/fetch.c Directory Properties: stable/7/usr.bin/fetch/ (props changed) Modified: stable/7/usr.bin/fetch/fetch.1 ============================================================================== --- stable/7/usr.bin/fetch/fetch.1 Mon Nov 5 12:57:07 2012 (r242613) +++ stable/7/usr.bin/fetch/fetch.1 Mon Nov 5 12:58:44 2012 (r242614) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. Modified: stable/7/usr.bin/fetch/fetch.c ============================================================================== --- stable/7/usr.bin/fetch/fetch.c Mon Nov 5 12:57:07 2012 (r242613) +++ stable/7/usr.bin/fetch/fetch.c Mon Nov 5 12:58:44 2012 (r242614) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 13:02:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16E40E11; Mon, 5 Nov 2012 13:02:35 +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 EF4168FC17; Mon, 5 Nov 2012 13:02:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5D2YQU004951; Mon, 5 Nov 2012 13:02:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5D2Y8n004949; Mon, 5 Nov 2012 13:02:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201211051302.qA5D2Y8n004949@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 5 Nov 2012 13:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242615 - stable/7/usr.bin/fetch X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 13:02:35 -0000 Author: des Date: Mon Nov 5 13:02:34 2012 New Revision: 242615 URL: http://svnweb.freebsd.org/changeset/base/242615 Log: MFH r225599: fix resume logic Modified: stable/7/usr.bin/fetch/fetch.c Directory Properties: stable/7/usr.bin/fetch/ (props changed) Modified: stable/7/usr.bin/fetch/fetch.c ============================================================================== --- stable/7/usr.bin/fetch/fetch.c Mon Nov 5 12:58:44 2012 (r242614) +++ stable/7/usr.bin/fetch/fetch.c Mon Nov 5 13:02:34 2012 (r242615) @@ -522,6 +522,12 @@ fetch(char *URL, const char *path) "does not match remote", path); goto failure_keep; } + } else if (url->offset > sb.st_size) { + /* gap between what we asked for and what we got */ + warnx("%s: gap in resume mode", URL); + fclose(of); + of = NULL; + /* picked up again later */ } else if (us.size != -1) { if (us.size == sb.st_size) /* nothing to do */ @@ -551,6 +557,14 @@ fetch(char *URL, const char *path) fclose(of); of = NULL; sb = nsb; + /* picked up again later */ + } + /* seek to where we left off */ + if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseek()", path); + fclose(of); + of = NULL; + /* picked up again later */ } } } else if (m_flag && sb.st_size != -1) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 15:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B3958E8; Mon, 5 Nov 2012 15:23:55 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 407148FC18; Mon, 5 Nov 2012 15:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5FNtp2026779; Mon, 5 Nov 2012 15:23:55 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5FNtCP026777; Mon, 5 Nov 2012 15:23:55 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211051523.qA5FNtCP026777@svn.freebsd.org> From: Attilio Rao Date: Mon, 5 Nov 2012 15:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242616 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 15:23:55 -0000 Author: attilio Date: Mon Nov 5 15:23:54 2012 New Revision: 242616 URL: http://svnweb.freebsd.org/changeset/base/242616 Log: fuse_io* must be able to crunch also VDIR vnodes. Update assert appropriately. Reported and Tested by: flo MFC after: 2 months X-MFC: 241519,242536 Modified: head/sys/fs/fuse/fuse_io.c Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Mon Nov 5 13:02:34 2012 (r242615) +++ head/sys/fs/fuse/fuse_io.c Mon Nov 5 15:23:54 2012 (r242616) @@ -122,7 +122,7 @@ fuse_io_dispatch(struct vnode *vp, struc struct fuse_filehandle *fufh; int err, directio; - MPASS(vp->v_type == VREG); + MPASS(vp->v_type == VREG || vp->v_type == VDIR); err = fuse_filehandle_getrw(vp, (uio->uio_rw == UIO_READ) ? FUFH_RDONLY : FUFH_WRONLY, &fufh); @@ -612,7 +612,7 @@ fuse_io_strategy(struct vnode *vp, struc const int biosize = fuse_iosize(vp); - MPASS(vp->v_type == VREG); + MPASS(vp->v_type == VREG || vp->v_type == VDIR); MPASS(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE); FS_DEBUG("inode=%ju offset=%jd resid=%ld\n", (uintmax_t)VTOI(vp), (intmax_t)(((off_t)bp->b_blkno) * biosize), From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 16:40:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63954695; Mon, 5 Nov 2012 16:40: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 494F38FC0A; Mon, 5 Nov 2012 16:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5GegUr038669; Mon, 5 Nov 2012 16:40:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5GegmV038667; Mon, 5 Nov 2012 16:40:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211051640.qA5GegmV038667@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 5 Nov 2012 16:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242617 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 16:40:42 -0000 Author: kib Date: Mon Nov 5 16:40:42 2012 New Revision: 242617 URL: http://svnweb.freebsd.org/changeset/base/242617 Log: A clarification to the behaviour of the active vnode list management regarding the vnode page cleaning. In collaboration with: pho MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 5 15:23:54 2012 (r242616) +++ head/sys/kern/vfs_subr.c Mon Nov 5 16:40:42 2012 (r242617) @@ -2507,6 +2507,9 @@ vinactive(struct vnode *vp, struct threa * Before moving off the active list, we must be sure that any * modified pages are on the vnode's dirty list since these will * no longer be checked once the vnode is on the inactive list. + * Because the vnode vm object keeps a hold reference on the vnode + * if there is at least one resident non-cached page, the vnode + * cannot leave the active list without the page cleanup done. */ obj = vp->v_object; if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 17:42:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34A515FB; Mon, 5 Nov 2012 17:42:51 +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 1B90B8FC14; Mon, 5 Nov 2012 17:42:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5HgoOO048513; Mon, 5 Nov 2012 17:42:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5HgoNo048511; Mon, 5 Nov 2012 17:42:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211051742.qA5HgoNo048511@svn.freebsd.org> From: Xin LI Date: Mon, 5 Nov 2012 17:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242618 - head/usr.bin/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 17:42:51 -0000 Author: delphij Date: Mon Nov 5 17:42:50 2012 New Revision: 242618 URL: http://svnweb.freebsd.org/changeset/base/242618 Log: Fix build with clang: properly terminate comment even in #if 0 blocks. Submitted by: dim Modified: head/usr.bin/less/defines.h Modified: head/usr.bin/less/defines.h ============================================================================== --- head/usr.bin/less/defines.h Mon Nov 5 16:40:42 2012 (r242617) +++ head/usr.bin/less/defines.h Mon Nov 5 17:42:50 2012 (r242618) @@ -184,7 +184,7 @@ /* * Sizes of various buffers. */ -#if 0 /* old sizes for small memory machines +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 17:50:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 603968A3; Mon, 5 Nov 2012 17:50:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 446A08FC12; Mon, 5 Nov 2012 17:50:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5HofO3049835; Mon, 5 Nov 2012 17:50:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5Hof8U049831; Mon, 5 Nov 2012 17:50:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211051750.qA5Hof8U049831@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 5 Nov 2012 17:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242619 - in head/sys: dev/usb/serial sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 17:50:41 -0000 Author: hselasky Date: Mon Nov 5 17:50:40 2012 New Revision: 242619 URL: http://svnweb.freebsd.org/changeset/base/242619 Log: Add a jitter buffer in the common USB serial driver code which temporarily stores characters if the TTY buffer is full when used a as a console. This can happen when a console is suspended. Also properly do the flow stop signalling when this happens and flow start when the condition changes back to normal again. Bump __FreeBSD_version to force external kernel modules to be recompiled. No kernel API changes. MFC after: 1 week Suggested by: ed @ Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/sys/param.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Nov 5 17:42:50 2012 (r242618) +++ head/sys/dev/usb/serial/usb_serial.c Mon Nov 5 17:50:40 2012 (r242619) @@ -162,6 +162,7 @@ static tsw_ioctl_t ucom_ioctl; static tsw_modem_t ucom_modem; static tsw_param_t ucom_param; static tsw_outwakeup_t ucom_outwakeup; +static tsw_inwakeup_t ucom_inwakeup; static tsw_free_t ucom_free; static struct ttydevsw ucom_class = { @@ -169,6 +170,7 @@ static struct ttydevsw ucom_class = { .tsw_open = ucom_open, .tsw_close = ucom_close, .tsw_outwakeup = ucom_outwakeup, + .tsw_inwakeup = ucom_inwakeup, .tsw_ioctl = ucom_ioctl, .tsw_param = ucom_param, .tsw_modem = ucom_modem, @@ -716,6 +718,10 @@ ucom_open(struct tty *tp) sc->sc_pls_set = 0; sc->sc_pls_clr = 0; + /* reset jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + ucom_queue_command(sc, ucom_cfg_open, NULL, &sc->sc_open_task[0].hdr, &sc->sc_open_task[1].hdr); @@ -780,6 +786,47 @@ ucom_close(struct tty *tp) } } +static void +ucom_inwakeup(struct tty *tp) +{ + struct ucom_softc *sc = tty_softc(tp); + uint16_t pos; + + if (sc == NULL) + return; + + tty_lock(tp); + + if (ttydisc_can_bypass(tp) != 0 || + (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { + tty_unlock(tp); + return; + } + + pos = sc->sc_jitterbuf_out; + + while (sc->sc_jitterbuf_in != pos) { + int c; + + c = (char)sc->sc_jitterbuf[pos]; + + if (ttydisc_rint(tp, c, 0) == -1) + break; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_out = pos; + + /* clear RTS in async fashion */ + if ((sc->sc_jitterbuf_in == pos) && + (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) + ucom_rts(sc, 0); + + tty_unlock(tp); +} + static int ucom_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { @@ -1360,6 +1407,11 @@ ucom_put_data(struct ucom_softc *sc, str /* first check if we can pass the buffer directly */ if (ttydisc_can_bypass(tp)) { + + /* clear any jitter buffer */ + sc->sc_jitterbuf_in = 0; + sc->sc_jitterbuf_out = 0; + if (ttydisc_rint_bypass(tp, buf, cnt) != cnt) { DPRINTF("tp=%p, data lost\n", tp); } @@ -1368,8 +1420,31 @@ ucom_put_data(struct ucom_softc *sc, str /* need to loop */ for (cnt = 0; cnt != res.length; cnt++) { - if (ttydisc_rint(tp, buf[cnt], 0) == -1) { - /* XXX what should we do? */ + if (sc->sc_jitterbuf_in != sc->sc_jitterbuf_out || + ttydisc_rint(tp, buf[cnt], 0) == -1) { + uint16_t end; + uint16_t pos; + + pos = sc->sc_jitterbuf_in; + end = sc->sc_jitterbuf_out + + UCOM_JITTERBUF_SIZE - 1; + if (end >= UCOM_JITTERBUF_SIZE) + end -= UCOM_JITTERBUF_SIZE; + + for (; cnt != res.length; cnt++) { + if (pos == end) + break; + sc->sc_jitterbuf[pos] = buf[cnt]; + pos++; + if (pos >= UCOM_JITTERBUF_SIZE) + pos -= UCOM_JITTERBUF_SIZE; + } + + sc->sc_jitterbuf_in = pos; + + /* set RTS in async fashion */ + if (sc->sc_flag & UCOM_FLAG_RTS_IFLOW) + ucom_rts(sc, 1); DPRINTF("tp=%p, lost %d " "chars\n", tp, res.length - cnt); Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Mon Nov 5 17:42:50 2012 (r242618) +++ head/sys/dev/usb/serial/usb_serial.h Mon Nov 5 17:50:40 2012 (r242619) @@ -78,6 +78,7 @@ #define UCOM_MINVER 1 #define UCOM_PREFVER UCOM_MODVER #define UCOM_MAXVER 1 +#define UCOM_JITTERBUF_SIZE 128 /* bytes */ struct usb_device; struct ucom_softc; @@ -169,6 +170,8 @@ struct ucom_softc { struct mtx *sc_mtx; void *sc_parent; int sc_subunit; + uint16_t sc_jitterbuf_in; + uint16_t sc_jitterbuf_out; uint16_t sc_portno; uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ @@ -191,6 +194,7 @@ struct ucom_softc { #define UCOM_LS_RTS 0x02 #define UCOM_LS_BREAK 0x04 #define UCOM_LS_RING 0x08 + uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; #define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 5 17:42:50 2012 (r242618) +++ head/sys/sys/param.h Mon Nov 5 17:50:40 2012 (r242619) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000022 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000023 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 17:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0390AA37; Mon, 5 Nov 2012 17:52:19 +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 DC4078FC0A; Mon, 5 Nov 2012 17:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5HqIJN050156; Mon, 5 Nov 2012 17:52:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5HqI6m050154; Mon, 5 Nov 2012 17:52:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211051752.qA5HqI6m050154@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 5 Nov 2012 17:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242620 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 17:52:19 -0000 Author: jilles Date: Mon Nov 5 17:52:18 2012 New Revision: 242620 URL: http://svnweb.freebsd.org/changeset/base/242620 Log: sh: Change cmdtype in tblentry from short to signed char. If this is a smaller type than int anyway, we can make it the smallest possible. Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Mon Nov 5 17:50:40 2012 (r242619) +++ head/bin/sh/exec.c Mon Nov 5 17:52:18 2012 (r242620) @@ -85,7 +85,7 @@ struct tblentry { struct tblentry *next; /* next entry in hash chain */ union param param; /* definition of builtin function */ int special; /* flag for special builtin commands */ - short cmdtype; /* index identifying command */ + signed char cmdtype; /* index identifying command */ char rehash; /* if set, cd done since entry created */ char cmdname[]; /* name of command */ }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 18:18:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C34B9688; Mon, 5 Nov 2012 18:18:04 +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 A7E138FC14; Mon, 5 Nov 2012 18:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5II4S4054616; Mon, 5 Nov 2012 18:18:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5II3QQ054612; Mon, 5 Nov 2012 18:18:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211051818.qA5II3QQ054612@svn.freebsd.org> From: Alexander Motin Date: Mon, 5 Nov 2012 18:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242621 - head/share/examples/ses/srcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 18:18:04 -0000 Author: mav Date: Mon Nov 5 18:18:03 2012 New Revision: 242621 URL: http://svnweb.freebsd.org/changeset/base/242621 Log: Fix a minor typo. Modified: head/share/examples/ses/srcs/eltsub.c Modified: head/share/examples/ses/srcs/eltsub.c ============================================================================== --- head/share/examples/ses/srcs/eltsub.c Mon Nov 5 17:52:18 2012 (r242620) +++ head/share/examples/ses/srcs/eltsub.c Mon Nov 5 18:18:03 2012 (r242621) @@ -71,7 +71,7 @@ geteltnm(int type) sprintf(rbuf, "Audible alarm"); break; case ELMTYP_ESCC: - sprintf(rbuf, "Enclosure Eervices Controller Electronics"); + sprintf(rbuf, "Enclosure Services Controller Electronics"); break; case ELMTYP_SCC: sprintf(rbuf, "SCC Controller Electronics"); From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 18:49:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86A4FDF7; Mon, 5 Nov 2012 18:49:21 +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 6C89C8FC0C; Mon, 5 Nov 2012 18:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5InLuF059627; Mon, 5 Nov 2012 18:49:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5InLAL059625; Mon, 5 Nov 2012 18:49:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211051849.qA5InLAL059625@svn.freebsd.org> From: Dimitry Andric Date: Mon, 5 Nov 2012 18:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242622 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 18:49:21 -0000 Author: dim Date: Mon Nov 5 18:49:21 2012 New Revision: 242622 URL: http://svnweb.freebsd.org/changeset/base/242622 Log: Fix a few warnings from newer clang 3.2 in libpmc, about comparing enum pmc_event values against integer constants which fall outside the enum range. Reviewed by: fabient, sbruno MFC after: 3 days Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Mon Nov 5 18:18:03 2012 (r242621) +++ head/lib/libpmc/libpmc.c Mon Nov 5 18:49:21 2012 (r242622) @@ -2264,7 +2264,7 @@ soft_allocate_pmc(enum pmc_event pe, cha (void)ctrspec; (void)pmc_config; - if (pe < PMC_EV_SOFT_FIRST || pe > PMC_EV_SOFT_LAST) + if ((int)pe < PMC_EV_SOFT_FIRST || (int)pe > PMC_EV_SOFT_LAST) return (-1); pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); @@ -3190,7 +3190,7 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe == PMC_EV_TSC_TSC) { ev = tsc_event_table; evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); - } else if (pe >= PMC_EV_SOFT_FIRST && pe <= PMC_EV_SOFT_LAST) { + } else if ((int)pe >= PMC_EV_SOFT_FIRST && (int)pe <= PMC_EV_SOFT_LAST) { ev = soft_event_table; evfence = soft_event_table + soft_event_info.pm_nevent; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 19:00:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDADA492; Mon, 5 Nov 2012 19:00:25 +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 8A3778FC08; Mon, 5 Nov 2012 19:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5J0PjZ061501; Mon, 5 Nov 2012 19:00:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5J0PXP061499; Mon, 5 Nov 2012 19:00:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211051900.qA5J0PXP061499@svn.freebsd.org> From: Dimitry Andric Date: Mon, 5 Nov 2012 19:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242623 - head/sys/contrib/ngatm/netnatm/msg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 19:00:25 -0000 Author: dim Date: Mon Nov 5 19:00:25 2012 New Revision: 242623 URL: http://svnweb.freebsd.org/changeset/base/242623 Log: In sys/contrib/ngatm/netnatm/msg/uni_ie.c, fix a few warnings from newer versions of clang 3.2, about comparing enum uni_cause values against integer constants which fall outside the enum range. No functional change. MFC after: 3 days Modified: head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Modified: head/sys/contrib/ngatm/netnatm/msg/uni_ie.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Mon Nov 5 18:49:21 2012 (r242622) +++ head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Mon Nov 5 19:00:25 2012 (r242623) @@ -869,7 +869,7 @@ UNI_DECLARE_CAUSE_VALUES enum uni_diag uni_diag(enum uni_cause cause, enum uni_coding code) { - if (cause >= 128) + if ((int)cause >= 128) return (UNI_DIAG_NONE); if (code == UNI_CODING_NET) @@ -925,9 +925,9 @@ print_cause(struct unicx *cx, struct uni if (uni_print_iehdr("cause", &ie->h, cx)) return; - if (ie->cause < 128 && tab1[ie->cause].str) + if ((int)ie->cause < 128 && tab1[ie->cause].str) strcpy(buf, tab1[ie->cause].str); - else if (ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) + else if ((int)ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) strcpy(buf, tab2[ie->cause].str); else { sprintf(buf, "UNKNOWN-%u", ie->cause); @@ -1059,7 +1059,7 @@ check_cause(struct uni_ie_cause *ie, str const struct causetab *ptr; - if (ie->cause >= 128) + if ((int)ie->cause >= 128) return (-1); switch (ie->loc) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 19:08:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B895EA7B; Mon, 5 Nov 2012 19:08:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80F808FC15; Mon, 5 Nov 2012 19:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5J8Ir9063069; Mon, 5 Nov 2012 19:08:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5J8I72063064; Mon, 5 Nov 2012 19:08:18 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201211051908.qA5J8I72063064@svn.freebsd.org> From: Brooks Davis Date: Mon, 5 Nov 2012 19:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242624 - in head: . share/mk sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 19:08:18 -0000 Author: brooks Date: Mon Nov 5 19:08:18 2012 New Revision: 242624 URL: http://svnweb.freebsd.org/changeset/base/242624 Log: After years of hard work by many FreeBSD and LLVM developers, make clang the default compiler on i386 and amd64 systems. Special thanks to: dim, ed, rdivacky Modified: head/UPDATING head/share/mk/bsd.own.mk head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 5 19:00:25 2012 (r242623) +++ head/UPDATING Mon Nov 5 19:08:18 2012 (r242624) @@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20121105: + On i386 and amd64 systems WITH_CLANG_IS_CC is now the default. + This means that the world and kernel will be compiled with clang + and that clang will be installed as /usr/bin/cc, /usr/bin/c++, + and /usr/bin/cpp. To disable this behavior and revert to building + with gcc, compiler with WITHOUT_CLANG_IS_CC. + 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its functionality now turned on by default. Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Nov 5 19:00:25 2012 (r242623) +++ head/share/mk/bsd.own.mk Mon Nov 5 19:08:18 2012 (r242624) @@ -426,7 +426,6 @@ __DEFAULT_NO_OPTIONS = \ BIND_XML \ BSDCONFIG \ CLANG_EXTRAS \ - CLANG_IS_CC \ CTF \ HESIOD \ ICONV \ @@ -455,6 +454,12 @@ __DEFAULT_YES_OPTIONS+=CLANG .else __DEFAULT_NO_OPTIONS+=CLANG .endif +# Clang the default system compiler only on x86. +.if ${__T} == "amd64" || ${__T} == "i386" +__DEFAULT_YES_OPTIONS+=CLANG_IS_CC +.else +__DEFAULT_NO_OPTIONS+=CLANG_IS_CC +.endif # FDT is needed only for arm, mips and powerpc .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} __DEFAULT_YES_OPTIONS+=FDT Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 5 19:00:25 2012 (r242623) +++ head/sys/sys/param.h Mon Nov 5 19:08:18 2012 (r242624) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000023 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000024 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 19:16:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3682CDDD; Mon, 5 Nov 2012 19:16:28 +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 14D728FC08; Mon, 5 Nov 2012 19:16:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5JGREZ064628; Mon, 5 Nov 2012 19:16:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5JGRDr064585; Mon, 5 Nov 2012 19:16:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211051916.qA5JGRDr064585@svn.freebsd.org> From: Dimitry Andric Date: Mon, 5 Nov 2012 19:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242625 - in head/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/ste de... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 19:16:28 -0000 Author: dim Date: Mon Nov 5 19:16:27 2012 New Revision: 242625 URL: http://svnweb.freebsd.org/changeset/base/242625 Log: Remove duplicate const specifiers in many drivers (I hope I got all of them, please let me know if not). Most of these are of the form: static const struct bzzt_type { [...list of members...] } const bzzt_devs[] = { [...list of initializers...] }; The second const is unnecessary, as arrays cannot be modified anyway, and if the elements are const, the whole thing is const automatically (e.g. it is placed in .rodata). I have verified this does not change the binary output of a full kernel build (except for build timestamps embedded in the object files). Reviewed by: yongari, marius MFC after: 1 week Modified: head/sys/dev/ale/if_ale.c head/sys/dev/ata/ata-card.c head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-adaptec.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/bge/if_bge.c head/sys/dev/cas/if_cas.c head/sys/dev/dc/if_dc.c head/sys/dev/flash/at45d.c head/sys/dev/fxp/if_fxp.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/lge/if_lge.c head/sys/dev/mii/mii.c head/sys/dev/nge/if_nge.c head/sys/dev/pci/pci.c head/sys/dev/re/if_re.c head/sys/dev/sis/if_sis.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/ti/if_ti.c head/sys/dev/tl/if_tl.c head/sys/dev/vr/if_vr.c head/sys/dev/wb/if_wb.c head/sys/dev/xl/if_xl.c head/sys/pci/if_rl.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ale/if_ale.c Mon Nov 5 19:16:27 2012 (r242625) @@ -95,7 +95,7 @@ static const struct ale_dev { uint16_t ale_vendorid; uint16_t ale_deviceid; const char *ale_name; -} const ale_devs[] = { +} ale_devs[] = { { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, }; Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/ata-card.c Mon Nov 5 19:16:27 2012 (r242625) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "pccarddevs.h" -static const struct pccard_product const ata_pccard_products[] = { +static const struct pccard_product ata_pccard_products[] = { PCMCIA_CARD(FREECOM, PCCARDIDE), PCMCIA_CARD(EXP, EXPMULTIMEDIA), PCMCIA_CARD(IODATA3, CBIDE2), Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-acard.c Mon Nov 5 19:16:27 2012 (r242625) @@ -81,7 +81,7 @@ static int ata_acard_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATP850R, 0, ATP_OLD, 0x00, ATA_UDMA2, "ATP850" }, { ATA_ATP860A, 0, 0, 0x00, ATA_UDMA4, "ATP860A" }, { ATA_ATP860R, 0, 0, 0x00, ATA_UDMA4, "ATP860R" }, Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 5 19:16:27 2012 (r242625) @@ -75,7 +75,7 @@ static int ata_ali_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ALI_5289, 0x00, 2, ALI_SATA, ATA_SA150, "M5289" }, { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" }, { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" }, Modified: head/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 5 19:16:27 2012 (r242625) @@ -62,7 +62,7 @@ static int ata_adaptec_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" }, { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" }, { 0, 0, 0, 0, 0, 0}}; Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Nov 5 19:16:27 2012 (r242625) @@ -67,7 +67,7 @@ static int ata_amd_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_AMD756, 0x00, 0x00, 0, ATA_UDMA4, "756" }, { ATA_AMD766, 0x00, AMD_CABLE|AMD_BUG, 0, ATA_UDMA5, "766" }, { ATA_AMD768, 0x00, AMD_CABLE, 0, ATA_UDMA5, "768" }, Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-ati.c Mon Nov 5 19:16:27 2012 (r242625) @@ -75,7 +75,7 @@ static int ata_ati_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATI_IXP200, 0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" }, { ATA_ATI_IXP300, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" }, { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" }, Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 5 19:16:27 2012 (r242625) @@ -73,7 +73,7 @@ ata_highpoint_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_HPT374, 0x07, HPT_374, 0, ATA_UDMA6, "HPT374" }, { ATA_HPT372, 0x02, HPT_372, 0, ATA_UDMA6, "HPT372N" }, { ATA_HPT372, 0x01, HPT_372, 0, ATA_UDMA6, "HPT372" }, Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 5 19:16:27 2012 (r242625) @@ -105,7 +105,7 @@ static int ata_intel_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_I82371FB, 0, 0, 2, ATA_WDMA2, "PIIX" }, { ATA_I82371SB, 0, 0, 2, ATA_WDMA2, "PIIX3" }, { ATA_I82371AB, 0, 0, 2, ATA_UDMA2, "PIIX4" }, Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-ite.c Mon Nov 5 19:16:27 2012 (r242625) @@ -64,7 +64,7 @@ static int ata_ite_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_IT8213F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8213F" }, { ATA_IT8212F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8212F" }, { ATA_IT8211F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8211F" }, Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 5 19:16:27 2012 (r242625) @@ -64,7 +64,7 @@ ata_jmicron_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 5 19:16:27 2012 (r242625) @@ -99,7 +99,7 @@ static int ata_marvell_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 5 19:16:27 2012 (r242625) @@ -75,7 +75,7 @@ static int ata_nvidia_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_NFORCE1, 0, 0, 0, ATA_UDMA5, "nForce" }, { ATA_NFORCE2, 0, 0, 0, ATA_UDMA6, "nForce2" }, { ATA_NFORCE2_PRO, 0, 0, 0, ATA_UDMA6, "nForce2 Pro" }, Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Nov 5 19:16:27 2012 (r242625) @@ -130,7 +130,7 @@ ata_promise_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_PDC20246, 0, PR_OLD, 0x00, ATA_UDMA2, "PDC20246" }, { ATA_PDC20262, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20262" }, { ATA_PDC20263, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20263" }, Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 5 19:16:27 2012 (r242625) @@ -75,7 +75,7 @@ static int ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 5 19:16:27 2012 (r242625) @@ -87,7 +87,7 @@ static int ata_sii_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SII3114, 0x00, SII_MEMIO, SII_4CH, ATA_SA150, "3114" }, { ATA_SII3512, 0x02, SII_MEMIO, 0, ATA_SA150, "3512" }, { ATA_SII3112, 0x02, SII_MEMIO, 0, ATA_SA150, "3112" }, Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-sis.c Mon Nov 5 19:16:27 2012 (r242625) @@ -74,7 +74,7 @@ ata_sis_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SIS182, 0x00, SIS_SATA, 0, ATA_SA150, "182" }, /* south */ { ATA_SIS181, 0x00, SIS_SATA, 0, ATA_SA150, "181" }, /* south */ { ATA_SIS180, 0x00, SIS_SATA, 0, ATA_SA150, "180" }, /* south */ Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ata/chipsets/ata-via.c Mon Nov 5 19:16:27 2012 (r242625) @@ -89,7 +89,7 @@ static int ata_via_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, @@ -113,7 +113,7 @@ ata_via_probe(device_t dev) { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; - static const struct ata_chip_id const new_ids[] = + static const struct ata_chip_id new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 5 19:16:27 2012 (r242625) @@ -143,7 +143,7 @@ typedef struct RfHalFuncs { int16_t *minPower, int16_t *maxPower, const struct ieee80211_channel *, uint16_t *rfXpdGain); HAL_BOOL (*getChannelMaxMinPower)(struct ath_hal *ah, - const const struct ieee80211_channel *, + const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow); int16_t (*getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL*); } RF_HAL_FUNCS; Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/bge/if_bge.c Mon Nov 5 19:16:27 2012 (r242625) @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; -} const bge_devs[] = { +} bge_devs[] = { { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, @@ -239,7 +239,7 @@ static const struct bge_type { static const struct bge_vendor { uint16_t v_id; const char *v_name; -} const bge_vendors[] = { +} bge_vendors[] = { { ALTEON_VENDORID, "Alteon" }, { ALTIMA_VENDORID, "Altima" }, { APPLE_VENDORID, "Apple" }, @@ -254,7 +254,7 @@ static const struct bge_vendor { static const struct bge_revision { uint32_t br_chipid; const char *br_name; -} const bge_revisions[] = { +} bge_revisions[] = { { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, @@ -328,7 +328,7 @@ static const struct bge_revision { * Some defaults for major revisions, so that newer steppings * that we don't know about have a shot at working. */ -static const struct bge_revision const bge_majorrevs[] = { +static const struct bge_revision bge_majorrevs[] = { { BGE_ASICREV_BCM5700, "unknown BCM5700" }, { BGE_ASICREV_BCM5701, "unknown BCM5701" }, { BGE_ASICREV_BCM5703, "unknown BCM5703" }, @@ -3122,7 +3122,7 @@ bge_mbox_reorder(struct bge_softc *sc) const uint16_t vendor; const uint16_t device; const char *desc; - } const mbox_reorder_lists[] = { + } mbox_reorder_lists[] = { { 0x1022, 0x7450, "AMD-8131 PCI-X Bridge" }, }; devclass_t pci, pcib; Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/cas/if_cas.c Mon Nov 5 19:16:27 2012 (r242625) @@ -2623,7 +2623,7 @@ static const struct cas_pci_dev { uint8_t cpd_revid; int cpd_variant; const char *cpd_desc; -} const cas_pci_devlist[] = { +} cas_pci_devlist[] = { { 0x0035100b, 0x0, CAS_SATURN, "NS DP83065 Saturn Gigabit Ethernet" }, { 0xabba108e, 0x10, CAS_CASPLUS, "Sun Cassini+ Gigabit Ethernet" }, { 0xabba108e, 0x0, CAS_CAS, "Sun Cassini Gigabit Ethernet" }, Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/dc/if_dc.c Mon Nov 5 19:16:27 2012 (r242625) @@ -150,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct dc_type const dc_devs[] = { +static const struct dc_type dc_devs[] = { { DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0, "Intel 21143 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0, Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/flash/at45d.c Mon Nov 5 19:16:27 2012 (r242625) @@ -106,7 +106,7 @@ static int at45d_wait_ready(device_t dev * 2^N byte pages. If support for the latter is enabled, the sector offset * has to be reduced by one. */ -static const struct at45d_flash_ident const at45d_flash_devices[] = { +static const struct at45d_flash_ident at45d_flash_devices[] = { { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/fxp/if_fxp.c Mon Nov 5 19:16:27 2012 (r242625) @@ -111,7 +111,7 @@ static int tx_threshold = 64; * * See struct fxp_cb_config for the bit definitions. */ -static const u_char const fxp_cb_config_template[] = { +static const u_char fxp_cb_config_template[] = { 0x0, 0x0, /* cb_status */ 0x0, 0x0, /* cb_command */ 0x0, 0x0, 0x0, 0x0, /* link_addr */ @@ -155,7 +155,7 @@ static const u_char const fxp_cb_config_ * particular variants, but we don't currently differentiate between * them. */ -static const struct fxp_ident const fxp_ident_table[] = { +static const struct fxp_ident fxp_ident_table[] = { { 0x1029, -1, 0, "Intel 82559 PCI/CardBus Pro/100" }, { 0x1030, -1, 0, "Intel 82559 Pro/100 Ethernet" }, { 0x1031, -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" }, @@ -3053,7 +3053,7 @@ static const struct ucode { int length; u_short int_delay_offset; u_short bundle_max_offset; -} const ucode_table[] = { +} ucode_table[] = { { FXP_REV_82558_A4, UCODE(fxp_ucode_d101a), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82558_B0, UCODE(fxp_ucode_d101b0), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82559_A0, UCODE(fxp_ucode_d101ma), Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/gem/if_gem_pci.c Mon Nov 5 19:16:27 2012 (r242625) @@ -104,7 +104,7 @@ static const struct gem_pci_dev { uint32_t gpd_devid; int gpd_variant; const char *gpd_desc; -} const gem_pci_devlist[] = { +} gem_pci_devlist[] = { { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/lge/if_lge.c Mon Nov 5 19:16:27 2012 (r242625) @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/types and their names. */ -static const struct lge_type const lge_devs[] = { +static const struct lge_type lge_devs[] = { { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, { 0, 0, NULL } }; Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/mii/mii.c Mon Nov 5 19:16:27 2012 (r242625) @@ -626,7 +626,7 @@ mii_down(struct mii_data *mii) static unsigned char mii_bitreverse(unsigned char x) { - static unsigned const char const nibbletab[16] = { + static unsigned const char nibbletab[16] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/nge/if_nge.c Mon Nov 5 19:16:27 2012 (r242625) @@ -139,7 +139,7 @@ MODULE_DEPEND(nge, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct nge_type const nge_devs[] = { +static const struct nge_type nge_devs[] = { { NGE_VENDORID, NGE_DEVICEID, "National Semiconductor Gigabit Ethernet" }, { 0, 0, NULL } Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/pci/pci.c Mon Nov 5 19:16:27 2012 (r242625) @@ -201,7 +201,7 @@ struct pci_quirk { int arg2; }; -static const struct pci_quirk const pci_quirks[] = { +static const struct pci_quirk pci_quirks[] = { /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/re/if_re.c Mon Nov 5 19:16:27 2012 (r242625) @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe /* * Various supported device vendors/types and their names. */ -static const struct rl_type const re_devs[] = { +static const struct rl_type re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, @@ -194,7 +194,7 @@ static const struct rl_type const re_dev "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; -static const struct rl_hwrev const re_hwrevs[] = { +static const struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8139, RL_8139, "", RL_MTU }, { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/sis/if_sis.c Mon Nov 5 19:16:27 2012 (r242625) @@ -126,7 +126,7 @@ MODULE_DEPEND(sis, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct sis_type const sis_devs[] = { +static const struct sis_type sis_devs[] = { { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" }, { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" }, { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP8381[56] 10/100BaseTX" }, Modified: head/sys/dev/ste/if_ste.c ============================================================================== --- head/sys/dev/ste/if_ste.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ste/if_ste.c Mon Nov 5 19:16:27 2012 (r242625) @@ -85,7 +85,7 @@ MODULE_DEPEND(ste, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct ste_type const ste_devs[] = { +static const struct ste_type ste_devs[] = { { ST_VENDORID, ST_DEVICEID_ST201_1, "Sundance ST201 10/100BaseTX" }, { ST_VENDORID, ST_DEVICEID_ST201_2, "Sundance ST201 10/100BaseTX" }, { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" }, Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/stge/if_stge.c Mon Nov 5 19:16:27 2012 (r242625) @@ -91,7 +91,7 @@ static const struct stge_product { uint16_t stge_vendorid; uint16_t stge_deviceid; const char *stge_name; -} const stge_products[] = { +} stge_products[] = { { VENDOR_SUNDANCETI, DEVICEID_SUNDANCETI_ST1023, "Sundance ST-1023 Gigabit Ethernet" }, Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/ti/if_ti.c Mon Nov 5 19:16:27 2012 (r242625) @@ -145,7 +145,7 @@ typedef enum { * Various supported device vendors/types and their names. */ -static const struct ti_type const ti_devs[] = { +static const struct ti_type ti_devs[] = { { ALT_VENDORID, ALT_DEVICEID_ACENIC, "Alteon AceNIC 1000baseSX Gigabit Ethernet" }, { ALT_VENDORID, ALT_DEVICEID_ACENIC_COPPER, Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/tl/if_tl.c Mon Nov 5 19:16:27 2012 (r242625) @@ -229,7 +229,7 @@ MODULE_DEPEND(tl, miibus, 1, 1, 1); * Various supported device vendors/types and their names. */ -static const struct tl_type const tl_devs[] = { +static const struct tl_type tl_devs[] = { { TI_VENDORID, TI_DEVICEID_THUNDERLAN, "Texas Instruments ThunderLAN" }, { COMPAQ_VENDORID, COMPAQ_DEVICEID_NETEL_10, Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/vr/if_vr.c Mon Nov 5 19:16:27 2012 (r242625) @@ -119,7 +119,7 @@ static const struct vr_type { u_int16_t vr_did; int vr_quirks; const char *vr_name; -} const vr_devs[] = { +} vr_devs[] = { { VIA_VENDORID, VIA_DEVICEID_RHINE, VR_Q_NEEDALIGN, "VIA VT3043 Rhine I 10/100BaseTX" }, @@ -200,7 +200,7 @@ static const struct vr_tx_threshold_tabl int tx_cfg; int bcr_cfg; int value; -} const vr_tx_threshold_tables[] = { +} vr_tx_threshold_tables[] = { { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/wb/if_wb.c Mon Nov 5 19:16:27 2012 (r242625) @@ -130,7 +130,7 @@ MODULE_DEPEND(wb, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct wb_type const wb_devs[] = { +static const struct wb_type wb_devs[] = { { WB_VENDORID, WB_DEVICEID_840F, "Winbond W89C840F 10/100BaseTX" }, { CP_VENDORID, CP_DEVICEID_RL100, Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/dev/xl/if_xl.c Mon Nov 5 19:16:27 2012 (r242625) @@ -161,7 +161,7 @@ MODULE_DEPEND(xl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct xl_type const xl_devs[] = { +static const struct xl_type xl_devs[] = { { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, "3Com 3c900-TPO Etherlink XL" }, { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT_COMBO, Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/pci/if_rl.c Mon Nov 5 19:16:27 2012 (r242625) @@ -131,7 +131,7 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct rl_type const rl_devs[] = { +static const struct rl_type rl_devs[] = { { RT_VENDORID, RT_DEVICEID_8129, RL_8129, "RealTek 8129 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8139, RL_8139, Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/sparc64/pci/fire.c Mon Nov 5 19:16:27 2012 (r242625) @@ -249,7 +249,7 @@ struct fire_desc { const char *fd_name; }; -static const struct fire_desc const fire_compats[] = { +static const struct fire_desc fire_compats[] = { { "pciex108e,80f0", FIRE_MODE_FIRE, "Fire" }, #if 0 { "pciex108e,80f8", FIRE_MODE_OBERON, "Oberon" }, Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/sparc64/pci/psycho.c Mon Nov 5 19:16:27 2012 (r242625) @@ -222,14 +222,14 @@ struct psycho_desc { const char *pd_name; }; -static const struct psycho_desc const psycho_compats[] = { +static const struct psycho_desc psycho_compats[] = { { "pci108e,8000", PSYCHO_MODE_PSYCHO, "Psycho compatible" }, { "pci108e,a000", PSYCHO_MODE_SABRE, "Sabre compatible" }, { "pci108e,a001", PSYCHO_MODE_SABRE, "Hummingbird compatible" }, { NULL, 0, NULL } }; -static const struct psycho_desc const psycho_models[] = { +static const struct psycho_desc psycho_models[] = { { "SUNW,psycho", PSYCHO_MODE_PSYCHO, "Psycho" }, { "SUNW,sabre", PSYCHO_MODE_SABRE, "Sabre" }, { NULL, 0, NULL } Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Mon Nov 5 19:08:18 2012 (r242624) +++ head/sys/sparc64/pci/schizo.c Mon Nov 5 19:16:27 2012 (r242625) @@ -229,7 +229,7 @@ struct schizo_desc { const char *sd_name; }; -static const struct schizo_desc const schizo_compats[] = { +static const struct schizo_desc schizo_compats[] = { { "pci108e,8001", SCHIZO_MODE_SCZ, "Schizo" }, #if 0 { "pci108e,8002", SCHIZO_MODE_XMS, "XMITS" }, From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 19:20:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BE69129; Mon, 5 Nov 2012 19:20:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21AB58FC14; Mon, 5 Nov 2012 19:20:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5JKJau065357; Mon, 5 Nov 2012 19:20:19 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5JKIb8065355; Mon, 5 Nov 2012 19:20:18 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201211051920.qA5JKIb8065355@svn.freebsd.org> From: Brooks Davis Date: Mon, 5 Nov 2012 19:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242626 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 19:20:19 -0000 Author: brooks Date: Mon Nov 5 19:20:18 2012 New Revision: 242626 URL: http://svnweb.freebsd.org/changeset/base/242626 Log: Fix a minor error in the clang update note. Reported by: emaste Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 5 19:16:27 2012 (r242625) +++ head/UPDATING Mon Nov 5 19:20:18 2012 (r242626) @@ -29,7 +29,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 This means that the world and kernel will be compiled with clang and that clang will be installed as /usr/bin/cc, /usr/bin/c++, and /usr/bin/cpp. To disable this behavior and revert to building - with gcc, compiler with WITHOUT_CLANG_IS_CC. + with gcc, compile with WITHOUT_CLANG_IS_CC. 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 20:55:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A923C745; Mon, 5 Nov 2012 20:55:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2098FC0A; Mon, 5 Nov 2012 20:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5KtHam083138; Mon, 5 Nov 2012 20:55:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5KtHvq083133; Mon, 5 Nov 2012 20:55:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211052055.qA5KtHvq083133@svn.freebsd.org> From: Michael Tuexen Date: Mon, 5 Nov 2012 20:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242627 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 20:55:17 -0000 Author: tuexen Date: Mon Nov 5 20:55:17 2012 New Revision: 242627 URL: http://svnweb.freebsd.org/changeset/base/242627 Log: Move from early SSN assignment to late SSN assignment. This doesn't change functionality, but makes upcoming change much easier. Developed with rrs@ at the IETF 85. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Nov 5 19:20:18 2012 (r242626) +++ head/sys/netinet/sctp_input.c Mon Nov 5 20:55:17 2012 (r242627) @@ -1942,7 +1942,7 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; } /* process the INIT-ACK info (my info) */ @@ -3489,7 +3489,7 @@ sctp_reset_out_streams(struct sctp_tcb * if (number_entries == 0) { for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; } } else if (number_entries) { for (i = 0; i < number_entries; i++) { @@ -3500,7 +3500,7 @@ sctp_reset_out_streams(struct sctp_tcb * /* no such stream */ continue; } - stcb->asoc.strmout[temp].next_sequence_sent = 0; + stcb->asoc.strmout[temp].next_sequence_send = 0; } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Nov 5 19:20:18 2012 (r242626) +++ head/sys/netinet/sctp_output.c Mon Nov 5 20:55:17 2012 (r242627) @@ -3513,7 +3513,7 @@ sctp_process_cmsgs_for_init(struct sctp_ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -6194,7 +6194,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; atomic_add_int(&sp->net->ref_count, 1); @@ -6235,10 +6234,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - strm->next_sequence_sent++; - } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; if (hold_stcb_lock == 0) { @@ -7379,7 +7374,10 @@ dont_do_it: chk->asoc = &stcb->asoc; chk->pad_inplace = 0; chk->no_fr_allowed = 0; - chk->rec.data.stream_seq = sp->strseq; + chk->rec.data.stream_seq = strq->next_sequence_send; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_sequence_send++; + } chk->rec.data.stream_number = sp->stream; chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; @@ -11794,7 +11792,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); - stcb->asoc.strmout[i].next_sequence_sent = oldstream[i].next_sequence_sent; + stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); @@ -11814,7 +11812,7 @@ sctp_send_str_reset_req(struct sctp_tcb /* now the new streams */ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0x0; + stcb->asoc.strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -11971,7 +11969,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; @@ -12724,15 +12721,7 @@ skip_preblock: } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&asoc->stream_queue_cnt, 1); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_SCTP) { - sctp_misc_ints(SCTP_STRMOUT_LOG_ASSIGN, - (uintptr_t) stcb, sp->length, - (uint32_t) ((srcv->sinfo_stream << 16) | sp->strseq), 0); - } - strm->next_sequence_sent++; - } else { + if (srcv->sinfo_flags & SCTP_UNORDERED) { SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Nov 5 19:20:18 2012 (r242626) +++ head/sys/netinet/sctp_structs.h Mon Nov 5 20:55:17 2012 (r242627) @@ -517,7 +517,6 @@ struct sctp_stream_queue_pending { uint32_t context; uint16_t sinfo_flags; uint16_t stream; - uint16_t strseq; uint16_t act_flags; uint16_t auth_keyid; uint8_t holds_key_ref; @@ -590,7 +589,7 @@ struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; uint16_t stream_no; - uint16_t next_sequence_sent; /* next one I expect to send out */ + uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; }; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Nov 5 19:20:18 2012 (r242626) +++ head/sys/netinet/sctputil.c Mon Nov 5 20:55:17 2012 (r242627) @@ -1052,7 +1052,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_sequence_sent = 0x0; + asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; @@ -2973,7 +2973,7 @@ sctp_notify_send_failed2(struct sctp_tcb /* not exactly what the user sent in, but should be close :) */ bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); ssf->ssf_info.sinfo_stream = sp->stream; - ssf->ssf_info.sinfo_ssn = sp->strseq; + ssf->ssf_info.sinfo_ssn = 0; if (sp->some_taken) { ssf->ssf_info.sinfo_flags = SCTP_DATA_LAST_FRAG; } else { @@ -4774,77 +4774,69 @@ sctp_release_pr_sctp_chunk(struct sctp_t * Still no eom found. That means there is stuff left on the * stream out queue.. yuck. */ - strq = &stcb->asoc.strmout[stream]; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(sp, &strq->outqueue, next) { - /* FIXME: Shouldn't this be a serial number check? */ - if (sp->strseq > seq) { - break; - } - /* Check if its our SEQ */ - if (sp->strseq == seq) { - sp->discard_rest = 1; - /* - * We may need to put a chunk on the queue - * that holds the TSN that would have been - * sent with the LAST bit. - */ + strq = &stcb->asoc.strmout[stream]; + sp = TAILQ_FIRST(&strq->outqueue); + if (sp != NULL) { + sp->discard_rest = 1; + /* + * We may need to put a chunk on the queue that + * holds the TSN that would have been sent with the + * LAST bit. + */ + if (chk == NULL) { + /* Yep, we have to */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { - /* Yep, we have to */ - sctp_alloc_a_chunk(stcb, chk); - if (chk == NULL) { - /* - * we are hosed. All we can - * do is nothing.. which - * will cause an abort if - * the peer is paying - * attention. - */ - goto oh_well; - } - memset(chk, 0, sizeof(*chk)); - chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; - chk->sent = SCTP_FORWARD_TSN_SKIP; - chk->asoc = &stcb->asoc; - chk->rec.data.stream_seq = sp->strseq; - chk->rec.data.stream_number = sp->stream; - chk->rec.data.payloadtype = sp->ppid; - chk->rec.data.context = sp->context; - chk->flags = sp->act_flags; - if (sp->net) - chk->whoTo = sp->net; - else - chk->whoTo = stcb->asoc.primary_destination; - atomic_add_int(&chk->whoTo->ref_count, 1); - chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); - stcb->asoc.pr_sctp_cnt++; - chk->pr_sctp_on = 1; - TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); - stcb->asoc.sent_queue_cnt++; - stcb->asoc.pr_sctp_cnt++; - } else { - chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; - } - oh_well: - if (sp->data) { /* - * Pull any data to free up the SB - * and allow sender to "add more" - * while we will throw away :-) + * we are hosed. All we can do is + * nothing.. which will cause an + * abort if the peer is paying + * attention. */ - sctp_free_spbufspace(stcb, &stcb->asoc, - sp); - ret_sz += sp->length; - do_wakeup_routine = 1; - sp->some_taken = 1; - sctp_m_freem(sp->data); - sp->data = NULL; - sp->tail_mbuf = NULL; - sp->length = 0; + goto oh_well; } - break; + memset(chk, 0, sizeof(*chk)); + chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; + chk->sent = SCTP_FORWARD_TSN_SKIP; + chk->asoc = &stcb->asoc; + chk->rec.data.stream_seq = strq->next_sequence_send; + chk->rec.data.stream_number = sp->stream; + chk->rec.data.payloadtype = sp->ppid; + chk->rec.data.context = sp->context; + chk->flags = sp->act_flags; + if (sp->net) + chk->whoTo = sp->net; + else + chk->whoTo = stcb->asoc.primary_destination; + atomic_add_int(&chk->whoTo->ref_count, 1); + chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); + stcb->asoc.pr_sctp_cnt++; + chk->pr_sctp_on = 1; + TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); + stcb->asoc.sent_queue_cnt++; + stcb->asoc.pr_sctp_cnt++; + } else { + chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; + } + strq->next_sequence_send++; + oh_well: + if (sp->data) { + /* + * Pull any data to free up the SB and allow + * sender to "add more" while we will throw + * away :-) + */ + sctp_free_spbufspace(stcb, &stcb->asoc, sp); + ret_sz += sp->length; + do_wakeup_routine = 1; + sp->some_taken = 1; + sctp_m_freem(sp->data); + sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } - } /* End tailq_foreach */ + } SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:03:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93095A28; Mon, 5 Nov 2012 21:03:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD3B8FC0C; Mon, 5 Nov 2012 21:03:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5L3c7h084818; Mon, 5 Nov 2012 21:03:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5L3cEg084813; Mon, 5 Nov 2012 21:03:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211052103.qA5L3cEg084813@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 5 Nov 2012 21:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242628 - in head/sys/dev/usb: . quirk storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:03:38 -0000 Author: marcel Date: Mon Nov 5 21:03:38 2012 New Revision: 242628 URL: http://svnweb.freebsd.org/changeset/base/242628 Log: Add the UQ_MSC_NO_PREVENT_ALLOW quirk to handle devices that do not support the 'PREVENT/ALLOW MEDIUM REMOVAL' SCSI command. An example of such a device is the STmicro ST72682. We send the SCSI command for every open and close, which can result in a significant amount of spam on the console during boot. Reviewed by: hps@ Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Nov 5 20:55:17 2012 (r242627) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Nov 5 21:03:38 2012 (r242628) @@ -390,6 +390,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SONY, PORTABLE_HDD_V2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(STMICRO, ST72682, 0x0000, 0xffff, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(SUPERTOP, IDE, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(SUPERTOP, FLASHDRIVE, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, @@ -523,6 +524,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_NO_GETMAXLUN] = "UQ_MSC_NO_GETMAXLUN", [UQ_MSC_NO_INQUIRY] = "UQ_MSC_NO_INQUIRY", [UQ_MSC_NO_INQUIRY_EVPD] = "UQ_MSC_NO_INQUIRY_EVPD", + [UQ_MSC_NO_PREVENT_ALLOW] = "UQ_MSC_NO_PREVENT_ALLOW", [UQ_MSC_NO_SYNC_CACHE] = "UQ_MSC_NO_SYNC_CACHE", [UQ_MSC_SHUTTLE_INIT] = "UQ_MSC_SHUTTLE_INIT", [UQ_MSC_ALT_IFACE_1] = "UQ_MSC_ALT_IFACE_1", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Mon Nov 5 20:55:17 2012 (r242627) +++ head/sys/dev/usb/quirk/usb_quirk.h Mon Nov 5 21:03:38 2012 (r242628) @@ -75,6 +75,7 @@ enum { UQ_MSC_NO_GETMAXLUN, /* does not support get max LUN */ UQ_MSC_NO_INQUIRY, /* fake generic inq response */ UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */ + UQ_MSC_NO_PREVENT_ALLOW, /* does not support medium removal */ UQ_MSC_NO_SYNC_CACHE, /* does not support sync cache */ UQ_MSC_SHUTTLE_INIT, /* requires Shuttle init sequence */ UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */ Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Mon Nov 5 20:55:17 2012 (r242627) +++ head/sys/dev/usb/storage/umass.c Mon Nov 5 21:03:38 2012 (r242628) @@ -361,6 +361,8 @@ typedef uint8_t (umass_transform_t)(stru * result. */ #define NO_SYNCHRONIZE_CACHE 0x4000 + /* Device does not support 'PREVENT/ALLOW MEDIUM REMOVAL'. */ +#define NO_PREVENT_ALLOW 0x8000 struct umass_softc { @@ -831,6 +833,8 @@ umass_probe_proto(device_t dev, struct u quirks |= NO_INQUIRY; if (usb_test_quirk(uaa, UQ_MSC_NO_INQUIRY_EVPD)) quirks |= NO_INQUIRY_EVPD; + if (usb_test_quirk(uaa, UQ_MSC_NO_PREVENT_ALLOW)) + quirks |= NO_PREVENT_ALLOW; if (usb_test_quirk(uaa, UQ_MSC_NO_SYNC_CACHE)) quirks |= NO_SYNCHRONIZE_CACHE; if (usb_test_quirk(uaa, UQ_MSC_SHUTTLE_INIT)) @@ -2245,6 +2249,13 @@ umass_cam_action(struct cam_sim *sim, un if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { ccb->csio.dxfer_len = SHORT_INQUIRY_LENGTH; } + } else if (sc->sc_transfer.cmd_data[0] == PREVENT_ALLOW) { + if (sc->sc_quirks & NO_PREVENT_ALLOW) { + ccb->csio.scsi_status = SCSI_STATUS_OK; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + goto done; + } } else if (sc->sc_transfer.cmd_data[0] == SYNCHRONIZE_CACHE) { if (sc->sc_quirks & NO_SYNCHRONIZE_CACHE) { ccb->csio.scsi_status = SCSI_STATUS_OK; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Nov 5 20:55:17 2012 (r242627) +++ head/sys/dev/usb/usbdevs Mon Nov 5 21:03:38 2012 (r242628) @@ -3949,6 +3949,7 @@ product STELERA E1012 0x1012 3G modem /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator +product STMICRO ST72682 0xfada USB 2.0 Flash drive controller /* STSN products */ product STSN STSN0001 0x0001 Internet Access Device From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:07:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25137C62; Mon, 5 Nov 2012 21:07:21 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id A705A8FC16; Mon, 5 Nov 2012 21:07:20 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so7858860oag.13 for ; Mon, 05 Nov 2012 13:07:19 -0800 (PST) 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=5EAlArqHAwJ5y5DwqS8BRy0lohyRIRATVx+cqLbyeh4=; b=bTess1YQYvlKqxYrrcRAM7fszmcs3P4ZNfyabzo+zoqF1Qb+u+UmxXwH6Oz6AO+o08 msFrgLsalmU5ojeFXhIJbdZ7P7DXTzcCvB96xtY4wRSCz5fpta0B/6Jy6Nuxvyk2PD/E OzsFDCnsURGEleKTF88gn9dji8mlEtagO6mX44p/QhE9rWjqf0ti0gRQBRZsbJE7tFQS fUdPWYNyRsZ4ujS05udZBcQWBkS1kjBxn0p8poeve+HHGFNt27vyJcDI//aUInaw3XIF 9OytbExO2ZXCNEuiINcJKWh3VSnZ1zTz6BwzI/WWyikAjz9aZh07bWDv7jsORG7YlF5n q27Q== MIME-Version: 1.0 Received: by 10.60.169.38 with SMTP id ab6mr9078093oec.139.1352149639853; Mon, 05 Nov 2012 13:07:19 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.76.151.39 with HTTP; Mon, 5 Nov 2012 13:07:19 -0800 (PST) In-Reply-To: <201211051908.qA5J8I72063064@svn.freebsd.org> References: <201211051908.qA5J8I72063064@svn.freebsd.org> Date: Mon, 5 Nov 2012 22:07:19 +0100 X-Google-Sender-Auth: nBMKe2RghaXwtdlXDIYOYFg-gKQ Message-ID: Subject: Re: svn commit: r242624 - in head: . share/mk sys/sys From: Ed Schouten To: Brooks Davis Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:07:21 -0000 2012/11/5 Brooks Davis : > After years of hard work by many FreeBSD and LLVM developers, make > clang the default compiler on i386 and amd64 systems. Woohoo! -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:17:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 294831B4 for ; Mon, 5 Nov 2012 21:17:41 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9698FC14 for ; Mon, 5 Nov 2012 21:17:40 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hq12so2981839wib.13 for ; Mon, 05 Nov 2012 13:17:39 -0800 (PST) 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 :cc:content-type; bh=7h3LEm56qT4fzF9g3L9uBQru+vI3579LqizxvJc7Xgo=; b=zgw17ajLXBbvPVOV3X8S0tjhuN+se05Lpk1nRb74WIRIb5BhSwQjSBYeMsAHIKzNxV 0FDTyZ9YcFdTZQlyWBB8uHt46tcsCZ1/aaPPMbVN/9R4grOcUjNunOl/TnWXswQlpRuV GSgthXzJdOqiTIWuEiX4B9pnStnLGG4NKme20= 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 :cc:content-type:x-gm-message-state; bh=7h3LEm56qT4fzF9g3L9uBQru+vI3579LqizxvJc7Xgo=; b=nCfBESsoC7xDhmJg8ClcBwc2upzV+7JxQ05ZMaBB1NixH1tWtkEexVqPe7wcRpoYU5 87OdbqIg6NrmoVfwEi/ATLc+J6wTO0c5960C3ihNLSZ79dVdpBP9x4h+SzZgdOQr5KXQ V7+1mlkUkttYYZbgDp1NKxeqYrXHBFBjoMVuV7zwwfD74UyLuabcKGFSq5gmnCSASxQL 6hX4Bl9xg9tLKNYtprkspIXINJYlCnFe6b/rZwh/g1zTdkxD8SuOCJ4/uLk6UaV+iOaL IeAMza2TtODM10MFFtf5VHKXbVEa06hgsYsQamGU51VW1eZYHIb6/rHrgfvtiDe1hApE q5vQ== MIME-Version: 1.0 Received: by 10.180.100.101 with SMTP id ex5mr15387693wib.16.1352150259795; Mon, 05 Nov 2012 13:17:39 -0800 (PST) Received: by 10.194.62.130 with HTTP; Mon, 5 Nov 2012 13:17:39 -0800 (PST) In-Reply-To: References: <201211051908.qA5J8I72063064@svn.freebsd.org> Date: Mon, 5 Nov 2012 13:17:39 -0800 Message-ID: Subject: Re: svn commit: r242624 - in head: . share/mk sys/sys From: Peter Wemm To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQk982Nt4kxNiciXvNQrBG3A6r+okL9kH221Y9drsdanZK+PdIIEPz59ijRxSDIOvD/4HofO Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:17:41 -0000 On Mon, Nov 5, 2012 at 1:07 PM, Ed Schouten wrote: > 2012/11/5 Brooks Davis : >> After years of hard work by many FreeBSD and LLVM developers, make >> clang the default compiler on i386 and amd64 systems. > > Woohoo! "When he reached the New World, Cortez burned his ships. As a result his men were well motivated." WITHOUT_GCC=yes :) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:33:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1F2F885; Mon, 5 Nov 2012 21:33:59 +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 6082E8FC12; Mon, 5 Nov 2012 21:33:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 680ADEC8; Mon, 5 Nov 2012 22:32:20 +0100 (CET) Date: Mon, 5 Nov 2012 22:34:48 +0100 From: Pawel Jakub Dawidek To: Jilles Tjoelker Subject: Re: svn commit: r242620 - head/bin/sh Message-ID: <20121105213448.GA1399@garage.freebsd.pl> References: <201211051752.qA5HqI6m050154@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <201211051752.qA5HqI6m050154@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:33:59 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 05, 2012 at 05:52:18PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Mon Nov 5 17:52:18 2012 > New Revision: 242620 > URL: http://svnweb.freebsd.org/changeset/base/242620 >=20 > Log: > sh: Change cmdtype in tblentry from short to signed char. > =20 > If this is a smaller type than int anyway, we can make it the smallest > possible. >=20 > Modified: > head/bin/sh/exec.c >=20 > Modified: head/bin/sh/exec.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/bin/sh/exec.c Mon Nov 5 17:50:40 2012 (r242619) > +++ head/bin/sh/exec.c Mon Nov 5 17:52:18 2012 (r242620) > @@ -85,7 +85,7 @@ struct tblentry { > struct tblentry *next; /* next entry in hash chain */ > union param param; /* definition of builtin function */ > int special; /* flag for special builtin commands */ > - short cmdtype; /* index identifying command */ > + signed char cmdtype; /* index identifying command */ Why not simply 'char'? > char rehash; /* if set, cd done since entry created */ > char cmdname[]; /* name of command */ > }; --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCYMPgACgkQForvXbEpPzRS6QCeLFh1UG0lcdWMSu9B2rRBWsi5 dCUAn0pUzpccJa/6YxHL7QU6MYXCj/bO =pIte -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:53:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61EACF16; Mon, 5 Nov 2012 21:53:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 466238FC08; Mon, 5 Nov 2012 21:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5LrNA6095526; Mon, 5 Nov 2012 21:53:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5LrN2K095525; Mon, 5 Nov 2012 21:53:23 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201211052153.qA5LrN2K095525@svn.freebsd.org> From: Brooks Davis Date: Mon, 5 Nov 2012 21:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242629 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:53:23 -0000 Author: brooks Date: Mon Nov 5 21:53:23 2012 New Revision: 242629 URL: http://svnweb.freebsd.org/changeset/base/242629 Log: Add a description of WITHOUT_CLANG_IS_CC. Added: head/tools/build/options/WITHOUT_CLANG_IS_CC (contents, props changed) Added: head/tools/build/options/WITHOUT_CLANG_IS_CC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_CLANG_IS_CC Mon Nov 5 21:53:23 2012 (r242629) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to install the GCC compiler as +.Pa /usr/bin/cc , +.Pa /usr/bin/c++ +and +.Pa /usr/bin/cpp . From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 21:55:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9425129; Mon, 5 Nov 2012 21:55:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A34998FC14; Mon, 5 Nov 2012 21:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5LtMPj095978; Mon, 5 Nov 2012 21:55:22 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5LtM6M095976; Mon, 5 Nov 2012 21:55:22 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201211052155.qA5LtM6M095976@svn.freebsd.org> From: Brooks Davis Date: Mon, 5 Nov 2012 21:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242630 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 21:55:23 -0000 Author: brooks Date: Mon Nov 5 21:55:22 2012 New Revision: 242630 URL: http://svnweb.freebsd.org/changeset/base/242630 Log: Now that WITH_CLANG_IS_CC is the default on x86 systems, document WITHOUT_CLANG_IS_CC. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Nov 5 21:53:23 2012 (r242629) +++ head/share/man/man5/src.conf.5 Mon Nov 5 21:55:22 2012 (r242630) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd October 21, 2012 +.Dd November 5, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -303,6 +303,16 @@ amd64/amd64, i386/i386, pc98/i386, power .It Va WITH_CLANG_EXTRAS .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITHOUT_CLANG_IS_CC +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks +Set to install the GCC compiler as +.Pa /usr/bin/cc , +.Pa /usr/bin/c++ +and +.Pa /usr/bin/cpp . +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as @@ -310,6 +320,9 @@ Set to install the Clang C/C++ compiler .Pa /usr/bin/c++ and .Pa /usr/bin/cpp . +.Pp +It is a default setting on +amd64/amd64, i386/i386 and pc98/i386. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:30:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B0C6C00; Mon, 5 Nov 2012 22:30:56 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FBD68FC08; Mon, 5 Nov 2012 22:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5MUuuw004142; Mon, 5 Nov 2012 22:30:56 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5MUuFF004140; Mon, 5 Nov 2012 22:30:56 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211052230.qA5MUuFF004140@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 5 Nov 2012 22:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242631 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:30:56 -0000 Author: melifaro Date: Mon Nov 5 22:30:56 2012 New Revision: 242631 URL: http://svnweb.freebsd.org/changeset/base/242631 Log: Use unified print_dyn_rule_flags() function for debugging messages instead of hand-made printfs in every place. MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Nov 5 21:55:22 2012 (r242630) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Nov 5 22:30:56 2012 (r242631) @@ -258,8 +258,12 @@ hash_packet(struct ipfw_flow_id *id) return i; } -static __inline void -unlink_dyn_rule_print(struct ipfw_flow_id *id) +/** + * Print customizable flow id description via log(9) facility. + */ +static void +print_dyn_rule_flags(struct ipfw_flow_id *id, int dyn_type, int log_flags, + char *prefix, char *postfix) { struct in_addr da; #ifdef INET6 @@ -280,10 +284,14 @@ unlink_dyn_rule_print(struct ipfw_flow_i da.s_addr = htonl(id->dst_ip); inet_ntop(AF_INET, &da, dst, sizeof(dst)); } - printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", - src, id->src_port, dst, id->dst_port, V_dyn_count - 1); + log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", + prefix, dyn_type, src, id->src_port, dst, + id->dst_port, V_dyn_count, postfix); } +#define print_dyn_rule(id, dtype, prefix, postfix) \ + print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) + /** * unlink a dynamic rule from a chain. prev is a pointer to * the previous one, q is a pointer to the rule to delete, @@ -296,12 +304,12 @@ unlink_dyn_rule_print(struct ipfw_flow_i /* remove a refcount to the parent */ \ if (q->dyn_type == O_LIMIT) \ q->parent->count--; \ - DEB(unlink_dyn_rule_print(&q->id);) \ + V_dyn_count--; \ + DEB(print_dyn_rule(&q->id, q->dyn_type, "unlink entry", "left");) \ if (prev != NULL) \ prev->next = q = q->next; \ else \ head = q = q->next; \ - V_dyn_count--; \ uma_zfree(ipfw_dyn_rule_zone, old_q); } #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) @@ -639,32 +647,7 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ r->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = r; V_dyn_count++; - DEB({ - struct in_addr da; -#ifdef INET6 - char src[INET6_ADDRSTRLEN]; - char dst[INET6_ADDRSTRLEN]; -#else - char src[INET_ADDRSTRLEN]; - char dst[INET_ADDRSTRLEN]; -#endif - -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(r->id))) { - ip6_sprintf(src, &r->id.src_ip6); - ip6_sprintf(dst, &r->id.dst_ip6); - } else -#endif - { - da.s_addr = htonl(r->id.src_ip); - inet_ntop(AF_INET, &da, src, sizeof(src)); - da.s_addr = htonl(r->id.dst_ip); - inet_ntop(AF_INET, &da, dst, sizeof(dst)); - } - printf("ipfw: add dyn entry ty %d %s %d -> %s %d, total %d\n", - dyn_type, src, r->id.src_port, dst, r->id.dst_port, - V_dyn_count); - }) + DEB(print_dyn_rule(id, dyn_type, "add dyn entry", "total");) return r; } @@ -701,7 +684,8 @@ lookup_dyn_parent(struct ipfw_flow_id *p ) ) { q->expire = time_uptime + V_dyn_short_lifetime; - DEB(printf("ipfw: lookup_dyn_parent found 0x%p\n",q);) + DEB(print_dyn_rule(pkt, q->dyn_type, + "lookup_dyn_parent found", "");) return q; } } @@ -720,38 +704,11 @@ ipfw_install_state(struct ip_fw *rule, i { static int last_log; ipfw_dyn_rule *q; - struct in_addr da; -#ifdef INET6 - char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; -#else - char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; -#endif - src[0] = '\0'; - dst[0] = '\0'; + DEB(print_dyn_rule(&args->f_id, cmd->o.opcode, "install_state", "");) IPFW_DYN_LOCK(); - DEB( -#ifdef INET6 - if (IS_IP6_FLOW_ID(&(args->f_id))) { - ip6_sprintf(src, &args->f_id.src_ip6); - ip6_sprintf(dst, &args->f_id.dst_ip6); - } else -#endif - { - da.s_addr = htonl(args->f_id.src_ip); - inet_ntop(AF_INET, &da, src, sizeof(src)); - da.s_addr = htonl(args->f_id.dst_ip); - inet_ntop(AF_INET, &da, dst, sizeof(dst)); - } - printf("ipfw: %s: type %d %s %u -> %s %u\n", - __func__, cmd->o.opcode, src, args->f_id.src_port, - dst, args->f_id.dst_port); - src[0] = '\0'; - dst[0] = '\0'; - ) - q = lookup_dyn_rule_locked(&args->f_id, NULL, NULL); if (q != NULL) { /* should never occur */ @@ -833,38 +790,15 @@ ipfw_install_state(struct ip_fw *rule, i if (parent->count >= conn_limit) { if (V_fw_verbose && last_log != time_uptime) { last_log = time_uptime; -#ifdef INET6 - /* - * XXX IPv6 flows are not - * supported yet. - */ - if (IS_IP6_FLOW_ID(&(args->f_id))) { - char ip6buf[INET6_ADDRSTRLEN]; - snprintf(src, sizeof(src), - "[%s]", ip6_sprintf(ip6buf, - &args->f_id.src_ip6)); - snprintf(dst, sizeof(dst), - "[%s]", ip6_sprintf(ip6buf, - &args->f_id.dst_ip6)); - } else -#endif - { - da.s_addr = - htonl(args->f_id.src_ip); - inet_ntop(AF_INET, &da, src, - sizeof(src)); - da.s_addr = - htonl(args->f_id.dst_ip); - inet_ntop(AF_INET, &da, dst, - sizeof(dst)); - } - log(LOG_SECURITY | LOG_DEBUG, - "ipfw: %d %s %s:%u -> %s:%u, %s\n", - parent->rule->rulenum, - "drop session", - src, (args->f_id.src_port), - dst, (args->f_id.dst_port), - "too many entries"); + char sbuf[24]; + last_log = time_uptime; + snprintf(sbuf, sizeof(sbuf), + "%d drop session", + parent->rule->rulenum); + print_dyn_rule_flags(&args->f_id, + cmd->o.opcode, + LOG_SECURITY | LOG_DEBUG, + sbuf, "too many entries"); } IPFW_DYN_UNLOCK(); return (1); From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:31:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43071D6E; Mon, 5 Nov 2012 22:31:26 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id CF8388FC14; Mon, 5 Nov 2012 22:31:24 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3C026358C61; Mon, 5 Nov 2012 23:31:23 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 27CE62848C; Mon, 5 Nov 2012 23:31:23 +0100 (CET) Date: Mon, 5 Nov 2012 23:31:23 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Subject: Re: svn commit: r242620 - head/bin/sh Message-ID: <20121105223122.GA67582@stack.nl> References: <201211051752.qA5HqI6m050154@svn.freebsd.org> <20121105213448.GA1399@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121105213448.GA1399@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:31:26 -0000 On Mon, Nov 05, 2012 at 10:34:48PM +0100, Pawel Jakub Dawidek wrote: > On Mon, Nov 05, 2012 at 05:52:18PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Mon Nov 5 17:52:18 2012 > > New Revision: 242620 > > URL: http://svnweb.freebsd.org/changeset/base/242620 > > Log: > > sh: Change cmdtype in tblentry from short to signed char. > > If this is a smaller type than int anyway, we can make it the smallest > > possible. > > Modified: > > head/bin/sh/exec.c > > Modified: head/bin/sh/exec.c > > ============================================================================== > > --- head/bin/sh/exec.c Mon Nov 5 17:50:40 2012 (r242619) > > +++ head/bin/sh/exec.c Mon Nov 5 17:52:18 2012 (r242620) > > @@ -85,7 +85,7 @@ struct tblentry { > > struct tblentry *next; /* next entry in hash chain */ > > union param param; /* definition of builtin function */ > > int special; /* flag for special builtin commands */ > > - short cmdtype; /* index identifying command */ > > + signed char cmdtype; /* index identifying command */ > Why not simply 'char'? Because 'char' may be signed or unsigned depending on architecture and we store the value -1 in it (CMDUNKNOWN). In particular, on ARM 'char' is unsigned. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:36:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8759F76; Mon, 5 Nov 2012 22:36:01 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF7A8FC08; Mon, 5 Nov 2012 22:36:00 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so3016612dad.13 for ; Mon, 05 Nov 2012 14:36:00 -0800 (PST) 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=xk7A86WgXSDE/Z8i6Swhu559ZYzqFAyFccVUQk4L+ak=; b=eFOY5agvzImrSzI521fBFAv2kPI0QTr5CZRhdbmDu6NWj8XAPWSDr1qbwlXrCd4aIR Sy+u+JBk/fapU6sKUb1VhInpH+DcJ9jaetiCxUTurj6jEgm5oxu08cqZxDYmZmjONfyq rz8XGjSGxzyQ/CUvsUsKrs/oT12Bw3fKch3ATZlY5y5va8qxhDe8wmjBcwkP1D6Xi7CG apsxbCfZCR0vwk8E+/lADvM2LLPh3tSDuq0kyQ51V0ddApz7VEb3NEcxZopDzSivcE7h laIE/KgWQyftbwaNQLUF5hvls970ufyhQuurnBJPwiZ4iC/0cCeeD7Y+Kb88AquexQLc +ByA== MIME-Version: 1.0 Received: by 10.68.193.228 with SMTP id hr4mr1660388pbc.95.1352154960749; Mon, 05 Nov 2012 14:36:00 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Mon, 5 Nov 2012 14:36:00 -0800 (PST) In-Reply-To: <201211051916.qA5JGRDr064585@svn.freebsd.org> References: <201211051916.qA5JGRDr064585@svn.freebsd.org> Date: Mon, 5 Nov 2012 14:36:00 -0800 X-Google-Sender-Auth: jWGNbsUK-B7H92uNOplA9UH7WaU Message-ID: Subject: Re: svn commit: r242625 - in head/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/ste de... From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:36:01 -0000 Hi, I'm fine with the change, but why didn't you run this by the various driver owners first before doing a drive-by commit? Adrian On 5 November 2012 11:16, Dimitry Andric wrote: > Author: dim > Date: Mon Nov 5 19:16:27 2012 > New Revision: 242625 > URL: http://svnweb.freebsd.org/changeset/base/242625 > > Log: > Remove duplicate const specifiers in many drivers (I hope I got all of > them, please let me know if not). Most of these are of the form: > > static const struct bzzt_type { > [...list of members...] > } const bzzt_devs[] = { > [...list of initializers...] > }; > > The second const is unnecessary, as arrays cannot be modified anyway, > and if the elements are const, the whole thing is const automatically > (e.g. it is placed in .rodata). > > I have verified this does not change the binary output of a full kernel > build (except for build timestamps embedded in the object files). > > Reviewed by: yongari, marius > MFC after: 1 week > > Modified: > head/sys/dev/ale/if_ale.c > head/sys/dev/ata/ata-card.c > head/sys/dev/ata/chipsets/ata-acard.c > head/sys/dev/ata/chipsets/ata-acerlabs.c > head/sys/dev/ata/chipsets/ata-adaptec.c > head/sys/dev/ata/chipsets/ata-amd.c > head/sys/dev/ata/chipsets/ata-ati.c > head/sys/dev/ata/chipsets/ata-highpoint.c > head/sys/dev/ata/chipsets/ata-intel.c > head/sys/dev/ata/chipsets/ata-ite.c > head/sys/dev/ata/chipsets/ata-jmicron.c > head/sys/dev/ata/chipsets/ata-marvell.c > head/sys/dev/ata/chipsets/ata-nvidia.c > head/sys/dev/ata/chipsets/ata-promise.c > head/sys/dev/ata/chipsets/ata-serverworks.c > head/sys/dev/ata/chipsets/ata-siliconimage.c > head/sys/dev/ata/chipsets/ata-sis.c > head/sys/dev/ata/chipsets/ata-via.c > head/sys/dev/ath/ath_hal/ar5212/ar5212.h > head/sys/dev/bge/if_bge.c > head/sys/dev/cas/if_cas.c > head/sys/dev/dc/if_dc.c > head/sys/dev/flash/at45d.c > head/sys/dev/fxp/if_fxp.c > head/sys/dev/gem/if_gem_pci.c > head/sys/dev/lge/if_lge.c > head/sys/dev/mii/mii.c > head/sys/dev/nge/if_nge.c > head/sys/dev/pci/pci.c > head/sys/dev/re/if_re.c > head/sys/dev/sis/if_sis.c > head/sys/dev/ste/if_ste.c > head/sys/dev/stge/if_stge.c > head/sys/dev/ti/if_ti.c > head/sys/dev/tl/if_tl.c > head/sys/dev/vr/if_vr.c > head/sys/dev/wb/if_wb.c > head/sys/dev/xl/if_xl.c > head/sys/pci/if_rl.c > head/sys/sparc64/pci/fire.c > head/sys/sparc64/pci/psycho.c > head/sys/sparc64/pci/schizo.c > > Modified: head/sys/dev/ale/if_ale.c > ============================================================================== > --- head/sys/dev/ale/if_ale.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ale/if_ale.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -95,7 +95,7 @@ static const struct ale_dev { > uint16_t ale_vendorid; > uint16_t ale_deviceid; > const char *ale_name; > -} const ale_devs[] = { > +} ale_devs[] = { > { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, > "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, > }; > > Modified: head/sys/dev/ata/ata-card.c > ============================================================================== > --- head/sys/dev/ata/ata-card.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/ata-card.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); > > #include "pccarddevs.h" > > -static const struct pccard_product const ata_pccard_products[] = { > +static const struct pccard_product ata_pccard_products[] = { > PCMCIA_CARD(FREECOM, PCCARDIDE), > PCMCIA_CARD(EXP, EXPMULTIMEDIA), > PCMCIA_CARD(IODATA3, CBIDE2), > > Modified: head/sys/dev/ata/chipsets/ata-acard.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-acard.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-acard.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -81,7 +81,7 @@ static int > ata_acard_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_ATP850R, 0, ATP_OLD, 0x00, ATA_UDMA2, "ATP850" }, > { ATA_ATP860A, 0, 0, 0x00, ATA_UDMA4, "ATP860A" }, > { ATA_ATP860R, 0, 0, 0x00, ATA_UDMA4, "ATP860R" }, > > Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -75,7 +75,7 @@ static int > ata_ali_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_ALI_5289, 0x00, 2, ALI_SATA, ATA_SA150, "M5289" }, > { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" }, > { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" }, > > Modified: head/sys/dev/ata/chipsets/ata-adaptec.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -62,7 +62,7 @@ static int > ata_adaptec_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" }, > { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" }, > { 0, 0, 0, 0, 0, 0}}; > > Modified: head/sys/dev/ata/chipsets/ata-amd.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-amd.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -67,7 +67,7 @@ static int > ata_amd_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_AMD756, 0x00, 0x00, 0, ATA_UDMA4, "756" }, > { ATA_AMD766, 0x00, AMD_CABLE|AMD_BUG, 0, ATA_UDMA5, "766" }, > { ATA_AMD768, 0x00, AMD_CABLE, 0, ATA_UDMA5, "768" }, > > Modified: head/sys/dev/ata/chipsets/ata-ati.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-ati.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-ati.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -75,7 +75,7 @@ static int > ata_ati_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_ATI_IXP200, 0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" }, > { ATA_ATI_IXP300, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" }, > { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" }, > > Modified: head/sys/dev/ata/chipsets/ata-highpoint.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -73,7 +73,7 @@ ata_highpoint_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > const struct ata_chip_id *idx; > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_HPT374, 0x07, HPT_374, 0, ATA_UDMA6, "HPT374" }, > { ATA_HPT372, 0x02, HPT_372, 0, ATA_UDMA6, "HPT372N" }, > { ATA_HPT372, 0x01, HPT_372, 0, ATA_UDMA6, "HPT372" }, > > Modified: head/sys/dev/ata/chipsets/ata-intel.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -105,7 +105,7 @@ static int > ata_intel_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_I82371FB, 0, 0, 2, ATA_WDMA2, "PIIX" }, > { ATA_I82371SB, 0, 0, 2, ATA_WDMA2, "PIIX3" }, > { ATA_I82371AB, 0, 0, 2, ATA_UDMA2, "PIIX4" }, > > Modified: head/sys/dev/ata/chipsets/ata-ite.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-ite.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-ite.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -64,7 +64,7 @@ static int > ata_ite_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_IT8213F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8213F" }, > { ATA_IT8212F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8212F" }, > { ATA_IT8211F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8211F" }, > > Modified: head/sys/dev/ata/chipsets/ata-jmicron.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -64,7 +64,7 @@ ata_jmicron_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > const struct ata_chip_id *idx; > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, > { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, > { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, > > Modified: head/sys/dev/ata/chipsets/ata-marvell.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -99,7 +99,7 @@ static int > ata_marvell_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, > { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, > { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, > > Modified: head/sys/dev/ata/chipsets/ata-nvidia.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -75,7 +75,7 @@ static int > ata_nvidia_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_NFORCE1, 0, 0, 0, ATA_UDMA5, "nForce" }, > { ATA_NFORCE2, 0, 0, 0, ATA_UDMA6, "nForce2" }, > { ATA_NFORCE2_PRO, 0, 0, 0, ATA_UDMA6, "nForce2 Pro" }, > > Modified: head/sys/dev/ata/chipsets/ata-promise.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-promise.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -130,7 +130,7 @@ ata_promise_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > const struct ata_chip_id *idx; > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_PDC20246, 0, PR_OLD, 0x00, ATA_UDMA2, "PDC20246" }, > { ATA_PDC20262, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20262" }, > { ATA_PDC20263, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20263" }, > > Modified: head/sys/dev/ata/chipsets/ata-serverworks.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -75,7 +75,7 @@ static int > ata_serverworks_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, > { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, > { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, > > Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -87,7 +87,7 @@ static int > ata_sii_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_SII3114, 0x00, SII_MEMIO, SII_4CH, ATA_SA150, "3114" }, > { ATA_SII3512, 0x02, SII_MEMIO, 0, ATA_SA150, "3512" }, > { ATA_SII3112, 0x02, SII_MEMIO, 0, ATA_SA150, "3112" }, > > Modified: head/sys/dev/ata/chipsets/ata-sis.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-sis.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-sis.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -74,7 +74,7 @@ ata_sis_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > const struct ata_chip_id *idx; > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_SIS182, 0x00, SIS_SATA, 0, ATA_SA150, "182" }, /* south */ > { ATA_SIS181, 0x00, SIS_SATA, 0, ATA_SA150, "181" }, /* south */ > { ATA_SIS180, 0x00, SIS_SATA, 0, ATA_SA150, "180" }, /* south */ > > Modified: head/sys/dev/ata/chipsets/ata-via.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-via.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ata/chipsets/ata-via.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -89,7 +89,7 @@ static int > ata_via_probe(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(dev); > - static const struct ata_chip_id const ids[] = > + static const struct ata_chip_id ids[] = > {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, > { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, > { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, > @@ -113,7 +113,7 @@ ata_via_probe(device_t dev) > { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, > { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, > { 0, 0, 0, 0, 0, 0 }}; > - static const struct ata_chip_id const new_ids[] = > + static const struct ata_chip_id new_ids[] = > {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, > { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, > { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, > > Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 5 19:16:27 2012 (r242625) > @@ -143,7 +143,7 @@ typedef struct RfHalFuncs { > int16_t *minPower, int16_t *maxPower, > const struct ieee80211_channel *, uint16_t *rfXpdGain); > HAL_BOOL (*getChannelMaxMinPower)(struct ath_hal *ah, > - const const struct ieee80211_channel *, > + const struct ieee80211_channel *, > int16_t *maxPow, int16_t *minPow); > int16_t (*getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL*); > } RF_HAL_FUNCS; > > Modified: head/sys/dev/bge/if_bge.c > ============================================================================== > --- head/sys/dev/bge/if_bge.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/bge/if_bge.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); > static const struct bge_type { > uint16_t bge_vid; > uint16_t bge_did; > -} const bge_devs[] = { > +} bge_devs[] = { > { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, > { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, > > @@ -239,7 +239,7 @@ static const struct bge_type { > static const struct bge_vendor { > uint16_t v_id; > const char *v_name; > -} const bge_vendors[] = { > +} bge_vendors[] = { > { ALTEON_VENDORID, "Alteon" }, > { ALTIMA_VENDORID, "Altima" }, > { APPLE_VENDORID, "Apple" }, > @@ -254,7 +254,7 @@ static const struct bge_vendor { > static const struct bge_revision { > uint32_t br_chipid; > const char *br_name; > -} const bge_revisions[] = { > +} bge_revisions[] = { > { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, > { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, > { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, > @@ -328,7 +328,7 @@ static const struct bge_revision { > * Some defaults for major revisions, so that newer steppings > * that we don't know about have a shot at working. > */ > -static const struct bge_revision const bge_majorrevs[] = { > +static const struct bge_revision bge_majorrevs[] = { > { BGE_ASICREV_BCM5700, "unknown BCM5700" }, > { BGE_ASICREV_BCM5701, "unknown BCM5701" }, > { BGE_ASICREV_BCM5703, "unknown BCM5703" }, > @@ -3122,7 +3122,7 @@ bge_mbox_reorder(struct bge_softc *sc) > const uint16_t vendor; > const uint16_t device; > const char *desc; > - } const mbox_reorder_lists[] = { > + } mbox_reorder_lists[] = { > { 0x1022, 0x7450, "AMD-8131 PCI-X Bridge" }, > }; > devclass_t pci, pcib; > > Modified: head/sys/dev/cas/if_cas.c > ============================================================================== > --- head/sys/dev/cas/if_cas.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/cas/if_cas.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -2623,7 +2623,7 @@ static const struct cas_pci_dev { > uint8_t cpd_revid; > int cpd_variant; > const char *cpd_desc; > -} const cas_pci_devlist[] = { > +} cas_pci_devlist[] = { > { 0x0035100b, 0x0, CAS_SATURN, "NS DP83065 Saturn Gigabit Ethernet" }, > { 0xabba108e, 0x10, CAS_CASPLUS, "Sun Cassini+ Gigabit Ethernet" }, > { 0xabba108e, 0x0, CAS_CAS, "Sun Cassini Gigabit Ethernet" }, > > Modified: head/sys/dev/dc/if_dc.c > ============================================================================== > --- head/sys/dev/dc/if_dc.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/dc/if_dc.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -150,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct dc_type const dc_devs[] = { > +static const struct dc_type dc_devs[] = { > { DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0, > "Intel 21143 10/100BaseTX" }, > { DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0, > > Modified: head/sys/dev/flash/at45d.c > ============================================================================== > --- head/sys/dev/flash/at45d.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/flash/at45d.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -106,7 +106,7 @@ static int at45d_wait_ready(device_t dev > * 2^N byte pages. If support for the latter is enabled, the sector offset > * has to be reduced by one. > */ > -static const struct at45d_flash_ident const at45d_flash_devices[] = { > +static const struct at45d_flash_ident at45d_flash_devices[] = { > { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, > { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, > { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, > > Modified: head/sys/dev/fxp/if_fxp.c > ============================================================================== > --- head/sys/dev/fxp/if_fxp.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/fxp/if_fxp.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -111,7 +111,7 @@ static int tx_threshold = 64; > * > * See struct fxp_cb_config for the bit definitions. > */ > -static const u_char const fxp_cb_config_template[] = { > +static const u_char fxp_cb_config_template[] = { > 0x0, 0x0, /* cb_status */ > 0x0, 0x0, /* cb_command */ > 0x0, 0x0, 0x0, 0x0, /* link_addr */ > @@ -155,7 +155,7 @@ static const u_char const fxp_cb_config_ > * particular variants, but we don't currently differentiate between > * them. > */ > -static const struct fxp_ident const fxp_ident_table[] = { > +static const struct fxp_ident fxp_ident_table[] = { > { 0x1029, -1, 0, "Intel 82559 PCI/CardBus Pro/100" }, > { 0x1030, -1, 0, "Intel 82559 Pro/100 Ethernet" }, > { 0x1031, -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" }, > @@ -3053,7 +3053,7 @@ static const struct ucode { > int length; > u_short int_delay_offset; > u_short bundle_max_offset; > -} const ucode_table[] = { > +} ucode_table[] = { > { FXP_REV_82558_A4, UCODE(fxp_ucode_d101a), D101_CPUSAVER_DWORD, 0 }, > { FXP_REV_82558_B0, UCODE(fxp_ucode_d101b0), D101_CPUSAVER_DWORD, 0 }, > { FXP_REV_82559_A0, UCODE(fxp_ucode_d101ma), > > Modified: head/sys/dev/gem/if_gem_pci.c > ============================================================================== > --- head/sys/dev/gem/if_gem_pci.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/gem/if_gem_pci.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -104,7 +104,7 @@ static const struct gem_pci_dev { > uint32_t gpd_devid; > int gpd_variant; > const char *gpd_desc; > -} const gem_pci_devlist[] = { > +} gem_pci_devlist[] = { > { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, > { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, > { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, > > Modified: head/sys/dev/lge/if_lge.c > ============================================================================== > --- head/sys/dev/lge/if_lge.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/lge/if_lge.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); > /* > * Various supported device vendors/types and their names. > */ > -static const struct lge_type const lge_devs[] = { > +static const struct lge_type lge_devs[] = { > { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, > { 0, 0, NULL } > }; > > Modified: head/sys/dev/mii/mii.c > ============================================================================== > --- head/sys/dev/mii/mii.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/mii/mii.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -626,7 +626,7 @@ mii_down(struct mii_data *mii) > static unsigned char > mii_bitreverse(unsigned char x) > { > - static unsigned const char const nibbletab[16] = { > + static unsigned const char nibbletab[16] = { > 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 > }; > > > Modified: head/sys/dev/nge/if_nge.c > ============================================================================== > --- head/sys/dev/nge/if_nge.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/nge/if_nge.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -139,7 +139,7 @@ MODULE_DEPEND(nge, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct nge_type const nge_devs[] = { > +static const struct nge_type nge_devs[] = { > { NGE_VENDORID, NGE_DEVICEID, > "National Semiconductor Gigabit Ethernet" }, > { 0, 0, NULL } > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/pci/pci.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -201,7 +201,7 @@ struct pci_quirk { > int arg2; > }; > > -static const struct pci_quirk const pci_quirks[] = { > +static const struct pci_quirk pci_quirks[] = { > /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ > { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, > { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, > > Modified: head/sys/dev/re/if_re.c > ============================================================================== > --- head/sys/dev/re/if_re.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/re/if_re.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe > /* > * Various supported device vendors/types and their names. > */ > -static const struct rl_type const re_devs[] = { > +static const struct rl_type re_devs[] = { > { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, > "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, > { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, > @@ -194,7 +194,7 @@ static const struct rl_type const re_dev > "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } > }; > > -static const struct rl_hwrev const re_hwrevs[] = { > +static const struct rl_hwrev re_hwrevs[] = { > { RL_HWREV_8139, RL_8139, "", RL_MTU }, > { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, > { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, > > Modified: head/sys/dev/sis/if_sis.c > ============================================================================== > --- head/sys/dev/sis/if_sis.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/sis/if_sis.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -126,7 +126,7 @@ MODULE_DEPEND(sis, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct sis_type const sis_devs[] = { > +static const struct sis_type sis_devs[] = { > { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" }, > { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" }, > { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP8381[56] 10/100BaseTX" }, > > Modified: head/sys/dev/ste/if_ste.c > ============================================================================== > --- head/sys/dev/ste/if_ste.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ste/if_ste.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -85,7 +85,7 @@ MODULE_DEPEND(ste, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct ste_type const ste_devs[] = { > +static const struct ste_type ste_devs[] = { > { ST_VENDORID, ST_DEVICEID_ST201_1, "Sundance ST201 10/100BaseTX" }, > { ST_VENDORID, ST_DEVICEID_ST201_2, "Sundance ST201 10/100BaseTX" }, > { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" }, > > Modified: head/sys/dev/stge/if_stge.c > ============================================================================== > --- head/sys/dev/stge/if_stge.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/stge/if_stge.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -91,7 +91,7 @@ static const struct stge_product { > uint16_t stge_vendorid; > uint16_t stge_deviceid; > const char *stge_name; > -} const stge_products[] = { > +} stge_products[] = { > { VENDOR_SUNDANCETI, DEVICEID_SUNDANCETI_ST1023, > "Sundance ST-1023 Gigabit Ethernet" }, > > > Modified: head/sys/dev/ti/if_ti.c > ============================================================================== > --- head/sys/dev/ti/if_ti.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/ti/if_ti.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -145,7 +145,7 @@ typedef enum { > * Various supported device vendors/types and their names. > */ > > -static const struct ti_type const ti_devs[] = { > +static const struct ti_type ti_devs[] = { > { ALT_VENDORID, ALT_DEVICEID_ACENIC, > "Alteon AceNIC 1000baseSX Gigabit Ethernet" }, > { ALT_VENDORID, ALT_DEVICEID_ACENIC_COPPER, > > Modified: head/sys/dev/tl/if_tl.c > ============================================================================== > --- head/sys/dev/tl/if_tl.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/tl/if_tl.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -229,7 +229,7 @@ MODULE_DEPEND(tl, miibus, 1, 1, 1); > * Various supported device vendors/types and their names. > */ > > -static const struct tl_type const tl_devs[] = { > +static const struct tl_type tl_devs[] = { > { TI_VENDORID, TI_DEVICEID_THUNDERLAN, > "Texas Instruments ThunderLAN" }, > { COMPAQ_VENDORID, COMPAQ_DEVICEID_NETEL_10, > > Modified: head/sys/dev/vr/if_vr.c > ============================================================================== > --- head/sys/dev/vr/if_vr.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/vr/if_vr.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -119,7 +119,7 @@ static const struct vr_type { > u_int16_t vr_did; > int vr_quirks; > const char *vr_name; > -} const vr_devs[] = { > +} vr_devs[] = { > { VIA_VENDORID, VIA_DEVICEID_RHINE, > VR_Q_NEEDALIGN, > "VIA VT3043 Rhine I 10/100BaseTX" }, > @@ -200,7 +200,7 @@ static const struct vr_tx_threshold_tabl > int tx_cfg; > int bcr_cfg; > int value; > -} const vr_tx_threshold_tables[] = { > +} vr_tx_threshold_tables[] = { > { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, > { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, > { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, > > Modified: head/sys/dev/wb/if_wb.c > ============================================================================== > --- head/sys/dev/wb/if_wb.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/wb/if_wb.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -130,7 +130,7 @@ MODULE_DEPEND(wb, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct wb_type const wb_devs[] = { > +static const struct wb_type wb_devs[] = { > { WB_VENDORID, WB_DEVICEID_840F, > "Winbond W89C840F 10/100BaseTX" }, > { CP_VENDORID, CP_DEVICEID_RL100, > > Modified: head/sys/dev/xl/if_xl.c > ============================================================================== > --- head/sys/dev/xl/if_xl.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/dev/xl/if_xl.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -161,7 +161,7 @@ MODULE_DEPEND(xl, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct xl_type const xl_devs[] = { > +static const struct xl_type xl_devs[] = { > { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, > "3Com 3c900-TPO Etherlink XL" }, > { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT_COMBO, > > Modified: head/sys/pci/if_rl.c > ============================================================================== > --- head/sys/pci/if_rl.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/pci/if_rl.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -131,7 +131,7 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); > /* > * Various supported device vendors/types and their names. > */ > -static const struct rl_type const rl_devs[] = { > +static const struct rl_type rl_devs[] = { > { RT_VENDORID, RT_DEVICEID_8129, RL_8129, > "RealTek 8129 10/100BaseTX" }, > { RT_VENDORID, RT_DEVICEID_8139, RL_8139, > > Modified: head/sys/sparc64/pci/fire.c > ============================================================================== > --- head/sys/sparc64/pci/fire.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/sparc64/pci/fire.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -249,7 +249,7 @@ struct fire_desc { > const char *fd_name; > }; > > -static const struct fire_desc const fire_compats[] = { > +static const struct fire_desc fire_compats[] = { > { "pciex108e,80f0", FIRE_MODE_FIRE, "Fire" }, > #if 0 > { "pciex108e,80f8", FIRE_MODE_OBERON, "Oberon" }, > > Modified: head/sys/sparc64/pci/psycho.c > ============================================================================== > --- head/sys/sparc64/pci/psycho.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/sparc64/pci/psycho.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -222,14 +222,14 @@ struct psycho_desc { > const char *pd_name; > }; > > -static const struct psycho_desc const psycho_compats[] = { > +static const struct psycho_desc psycho_compats[] = { > { "pci108e,8000", PSYCHO_MODE_PSYCHO, "Psycho compatible" }, > { "pci108e,a000", PSYCHO_MODE_SABRE, "Sabre compatible" }, > { "pci108e,a001", PSYCHO_MODE_SABRE, "Hummingbird compatible" }, > { NULL, 0, NULL } > }; > > -static const struct psycho_desc const psycho_models[] = { > +static const struct psycho_desc psycho_models[] = { > { "SUNW,psycho", PSYCHO_MODE_PSYCHO, "Psycho" }, > { "SUNW,sabre", PSYCHO_MODE_SABRE, "Sabre" }, > { NULL, 0, NULL } > > Modified: head/sys/sparc64/pci/schizo.c > ============================================================================== > --- head/sys/sparc64/pci/schizo.c Mon Nov 5 19:08:18 2012 (r242624) > +++ head/sys/sparc64/pci/schizo.c Mon Nov 5 19:16:27 2012 (r242625) > @@ -229,7 +229,7 @@ struct schizo_desc { > const char *sd_name; > }; > > -static const struct schizo_desc const schizo_compats[] = { > +static const struct schizo_desc schizo_compats[] = { > { "pci108e,8001", SCHIZO_MODE_SCZ, "Schizo" }, > #if 0 > { "pci108e,8002", SCHIZO_MODE_XMS, "XMITS" }, From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:45:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 563322CF; Mon, 5 Nov 2012 22:45:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8BC8FC08; Mon, 5 Nov 2012 22:45:06 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 71AF65C59; Mon, 5 Nov 2012 23:45:04 +0100 (CET) Message-ID: <5098416C.3040802@FreeBSD.org> Date: Mon, 05 Nov 2012 23:45:00 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r242625 - in head/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/ste de... References: <201211051916.qA5JGRDr064585@svn.freebsd.org> In-Reply-To: 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:45:06 -0000 On 2012-11-05 23:36, Adrian Chadd wrote: > I'm fine with the change, but why didn't you run this by the various > driver owners first before doing a drive-by commit? The change was trivial, and did not cause any binary difference. I see no reason to bother 20 different maintainers with something like this, except bureaucratic ones... :) From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:54:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91EDE632; Mon, 5 Nov 2012 22:54:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7562E8FC12; Mon, 5 Nov 2012 22:54:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5Ms0h1009066; Mon, 5 Nov 2012 22:54:00 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5Ms0kf009063; Mon, 5 Nov 2012 22:54:00 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211052254.qA5Ms0kf009063@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 5 Nov 2012 22:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242632 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:54:00 -0000 Author: melifaro Date: Mon Nov 5 22:54:00 2012 New Revision: 242632 URL: http://svnweb.freebsd.org/changeset/base/242632 Log: Add assertion to enforce 'nat global' locking requierements changed by r241908. Suggested by: adrian, glebius MFC after: 3 days Modified: head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Mon Nov 5 22:30:56 2012 (r242631) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Mon Nov 5 22:54:00 2012 (r242632) @@ -276,6 +276,7 @@ ipfw_nat(struct ip_fw_args *args, struct found = 0; chain = &V_layer3_chain; + IPFW_RLOCK_ASSERT(chain); /* Check every nat entry... */ LIST_FOREACH(t, &chain->nat, _next) { if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0) Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Mon Nov 5 22:30:56 2012 (r242631) +++ head/sys/netpfil/ipfw/ip_fw_private.h Mon Nov 5 22:54:00 2012 (r242632) @@ -251,6 +251,7 @@ struct sockopt; /* used by tcp_var.h */ rw_destroy(&(_chain)->uh_lock); \ } while (0) +#define IPFW_RLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_RLOCKED) #define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED) #define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx) From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:56:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B2247DE; Mon, 5 Nov 2012 22:56:24 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id DA6F58FC12; Mon, 5 Nov 2012 22:56:23 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id qA5MuGNT061233; Mon, 5 Nov 2012 23:56:16 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id qA5MuGqO061232; Mon, 5 Nov 2012 23:56:16 +0100 (CET) (envelope-from marius) Date: Mon, 5 Nov 2012 23:56:16 +0100 From: Marius Strobl To: Dimitry Andric Subject: Re: svn commit: r242625 - in head/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/ste de... Message-ID: <20121105225616.GC93413@alchemy.franken.de> References: <201211051916.qA5JGRDr064585@svn.freebsd.org> <5098416C.3040802@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5098416C.3040802@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:56:24 -0000 On Mon, Nov 05, 2012 at 11:45:00PM +0100, Dimitry Andric wrote: > On 2012-11-05 23:36, Adrian Chadd wrote: > >I'm fine with the change, but why didn't you run this by the various > >driver owners first before doing a drive-by commit? > > The change was trivial, and did not cause any binary difference. I see > no reason to bother 20 different maintainers with something like this, > except bureaucratic ones... :) Except for ath(4), you caught all maintainers anyway (as far as there is one) :) Marius From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 23:05:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89450A59; Mon, 5 Nov 2012 23:05:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9208FC12; Mon, 5 Nov 2012 23:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5N5E98011472; Mon, 5 Nov 2012 23:05:14 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5N5Ene011470; Mon, 5 Nov 2012 23:05:14 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201211052305.qA5N5Ene011470@svn.freebsd.org> From: Brooks Davis Date: Mon, 5 Nov 2012 23:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242633 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 23:05:14 -0000 Author: brooks Date: Mon Nov 5 23:05:14 2012 New Revision: 242633 URL: http://svnweb.freebsd.org/changeset/base/242633 Log: Allow CC to be gcc46 or similar by matching gcc*. Don't test the value of the :M matches, either the string matches or does not. Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Mon Nov 5 22:54:00 2012 (r242632) +++ head/share/mk/bsd.compiler.mk Mon Nov 5 23:05:14 2012 (r242633) @@ -1,17 +1,17 @@ # $FreeBSD$ .if !defined(COMPILER_TYPE) -. if ${CC:T:Mgcc} == "gcc" +. if ${CC:T:Mgcc*} COMPILER_TYPE:= gcc -. elif ${CC:T:Mclang} == "clang" +. elif ${CC:T:Mclang} COMPILER_TYPE:= clang . else _COMPILER_VERSION!= ${CC} --version -. if ${_COMPILER_VERSION:Mgcc} == "gcc" +. if ${_COMPILER_VERSION:Mgcc} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:M\(GCC\)} == "(GCC)" +. elif ${_COMPILER_VERSION:M\(GCC\)} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:Mclang} == "clang" +. elif ${_COMPILER_VERSION:Mclang} COMPILER_TYPE:= clang . else .error Unable to determing compiler type for ${CC} From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 23:20:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDB7CD1A; Mon, 5 Nov 2012 23:20:48 +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 D39A58FC14; Mon, 5 Nov 2012 23:20:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA5NKm1w014747; Mon, 5 Nov 2012 23:20:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA5NKmN6014745; Mon, 5 Nov 2012 23:20:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211052320.qA5NKmN6014745@svn.freebsd.org> From: Alexander Motin Date: Mon, 5 Nov 2012 23:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242634 - head/share/examples/ses/srcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 23:20:49 -0000 Author: mav Date: Mon Nov 5 23:20:48 2012 New Revision: 242634 URL: http://svnweb.freebsd.org/changeset/base/242634 Log: Rise priority of the informational messages from LOG_INFO to LOG_NOTICE, same as used for OK status. Otherwise it looks strange when OK status is reported, while informational is not. Modified: head/share/examples/ses/srcs/sesd.c Modified: head/share/examples/ses/srcs/sesd.c ============================================================================== --- head/share/examples/ses/srcs/sesd.c Mon Nov 5 23:05:14 2012 (r242633) +++ head/share/examples/ses/srcs/sesd.c Mon Nov 5 23:20:48 2012 (r242634) @@ -142,9 +142,8 @@ main(int a, char **v) "%s: Enclosure Status OK", v[dev]); } if (stat & SES_ENCSTAT_INFO) { - syslog(LOG_INFO, - "%s: Enclosure Status Has Information", - v[dev]); + syslog(LOG_NOTICE, + "%s: Enclosure Has Information", v[dev]); } if (stat & SES_ENCSTAT_NONCRITICAL) { syslog(LOG_WARNING, From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:22:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3195EC2E; Tue, 6 Nov 2012 00:22:34 +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 166EA8FC12; Tue, 6 Nov 2012 00:22:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60MXRX028011; Tue, 6 Nov 2012 00:22:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60MXWI028008; Tue, 6 Nov 2012 00:22:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211060022.qA60MXWI028008@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Nov 2012 00:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242638 - in head/share/examples/ses: sesd srcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:22:34 -0000 Author: mav Date: Tue Nov 6 00:22:33 2012 New Revision: 242638 URL: http://svnweb.freebsd.org/changeset/base/242638 Log: Add -c option to sesd to make it clear enclosure status after reading it in case if it is not permanent and was fixed. Modified: head/share/examples/ses/sesd/sesd.0 head/share/examples/ses/srcs/sesd.c Modified: head/share/examples/ses/sesd/sesd.0 ============================================================================== --- head/share/examples/ses/sesd/sesd.0 Tue Nov 6 00:08:09 2012 (r242637) +++ head/share/examples/ses/sesd/sesd.0 Tue Nov 6 00:22:33 2012 (r242638) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2000 +.Dd November 5, 2012 .Dt SESD 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd monitor SCSI Environmental Services Devices .Sh SYNOPSIS .Nm +.Op Fl c .Op Fl d .Op Fl t Ar poll-interval .Ar device @@ -57,7 +58,9 @@ poll each device for a change in state. .Pp The following options may be used: .Bl -tag -width Ds -.It Fl p Ar poll-interval +.It Fl c +Try to clear enclosure status after read. +.It Fl t Ar poll-interval Change the interval of polling from the default 30 seconds to the number of seconds specified. .It Fl d Modified: head/share/examples/ses/srcs/sesd.c ============================================================================== --- head/share/examples/ses/srcs/sesd.c Tue Nov 6 00:08:09 2012 (r242637) +++ head/share/examples/ses/srcs/sesd.c Tue Nov 6 00:22:33 2012 (r242638) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -55,29 +56,33 @@ int main(int a, char **v) { static const char *usage = - "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; - int fd, polltime, dev, devbase, nodaemon; - encioc_enc_status_t stat, *carray; + "usage: %s [ -c ] [ -d ] [ -t pollinterval ] device [ device ]\n"; + int fd, polltime, dev, nodaemon, clear, c; + encioc_enc_status_t stat, nstat, *carray; if (a < 2) { fprintf(stderr, usage, *v); return (1); } - devbase = 1; - - if (strcmp(v[1], "-d") == 0) { - nodaemon = 1; - devbase++; - } else { - nodaemon = 0; - } - - if (a > 2 && strcmp(v[2], "-t") == 0) { - devbase += 2; - polltime = atoi(v[3]); - } else { - polltime = 30; + nodaemon = 0; + polltime = 30; + clear = 0; + while ((c = getopt(a, v, "cdt:")) != -1) { + switch (c) { + case 'c': + clear = 1; + break; + case 'd': + nodaemon = 1; + break; + case 't': + polltime = atoi(optarg); + break; + default: + fprintf(stderr, usage, *v); + return (1); + } } carray = malloc(a); @@ -85,13 +90,13 @@ main(int a, char **v) perror("malloc"); return (1); } - for (dev = devbase; dev < a; dev++) + for (dev = optind; dev < a; dev++) carray[dev] = (encioc_enc_status_t) -1; /* * Check to make sure we can open all devices */ - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { perror(v[dev]); @@ -115,7 +120,7 @@ main(int a, char **v) } for (;;) { - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { syslog(LOG_ERR, "%s: %m", v[dev]); @@ -131,6 +136,14 @@ main(int a, char **v) (void) close(fd); continue; } + if (stat != 0 && clear) { + nstat = 0; + if (ioctl(fd, ENCIOC_SETENCSTAT, + (caddr_t) &nstat) < 0) { + syslog(LOG_ERR, + "%s: ENCIOC_SETENCSTAT- %m", v[dev]); + } + } (void) close(fd); if (stat == carray[dev]) From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3345EEDE; Tue, 6 Nov 2012 00:26:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id DFCB28FC0A; Tue, 6 Nov 2012 00:26:17 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so4547977pad.13 for ; Mon, 05 Nov 2012 16:26:17 -0800 (PST) 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=wf3TfonCA7+pi9LtiLRGnvnf0ggSPz6rRshLrMCWYU0=; b=NWHcuz1D3GN96N1srKmjnodKrhzVyXEEkfSUQNS2Z9Dm2KR6HSD9C63ucFbx6dWR0H tdk+gsMoje/hPnlgw9W7nhgA60ao1hf++r9v2vx/OgRCX3AxXVefhBgB3ZayMvkyR+4m o0Hhd3ASYu2qiyW7tyIZWcBYvwIN6+G1u3/3QGJ60O/Kofr2K7QgBuonnPKA0daTbjYX N8krEBHbt4utmBywS94ITxyUWA5JvFHqzngV8FJkiEGySBxrouexKQh2iP8MY+JYDPI1 zT8JYv4bNcb9YmkLyxn3Q8uiypdPhOPf8b9dkgfWSeXZvKX7/z3KFZp9LLtWBtHP+csa V5hQ== MIME-Version: 1.0 Received: by 10.66.87.105 with SMTP id w9mr33260077paz.5.1352161577089; Mon, 05 Nov 2012 16:26:17 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Mon, 5 Nov 2012 16:26:17 -0800 (PST) In-Reply-To: <5098416C.3040802@FreeBSD.org> References: <201211051916.qA5JGRDr064585@svn.freebsd.org> <5098416C.3040802@FreeBSD.org> Date: Mon, 5 Nov 2012 16:26:17 -0800 X-Google-Sender-Auth: A2ok5heVkG7OL-Tb2KyhVN6BWgk Message-ID: Subject: Re: svn commit: r242625 - in head/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/mii dev/nge dev/pci dev/re dev/sis dev/ste de... From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:26:18 -0000 On 5 November 2012 14:45, Dimitry Andric wrote: > On 2012-11-05 23:36, Adrian Chadd wrote: >> >> I'm fine with the change, but why didn't you run this by the various >> driver owners first before doing a drive-by commit? > The change was trivial, and did not cause any binary difference. I see > no reason to bother 20 different maintainers with something like this, > except bureaucratic ones... :) It's less bureaucracy and more "common courtesy." I mean, _I_ think this change was fine as it didn't change things, but it could have easily been something bigger. We're playing in the same sand-pit, please don't just magically assume that stomping on my area without asking first is appropriate - especially if you think it's "a trivial problem, why would they mind?" That's exactly the reason you should ask. :-) Adrian From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:41:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68E981EE; Tue, 6 Nov 2012 00:41:59 +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 4D5AA8FC0A; Tue, 6 Nov 2012 00:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60fxis032054; Tue, 6 Nov 2012 00:41:59 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60fx0x032052; Tue, 6 Nov 2012 00:41:59 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201211060041.qA60fx0x032052@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 6 Nov 2012 00:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242639 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:41:59 -0000 Author: bryanv Date: Tue Nov 6 00:41:59 2012 New Revision: 242639 URL: http://svnweb.freebsd.org/changeset/base/242639 Log: Add myself as a new src committer Approved by: grehan (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Nov 6 00:22:33 2012 (r242638) +++ head/share/misc/committers-src.dot Tue Nov 6 00:41:59 2012 (r242639) @@ -114,6 +114,7 @@ brooks [label="Brooks Davis\nbrooks@Free brucec [label="Bruce Cran\nbrucec@FreeBSD.org\n2010/01/29"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2006/02/28"] bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] +bryanv [label="Bryan Venteicher\nbryanv@FreeBSD.org\n2012/11/03"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] @@ -396,6 +397,8 @@ gnn -> lstewart gnn -> np gnn -> davide +grehan -> bryanv + grog -> edwin grog -> le grog -> peterj From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:49:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E45173E1; Tue, 6 Nov 2012 00:49:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C85628FC0A; Tue, 6 Nov 2012 00:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60nqxU033699; Tue, 6 Nov 2012 00:49:52 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60nqfv033694; Tue, 6 Nov 2012 00:49:52 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211060049.qA60nqfv033694@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 6 Nov 2012 00:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242640 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:49:53 -0000 Author: melifaro Date: Tue Nov 6 00:49:52 2012 New Revision: 242640 URL: http://svnweb.freebsd.org/changeset/base/242640 Log: MFC r241406. Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is enabled. This eliminates one mtx_lock() per each routing lookup thus improving performance in several cases (routing to directly connected interface or routing to default gateway). Icmp redirects should not be used to provide routing direction nowadays, even for end hosts. Routers should not use them too (and this is explicitly restricted in IPv6, see RFC 4861, clause 8.2). Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every AF_INET routing table in given VNET instance on drop_redirect sysctl change. This change is part of bigger patch eliminating rte locking. Sponsored by: Yandex LLC Modified: stable/9/sys/netinet/in_rmx.c stable/9/sys/netinet/in_var.h stable/9/sys/netinet/ip_icmp.c stable/9/sys/netinet/ip_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_rmx.c ============================================================================== --- stable/9/sys/netinet/in_rmx.c Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/in_rmx.c Tue Nov 6 00:49:52 2012 (r242640) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include extern int in_inithead(void **head, int off); @@ -340,6 +342,13 @@ in_rtqdrain(void) VNET_LIST_RUNLOCK_NOSLEEP(); } +void +in_setmatchfunc(struct radix_node_head *rnh, int val) +{ + + rnh->rnh_matchaddr = (val != 0) ? rn_match : in_matroute; +} + static int _in_rt_was_here; /* * Initialize our routing tree. @@ -365,7 +374,7 @@ in_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in_addroute; - rnh->rnh_matchaddr = in_matroute; + in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; if (_in_rt_was_here == 0 ) { callout_init(&V_rtq_timer, CALLOUT_MPSAFE); Modified: stable/9/sys/netinet/in_var.h ============================================================================== --- stable/9/sys/netinet/in_var.h Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/in_var.h Tue Nov 6 00:49:52 2012 (r242640) @@ -422,6 +422,7 @@ inm_acquire_locked(struct in_multi *inm) struct rtentry; struct route; struct ip_moptions; +struct radix_node_head; int imo_multi_filter(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *, const struct sockaddr *); @@ -460,6 +461,7 @@ void in_rtredirect(struct sockaddr *, s struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); +void in_setmatchfunc(struct radix_node_head *, int); #if 0 int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); Modified: stable/9/sys/netinet/ip_icmp.c ============================================================================== --- stable/9/sys/netinet/ip_icmp.c Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/ip_icmp.c Tue Nov 6 00:49:52 2012 (r242640) @@ -108,11 +108,7 @@ SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUT &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); -static VNET_DEFINE(int, drop_redirect) = 0; -#define V_drop_redirect VNET(drop_redirect) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, - &VNET_NAME(drop_redirect), 0, - "Ignore ICMP redirects"); +VNET_DEFINE(int, drop_redirect) = 0; static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) @@ -157,6 +153,39 @@ static void icmp_send(struct mbuf *, str extern struct protosw inetsw[]; +static int +sysctl_net_icmp_drop_redir(SYSCTL_HANDLER_ARGS) +{ + int error, new; + int i; + struct radix_node_head *rnh; + + new = V_drop_redirect; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + new = (new != 0) ? 1 : 0; + + if (new == V_drop_redirect) + return (0); + + for (i = 0; i < rt_numfibs; i++) { + if ((rnh = rt_tables_get_rnh(i, AF_INET)) == NULL) + continue; + RADIX_NODE_HEAD_LOCK(rnh); + in_setmatchfunc(rnh, new); + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + V_drop_redirect = new; + } + + return (error); +} + +SYSCTL_VNET_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, + sysctl_net_icmp_drop_redir, "I", "Ignore ICMP redirects"); + /* * Kernel module interface for updating icmpstat. The argument is an index * into icmpstat treated as an array of u_long. While this encodes the Modified: stable/9/sys/netinet/ip_var.h ============================================================================== --- stable/9/sys/netinet/ip_var.h Tue Nov 6 00:41:59 2012 (r242639) +++ stable/9/sys/netinet/ip_var.h Tue Nov 6 00:49:52 2012 (r242640) @@ -187,6 +187,7 @@ VNET_DECLARE(struct socket *, ip_mrouter extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); VNET_DECLARE(int, rsvp_on); +VNET_DECLARE(int, drop_redirect); extern struct pr_usrreqs rip_usrreqs; #define V_ipstat VNET(ipstat) @@ -199,6 +200,7 @@ extern struct pr_usrreqs rip_usrreqs; #define V_ip_rsvpd VNET(ip_rsvpd) #define V_ip_mrouter VNET(ip_mrouter) #define V_rsvp_on VNET(rsvp_on) +#define V_drop_redirect VNET(drop_redirect) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:54:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FA2858B; Tue, 6 Nov 2012 00:54:25 +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 539B78FC08; Tue, 6 Nov 2012 00:54:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60sPuU034707; Tue, 6 Nov 2012 00:54:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60sPZl034705; Tue, 6 Nov 2012 00:54:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060054.qA60sPZl034705@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 00:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242641 - stable/9/sys/dev/age X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:54:25 -0000 Author: yongari Date: Tue Nov 6 00:54:25 2012 New Revision: 242641 URL: http://svnweb.freebsd.org/changeset/base/242641 Log: MFC r242348: TSO engine of L1 requires a separate DMA descriptor for TCP payload. This means driver has to split a TX buffer into two pieces of TX buffers when the TX buffer contains both ethernet/IP/TCP header and partial TCP payload. The controller does not require all header should be in a TX buffer but driver forced it to compute IP/TCP header size/offset which is required parameter to configure DMA descriptor for TSO. While here, slightly reorder DMA descriptor setup to enhance readability and remove unnecessary code for TSO(upper stack never requests TSO when the frame length is less than or equal to MTU). Reported by: Yamagi Burmeister yamagi dot org> Tested by: Yamagi Burmeister yamagi dot org> Modified: stable/9/sys/dev/age/if_age.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/age/if_age.c ============================================================================== --- stable/9/sys/dev/age/if_age.c Tue Nov 6 00:49:52 2012 (r242640) +++ stable/9/sys/dev/age/if_age.c Tue Nov 6 00:54:25 2012 (r242641) @@ -1495,7 +1495,7 @@ age_encap(struct age_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[AGE_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, ip_off, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, i, nsegs, prod, si; AGE_LOCK_ASSERT(sc); @@ -1562,8 +1562,12 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } /* * L1 requires IP/TCP header size and offset as * well as TCP pseudo checksum which complicates @@ -1578,14 +1582,11 @@ age_encap(struct age_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons((tcp->th_off << 2) + IPPROTO_TCP)); - else - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } *m_head = m; } @@ -1627,23 +1628,48 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; + /* Configure VLAN hardware tag insertion. */ + if ((m->m_flags & M_VLANTAG) != 0) { + vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); + vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); + cflags |= AGE_TD_INSERT_VLAN_TAG; + } + + desc = NULL; + i = 0; if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Configure TSO. */ - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { - /* Not TSO but IP/TCP checksum offload. */ - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - /* Clear TSO in order not to set AGE_TD_TSO_HDR. */ - m->m_pkthdr.csum_flags &= ~CSUM_TSO; - } else { - /* Request TSO and set MSS. */ - cflags |= AGE_TD_TSO_IPV4; - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << - AGE_TD_TSO_MSS_SHIFT); - } + /* Request TSO and set MSS. */ + cflags |= AGE_TD_TSO_IPV4; + cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << + AGE_TD_TSO_MSS_SHIFT); /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + /* + * L1 requires the first buffer should only hold IP/TCP + * header data. TCP payload should be handled in other + * descriptors. + */ + hdrlen = poff + (tcp->th_off << 2); + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr); + desc->len = htole32(AGE_TX_BYTES(hdrlen) | vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + if (m->m_len - hdrlen > 0) { + /* Handle remaining payload of the 1st fragment. */ + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr + hdrlen); + desc->len = htole32(AGE_TX_BYTES(m->m_len - hdrlen) | + vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + } + /* Handle remaining fragments. */ + i = 1; } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { /* Configure Tx IP/TCP/UDP checksum offload. */ cflags |= AGE_TD_CSUM; @@ -1657,16 +1683,7 @@ age_encap(struct age_softc *sc, struct m cflags |= ((poff + m->m_pkthdr.csum_data) << AGE_TD_CSUM_XSUMOFFSET_SHIFT); } - - /* Configure VLAN hardware tag insertion. */ - if ((m->m_flags & M_VLANTAG) != 0) { - vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); - vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); - cflags |= AGE_TD_INSERT_VLAN_TAG; - } - - desc = NULL; - for (i = 0; i < nsegs; i++) { + for (; i < nsegs; i++) { desc = &sc->age_rdata.age_tx_ring[prod]; desc->addr = htole64(txsegs[i].ds_addr); desc->len = htole32(AGE_TX_BYTES(txsegs[i].ds_len) | vtag); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:55:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51F1F792; Tue, 6 Nov 2012 00:55:44 +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 1D2328FC12; Tue, 6 Nov 2012 00:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60thLg035070; Tue, 6 Nov 2012 00:55:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60thwE035055; Tue, 6 Nov 2012 00:55:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211060055.qA60thwE035055@svn.freebsd.org> From: Eitan Adler Date: Tue, 6 Nov 2012 00:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242642 - in stable/8: etc/root share/skel X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:55:44 -0000 Author: eadler Date: Tue Nov 6 00:55:43 2012 New Revision: 242642 URL: http://svnweb.freebsd.org/changeset/base/242642 Log: MFC r242514,r242541: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core ==== Change default prompt to show ~ again for the home directory Approved by: cperciva (implicit) Modified: stable/8/etc/root/dot.cshrc stable/8/share/skel/dot.cshrc Directory Properties: stable/8/etc/ (props changed) stable/8/share/skel/ (props changed) Modified: stable/8/etc/root/dot.cshrc ============================================================================== --- stable/8/etc/root/dot.cshrc Tue Nov 6 00:54:25 2012 (r242641) +++ stable/8/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: stable/8/share/skel/dot.cshrc ============================================================================== --- stable/8/share/skel/dot.cshrc Tue Nov 6 00:54:25 2012 (r242641) +++ stable/8/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:55:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 736E5793; Tue, 6 Nov 2012 00:55:44 +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 3DA758FC15; Tue, 6 Nov 2012 00:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60tijY035086; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60tian035082; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211060055.qA60tian035082@svn.freebsd.org> From: Eitan Adler Date: Tue, 6 Nov 2012 00:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242644 - in stable/7: etc/root share/skel X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:55:44 -0000 Author: eadler Date: Tue Nov 6 00:55:43 2012 New Revision: 242644 URL: http://svnweb.freebsd.org/changeset/base/242644 Log: MFC r242514,r242541: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core ==== Change default prompt to show ~ again for the home directory Approved by: cperciva (implicit) Modified: stable/7/etc/root/dot.cshrc stable/7/share/skel/dot.cshrc Directory Properties: stable/7/etc/ (props changed) stable/7/share/skel/ (props changed) Modified: stable/7/etc/root/dot.cshrc ============================================================================== --- stable/7/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) +++ stable/7/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242644) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: stable/7/share/skel/dot.cshrc ============================================================================== --- stable/7/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) +++ stable/7/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242644) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 00:55:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73CF9794; Tue, 6 Nov 2012 00:55:44 +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 3A06C8FC14; Tue, 6 Nov 2012 00:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA60tir5035085; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA60ti7W035079; Tue, 6 Nov 2012 00:55:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211060055.qA60ti7W035079@svn.freebsd.org> From: Eitan Adler Date: Tue, 6 Nov 2012 00:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242643 - in stable/9: etc/root share/skel X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 00:55:44 -0000 Author: eadler Date: Tue Nov 6 00:55:43 2012 New Revision: 242643 URL: http://svnweb.freebsd.org/changeset/base/242643 Log: MFC r242514,r242541: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core ==== Change default prompt to show ~ again for the home directory Approved by: cperciva (implicit) Modified: stable/9/etc/root/dot.cshrc stable/9/share/skel/dot.cshrc Directory Properties: stable/9/etc/ (props changed) stable/9/share/skel/ (props changed) Modified: stable/9/etc/root/dot.cshrc ============================================================================== --- stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) +++ stable/9/etc/root/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec Modified: stable/9/share/skel/dot.cshrc ============================================================================== --- stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242642) +++ stable/9/share/skel/dot.cshrc Tue Nov 6 00:55:43 2012 (r242643) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then @@ -26,7 +26,7 @@ if ($?prompt) then if ($uid == 0) then set user = root endif - set prompt = "%n@%m:%/ %# " + set prompt = "%n@%m:%~ %# " set promptchars = "%#" set filec From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:04:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0DECEA4; Tue, 6 Nov 2012 01:04:46 +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 B350C8FC08; Tue, 6 Nov 2012 01:04:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA614kWl037266; Tue, 6 Nov 2012 01:04:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA614kR5037264; Tue, 6 Nov 2012 01:04:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060104.qA614kR5037264@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 01:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242645 - stable/8/sys/dev/age X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:04:47 -0000 Author: yongari Date: Tue Nov 6 01:04:46 2012 New Revision: 242645 URL: http://svnweb.freebsd.org/changeset/base/242645 Log: MFC r242348: TSO engine of L1 requires a separate DMA descriptor for TCP payload. This means driver has to split a TX buffer into two pieces of TX buffers when the TX buffer contains both ethernet/IP/TCP header and partial TCP payload. The controller does not require all header should be in a TX buffer but driver forced it to compute IP/TCP header size/offset which is required parameter to configure DMA descriptor for TSO. While here, slightly reorder DMA descriptor setup to enhance readability and remove unnecessary code for TSO(upper stack never requests TSO when the frame length is less than or equal to MTU). Reported by: Yamagi Burmeister yamagi dot org> Tested by: Yamagi Burmeister yamagi dot org> Modified: stable/8/sys/dev/age/if_age.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/age/ (props changed) Modified: stable/8/sys/dev/age/if_age.c ============================================================================== --- stable/8/sys/dev/age/if_age.c Tue Nov 6 00:55:43 2012 (r242644) +++ stable/8/sys/dev/age/if_age.c Tue Nov 6 01:04:46 2012 (r242645) @@ -1495,7 +1495,7 @@ age_encap(struct age_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[AGE_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, ip_off, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, i, nsegs, prod, si; AGE_LOCK_ASSERT(sc); @@ -1562,8 +1562,12 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } /* * L1 requires IP/TCP header size and offset as * well as TCP pseudo checksum which complicates @@ -1578,14 +1582,11 @@ age_encap(struct age_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons((tcp->th_off << 2) + IPPROTO_TCP)); - else - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } *m_head = m; } @@ -1627,23 +1628,48 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; + /* Configure VLAN hardware tag insertion. */ + if ((m->m_flags & M_VLANTAG) != 0) { + vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); + vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); + cflags |= AGE_TD_INSERT_VLAN_TAG; + } + + desc = NULL; + i = 0; if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Configure TSO. */ - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { - /* Not TSO but IP/TCP checksum offload. */ - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - /* Clear TSO in order not to set AGE_TD_TSO_HDR. */ - m->m_pkthdr.csum_flags &= ~CSUM_TSO; - } else { - /* Request TSO and set MSS. */ - cflags |= AGE_TD_TSO_IPV4; - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << - AGE_TD_TSO_MSS_SHIFT); - } + /* Request TSO and set MSS. */ + cflags |= AGE_TD_TSO_IPV4; + cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << + AGE_TD_TSO_MSS_SHIFT); /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + /* + * L1 requires the first buffer should only hold IP/TCP + * header data. TCP payload should be handled in other + * descriptors. + */ + hdrlen = poff + (tcp->th_off << 2); + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr); + desc->len = htole32(AGE_TX_BYTES(hdrlen) | vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + if (m->m_len - hdrlen > 0) { + /* Handle remaining payload of the 1st fragment. */ + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr + hdrlen); + desc->len = htole32(AGE_TX_BYTES(m->m_len - hdrlen) | + vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + } + /* Handle remaining fragments. */ + i = 1; } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { /* Configure Tx IP/TCP/UDP checksum offload. */ cflags |= AGE_TD_CSUM; @@ -1657,16 +1683,7 @@ age_encap(struct age_softc *sc, struct m cflags |= ((poff + m->m_pkthdr.csum_data) << AGE_TD_CSUM_XSUMOFFSET_SHIFT); } - - /* Configure VLAN hardware tag insertion. */ - if ((m->m_flags & M_VLANTAG) != 0) { - vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); - vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); - cflags |= AGE_TD_INSERT_VLAN_TAG; - } - - desc = NULL; - for (i = 0; i < nsegs; i++) { + for (; i < nsegs; i++) { desc = &sc->age_rdata.age_tx_ring[prod]; desc->addr = htole64(txsegs[i].ds_addr); desc->len = htole32(AGE_TX_BYTES(txsegs[i].ds_len) | vtag); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:18:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C926626A; Tue, 6 Nov 2012 01:18:53 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8218FC0C; Tue, 6 Nov 2012 01:18:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61IrSH039950; Tue, 6 Nov 2012 01:18:53 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61Ir0u039947; Tue, 6 Nov 2012 01:18:53 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211060118.qA61Ir0u039947@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 6 Nov 2012 01:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242646 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:18:53 -0000 Author: melifaro Date: Tue Nov 6 01:18:53 2012 New Revision: 242646 URL: http://svnweb.freebsd.org/changeset/base/242646 Log: MFC r241502, r241884 Cleanup documentation: cloning route support has been removed in r186119. Eliminate code checking if found IPv6 rte is dynamic. IPv6 redirects are using (different) ND-based approach described in RFC 4861. This change is similar to r241406 which conditionally skips the same check in IPv4. This change is part of bigger patch eliminating rte locking. Sponsored by: Yandex LLC. Modified: stable/9/sys/netinet/in_rmx.c stable/9/sys/netinet6/in6_rmx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_rmx.c ============================================================================== --- stable/9/sys/netinet/in_rmx.c Tue Nov 6 01:04:46 2012 (r242645) +++ stable/9/sys/netinet/in_rmx.c Tue Nov 6 01:18:53 2012 (r242646) @@ -27,19 +27,6 @@ * SUCH DAMAGE. */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/netinet6/in6_rmx.c ============================================================================== --- stable/9/sys/netinet6/in6_rmx.c Tue Nov 6 01:04:46 2012 (r242645) +++ stable/9/sys/netinet6/in6_rmx.c Tue Nov 6 01:18:53 2012 (r242646) @@ -59,19 +59,6 @@ * */ -/* - * This code does two things necessary for the enhanced TCP metrics to - * function in a useful manner: - * 1) It marks all non-host routes as `cloning', thus ensuring that - * every actual reference to such a route actually gets turned - * into a reference to a host route to the specific destination - * requested. - * 2) When such routes lose all their references, it arranges for them - * to be deleted in some random collection of circumstances, so that - * a large quantity of stale routing data is not kept in kernel memory - * indefinitely. See in6_rtqtimo() below for the exact mechanism. - */ - #include __FBSDID("$FreeBSD$"); @@ -111,8 +98,6 @@ extern int in6_inithead(void **head, int extern int in6_detachhead(void **head, int off); #endif -#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ - /* * Do what we need to do when inserting a route. */ @@ -183,42 +168,8 @@ in6_addroute(void *v_arg, void *n_arg, s return (ret); } -/* - * This code is the inverse of in6_clsroute: on first reference, if we - * were managing the route, stop doing so and set the expiration timer - * back off again. - */ -static struct radix_node * -in6_matroute(void *v_arg, struct radix_node_head *head) -{ - struct radix_node *rn = rn_match(v_arg, head); - struct rtentry *rt = (struct rtentry *)rn; - - if (rt) { - RT_LOCK(rt); - if (rt->rt_flags & RTPRF_OURS) { - rt->rt_flags &= ~RTPRF_OURS; - rt->rt_rmx.rmx_expire = 0; - } - RT_UNLOCK(rt); - } - return rn; -} - SYSCTL_DECL(_net_inet6_ip6); -static VNET_DEFINE(int, rtq_reallyold6) = 60*60; - /* one hour is ``really old'' */ -#define V_rtq_reallyold6 VNET(rtq_reallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, CTLFLAG_RW, - &VNET_NAME(rtq_reallyold6) , 0, ""); - -static VNET_DEFINE(int, rtq_minreallyold6) = 10; - /* never automatically crank down to less */ -#define V_rtq_minreallyold6 VNET(rtq_minreallyold6) -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, - &VNET_NAME(rtq_minreallyold6) , 0, ""); - static VNET_DEFINE(int, rtq_toomany6) = 128; /* 128 cached routes is ``too many'' */ #define V_rtq_toomany6 VNET(rtq_toomany6) @@ -236,122 +187,6 @@ struct rtqk_arg { }; /* - * Get rid of old routes. When draining, this deletes everything, even when - * the timeout is not expired yet. When updating, this makes sure that - * nothing has a timeout longer than the current value of rtq_reallyold6. - */ -static int -in6_rtqkill(struct radix_node *rn, void *rock) -{ - struct rtqk_arg *ap = rock; - struct rtentry *rt = (struct rtentry *)rn; - int err; - - RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh); - - if (rt->rt_flags & RTPRF_OURS) { - ap->found++; - - if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) { - if (rt->rt_refcnt > 0) - panic("rtqkill route really not free"); - - err = in6_rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), - rt->rt_flags|RTF_RNH_LOCKED, 0, - rt->rt_fibnum); - if (err) { - log(LOG_WARNING, "in6_rtqkill: error %d", err); - } else { - ap->killed++; - } - } else { - if (ap->updating - && (rt->rt_rmx.rmx_expire - time_uptime - > V_rtq_reallyold6)) { - rt->rt_rmx.rmx_expire = time_uptime - + V_rtq_reallyold6; - } - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); - } - } - - return 0; -} - -#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout6) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer6); - -#define V_rtq_timeout6 VNET(rtq_timeout6) -#define V_rtq_timer6 VNET(rtq_timer6) - -static void -in6_rtqtimo_one(struct radix_node_head *rnh) -{ - struct rtqk_arg arg; - static time_t last_adjusted_timeout = 0; - - arg.found = arg.killed = 0; - arg.rnh = rnh; - arg.nextstop = time_uptime + V_rtq_timeout6; - arg.draining = arg.updating = 0; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - - /* - * Attempt to be somewhat dynamic about this: - * If there are ``too many'' routes sitting around taking up space, - * then crank down the timeout, and see if we can't make some more - * go away. However, we make sure that we will never adjust more - * than once in rtq_timeout6 seconds, to keep from cranking down too - * hard. - */ - if ((arg.found - arg.killed > V_rtq_toomany6) - && (time_uptime - last_adjusted_timeout >= V_rtq_timeout6) - && V_rtq_reallyold6 > V_rtq_minreallyold6) { - V_rtq_reallyold6 = 2*V_rtq_reallyold6 / 3; - if (V_rtq_reallyold6 < V_rtq_minreallyold6) { - V_rtq_reallyold6 = V_rtq_minreallyold6; - } - - last_adjusted_timeout = time_uptime; -#ifdef DIAGNOSTIC - log(LOG_DEBUG, "in6_rtqtimo: adjusted rtq_reallyold6 to %d", - V_rtq_reallyold6); -#endif - arg.found = arg.killed = 0; - arg.updating = 1; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in6_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } -} - -static void -in6_rtqtimo(void *rock) -{ - CURVNET_SET_QUIET((struct vnet *) rock); - struct radix_node_head *rnh; - struct timeval atv; - u_int fibnum; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = rt_tables_get_rnh(fibnum, AF_INET6); - if (rnh != NULL) - in6_rtqtimo_one(rnh); - } - - atv.tv_usec = 0; - atv.tv_sec = V_rtq_timeout6; - callout_reset(&V_rtq_timer6, tvtohz(&atv), in6_rtqtimo, rock); - CURVNET_RESTORE(); -} - -/* * Age old PMTUs. */ struct mtuex_arg { @@ -440,12 +275,9 @@ in6_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in6_addroute; - rnh->rnh_matchaddr = in6_matroute; if (V__in6_rt_was_here == 0) { - callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE); - in6_rtqtimo(curvnet); /* kick off timeout first time */ in6_mtutimo(curvnet); /* kick off timeout first time */ V__in6_rt_was_here = 1; } @@ -458,7 +290,6 @@ int in6_detachhead(void **head, int off) { - callout_drain(&V_rtq_timer6); callout_drain(&V_rtq_mtutimer); return (1); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:29:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEFFC6D2; Tue, 6 Nov 2012 01:29:26 +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 93AED8FC14; Tue, 6 Nov 2012 01:29:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61TQwW041957; Tue, 6 Nov 2012 01:29:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61TQpd041955; Tue, 6 Nov 2012 01:29:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211060129.qA61TQpd041955@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Nov 2012 01:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242647 - head/share/examples/ses/srcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:29:26 -0000 Author: mav Date: Tue Nov 6 01:29:26 2012 New Revision: 242647 URL: http://svnweb.freebsd.org/changeset/base/242647 Log: Decode common state bits in getencstat output. Modified: head/share/examples/ses/srcs/eltsub.c Modified: head/share/examples/ses/srcs/eltsub.c ============================================================================== --- head/share/examples/ses/srcs/eltsub.c Tue Nov 6 01:18:53 2012 (r242646) +++ head/share/examples/ses/srcs/eltsub.c Tue Nov 6 01:29:26 2012 (r242647) @@ -180,7 +180,11 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "status: %s (0x%02x 0x%02x 0x%02x 0x%02x)", - scode, cstat[0], cstat[1], cstat[2], cstat[3]); + sprintf(ebuf, "status: %s%s%s%s (0x%02x 0x%02x 0x%02x 0x%02x)", + scode, + (cstat[0] & 0x40) ? ", Prd.Fail" : "", + (cstat[0] & 0x20) ? ", Disabled" : "", + (cstat[0] & 0x10) ? ", Swapped" : "", + cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:49:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9B60A13; Tue, 6 Nov 2012 01:49:55 +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 CCEF38FC0A; Tue, 6 Nov 2012 01:49:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61ntJX045844; Tue, 6 Nov 2012 01:49:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61ntqS045842; Tue, 6 Nov 2012 01:49:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201211060149.qA61ntqS045842@svn.freebsd.org> From: Glen Barber Date: Tue, 6 Nov 2012 01:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242648 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:49:56 -0000 Author: gjb (doc,ports committer) Date: Tue Nov 6 01:49:55 2012 New Revision: 242648 URL: http://svnweb.freebsd.org/changeset/base/242648 Log: MFC r240588: Update release(7) to reflect changes from r240586 and r240587: - Remove cvs(1) references. - Remove CVS* environment references. - Add default entries for the default SVNROOT for the Ports Collection, and Documentation Project. - While here, update 'SGML-based documentation' to 'XML-based', since the recent SGML->XML conversion. - Update an example providing SVNROOT environment usage. Modified: stable/9/share/man/man7/release.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Tue Nov 6 01:29:26 2012 (r242647) +++ stable/9/share/man/man7/release.7 Tue Nov 6 01:49:55 2012 (r242648) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2012 +.Dd September 16, 2012 .Dt RELEASE 7 .Os .Sh NAME @@ -105,11 +105,7 @@ environment in It then checks out the src tree specified by .Ar svn-branch using -.Xr svn 1 -and (optionally) the ports and documentation trees using -.Xr csup 1 -or -.Xr cvs 1 . +.Xr svn 1 . Once the various source trees have been obtained, it executes .Dq Li "make release" within the @@ -122,33 +118,19 @@ release media. .Pp Environment variables: .Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev CVSUP_HOST -The CVSUP server to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVSROOT -The location of the -.Fx -CVS repository to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVS_TAG -If the variable -.Ev CVS_TAG -is set, that tag will be used for CVS checkouts (doc and ports), otherwise -.Ic generate-release.sh -will use HEAD. .It Ev MAKE_FLAGS This environment variable can be set to pass flags (e.g. -j) to .Xr make 1 when invoked by the script. .It Ev SVNROOT -The location of the FreeBSD SVN source repository. Defaults to -.Pa svn://svn.freebsd.org/base . +The location of the FreeBSD SVN source, doc, and ports repositories. +Defaults to +.Pa svn://svn.freebsd.org/base +for the source tree, +.Pa svn://svn.freebsd.org/ports/head +for the Ports Collection, and +.Pa svn://svn.freebsd.org/doc/head +for the Documentation Project source. .It Ev RELSTRING Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). Defaults to the output of @@ -246,7 +228,7 @@ If defined, the Ports Collection will be .It Va NOSRC If set, do not include system source code in the release. .It Va NODOC -If defined, the SGML-based documentation from the +If defined, the XML-based documentation from the .Fx Documentation Project will not be built. However, the @@ -317,7 +299,7 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export CVSUP_HOST=cvsupN.freebsd.org +export SVNROOT=svn://svn.freebsd.org/base sh generate-release.sh head /local3/release .Ed .Pp @@ -326,7 +308,6 @@ After running these commands, all prepar directory. .Sh SEE ALSO .Xr cc 1 , -.Xr cvs 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 Pq Pa ports/devel/subversion-freebsd , @@ -376,7 +357,7 @@ was overhauled and the wrapper script introduced to support the introduction of a new installer. .Pp At near 1000 revisions spread over multiple branches, the -.Xr cvs 1 +.Xr svn 1 log of .Pa src/release/Makefile contains a vivid historical record of some From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:53:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD659BB9; Tue, 6 Nov 2012 01:53:25 +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 91A918FC14; Tue, 6 Nov 2012 01:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61rPTV046650; Tue, 6 Nov 2012 01:53:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61rPTu046645; Tue, 6 Nov 2012 01:53:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211060153.qA61rPTu046645@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Nov 2012 01:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242649 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:53:25 -0000 Author: mav Date: Tue Nov 6 01:53:25 2012 New Revision: 242649 URL: http://svnweb.freebsd.org/changeset/base/242649 Log: MFC r241329: Make graid command line a bit more friendly by allowing volume name or provider name to be specified instead of geom name (first argument in all subcommands except label). In most cases there is only one array used any way, so it is not really useful to make user type ugly geom names like Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/geom/raid/g_raid_ctl.c stable/9/sys/geom/raid/md_ddf.c stable/9/sys/geom/raid/md_intel.c stable/9/sys/geom/raid/md_promise.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/9/sys/geom/raid/g_raid_ctl.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/g_raid_ctl.c Tue Nov 6 01:53:25 2012 (r242649) @@ -51,7 +51,10 @@ g_raid_find_node(struct g_class *mp, con { struct g_raid_softc *sc; struct g_geom *gp; + struct g_provider *pp; + struct g_raid_volume *vol; + /* Look for geom with specified name. */ LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; if (sc == NULL) @@ -61,6 +64,35 @@ g_raid_find_node(struct g_class *mp, con if (strcasecmp(sc->sc_name, name) == 0) return (sc); } + + /* Look for provider with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (strcmp(pp->name, name) == 0) + return (sc); + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, name) == 0) + return (sc); + } + } + + /* Look for volume with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (strcmp(vol->v_name, name) == 0) + return (sc); + } + } return (NULL); } Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_ddf.c Tue Nov 6 01:53:25 2012 (r242649) @@ -2231,7 +2231,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip, offs[DDF_MAX_DISKS_HARD], esize; @@ -2502,8 +2502,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -2521,11 +2525,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -2535,6 +2540,14 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/9/sys/geom/raid/md_intel.c ============================================================================== --- stable/9/sys/geom/raid/md_intel.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_intel.c Tue Nov 6 01:53:25 2012 (r242649) @@ -1461,7 +1461,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_consumer *cp; struct g_provider *pp; char arg[16], serial[INTEL_SERIAL_LEN]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t off, size, sectorsize, strip, disk_sectors; @@ -1876,8 +1876,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1895,11 +1899,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1909,6 +1914,14 @@ g_raid_md_ctl_intel(struct g_raid_md_obj TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Tue Nov 6 01:49:55 2012 (r242648) +++ stable/9/sys/geom/raid/md_promise.c Tue Nov 6 01:53:25 2012 (r242649) @@ -1217,7 +1217,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip; @@ -1478,8 +1478,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1497,11 +1501,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1511,6 +1516,14 @@ g_raid_md_ctl_promise(struct g_raid_md_o TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:56:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0FC8DD6; Tue, 6 Nov 2012 01:56:39 +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 9245A8FC0C; Tue, 6 Nov 2012 01:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA61ud7K047368; Tue, 6 Nov 2012 01:56:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA61udlE047366; Tue, 6 Nov 2012 01:56:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201211060156.qA61udlE047366@svn.freebsd.org> From: Glen Barber Date: Tue, 6 Nov 2012 01:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242650 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:56:40 -0000 Author: gjb (doc,ports committer) Date: Tue Nov 6 01:56:39 2012 New Revision: 242650 URL: http://svnweb.freebsd.org/changeset/base/242650 Log: MFC r227536, r240967: r227536 (nwhitehorn): Further automate production release generation by naming files the right things and generating checksums. r240967: - Allow cross-architecture builds with 'generate-release.sh', which is set by specifying '-a '. (Only supported for i386 on amd64 and powerpc on powerpc64 currently). - Change how textproc/docproj is installed: o Attempt to install from pkg(8); o Fall back to pkg_add(1) if pkg(8) installation is not successful; o Fall back to installing from ports as last resort. - Ensure the script is run by root[1]. - Get OSVERSION from param.h[1]. Modified: stable/9/release/generate-release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/generate-release.sh ============================================================================== --- stable/9/release/generate-release.sh Tue Nov 6 01:53:25 2012 (r242649) +++ stable/9/release/generate-release.sh Tue Nov 6 01:56:39 2012 (r242650) @@ -10,23 +10,54 @@ # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) +# RELSTRING: optional base name for media images (e.g. FreeBSD-9.0-RC2-amd64) # # Note: Since this requires a chroot, release cross-builds will not work! # # $FreeBSD$ # +unset B_ARCH +unset ARCH +unset MACHINE_ARCH + +HOST_ARCH=`uname -p` + usage() { - echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + echo "Usage: $0 [-a arch] [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + exit 1 +} + +arch_error () +{ + echo "Architecture ${OPTARG} cannot be built on host architecture ${HOST_ARCH}" exit 1 } REVISION= DOCREVISION= PORTSREVISION= -while getopts d:r:p: opt; do +while getopts a:d:r:p: opt; do case $opt in + a) + case "${OPTARG}" in + i386|amd64) + if [ "${HOST_ARCH}" != "amd64" ]; then + arch_error "${OPTARG}" + fi + ;; + powerpc|powerpc64) + if [ "${HOST_ARCH}" != "powerpc64" ]; then + arch_error "${OPTARG}" + fi + ;; + *) + arch_error "${OPTARG}" + ;; + esac + B_ARCH="$OPTARG" + ;; d) DOCREVISION="-r $OPTARG" ;; @@ -43,10 +74,21 @@ while getopts d:r:p: opt; do done shift $(($OPTIND - 1)) +# If target architecture is not specified, use hw.machine_arch +if [ "x${B_ARCH}" == "x" ]; then + B_ARCH="${HOST_ARCH}" +fi +ARCH_FLAGS="ARCH=${B_ARCH} TARGET_ARCH=${B_ARCH}" + if [ $# -lt 2 ]; then usage fi +if [ $(id -u) -ne 0 ]; then + echo "Needs to be run as root." + exit 1 +fi + set -e # Everything must succeed svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src @@ -54,19 +96,88 @@ svn co ${SVNROOT:-svn://svn.freebsd.org/ svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION cd $2/usr/src -make $MAKE_FLAGS buildworld -make installworld distribution DESTDIR=$2 +make $MAKE_FLAGS ${ARCH_FLAGS} buildworld +make $ARCH_FLAGS installworld distribution DESTDIR=$2 mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit +# Most commands below are run in chroot, so fake getosreldate(3) right now +OSVERSION=$(grep '#define __FreeBSD_version' $2/usr/include/sys/param.h | awk '{print $3}') +export OSVERSION +BRANCH=$(grep '^BRANCH=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') +BRANCH=`echo ${BRANCH} | sed -e 's,",,g'` +REVISION=$(grep '^REVISION=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') +REVISION=`echo ${REVISION} | sed -e 's,",,g'` +OSRELEASE="${REVISION}-${BRANCH}" + +pkgng_install_docports () +{ + # Attempt to install docproj port from pkgng package. + chroot ${CHROOTDIR} /bin/sh -c 'env ASSUME_ALWAYS_YES=1 /usr/sbin/pkg install -y docproj-nojadetex' + # Check if docproj was installed, since pkg(8) returns '0' if unable + # to install a package from the repository. If it is not installed, + # fallback to installing using pkg_add(1). + chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg info -q docproj-nojadetex' || \ + pkgadd_install_docports +} + +build_compat9_port () +{ + chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/misc/compat9x BATCH=yes install clean' +} + +pkgadd_install_docports () +{ + # Attempt to install docproj package with pkg_add(1). + # If not successful, build the docproj port. + if [ "${REVISION}" == "10.0" ]; then + # Packages for 10-CURRENT are still located in the 9-CURRENT + # directory. Override environment to use correct package + # location if building for 10-CURRENT. + PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/Latest/" + export PACKAGESITE + PACKAGEROOT="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/" + export PACKAGEROOT + PKG_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/All/" + export PKG_PATH + build_compat9_port + fi + chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg_add -r docproj-nojadetex' || \ + build_docports +} + +build_docports() +{ + # Could not install textproc/docproj from pkg(8) or pkg_add(1). Build + # the port as final fallback. + chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ + { echo "*** Could not build the textproj/docproj port. Exiting."; exit 2; } +} + if [ -d $2/usr/doc ]; then cp /etc/resolv.conf $2/etc/resolv.conf # Install docproj to build release documentation - chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' + CHROOTDIR="$2" + set +e + pkgng_install_docports "${CHROOTDIR}" + set -e fi -chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel -chroot $2 make -C /usr/src/release release +chroot $2 make -C /usr/src $MAKE_FLAGS ${ARCH_FLAGS} buildworld buildkernel +chroot $2 make -C /usr/src/release ${ARCH_FLAGS} release chroot $2 make -C /usr/src/release install DESTDIR=/R +if [ "x${OSVERSION}" == "x" ]; then + OSRELEASE=`chroot $2 uname -r` +fi + +: ${RELSTRING=`chroot $2 uname -s`-${OSRELEASE}-${B_ARCH}} + +cd $2/R +for i in release.iso bootonly.iso memstick; do + mv $i $RELSTRING-$i +done +sha256 $RELSTRING-* > CHECKSUM.SHA256 +md5 $RELSTRING-* > CHECKSUM.MD5 + From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 01:59:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BBB8F5A for ; Tue, 6 Nov 2012 01:59:54 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 920128FC0A for ; Tue, 6 Nov 2012 01:59:53 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so12246lbd.13 for ; Mon, 05 Nov 2012 17:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=cEycR+PYmBsM+avbMOCHxdRZ02MbCHT4qxGfCeWonro=; b=rNoX0OCvU1DGRrhudjqm+oLHHdyF3PGDJoeuoO8JInLXZA1iBoGzj/itFjWq2A3auH irrAJNSLwtjBK2aeDA8MUZ6xwre86xcMSrwTUpYrspAp0Rdm4KpvNK7zW0/TvvbWUN9f aL244pi+r2FKjMl3wuZkvrP7ou10cYHe78ADw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=cEycR+PYmBsM+avbMOCHxdRZ02MbCHT4qxGfCeWonro=; b=UkRlD10UMq2M7hDfnKcFJbNBW8BB2Lvmk47MTPz5Z59jKbScIfmYZLcfudvfW9j51F I8Rp0zTbccpcZTUuDq+QiYtuOJh26gqsvJyxiXSa6tiTrHsyrjRUeO07hDOx//W2PGz7 bUqxlwHnz+c9C2KWAEaS9ZM52CLIRnLDtHkGzt3M4xyhEUzdWdukKutZ2FpHL6jZjNtU 2J5LEIqoUSjNiUJMTV5V7Gows593fqpK9IJobckbg1I8sVCa5OPscaV3dmhYLDcItBng vMkDuoe3yvqnP5lpAiCvYU95vew7iYyxHxp7FoMH9HyxuY2Xm8LNXU9GZs65Ct5LCc6L D4lA== Received: by 10.112.13.140 with SMTP id h12mr4799995lbc.12.1352167192202; Mon, 05 Nov 2012 17:59:52 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Mon, 5 Nov 2012 17:59:21 -0800 (PST) In-Reply-To: <201211060149.qA61ntqS045842@svn.freebsd.org> References: <201211060149.qA61ntqS045842@svn.freebsd.org> From: Eitan Adler Date: Mon, 5 Nov 2012 20:59:21 -0500 X-Google-Sender-Auth: psaeluAfxBP_FARg5sMOG8nLTBM Message-ID: Subject: Re: svn commit: r242648 - stable/9/share/man/man7 To: Glen Barber Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmDO7/w9GZqVF4Q8zJMqostT9PaaLnMJxiydGkJWMPo7O/poyHL8WLpv4RcxmOedj8haHoa Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 01:59:54 -0000 On 5 November 2012 20:49, Glen Barber wrote: > Author: gjb (doc,ports committer) > Date: Tue Nov 6 01:49:55 2012 > New Revision: 242648 > URL: http://svnweb.freebsd.org/changeset/base/242648 > > Log: > MFC r240588: > > Update release(7) to reflect changes from r240586 and r240587: > > - Remove cvs(1) references. > - Remove CVS* environment references. > - Add default entries for the default SVNROOT for the Ports > Collection, and Documentation Project. > - While here, update 'SGML-based documentation' to 'XML-based', > since the recent SGML->XML conversion. > - Update an example providing SVNROOT environment usage. Thanks! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 02:05:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F73626D; Tue, 6 Nov 2012 02:05:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 4455D8FC12; Tue, 6 Nov 2012 02:05:24 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:0:100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4805A23F645; Mon, 5 Nov 2012 21:05:22 -0500 (EST) Date: Mon, 5 Nov 2012 21:05:19 -0500 From: Glen Barber To: Eitan Adler Subject: Re: svn commit: r242648 - stable/9/share/man/man7 Message-ID: <20121106020519.GA1372@glenbarber.us> References: <201211060149.qA61ntqS045842@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:05:24 -0000 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 05, 2012 at 08:59:21PM -0500, Eitan Adler wrote: > > Log: > > MFC r240588: > > > > Update release(7) to reflect changes from r240586 and r240587: > > > > - Remove cvs(1) references. > > - Remove CVS* environment references. > > - Add default entries for the default SVNROOT for the Ports > > Collection, and Documentation Project. > > - While here, update 'SGML-based documentation' to 'XML-based', > > since the recent SGML->XML conversion. > > - Update an example providing SVNROOT environment usage. >=20 > Thanks! >=20 Sorry for the delay on this... Glen --+HP7ph2BbKc20aGI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQmHBfAAoJEFJPDDeguUajR5cIAJQ94bPzzLjxeZmFHgvZompr 2OxOvNLUuja6OyQMhm8PWF5qTuN0j6atIigm9eURnahZDfsv3n78K9u6kV/I5APv ALxK9yVRtpC3Yjf7gqcgi45SzUQnmq5Ua6IjzL4udDwuH66+BK2AaMVnWsQN7Bc7 Ddxv0UiYrjCUv5dSDLTPPHTs1InWX1df0LFTZjT0ija0UDbiF1tZyq1ny0Q8FzEN Z27icplyZgybDCpKWEcwzV+Fv3EaoBWnWCJkyGLNWGcrbeL5+KVeYV6e+gjsukJq TLo3TgM7RDLV9Fr0pK/HcZ3YUTuMFrtKZi7YlsR8huS4/Vo0c7bPt+pjD4O2e4g= =bEoG -----END PGP SIGNATURE----- --+HP7ph2BbKc20aGI-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 02:08:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A197A447; Tue, 6 Nov 2012 02:08:09 +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 840B58FC08; Tue, 6 Nov 2012 02:08:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6289HC049799; Tue, 6 Nov 2012 02:08:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6289RU049794; Tue, 6 Nov 2012 02:08:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211060208.qA6289RU049794@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Nov 2012 02:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242651 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:08:09 -0000 Author: mav Date: Tue Nov 6 02:08:09 2012 New Revision: 242651 URL: http://svnweb.freebsd.org/changeset/base/242651 Log: MFC r241329: Make graid command line a bit more friendly by allowing volume name or provider name to be specified instead of geom name (first argument in all subcommands except label). In most cases there is only one array used any way, so it is not really useful to make user type ugly geom names like Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases. Sponsored by: iXsystems, Inc. Modified: stable/8/sys/geom/raid/g_raid_ctl.c stable/8/sys/geom/raid/md_ddf.c stable/8/sys/geom/raid/md_intel.c stable/8/sys/geom/raid/md_promise.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/8/sys/geom/raid/g_raid_ctl.c Tue Nov 6 01:56:39 2012 (r242650) +++ stable/8/sys/geom/raid/g_raid_ctl.c Tue Nov 6 02:08:09 2012 (r242651) @@ -51,7 +51,10 @@ g_raid_find_node(struct g_class *mp, con { struct g_raid_softc *sc; struct g_geom *gp; + struct g_provider *pp; + struct g_raid_volume *vol; + /* Look for geom with specified name. */ LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; if (sc == NULL) @@ -61,6 +64,35 @@ g_raid_find_node(struct g_class *mp, con if (strcasecmp(sc->sc_name, name) == 0) return (sc); } + + /* Look for provider with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (strcmp(pp->name, name) == 0) + return (sc); + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, name) == 0) + return (sc); + } + } + + /* Look for volume with specified name. */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + if (sc->sc_stopping != 0) + continue; + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + if (strcmp(vol->v_name, name) == 0) + return (sc); + } + } return (NULL); } Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Tue Nov 6 01:56:39 2012 (r242650) +++ stable/8/sys/geom/raid/md_ddf.c Tue Nov 6 02:08:09 2012 (r242651) @@ -2231,7 +2231,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip, offs[DDF_MAX_DISKS_HARD], esize; @@ -2502,8 +2502,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -2521,11 +2525,12 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -2535,6 +2540,14 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Tue Nov 6 01:56:39 2012 (r242650) +++ stable/8/sys/geom/raid/md_intel.c Tue Nov 6 02:08:09 2012 (r242651) @@ -1461,7 +1461,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_consumer *cp; struct g_provider *pp; char arg[16], serial[INTEL_SERIAL_LEN]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t off, size, sectorsize, strip, disk_sectors; @@ -1876,8 +1876,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1895,11 +1899,12 @@ g_raid_md_ctl_intel(struct g_raid_md_obj } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1909,6 +1914,14 @@ g_raid_md_ctl_intel(struct g_raid_md_obj TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); Modified: stable/8/sys/geom/raid/md_promise.c ============================================================================== --- stable/8/sys/geom/raid/md_promise.c Tue Nov 6 01:56:39 2012 (r242650) +++ stable/8/sys/geom/raid/md_promise.c Tue Nov 6 02:08:09 2012 (r242651) @@ -1217,7 +1217,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o struct g_consumer *cp; struct g_provider *pp; char arg[16]; - const char *verb, *volname, *levelname, *diskname; + const char *nodename, *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; off_t size, sectorsize, strip; @@ -1478,8 +1478,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } if (strcmp(verb, "delete") == 0) { + nodename = gctl_get_asciiparam(req, "arg0"); + if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0) + nodename = NULL; + /* Full node destruction. */ - if (*nargs == 1) { + if (*nargs == 1 && nodename != NULL) { /* Check if some volume is still open. */ force = gctl_get_paraml(req, "force", sizeof(*force)); if (force != NULL && *force == 0 && @@ -1497,11 +1501,12 @@ g_raid_md_ctl_promise(struct g_raid_md_o } /* Destroy specified volume. If it was last - all node. */ - if (*nargs != 2) { + if (*nargs > 2) { gctl_error(req, "Invalid number of arguments."); return (-1); } - volname = gctl_get_asciiparam(req, "arg1"); + volname = gctl_get_asciiparam(req, + nodename != NULL ? "arg1" : "arg0"); if (volname == NULL) { gctl_error(req, "No volume name."); return (-2); @@ -1511,6 +1516,14 @@ g_raid_md_ctl_promise(struct g_raid_md_o TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { if (strcmp(vol->v_name, volname) == 0) break; + pp = vol->v_provider; + if (pp == NULL) + continue; + if (strcmp(pp->name, volname) == 0) + break; + if (strncmp(pp->name, "raid/", 5) == 0 && + strcmp(pp->name + 5, volname) == 0) + break; } if (vol == NULL) { i = strtol(volname, &tmp, 10); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 02:19:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 038846BA; Tue, 6 Nov 2012 02:19:52 +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 DC5288FC15; Tue, 6 Nov 2012 02:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA62JpiM052170; Tue, 6 Nov 2012 02:19:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA62Jp9B052168; Tue, 6 Nov 2012 02:19:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060219.qA62Jp9B052168@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 02:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242652 - stable/9/sys/dev/ale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:19:52 -0000 Author: yongari Date: Tue Nov 6 02:19:51 2012 New Revision: 242652 URL: http://svnweb.freebsd.org/changeset/base/242652 Log: MFC r241340: Fix typo. Check against number of allocated MSI-X vectors. There is no ale(4) controller that supports MSI-X so this is not real issue. PR: kern/171825 Modified: stable/9/sys/dev/ale/if_ale.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ale/if_ale.c ============================================================================== --- stable/9/sys/dev/ale/if_ale.c Tue Nov 6 02:08:09 2012 (r242651) +++ stable/9/sys/dev/ale/if_ale.c Tue Nov 6 02:19:51 2012 (r242652) @@ -551,7 +551,7 @@ ale_attach(device_t dev) if (msix_disable == 0 || msi_disable == 0) { if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES && pci_alloc_msix(dev, &msixc) == 0) { - if (msic == ALE_MSIX_MESSAGES) { + if (msixc == ALE_MSIX_MESSAGES) { device_printf(dev, "Using %d MSIX messages.\n", msixc); sc->ale_flags |= ALE_FLAG_MSIX; From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 02:20:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A18D0832; Tue, 6 Nov 2012 02:20:44 +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 859708FC08; Tue, 6 Nov 2012 02:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA62KiU5052412; Tue, 6 Nov 2012 02:20:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA62KiME052410; Tue, 6 Nov 2012 02:20:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211060220.qA62KiME052410@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Nov 2012 02:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242653 - stable/8/sys/dev/ale X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 02:20:44 -0000 Author: yongari Date: Tue Nov 6 02:20:44 2012 New Revision: 242653 URL: http://svnweb.freebsd.org/changeset/base/242653 Log: MFC r241340: Fix typo. Check against number of allocated MSI-X vectors. There is no ale(4) controller that supports MSI-X so this is not real issue. PR: kern/171825 Modified: stable/8/sys/dev/ale/if_ale.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ale/ (props changed) Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Tue Nov 6 02:19:51 2012 (r242652) +++ stable/8/sys/dev/ale/if_ale.c Tue Nov 6 02:20:44 2012 (r242653) @@ -551,7 +551,7 @@ ale_attach(device_t dev) if (msix_disable == 0 || msi_disable == 0) { if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES && pci_alloc_msix(dev, &msixc) == 0) { - if (msic == ALE_MSIX_MESSAGES) { + if (msixc == ALE_MSIX_MESSAGES) { device_printf(dev, "Using %d MSIX messages.\n", msixc); sc->ale_flags |= ALE_FLAG_MSIX; From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 04:10:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 680CBBD; Tue, 6 Nov 2012 04:10:32 +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 4E7108FC0A; Tue, 6 Nov 2012 04:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA64AWRt075492; Tue, 6 Nov 2012 04:10:32 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA64AWC0075490; Tue, 6 Nov 2012 04:10:32 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211060410.qA64AWC0075490@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 6 Nov 2012 04:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242655 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 04:10:32 -0000 Author: alfred Date: Tue Nov 6 04:10:32 2012 New Revision: 242655 URL: http://svnweb.freebsd.org/changeset/base/242655 Log: export VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS via sysctl. On several platforms the are determined by too many nested #defines to be easily discernible. This will aid in development of auto-tuning. Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Nov 6 02:43:41 2012 (r242654) +++ head/sys/kern/kern_malloc.c Tue Nov 6 04:10:32 2012 (r242655) @@ -186,6 +186,14 @@ struct { */ static uma_zone_t mt_zone; +static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, + &vm_min_kernel_address, 0, "Min kernel address"); + +static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, + &vm_max_kernel_address, 0, "Max kernel address"); + u_long vm_kmem_size; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 06:19:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33EEAFBD; Tue, 6 Nov 2012 06:19:12 +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 0CE108FC0A; Tue, 6 Nov 2012 06:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA66JBYx097315; Tue, 6 Nov 2012 06:19:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA66JBFD097313; Tue, 6 Nov 2012 06:19:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211060619.qA66JBFD097313@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 Nov 2012 06:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242656 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 06:19:12 -0000 Author: adrian Date: Tue Nov 6 06:19:11 2012 New Revision: 242656 URL: http://svnweb.freebsd.org/changeset/base/242656 Log: Convert the aggregate descriptor path over to use the same API as the non-aggregate path. I "cheated" by using some TX setup code in our HAL that isn't present in the atheros HAL (or Linux ath9k.) The old path for forming aggregates was: * setup the rate control in the first descriptor; * call chaintxdesc() on all the frames; * call setupfirsttxdesc() on the first descrpitor in the first frame; * call setuplasttxdesc() on the last descriptor in the last frame. The new path for forming aggregates looks like the non-aggregate path: * call setuptxdesc() on the first descriptor in the first frame; * setup the rate control in the first descriptor; * call filltxdesc() on each descriptor in the frame; * if it's an aggregate - call set11n_aggr_{first, middle, last} as appropriate (see the code for a description of what is "appropriate".) Now, this is done primarily for the AR9300 HAL - it doesn't implement the first set of aggregate functions. It just has the older methods and the "first/middle/last" aggregate methods. So, let's convert the code to use these. Note: the AR5416 HAL in FreeBSD had that code (from me, a while ago) and a previous commit brought it up to behave the same as the AR9300 HAL routines. There's some further tidyups to be done - specifically, avoid doing multiple calls to the 11n descriptor functions. I shouldn't call clr11n_aggr(), then set11n_aggr_middle(), then also set11n_aggr_first(). On (at least MIPS) the TX descriptors are in non-cachable memory and this will cause multiple slow writes. I'll debug/tidy that up in a future commit. Tested: * AR9280, STA * AR9280/AR9160, AP * AR9380, STA (using a local, closed source HAL, sorry!) Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Nov 6 04:10:32 2012 (r242655) +++ head/sys/dev/ath/if_ath_tx.c Tue Nov 6 06:19:11 2012 (r242656) @@ -323,13 +323,17 @@ ath_tx_dmasetup(struct ath_softc *sc, st } /* - * Chain together segments+descriptors for a non-11n frame. + * Chain together segments+descriptors for a frame - 11n or otherwise. + * + * For aggregates, this is called on each frame in the aggregate. */ static void -ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf) +ath_tx_chaindesclist(struct ath_softc *sc, struct ath_desc *ds0, + struct ath_buf *bf, int is_aggr, int is_first_subframe, + int is_last_subframe) { struct ath_hal *ah = sc->sc_ah; - char *ds, *ds0; + char *ds; int i, bp, dsp; HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; @@ -361,7 +365,7 @@ ath_tx_chaindesclist(struct ath_softc *s * For EDMA and later chips ensure the TX map is fully populated * before advancing to the next descriptor. */ - ds0 = ds = (char *) bf->bf_desc; + ds = (char *) bf->bf_desc; bp = dsp = 0; bzero(bufAddrList, sizeof(bufAddrList)); bzero(segLenList, sizeof(segLenList)); @@ -406,10 +410,38 @@ ath_tx_chaindesclist(struct ath_softc *s , (struct ath_desc *) ds0 /* first descriptor */ ); - /* Make sure the 11n aggregate fields are cleared */ + /* + * Make sure the 11n aggregate fields are cleared. + * + * XXX TODO: this doesn't need to be called for + * aggregate frames; as it'll be called on all + * sub-frames. Since the descriptors are in + * non-cacheable memory, this leads to some + * rather slow writes on MIPS/ARM platforms. + */ if (ath_tx_is_11n(sc)) ath_hal_clr11n_aggr(sc->sc_ah, (struct ath_desc *) ds); + /* + * If 11n is enabled, set it up as if it's an aggregate + * frame. + */ + if (is_last_subframe) { + ath_hal_set11n_aggr_last(sc->sc_ah, + (struct ath_desc *) ds); + } else if (is_aggr) { + /* + * This clears the aggrlen field; so + * the caller needs to call set_aggr_first()! + * + * XXX TODO: don't call this for the first + * descriptor in the first frame in an + * aggregate! + */ + ath_hal_set11n_aggr_middle(sc->sc_ah, + (struct ath_desc *) ds, + bf->bf_state.bfs_ndelim); + } isFirstDesc = 0; #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT) @@ -433,73 +465,6 @@ ath_tx_chaindesclist(struct ath_softc *s } /* - * Fill in the descriptor list for a aggregate subframe. - * - * The subframe is returned with the ds_link field in the last subframe - * pointing to 0. - */ -static void -ath_tx_chaindesclist_subframe(struct ath_softc *sc, struct ath_buf *bf) -{ - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds, *ds0; - int i; - HAL_DMA_ADDR bufAddrList[4]; - uint32_t segLenList[4]; - - /* - * XXX There's txdma and txdma_mgmt; the descriptor - * sizes must match. - */ - struct ath_descdma *dd = &sc->sc_txdma; - - ds0 = ds = bf->bf_desc; - - /* - * There's no need to call ath_hal_setupfirsttxdesc here; - * That's only going to occur for the first frame in an aggregate. - */ - for (i = 0; i < bf->bf_nseg; i++, ds++) { - bzero(bufAddrList, sizeof(bufAddrList)); - bzero(segLenList, sizeof(segLenList)); - if (i == bf->bf_nseg - 1) - ath_hal_settxdesclink(ah, ds, 0); - else - ath_hal_settxdesclink(ah, ds, - bf->bf_daddr + dd->dd_descsize * (i + 1)); - - bufAddrList[0] = bf->bf_segs[i].ds_addr; - segLenList[0] = bf->bf_segs[i].ds_len; - - /* - * This performs the setup for an aggregate frame. - * This includes enabling the aggregate flags if needed. - */ - ath_hal_chaintxdesc(ah, ds, - bufAddrList, - segLenList, - bf->bf_state.bfs_pktlen, - bf->bf_state.bfs_hdrlen, - HAL_PKT_TYPE_AMPDU, /* forces aggregate bits to be set */ - bf->bf_state.bfs_keyix, - 0, /* cipher, calculated from keyix */ - bf->bf_state.bfs_ndelim, - i == 0, /* first segment */ - i == bf->bf_nseg - 1, /* last segment */ - bf->bf_next == NULL /* last sub-frame in aggr */ - ); - - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: %d: %08x %08x %08x %08x %08x %08x\n", - __func__, i, ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); - bf->bf_lastds = ds; - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_PREWRITE); - } -} - -/* * Set the rate control fields in the given descriptor based on * the bf_state fields and node state. * @@ -553,13 +518,15 @@ static void ath_tx_setds_11n(struct ath_softc *sc, struct ath_buf *bf_first) { struct ath_buf *bf, *bf_prev = NULL; + struct ath_desc *ds0 = bf_first->bf_desc; DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: nframes=%d, al=%d\n", __func__, bf_first->bf_state.bfs_nframes, bf_first->bf_state.bfs_al); /* - * Setup all descriptors of all subframes. + * Setup all descriptors of all subframes - this will + * call ath_hal_set11naggrmiddle() on every frame. */ bf = bf_first; while (bf != NULL) { @@ -568,8 +535,55 @@ ath_tx_setds_11n(struct ath_softc *sc, s __func__, bf, bf->bf_nseg, bf->bf_state.bfs_pktlen, SEQNO(bf->bf_state.bfs_seqno)); - /* Sub-frame setup */ - ath_tx_chaindesclist_subframe(sc, bf); + /* + * Setup the initial fields for the first descriptor - all + * the non-11n specific stuff. + */ + ath_hal_setuptxdesc(sc->sc_ah, bf->bf_desc + , bf->bf_state.bfs_pktlen /* packet length */ + , bf->bf_state.bfs_hdrlen /* header length */ + , bf->bf_state.bfs_atype /* Atheros packet type */ + , bf->bf_state.bfs_txpower /* txpower */ + , bf->bf_state.bfs_txrate0 + , bf->bf_state.bfs_try0 /* series 0 rate/tries */ + , bf->bf_state.bfs_keyix /* key cache index */ + , bf->bf_state.bfs_txantenna /* antenna mode */ + , bf->bf_state.bfs_txflags | HAL_TXDESC_INTREQ /* flags */ + , bf->bf_state.bfs_ctsrate /* rts/cts rate */ + , bf->bf_state.bfs_ctsduration /* rts/cts duration */ + ); + + /* + * First descriptor? Setup the rate control and initial + * aggregate header information. + */ + if (bf == bf_first) { + /* + * setup first desc with rate and aggr info + */ + ath_tx_set_ratectrl(sc, bf->bf_node, bf); + } + + /* + * Setup the descriptors for a multi-descriptor frame. + * This is both aggregate and non-aggregate aware. + */ + ath_tx_chaindesclist(sc, ds0, bf, + 1, /* is_aggr */ + !! (bf == bf_first), /* is_first_subframe */ + !! (bf->bf_next == NULL) /* is_last_subframe */ + ); + + if (bf == bf_first) { + /* + * Initialise the first 11n aggregate with the + * aggregate length and aggregate enable bits. + */ + ath_hal_set11n_aggr_first(sc->sc_ah, + ds0, + bf->bf_state.bfs_al, + bf->bf_state.bfs_ndelim); + } /* * Link the last descriptor of the previous frame @@ -585,23 +599,6 @@ ath_tx_setds_11n(struct ath_softc *sc, s } /* - * Setup first descriptor of first frame. - * chaintxdesc() overwrites the descriptor entries; - * setupfirsttxdesc() merges in things. - * Otherwise various fields aren't set correctly (eg flags). - */ - ath_hal_setupfirsttxdesc(sc->sc_ah, - bf_first->bf_desc, - bf_first->bf_state.bfs_al, - bf_first->bf_state.bfs_txflags | HAL_TXDESC_INTREQ, - bf_first->bf_state.bfs_txpower, - bf_first->bf_state.bfs_txrate0, - bf_first->bf_state.bfs_try0, - bf_first->bf_state.bfs_txantenna, - bf_first->bf_state.bfs_ctsrate, - bf_first->bf_state.bfs_ctsduration); - - /* * Set the first descriptor bf_lastds field to point to * the last descriptor in the last subframe, that's where * the status update will occur. @@ -614,21 +611,6 @@ ath_tx_setds_11n(struct ath_softc *sc, s */ bf_first->bf_last = bf_prev; - /* - * setup first desc with rate and aggr info - */ - ath_tx_set_ratectrl(sc, bf_first->bf_node, bf_first); - - /* - * Setup the last descriptor in the list. - * - * bf_first->bf_lastds already points to it; the rate - * control information needs to be squirreled away here - * as well ans clearing the moreaggr/paddelim fields. - */ - ath_hal_setuplasttxdesc(sc->sc_ah, bf_first->bf_lastds, - bf_first->bf_desc); - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: end\n", __func__); } @@ -1272,7 +1254,7 @@ ath_tx_setds(struct ath_softc *sc, struc /* Set rate control and descriptor chain for this frame */ ath_tx_set_ratectrl(sc, bf->bf_node, bf); - ath_tx_chaindesclist(sc, bf); + ath_tx_chaindesclist(sc, ds, bf, 0, 0, 0); } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 07:46:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 939DCA22; Tue, 6 Nov 2012 07:46:07 +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 775588FC1B; Tue, 6 Nov 2012 07:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA67k7UK011872; Tue, 6 Nov 2012 07:46:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA67k7JU011870; Tue, 6 Nov 2012 07:46:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211060746.qA67k7JU011870@svn.freebsd.org> From: Dimitry Andric Date: Tue, 6 Nov 2012 07:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242657 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 07:46:07 -0000 Author: dim Date: Tue Nov 6 07:46:07 2012 New Revision: 242657 URL: http://svnweb.freebsd.org/changeset/base/242657 Log: MFC r242380: Pull in r165377 from upstream llvm trunk: X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others. Otherwise it will try to use SSE patterns and fail horribly if sse is disabled. Fixes PR14035. This should fix the following assertion failure: Assertion failed: (Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!"), function getFPReg, file contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp, line 330. which can show up when compiling contrib/compiler-rt, using -march=i686 through -march=pentium3 (CPU's which do support fcmov, but don't support SSE2). Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Nov 6 06:19:11 2012 (r242656) +++ stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Nov 6 07:46:07 2012 (r242657) @@ -443,6 +443,11 @@ def CMOV_GR16 : I<0, Pseudo, "#CMOV_GR16* PSEUDO!", [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2, imm:$cond, EFLAGS))]>; +} // Predicates = [NoCMov] + +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE1. +let Predicates = [FPStackf32] in def CMOV_RFP32 : I<0, Pseudo, (outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2, i8imm:$cond), @@ -450,6 +455,9 @@ def CMOV_RFP32 : I<0, Pseudo, [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2, imm:$cond, EFLAGS))]>; +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE2. +let Predicates = [FPStackf64] in def CMOV_RFP64 : I<0, Pseudo, (outs RFP64:$dst), (ins RFP64:$src1, RFP64:$src2, i8imm:$cond), @@ -464,7 +472,6 @@ def CMOV_RFP80 : I<0, Pseudo, [(set RFP80:$dst, (X86cmov RFP80:$src1, RFP80:$src2, imm:$cond, EFLAGS))]>; -} // Predicates = [NoCMov] } // UsesCustomInserter = 1, Uses = [EFLAGS] From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 07:51:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F953B9E; Tue, 6 Nov 2012 07:51:21 +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 260568FC0C; Tue, 6 Nov 2012 07:51:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA67pLjg012731; Tue, 6 Nov 2012 07:51:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA67pKC4012730; Tue, 6 Nov 2012 07:51:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211060751.qA67pKC4012730@svn.freebsd.org> From: Dimitry Andric Date: Tue, 6 Nov 2012 07:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242658 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 07:51:21 -0000 Author: dim Date: Tue Nov 6 07:51:20 2012 New Revision: 242658 URL: http://svnweb.freebsd.org/changeset/base/242658 Log: Fix typo in bsd.compiler.mk. Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Nov 6 07:46:07 2012 (r242657) +++ head/share/mk/bsd.compiler.mk Tue Nov 6 07:51:20 2012 (r242658) @@ -14,7 +14,7 @@ COMPILER_TYPE:= gcc . elif ${_COMPILER_VERSION:Mclang} COMPILER_TYPE:= clang . else -.error Unable to determing compiler type for ${CC} +.error Unable to determine compiler type for ${CC} . endif . undef _COMPILER_VERSION . endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 08:01:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB301EB6; Tue, 6 Nov 2012 08:01:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 714758FC08; Tue, 6 Nov 2012 08:01:55 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA681n1w011427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 Nov 2012 19:01:51 +1100 Date: Tue, 6 Nov 2012 19:01:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky Subject: Re: svn commit: r242619 - in head/sys: dev/usb/serial sys In-Reply-To: <201211051750.qA5Hof8U049831@svn.freebsd.org> Message-ID: <20121106161421.F4852@besplex.bde.org> References: <201211051750.qA5Hof8U049831@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-479278205-1352188909=:4852" X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=It1G68Dg c=1 sm=1 a=pBnjnFNEGTgA:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=QX0dRIIV8bwA:10 a=LEBpqzH6nSD3--BwmjQA:9 a=45ClL6m2LaAA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 08:01:58 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-479278205-1352188909=:4852 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 5 Nov 2012, Hans Petter Selasky wrote: > Log: > Add a jitter buffer in the common USB serial driver code which > temporarily stores characters if the TTY buffer is full when > used a as a console. This can happen when a console is suspended. (Non-broken) console drivers cannot block or even use normal locking (except possibly mtx_trylock()). That's for the low-level part. > Also properly do the flow stop signalling when this happens and > flow start when the condition changes back to normal again. For the high-level part, (non-broken) console drivers have hardware flow control locked off in their lock state flags. It may be unlocked by users with write access to the lock state device, but then it is the user's fault for breaking console i/o by blocking it. This might be fixed in the following: % diff -c2 ./dev/usb/serial/usb_serial.c~ ./dev/usb/serial/usb_serial.c % *** ./dev/usb/serial/usb_serial.c~=09Tue Apr 10 01:48:34 2012 % --- ./dev/usb/serial/usb_serial.c=09Tue Apr 10 01:48:57 2012 % *************** % *** 331,336 **** %=20 % =09tp =3D tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx); % - =09if (tp =3D=3D NULL) % - =09=09return (ENOMEM); %=20 % =09/* Check if the client has a custom TTY name */ % --- 331,334 ---- % *************** % *** 369,376 **** % =09=09ucom_cons_softc =3D sc; %=20 % ! =09=09memset(&t, 0, sizeof(t)); % ! =09=09t.c_ispeed =3D ucom_cons_baud; % ! =09=09t.c_ospeed =3D t.c_ispeed; % =09=09t.c_cflag =3D CS8; %=20 % =09=09mtx_lock(ucom_cons_softc->sc_mtx); % --- 367,375 ---- % =09=09ucom_cons_softc =3D sc; %=20 % ! =09=09tty_init_console(tp, ucom_cons_baud); % ! =09=09t =3D tp->t_termios_init_in; % ! #ifdef GARBAGE /* maybe usb can't do all modes, but CS8 by itself is in= valid */ % =09=09t.c_cflag =3D CS8; % + #endif %=20 % =09=09mtx_lock(ucom_cons_softc->sc_mtx); % *************** % *** 1080,1084 **** %=20 % =09=09/* XXX the TTY layer should call "open()" first! */ % !=20 % =09=09error =3D ucom_open(tp); % =09=09if (error) { % --- 1079,1087 ---- %=20 % =09=09/* XXX the TTY layer should call "open()" first! */ % ! =09=09/* % ! =09=09 * Not quite; its ordering is partly backwards, but some % ! =09=09 * parameters must be set early in ttydev_open(), possibly % ! =09=09 * before calling ttydevsw_open(). % ! =09=09 */ % =09=09error =3D ucom_open(tp); % =09=09if (error) { % *************** % *** 1091,1094 **** % --- 1094,1098 ---- % =09/* Check requested parameters. */ % =09if (t->c_ispeed && (t->c_ispeed !=3D t->c_ospeed)) { % + =09=09/* XXX c_ospeed =3D=3D 0 is perfectly valid. */ % =09=09DPRINTF("mismatch ispeed and ospeed\n"); % =09=09error =3D EINVAL; Without the tty_init_console() call, the special lock state initialization for consoles can't work. This is part of a larger patch set for console initialization. Most drivers aren't missing the tty_init_console() call, but many don't pass the speed, so the speed isn't locked properly. The upper layers are broken too. The idea of a replay buffer for fixing console drivers is good, but quite complicated. I use one in the following to fix syscons a little. It must use atomic ops quite carefully. Note that it is for an old version of FreeBSD. syscons is also missing the tty_init_console() call, but the old version of FreeBSD is too old to have tty_init_console() so the patch is missing the fix for that. % diff -c2 ./dev/syscons/scmouse.c~ ./dev/syscons/scmouse.c % *** ./dev/syscons/scmouse.c~=09Fri May 25 15:01:31 2007 % --- ./dev/syscons/scmouse.c=09Wed Feb 22 21:21:47 2012 % *************** % *** 35,38 **** % --- 35,39 ---- % #include % #include % + #include % #include % #include For kdb_active in some macros in syscons.h. % diff -c2 ./dev/syscons/syscons.c~ ./dev/syscons/syscons.c % *** ./dev/syscons/syscons.c~=09Thu Aug 14 15:47:30 2008 % --- ./dev/syscons/syscons.c=09Fri Mar 2 08:44:37 2012 % *************** % *** 1,2 **** % --- 1,6 ---- % + int bde_kill_bde_wait =3D 1; % + int bde_wait_delay =3D 10 * 1000; % + int bde_wait_verbose =3D 0; % +=20 % /*- % * Copyright (c) 1992-1998 S=F8ren Schmidt Debugging cruft. % *************** % *** 70,73 **** % --- 74,78 ---- % #include % #endif % + #include %=20 % #include % *************** % *** 166,170 **** % #define ISTTYOPEN(tp)=09((tp) && ((tp)->t_state & TS_ISOPEN)) %=20 % ! static=09int=09=09debugger; %=20 % /* prototypes */ % --- 171,175 ---- % #define ISTTYOPEN(tp)=09((tp) && ((tp)->t_state & TS_ISOPEN)) %=20 % ! static=09int=09=09debugger =3D 1; %=20 % /* prototypes */ Unbreak the `debugger' flag a little. This flag used to be set on debugger entry to avoid bugs like calling wakeup() for screen savers in debugger mode. This flag is still checked, but the console call for setting it was axed. Now there is a different console call (with differently wrong semantics) for setting it, but it is still not set there. But this version is too old to have the new console call, though old enough to not have the axed one. So hack on the variable by setting it here. This doesn't cause too many problems in non-debugger mode. The current version of this patch doesn't have the replay buffer, but handles this variable as well as possible by setting it in the new console call. % *************** % *** 246,249 **** % --- 251,315 ---- % }; %=20 % + static char bde_putc_log[0x40000]; % + static int bde_putc_logindex; % + static int bde_putc_scrindex; This is the replay buffer. % +=20 % + static void % + bde_putc(int c) % + { % + =09static u_short attrs[2] =3D { FG_YELLOW << 8, FG_LIGHTRED << 8 }; % + =09static u_short * const scrptr =3D (short *)0xc00b8000; % + =09int attr, ind; % +=20 % + =09attr =3D attrs[PCPU_GET(cpuid) % 2]; % + =09do % + =09=09ind =3D bde_putc_scrindex; % + =09while (atomic_cmpset_rel_int(&bde_putc_scrindex, ind, ind + 1) =3D= =3D 0); % + =09scrptr[5 * 80 + (ind % (15 * 80))] =3D attr | (c & 0xff); % + =09bde_putc_log[ind % sizeof(bde_putc_log)] =3D c; % + } When normal output is blocked, it is not completely blocked but is always atomically splatted into the frame buffer, which is assumed to exist and to be CGA/EGA/VGA 80x25 text mode. This makes a mess of the frame buffer, but it is readable enough to debug deadlocks where normal output is never unblocked. The special output in the frame buffer is completely overwritten by screen updates if normal output is unblocked. It is replayed as normal output then. % +=20 % + static void % + bde_puts(const char *s) % + { % + =09while (*s !=3D '\0') % + =09=09bde_putc(*s++); % + } Convenience function. It has no formatting. Linefeeds get put into the frame buffer as hard 0xa characters. % +=20 % + static void % + bde_wait(void) % + { % + =09int timeout; % +=20 % + =09if (bde_kill_bde_wait) % + =09=09return; % + =09if (!bde_wait_verbose) { % + =09=09DELAY(bde_wait_delay); % + =09=09return; % + =09} % + =09bde_puts("hit any key to abort wait of 300 seconds..."); % + =09timeout =3D 300 * 1000; % + =09do { % + =09=09if (cncheckc() !=3D -1) % + =09=09=09break; % + =09=09DELAY(1000); % + =09} while (--timeout !=3D 0); % + =09bde_puts("done"); % + } A delay is sometimes need to see the special output in its special place, to watch deadlocks building up. % +=20 % + void bde_printf_emerg(const char *fmt, ...); % + void % + bde_printf_emerg(const char *fmt, ...) % + { % + =09va_list ap; % + =09char buf[256]; % +=20 % + =09va_start(ap, fmt); % + =09vsnprintf(buf, sizeof(buf) - 3, fmt, ap); % + =09// strcat(buf, "!E!"); % + =09bde_puts(buf); % + =09// bde_wait(); % + } % +=20 % int % sc_probe_unit(int unit, int flags) This is called in places where printf() is likely to deadlock. Printf() and the message buffer and top-level console output have been broken using locking in code that cannot use normal locks. My version avoids some of these deadlocks essentially by blowing the locks open after a delay. The above can be used to force some output without waiting for the full top-level delay, with the output normally containing info about the deadlock state and it being blown open. % *************** % *** 1463,1467 **** % --- 1529,1535 ---- % =09 len =3D q_to_b(rbp, buf, PCBURST); % =09 splx(s); % + =09 mtx_lock_spin(&scp->scr_lock); % =09 sc_puts(scp, buf, len); % + =09 mtx_unlock_spin(&scp->scr_lock); % =09 s =3D spltty(); % =09} Locking like this tends to deadlock, but syscons uses it elsewhere and IIRC I added it here so that I could assert that lock is always held in sc_puts(). The easiest way for this to deadlock is for the system to be UP and be doing normal (non-console) syscons output via sc_puts() (perhaps not from here) and for a fast interrupt or NMI handler to call printf(). It is a bug for them to call printf(), but printf() might be needed to debug them, and at least NMI handlers on at least x86 have always had this bug. printf()s are also useful in trap(), and most traps are not prevented by spinlocking. OTOH, syscons output is highly non-reentrant, so some locking is needed. The printf() from NMI will just have to block while the lock is held. But only normal output needs to block. A less-highly non-reentrant console driver would merge the special output into the normal output better. One way to do this is to have separate vty for this and to atomically switch to and from this vty for all low-level console output. This has the advantage and the disadvantage that alll low-level console output is kept completely separate. It is easier to read but harder to see when it is separate. % *************** % *** 1534,1541 **** % struct tty *tp; % #endif /* !SC_NO_HISTORY */ % ! int s; %=20 % /* assert(sc_console !=3D NULL) */ %=20 % #ifndef SC_NO_HISTORY % if (scp =3D=3D scp->sc->cur_scp && scp->status & SLKED) { % --- 1602,1634 ---- % struct tty *tp; % #endif /* !SC_NO_HISTORY */ % ! int need_unlock, s; %=20 % /* assert(sc_console !=3D NULL) */ %=20 % + /* % + * syscons has extremely confused and dysfunctional locking, with % + * not just 1, but 2 deadlocking spin mutexes to work around here, % + * plus a tty lock which doesn't work automatically since these % + * (tty lock only in -current) % + * spin mutexes provide some necessary additional locking in a bad % + * way, plus old spltty() locking which has no effect except to % + * mark some of the places that may be missing mutex locking. % + * % + * Yikes, mtx_trylock() is not implemented for spin mutexes. % + */ % + if (!cold && % + =09(mtx_owned(&scp->sc->video_mtx) || mtx_owned(&scp->scr_lock))) { % + =09bde_putc(c); % + =09bde_wait(); % + =09return; % + } This just detects if the console is locked and does only the special output when it is. % + need_unlock =3D 0; % + if (!cold && !kdb_active) { % + =09/* XXX, races from no trylock, problems with later vidlocks... */ % + =09mtx_lock_spin(&scp->scr_lock); % + =09SC_VIDEO_LOCK(scp->sc); % + =09need_unlock =3D 1; % + } % + This locks the console for the case of direct low-level console output. Without mtx_trylock(), it is racy. % #ifndef SC_NO_HISTORY % if (scp =3D=3D scp->sc->cur_scp && scp->status & SLKED) { % *************** % *** 1558,1561 **** % --- 1651,1660 ---- % if (kernel_console_ts !=3D NULL) % =09scp->ts =3D kernel_console_ts; % +=20 % + /* Replay log. */ % + while (bde_putc_logindex !=3D atomic_load_acq_int(&bde_putc_scrinde= x)) % + =09sc_puts(scp, &bde_putc_log[bde_putc_logindex++ % sizeof(bde_putc_log= )], % + =09=091); % +=20 % buf[0] =3D c; % sc_puts(scp, buf, 1); Log replay is very easy, even with sufficient atomicity. % *************** % *** 1565,1568 **** % --- 1664,1671 ---- % sccnupdate(scp); % splx(s); % + if (need_unlock) { % + =09SC_VIDEO_UNLOCK(scp->sc); % + =09mtx_unlock_spin(&scp->scr_lock); % + } % } % This unlocks the console for the case of direct low-level console output. % *************** % *** 2506,2511 **** % sc_puts(scr_stat *scp, u_char *buf, int len) % { % - int need_unlock =3D 0; % -=20 % #ifdef DEV_SPLASH % /* make screensaver happy */ % --- 2609,2612 ---- % *************** % *** 2514,2527 **** % #endif %=20 % ! if (scp->tsw) { % ! =09if (!kdb_active && !mtx_owned(&scp->scr_lock)) { % ! =09=09need_unlock =3D 1; % ! =09=09mtx_lock_spin(&scp->scr_lock); % ! =09} % =09(*scp->tsw->te_puts)(scp, buf, len); % - =09if (need_unlock) % - =09=09mtx_unlock_spin(&scp->scr_lock); % - } % -=20 % if (scp->sc->delayed_next_scr) % =09sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1); % --- 2615,2620 ---- % #endif %=20 % ! if (scp->tsw) % =09(*scp->tsw->te_puts)(scp, buf, len); % if (scp->sc->delayed_next_scr) % =09sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1); Here (at the start of scr_puts()) is too late to acquire the necessary locks. Deadlock would have to be handled... Now, scr_lock is supposed to be acquired by callers, and deadlocks there are supposed not to happen. This also fixes some style bugs -- the kdb_active code was copied from somwhere with a more normal style and it has wrong indentation for syscons. % diff -c2 ./dev/syscons/syscons.h~ ./dev/syscons/syscons.h % *** ./dev/syscons/syscons.h~=09Sat Mar 8 23:59:07 2008 % --- ./dev/syscons/syscons.h=09Fri Mar 2 08:44:25 2012 % *************** % *** 35,40 **** % #define=09_DEV_SYSCONS_SYSCONS_H_ %=20 % ! #include % ! #include %=20 % /* machine-dependent part of the header */ % --- 35,40 ---- % #define=09_DEV_SYSCONS_SYSCONS_H_ %=20 % ! #include % ! #include %=20 % /* machine-dependent part of the header */ Namespace de-pollution. % *************** % *** 517,520 **** % --- 517,546 ---- % #define ISSIGVALID(sig)=09((sig) > 0 && (sig) < NSIG) %=20 % + /* % + * XXX this must (bogusly) be recursive, else we get instant reboots % + * (instead of deadlock like we would expect) when the ipi NMI % + * handler calls printf(). Note that this locking is completely % + * wrong. Before it, the videoio_in_progress counter was used % + * to avoid some harmful things including recursion which may be % + * the start of more harmful things. Now the locking just allows % + * recursion and any harmful things reachable by it. The locking % + * should at least use trylock and avoid recursion, as before. % + * % + * Also, this locking is mostly unrelated to its claimed purpose of % + * protecting printf() output. Recursion can happen for that, and % + * then the locking provides no protection. Our own console grabbing % + * now handles this better anyway. Grabbing doesn't prevent recursion, % + * but printf() now has some serialization that limits recursion. % + * For user writes versus each other, we had Giant locking of everythin= g % + * at the time that this locking was added. Now we hopefully have tty % + * locking instead, but it is not so clear that we have it for everythi= ng % + * (I think we have it for writes but not for all parts of reads). % + * % + * One very broken case remains: debugger output vs everything else: % + * - in the recursive case, we just allow debugger output, so we have % + * large races % + * - int the non-recursive case, we used to deadlock. Now we ignore th= e % + * lock, so we have large races in this case too. % + */ % #define SC_VIDEO_LOCKINIT(sc)=09=09=09=09=09=09\ % =09=09mtx_init(&(sc)->video_mtx, "syscons video lock", NULL,=09\ Previous versions tried to kill this lock and run into the above problems. There are still 2 spinlocks and now in -current 1 tty-level lock where this version has only Giant (but IIRC the tty-level lock is still just Giant, and there are cases during initialization where there is still only Giant and no tty-level lock for all types of tty drivers (for new-bus parts). % *************** % *** 522,531 **** % #define SC_VIDEO_LOCK(sc)=09=09=09=09=09=09\ % =09=09do {=09=09=09=09=09=09=09\ % ! =09=09=09if (!cold)=09=09=09=09=09\ % =09=09=09=09mtx_lock_spin(&(sc)->video_mtx);=09\ % =09=09} while(0) % #define SC_VIDEO_UNLOCK(sc)=09=09=09=09=09=09\ % =09=09do {=09=09=09=09=09=09=09\ % ! =09=09=09if (!cold)=09=09=09=09=09\ % =09=09=09=09mtx_unlock_spin(&(sc)->video_mtx);=09\ % =09=09} while(0) % --- 548,557 ---- % #define SC_VIDEO_LOCK(sc)=09=09=09=09=09=09\ % =09=09do {=09=09=09=09=09=09=09\ % ! =09=09=09if (!cold && !kdb_active)=09=09=09\ % =09=09=09=09mtx_lock_spin(&(sc)->video_mtx);=09\ % =09=09} while(0) % #define SC_VIDEO_UNLOCK(sc)=09=09=09=09=09=09\ % =09=09do {=09=09=09=09=09=09=09\ % ! =09=09=09if (!cold && !kdb_active)=09=09=09\ % =09=09=09=09mtx_unlock_spin(&(sc)->video_mtx);=09\ % =09=09} while(0) As in some serial console drivers, ignore our locking when kdb_active. The special output makes this less necessary. Normal locking calls while (kdb_active) might deadlock and should cause assertion failures. -current doesn't do the assertions, and the above anti-deadlock code in console output turns deadlock into special output that you can seee and a return to avoid deadlock. Any console driver can use a replay buffer to avoid deadlocks in the driver itself and guarantee that the output actually goes out provided there are no deadlocks in upper layers. But it needs to actually do the i/o to a readable place without blocking or otherwise delaying or de-serializing the output for printf() to work properly. Bruce --0-479278205-1352188909=:4852-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 18:58:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 549465DF; Tue, 6 Nov 2012 18:58:58 +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 3AF1C8FC0C; Tue, 6 Nov 2012 18:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6IwwsX028929; Tue, 6 Nov 2012 18:58:58 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6IwwJe028927; Tue, 6 Nov 2012 18:58:58 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211061858.qA6IwwJe028927@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 Nov 2012 18:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242666 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 18:58:58 -0000 Author: np Date: Tue Nov 6 18:58:57 2012 New Revision: 242666 URL: http://svnweb.freebsd.org/changeset/base/242666 Log: Remove the tid from the software table (and bump down the in-use counter) when the syncache doesn't want the driver to reply to an incoming SYN. This fixes a harmless bug where tids_in_use would go out of sync with the hardware counter. MFC after: 3 days Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 6 17:20:17 2012 (r242665) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Nov 6 18:58:57 2012 (r242666) @@ -1202,6 +1202,7 @@ do_pass_accept_req(struct sge_iq *iq, co if (m) m->m_pkthdr.rcvif = ifp; + remove_tid(sc, synqe->tid); release_synqe(synqe); /* about to exit function */ free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 19:26:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1257D10; Tue, 6 Nov 2012 19:26: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 C4DED8FC0A; Tue, 6 Nov 2012 19:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6JQamP033372; Tue, 6 Nov 2012 19:26:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6JQauO033366; Tue, 6 Nov 2012 19:26:36 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211061926.qA6JQauO033366@svn.freebsd.org> From: Devin Teske Date: Tue, 6 Nov 2012 19:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242667 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 19:26:37 -0000 Author: dteske Date: Tue Nov 6 19:26:36 2012 New Revision: 242667 URL: http://svnweb.freebsd.org/changeset/base/242667 Log: Add ontop of my existing boot loader Forth code, including support for submenus. See menusets.4th(8) for additional details including examples. Discussed on arch and recommended for inclusion at the devsummit. This change does not alter the appearance or user experience, only enhances possibilities. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Added: head/sys/boot/forth/menusets.4th (contents, props changed) head/sys/boot/forth/menusets.4th.8 (contents, props changed) Modified: head/sys/boot/forth/loader.4th head/sys/boot/forth/menu-commands.4th head/sys/boot/forth/menu.4th Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Tue Nov 6 18:58:57 2012 (r242666) +++ head/sys/boot/forth/loader.4th Tue Nov 6 19:26:36 2012 (r242667) @@ -60,6 +60,12 @@ only forth also support-functions also b else drop then + s" menusets-unset" + sfind if + execute + else + drop + then ; : boot Modified: head/sys/boot/forth/menu-commands.4th ============================================================================== --- head/sys/boot/forth/menu-commands.4th Tue Nov 6 18:58:57 2012 (r242666) +++ head/sys/boot/forth/menu-commands.4th Tue Nov 6 19:26:36 2012 (r242667) @@ -26,6 +26,8 @@ marker task-menu-commands.4th +include /boot/menusets.4th + variable kernel_state variable root_state @@ -223,3 +225,10 @@ variable root_state TRUE \ loop menu again ; + +: goto_menu ( N M -- N TRUE ) + menu-unset + menuset-loadsetnum ( n m -- n ) + menu-redraw + TRUE \ Loop menu again +; Modified: head/sys/boot/forth/menu.4th ============================================================================== --- head/sys/boot/forth/menu.4th Tue Nov 6 18:58:57 2012 (r242666) +++ head/sys/boot/forth/menu.4th Tue Nov 6 19:26:36 2012 (r242667) @@ -493,6 +493,10 @@ create init_text8 255 allot \ Initialize "Reboot" menu state variable (prevents double-entry) false menurebootadded ! + menu_start + 1- menuidx ! \ Initialize the starting index for the menu + 0 menurow ! \ Initialize the starting position for the menu + 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') begin \ If the "Options:" separator, print it. @@ -841,6 +845,8 @@ create init_text8 255 allot exit ( pedantic; never reached ) then + dup menureboot @ = if 0 reboot then + \ Evaluate the decimal ASCII value against known menu item \ key associations and act accordingly @@ -932,8 +938,7 @@ create init_text8 255 allot \ continue if less than 57 until drop \ loop iterator - - menureboot @ = if 0 reboot then + drop \ key pressed again \ Non-operational key was pressed; repeat ; @@ -1005,6 +1010,18 @@ create init_text8 255 allot -rot 2dup 12 + c! rot \ replace 'N' evaluate + s" 0 toggle_stateN !" \ used by toggle_menuitem + -rot 2dup 14 + c! rot \ replace 'N' + evaluate + + s" 0 cycle_stateN !" \ used by cycle_menuitem + -rot 2dup 13 + c! rot \ replace 'N' + evaluate + + s" 0 init_textN c!" \ used by toggle_menuitem + -rot 2dup 11 + c! rot \ replace 'N' + evaluate + 1+ dup 56 > \ increment, continue if less than 57 until drop \ iterator Added: head/sys/boot/forth/menusets.4th ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/forth/menusets.4th Tue Nov 6 19:26:36 2012 (r242667) @@ -0,0 +1,610 @@ +\ Copyright (c) 2012 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 (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$ + +marker task-menusets.4th + +variable menuset_use_name + +create menuset_affixbuf 255 allot +create menuset_x 1 allot +create menuset_y 1 allot + +: menuset-loadvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + s" set cmdbuf='set ${type}_${var}=\$'" evaluate + s" cmdbuf" getenv swap drop ( -- u1 ) \ get string length + menuset_use_name @ true = if + s" set cmdbuf=${cmdbuf}${affix}${type}_${var}" + ( u1 -- u1 c-addr2 u2 ) + else + s" set cmdbuf=${cmdbuf}${type}set${affix}_${var}" + ( u1 -- u1 c-addr2 u2 ) + then + evaluate ( u1 c-addr2 u2 -- u1 ) + s" cmdbuf" getenv ( u1 -- u1 c-addr2 u2 ) + rot 2 pick 2 pick over + -rot + tuck - + ( u1 c-addr2 u2 -- c-addr2 u2 c-addr1 u1 ) + \ Generate a string representing rvalue inheritance var + getenv dup -1 = if + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 -1 ) + \ NOT set -- clean up the stack + drop ( c-addr2 u2 -1 -- c-addr2 u2 ) + 2drop ( c-addr2 u2 -- ) + else + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 c-addr1 u1 ) + \ SET -- execute cmdbuf (c-addr2/u2) to inherit value + 2drop ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 ) + evaluate ( c-addr2 u2 -- ) + then + + s" cmdbuf" unsetenv +; + +: menuset-unloadvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + menuset_use_name @ true = if + s" set buf=${affix}${type}_${var}" + else + s" set buf=${type}set${affix}_${var}" + then + evaluate + s" buf" getenv unsetenv + s" buf" unsetenv +; + +: menuset-loadmenuvar ( -- ) + s" set type=menu" evaluate + menuset-loadvar +; + +: menuset-unloadmenuvar ( -- ) + s" set type=menu" evaluate + menuset-unloadvar +; + +: menuset-loadxvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $x is "1" through "8" + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + s" set cmdbuf='set ${type}_${var}[${x}]=\$'" evaluate + s" cmdbuf" getenv swap drop ( -- u1 ) \ get string length + menuset_use_name @ true = if + s" set cmdbuf=${cmdbuf}${affix}${type}_${var}[${x}]" + ( u1 -- u1 c-addr2 u2 ) + else + s" set cmdbuf=${cmdbuf}${type}set${affix}_${var}[${x}]" + ( u1 -- u1 c-addr2 u2 ) + then + evaluate ( u1 c-addr2 u2 -- u1 ) + s" cmdbuf" getenv ( u1 -- u1 c-addr2 u2 ) + rot 2 pick 2 pick over + -rot + tuck - + ( u1 c-addr2 u2 -- c-addr2 u2 c-addr1 u1 ) + \ Generate a string representing rvalue inheritance var + getenv dup -1 = if + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 -1 ) + \ NOT set -- clean up the stack + drop ( c-addr2 u2 -1 -- c-addr2 u2 ) + 2drop ( c-addr2 u2 -- ) + else + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 c-addr1 u1 ) + \ SET -- execute cmdbuf (c-addr2/u2) to inherit value + 2drop ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 ) + evaluate ( c-addr2 u2 -- ) + then + + s" cmdbuf" unsetenv +; + +: menuset-unloadxvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $x is "1" through "8" + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + menuset_use_name @ true = if + s" set buf=${affix}${type}_${var}[${x}]" + else + s" set buf=${type}set${affix}_${var}[${x}]" + then + evaluate + s" buf" getenv unsetenv + s" buf" unsetenv +; + +: menuset-loadansixvar ( -- ) + s" set type=ansi" evaluate + menuset-loadxvar +; + +: menuset-unloadansixvar ( -- ) + s" set type=ansi" evaluate + menuset-unloadxvar +; + +: menuset-loadmenuxvar ( -- ) + s" set type=menu" evaluate + menuset-loadxvar +; + +: menuset-unloadmenuxvar ( -- ) + s" set type=menu" evaluate + menuset-unloadxvar +; + +: menuset-loadtoggledxvar ( -- ) + s" set type=toggled" evaluate + menuset-loadxvar +; + +: menuset-unloadtoggledxvar ( -- ) + s" set type=toggled" evaluate + menuset-unloadxvar +; + +: menuset-loadxyvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $x is "1" through "8" + \ $y is "0" through "9" + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + s" set cmdbuf='set ${type}_${var}[${x}][${y}]=\$'" evaluate + s" cmdbuf" getenv swap drop ( -- u1 ) \ get string length + menuset_use_name @ true = if + s" set cmdbuf=${cmdbuf}${affix}${type}_${var}[${x}][${y}]" + ( u1 -- u1 c-addr2 u2 ) + else + s" set cmdbuf=${cmdbuf}${type}set${affix}_${var}[${x}][${y}]" + ( u1 -- u1 c-addr2 u2 ) + then + evaluate ( u1 c-addr2 u2 -- u1 ) + s" cmdbuf" getenv ( u1 -- u1 c-addr2 u2 ) + rot 2 pick 2 pick over + -rot + tuck - + ( u1 c-addr2 u2 -- c-addr2 u2 c-addr1 u1 ) + \ Generate a string representing rvalue inheritance var + getenv dup -1 = if + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 -1 ) + \ NOT set -- clean up the stack + drop ( c-addr2 u2 -1 -- c-addr2 u2 ) + 2drop ( c-addr2 u2 -- ) + else + ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 c-addr1 u1 ) + \ SET -- execute cmdbuf (c-addr2/u2) to inherit value + 2drop ( c-addr2 u2 c-addr1 u1 -- c-addr2 u2 ) + evaluate ( c-addr2 u2 -- ) + then + + s" cmdbuf" unsetenv +; + +: menuset-unloadxyvar ( -- ) + + \ menuset_use_name is true or false + \ $type should be set to one of: + \ menu toggled ansi + \ $var should be set to one of: + \ caption command keycode text ... + \ $x is "1" through "8" + \ $y is "0" through "9" + \ $affix is either prefix (menuset_use_name is true) + \ or infix (menuset_use_name is false) + + menuset_use_name @ true = if + s" set buf=${affix}${type}_${var}[${x}][${y}]" + else + s" set buf=${type}set${affix}_${var}[${x}][${y}]" + then + evaluate + s" buf" getenv unsetenv + s" buf" unsetenv +; + +: menuset-loadansixyvar ( -- ) + s" set type=ansi" evaluate + menuset-loadxyvar +; + +: menuset-unloadansixyvar ( -- ) + s" set type=ansi" evaluate + menuset-unloadxyvar +; + +: menuset-loadmenuxyvar ( -- ) + s" set type=menu" evaluate + menuset-loadxyvar +; + +: menuset-unloadmenuxyvar ( -- ) + s" set type=menu" evaluate + menuset-unloadxyvar +; + +: menuset-setnum-namevar ( N -- C-Addr/U ) + + s" menuset_nameNNNNN" ( n -- n c-addr1 u1 ) \ variable basename + drop 12 ( n c-addr1 u1 -- n c-addr1 12 ) \ remove "NNNNN" + rot ( n c-addr1 12 -- c-addr1 12 n ) \ move number on top + + \ convert to string + s>d <# #s #> ( c-addr1 12 n -- c-addr1 12 c-addr2 u2 ) + + \ Combine strings + begin ( using u2 in c-addr2/u2 pair as countdown to zero ) + over ( c-addr1 u1 c-addr2 u2 -- continued below ) + ( c-addr1 u1 c-addr2 u2 c-addr2 ) \ copy src-addr + c@ ( c-addr1 u1 c-addr2 u2 c-addr2 -- continued below ) + ( c-addr1 u1 c-addr2 u2 c ) \ get next src-addr byte + 4 pick 4 pick + ( c-addr1 u1 c-addr2 u2 c -- continued below ) + ( c-addr1 u1 c-addr2 u2 c c-addr1 u1 ) + \ get destination c-addr1/u1 pair + + ( c-addr1 u1 c-addr2 u2 c c-addr1 u1 -- cont. below ) + ( c-addr1 u1 c-addr2 u2 c c-addr3 ) + \ combine dest-c-addr to get dest-addr for byte + c! ( c-addr1 u1 c-addr2 u2 c c-addr3 -- continued below ) + ( c-addr1 u1 c-addr2 u2 ) + \ store the current src-addr byte into dest-addr + + 2swap 1+ 2swap \ increment u1 in destination c-addr1/u1 pair + swap 1+ swap \ increment c-addr2 in source c-addr2/u2 pair + 1- \ decrement u2 in the source c-addr2/u2 pair + + dup 0= \ time to break? + until + + 2drop ( c-addr1 u1 c-addr2 u2 -- c-addr1 u1 ) + \ drop temporary number-format conversion c-addr2/u2 +; + +: menuset-checksetnum ( N -- ) + + \ + \ adjust input to be both positive and no-higher than 65535 + \ + abs dup 65535 > if drop 65535 then ( n -- n ) + + \ + \ The next few blocks will determine if we should use the default + \ methodology (referencing the original numeric stack-input), or if- + \ instead $menuset_name{N} has been defined wherein we would then + \ use the value thereof as the prefix to every menu variable. + \ + + false menuset_use_name ! \ assume name is not set + + menuset-setnum-namevar + \ + \ We now have a string that is the assembled variable name to check + \ for... $menuset_name{N}. Let's check for it. + \ + 2dup ( c-addr1 u1 -- c-addr1 u1 c-addr1 u1 ) \ save a copy + getenv dup -1 <> if ( c-addr1 u1 c-addr1 u1 -- c-addr1 u1 c-addr2 u2 ) + \ The variable is set. Let's clean up the stack leaving only + \ its value for later use. + + true menuset_use_name ! + 2swap 2drop ( c-addr1 u1 c-addr2 u2 -- c-addr2 u2 ) + \ drop assembled variable name, leave the value + else ( c-addr1 u1 c-addr1 u1 -- c-addr1 u1 -1 ) \ no such variable + \ The variable is not set. Let's clean up the stack leaving the + \ string [portion] representing the original numeric input. + + drop ( c-addr1 u1 -1 -- c-addr1 u1 ) \ drop -1 result + 12 - swap 12 + swap ( c-addr1 u1 -- c-addr2 u2 ) + \ truncate to original numeric stack-input + then + + \ + \ Now, depending on whether $menuset_name{N} has been set, we have + \ either the value thereof to be used as a prefix to all menu_* + \ variables or we have a string representing the numeric stack-input + \ to be used as a "set{N}" infix to the same menu_* variables. + \ + \ For example, if the stack-input is 1 and menuset_name1 is NOT set + \ the following variables will be referenced: + \ ansiset1_caption[x] -> ansi_caption[x] + \ ansiset1_caption[x][y] -> ansi_caption[x][y] + \ menuset1_acpi -> menu_acpi + \ menuset1_caption[x] -> menu_caption[x] + \ menuset1_caption[x][y] -> menu_caption[x][y] + \ menuset1_command[x] -> menu_command[x] + \ menuset1_init -> ``evaluated'' + \ menuset1_init[x] -> menu_init[x] + \ menuset1_keycode[x] -> menu_keycode[x] + \ menuset1_options -> menu_options + \ menuset1_optionstext -> menu_optionstext + \ menuset1_reboot -> menu_reboot + \ toggledset1_ansi[x] -> toggled_ansi[x] + \ toggledset1_text[x] -> toggled_text[x] + \ otherwise, the following variables are referenced (where {name} + \ represents the value of $menuset_name1 (given 1 as stack-input): + \ {name}ansi_caption[x] -> ansi_caption[x] + \ {name}ansi_caption[x][y] -> ansi_caption[x][y] + \ {name}menu_acpi -> menu_acpi + \ {name}menu_caption[x] -> menu_caption[x] + \ {name}menu_caption[x][y] -> menu_caption[x][y] + \ {name}menu_command[x] -> menu_command[x] + \ {name}menu_init -> ``evaluated'' + \ {name}menu_init[x] -> menu_init[x] + \ {name}menu_keycode[x] -> menu_keycode[x] + \ {name}menu_options -> menu_options + \ {name}menu_optionstext -> menu_optionstext + \ {name}menu_reboot -> menu_reboot + \ {name}toggled_ansi[x] -> toggled_ansi[x] + \ {name}toggled_text[x] -> toggled_text[x] + \ + \ Note that menuset{N}_init and {name}menu_init are the initializers + \ for the entire menu (for wholly dynamic menus) opposed to the per- + \ menuitem initializers (with [x] afterward). The whole-menu init + \ routine is evaluated and not passed down to $menu_init (which + \ would result in double evaluation). By doing this, the initializer + \ can initialize the menuset before we transfer it to active-duty. + \ + + \ + \ Copy our affixation (prefix or infix depending on menuset_use_name) + \ to our buffer so that we can safely use the s-quote (s") buf again. + \ + menuset_affixbuf 0 2swap ( c-addr2 u2 -- c-addr1 0 c-addr2 u2 ) + begin ( using u2 in c-addr2/u2 pair as countdown to zero ) + over ( c-addr1 u1 c-addr2 u2 -- c-addr1 u1 c-addr2 u2 c-addr2 ) + c@ ( c-addr1 u1 c-addr2 u2 -- c-addr1 u1 c-addr2 u2 c ) + 4 pick 4 pick + ( c-addr1 u1 c-addr2 u2 c -- continued below ) + ( c-addr1 u1 c-addr2 u2 c c-addr1 u1 ) + + ( c-addr1 u1 c-addr2 u2 c c-addr1 u1 -- continued below ) + ( c-addr1 u1 c-addr2 u2 c c-addr3 ) + c! ( c-addr1 u1 c-addr2 u2 c c-addr3 -- continued below ) + ( c-addr1 u1 c-addr2 u2 ) + 2swap 1+ 2swap \ increment affixbuf byte position/count + swap 1+ swap \ increment strbuf pointer (source c-addr2) + 1- \ decrement strbuf byte count (source u2) + dup 0= \ time to break? + until + 2drop ( c-addr1 u1 c-addr2 u2 -- c-addr1 u1 ) \ drop strbuf c-addr2/u2 + + \ + \ Create a variable for referencing our affix data (prefix or infix + \ depending on menuset_use_name as described above). This variable will + \ be temporary and only used to simplify cmdbuf assembly. + \ + s" affix" setenv ( c-addr1 u1 -- ) +; + +: menuset-cleanup ( -- ) + s" type" unsetenv + s" var" unsetenv + s" x" unsetenv + s" y" unsetenv + s" affix" unsetenv +; + +: menuset-loadsetnum ( N -- ) + + menuset-checksetnum ( n -- ) + + \ + \ From here out, we use temporary environment variables to make + \ dealing with variable-length strings easier. + \ + \ menuset_use_name is true or false + \ $affix should be use appropriated w/respect to menuset_use_name + \ + + \ ... menu_init ... + s" set var=init" evaluate + menuset-loadmenuvar + + \ If menu_init was set by the above, evaluate it here-and-now + \ so that the remaining variables are influenced by its actions + s" menu_init" 2dup getenv dup -1 <> if + 2swap unsetenv \ don't want later menu-create to re-call this + evaluate + else + drop 2drop ( n c-addr u -1 -- n ) + then + + [char] 1 ( -- x ) \ Loop range ASCII '1' (49) to '8' (56) + begin + dup menuset_x tuck c! 1 s" x" setenv \ set loop iterator and $x + + s" set var=caption" evaluate + + \ ... menu_caption[x] ... + menuset-loadmenuxvar + + \ ... ansi_caption[x] ... + menuset-loadansixvar + + [char] 0 ( x -- x y ) \ Inner Loop ASCII '1' (48) to '9' (57) + begin + dup menuset_y tuck c! 1 s" y" setenv + \ set inner loop iterator and $y + + \ ... menu_caption[x][y] ... + menuset-loadmenuxyvar + + \ ... ansi_caption[x][y] ... + menuset-loadansixyvar + + 1+ dup 57 > ( x y -- y' 0|-1 ) \ increment and test + until + drop ( x y -- x ) + + \ ... menu_command[x] ... + s" set var=command" evaluate + menuset-loadmenuxvar + + \ ... menu_init[x] ... + s" set var=init" evaluate + menuset-loadmenuxvar + + \ ... menu_keycode[x] ... + s" set var=keycode" evaluate + menuset-loadmenuxvar + + \ ... toggled_text[x] ... + s" set var=text" evaluate + menuset-loadtoggledxvar + + \ ... toggled_ansi[x] ... + s" set var=ansi" evaluate + menuset-loadtoggledxvar + + 1+ dup 56 > ( x -- x' 0|-1 ) \ increment iterator + \ continue if less than 57 + until + drop ( x -- ) \ loop iterator + + \ ... menu_reboot ... + s" set var=reboot" evaluate + menuset-loadmenuvar + + \ ... menu_acpi ... + s" set var=acpi" evaluate + menuset-loadmenuvar + + \ ... menu_options ... + s" set var=options" evaluate + menuset-loadmenuvar + + \ ... menu_options ... + s" set var=optionstext" evaluate + menuset-loadmenuvar + + menuset-cleanup +; + +: menuset-loadinitial ( -- ) + s" menuset_initial" getenv dup -1 <> if + ?number 0<> if + menuset-loadsetnum + then + else + drop \ cruft + then +; + +: menusets-unset ( -- ) + + s" menuset_initial" unsetenv + + 1 begin + dup menuset-checksetnum ( n n -- n ) + + dup menuset-setnum-namevar ( n n -- n ) + unsetenv + + \ If the current menuset does not populate the first menuitem, + \ we stop completely. + + menuset_use_name @ true = if + s" set buf=${affix}menu_caption[1]" + else + s" set buf=menuset${affix}_caption[1]" + then + evaluate s" buf" getenv getenv -1 = if + drop ( n -- ) + s" buf" unsetenv + menuset-cleanup + exit + else + drop ( n c-addr2 -- n ) \ unused + then + + [char] 1 ( n -- n x ) \ Loop range ASCII '1' (49) to '8' (56) + begin + dup menuset_x tuck c! 1 s" x" setenv \ set $x to x + + s" set var=caption" evaluate + menuset-unloadmenuxvar + menuset-unloadmenuxvar + menuset-unloadansixvar + [char] 0 ( n x -- n x y ) \ Inner loop '0' to '9' + begin + dup menuset_y tuck c! 1 s" y" setenv + \ sets $y to y + menuset-unloadmenuxyvar + menuset-unloadansixyvar + 1+ dup 57 > ( n x y -- n x y' 0|-1 ) + until + drop ( n x y -- n x ) + s" set var=command" evaluate menuset-unloadmenuxvar + s" set var=init" evaluate menuset-unloadmenuxvar + s" set var=keycode" evaluate menuset-unloadmenuxvar + s" set var=text" evaluate menuset-unloadtoggledxvar + s" set var=ansi" evaluate menuset-unloadtoggledxvar + + 1+ dup 56 > ( x -- x' 0|-1 ) \ increment and test + until + drop ( n x -- n ) \ loop iterator + + s" set var=acpi" evaluate menuset-unloadmenuvar + s" set var=init" evaluate menuset-unloadmenuvar + s" set var=options" evaluate menuset-unloadmenuvar + s" set var=optionstext" evaluate menuset-unloadmenuvar + s" set var=reboot" evaluate menuset-unloadmenuvar + + 1+ dup 65535 > ( n -- n' 0|-1 ) \ increment and test + until + drop ( n' -- ) \ loop iterator + + s" buf" unsetenv + menuset-cleanup +; Added: head/sys/boot/forth/menusets.4th.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/forth/menusets.4th.8 Tue Nov 6 19:26:36 2012 (r242667) @@ -0,0 +1,372 @@ +.\" Copyright (c) 2012 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 (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 November 5, 2012 +.Dt MENUSETS.4TH 8 +.Os +.Sh NAME +.Nm menusets.4th +.Nd FreeBSD dynamic submenu boot module +.Sh DESCRIPTION +The file that goes by the name of +.Nm +is a set of commands designed to add submenu functionality to the dynamic menu +system provided by +.Xr menu.4th 8 . +Submenus are managed through a system of carefully named environment variables. +The commands of +.Nm +by themselves are not enough for most uses. +Please refer to the examples below for the most common situations, and to +.Xr menu.4th 8 +for additional commands. +.Pp +Before using any of the commands provided in +.Nm , +it must be included +through the command: +.Pp +.Dl include menusets.4th +.Pp +This line is present in the default +.Pa /boot/menu-commands.4th +file, so it is not needed (and should not be re-issued) in a normal setup. +.Pp +The commands provided by it are: +.Pp +.Bl -tag -width menuset-loadinitial -compact -offset indent +.It Ic menuset-loadsetnum +Takes a single integer on the stack to identify the menuset environment +variables to be activated (see environment variables below). +.It Ic menuset-loadinitial +If $menuset_initial is set, passes the value to menuset-loadsetnum. +The value must be a number. +.It Ic menusets-unset +Unsets the environment variables associated with all menusets. +Increments starting at 1 and stops at the first unconfigured menuset. +A menuset is considered configured if the caption for item 1 is set. +.El +.Pp +The environment variables that effect its behavior are: +.Bl -tag -width bootfile -offset indent +.It Va menuset_initial +Number to pass to menuset-loadsetnum when menuset-loadinitial is called. +.It Va menuset_nameN +Used to give a name to a menuset. +.El +.Pp +When a menuset is NOT given a name (the default), +menuset N is comprised of the following environment variables: +.Pp +.Bl -tag -width menusetN_caption[x][y] -compact -offset indent +.It Va ansisetN_caption[x] +-> ansi_caption[x] +.It Va ansisetN_caption[x][y] +-> ansi_caption[x][y] +.It Va menusetN_acpi +-> menu_acpi +.It Va menusetN_caption[x] +-> menu_caption[x] +.It Va menusetN_caption[x][y] +-> menu_caption[x][y] +.It Va menusetN_command[x] +-> menu_command[x] +.It Va menusetN_init +-> +.Dq Li evaluated +.It Va menusetN_init[x] +-> menu_init[x] +.It Va menusetN_keycode[x] +-> menu_keycode[x] +.It Va menusetN_options +-> menu_options +.It Va menusetN_optionstext +-> menu_optionstext +.It Va menusetN_reboot +-> menu_reboot +.It Va toggledsetN_ansi[x] +-> toggled_ansi[x] +.It Va toggledsetN_text[x] +-> toggled_text[x] +.El +.Pp +When you choose to give a menuset a name (by setting $menuset_nameN), +menuset N is instead comprised of the following environment variables: +.Pp +.Bl -tag -width NAMEmenu_caption[x][y] -compact -offset indent +.It Va NAMEansi_caption[x] +-> ansi_caption[x] +.It Va NAMEansi_caption[x][y] +-> ansi_caption[x][y] +.It Va NAMEmenu_acpi +-> menu_acpi +.It Va NAMEmenu_caption[x] +-> menu_caption[x] +.It Va NAMEmenu_caption[x][y] +-> menu_caption[x][y] +.It Va NAMEmenu_command[x] +-> menu_command[x] +.It Va NAMEmenu_init +-> +.Dq Li evaluated +.It Va NAMEmenu_init[x] +-> menu_init[x] +.It Va NAMEmenu_keycode[x] +-> menu_keycode[x] +.It Va NAMEmenu_options +-> menu_options +.It Va NAMEmenu_optionstext +-> menu_optionstext +.It Va NAMEmenu_reboot +-> menu_reboot +.It Va NAMEtoggled_ansi[x] +-> toggled_ansi[x] +.It Va NAMEtoggled_text[x] +-> toggled_text[x] +.El +.Pp +where +.Dq Li NAME +is the value of $menuset_nameN. +In the case of $NAMEmenu_init ($menusetN_init when $menuset_nameN is unset), +the value is evaluated as an FICL statement. +This can be used to dynamically adjust the menuset variables right before the +menu is activated. +.Pp +In addition, +.Nm +provides the following FICL words: +.Pp +.Bl -tag -width menuset -compact -offset indent +.It Ic menuset-checksetnum ( N -- ) +Given a single integer on the stack, sets a global variable +.Va menuset_use_name +to a boolean based on whether $menuset_nameN is set (true) or not (false). +Also sets $affix temporary variable (prefix or infix depending on +menuset_use_name). +Automatically called by menuset-loadsetnum and menusets-unset. +.It Ic menuset-loadvar ( -- ) +Used indirectly to shorten syntax and mitigate dictionary size. +Requires the following temporary environment variables: +.Pp +.Bl -tag -width affix -compact -offset indent +.It Va type +should be set to one of: menu toggled ansi +.It Va var +should be set to one of: caption command keycode text ... +.It Va affix +either a prefix (menuset_use_name is true) or infix (menuset_use_name is false) +.El +.Pp +If the global +.Va menuset_use_name +is true, the variable ${type}_${var} is made to +equal the value of the variable ${affix}${type}_${var} +(note: in this case menuset-checksetnum has set $affix to $menuset_nameN). +Otherwise (when +.Va menuset_use_name +is false), the variable ${type}_${var} is made to +equal the value of the variable ${type}set${affix}_${var} +(note: in this case menuset-checksetnum has set $affix to N). +.Pp +Both the global variable +.Va menuset_use_name +and the environment variable $affix are automatically handled by +menuset-checksetnum above (which is automatically called by +menuset-loadsetnum). +.It Ic menuset-unloadvar ( -- ) +Used indirectly to shorten syntax and mitigate dictionary size. +Like menuset-loadvar except it unsets the menuset variable. +If global +.Va menuset_use_name +is true ($affix is $menuset_nameN), +variable ${affix}${type}_${var} is unset. +Otherwise, $affix is N and variable ${type}set${affix}_${var} is unset. +.It Ic menuset-loadmenuvar ( -- ) +Sets $type to +.Dq menu +and calls menuset-loadvar. +.It Ic menuset-unloadmenuvar ( -- ) +Sets $type to +.Dq menu +and calls menuset-unloadvar. +.It Ic menuset-loadxvar ( -- ) +Like menuset-loadvar except it takes an additional temporary variable $x. +If the global +.Va menuset_use_name +is true (making $affix equal $menuset_nameN), +sets variable ${type}_${var}[${x}] to variable ${affix}${type}_${var}[${x}]. +Otherwise ($affix being N), sets the same variable to instead +${type}set{affix}_${var}[${x}]. +.It Ic menuset-unloadxvar ( -- ) +Like menuset-loadxvar except it unsets the menuset variable. +If global +.Va menuset_use_name +is true, unsets ${affix}${type}_${var}[${x}]. +Otherwise, unsets ${type}set${affix}_${var}[${x}]. +.It Ic menuset-loadansixvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-loadxvar +.It Ic menuset-unloadansixvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-unloadxvar +.It Ic menuset-loadmenuxvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-loadxvar +.It Ic menuset-unloadmenuxvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-unloadxvar +.It Ic menuset-loadtoggledxvar ( -- ) +Sets $type to +.Dq toggled +and calls menuset-loadxvar +.It Ic menuset-unloadtoggledxvar ( -- ) +Sets $type to +.Dq toggled +and calls menuset-unloadxvar +.It Ic menuset-loadxyvar ( -- ) +Like menuset-loadxvar except it takes an additional temporary variable $y. +If the global +.Va menuset_use_name +is true ($affix is $menuset_nameN), +sets variable ${type}_${var}[${x}][${y}] to ${affix}${type}_${var}[${x}][${y}]. +Otherwise ($affix is N) sets the same variable to instead +${type}set${affix}_${var}[${x}][${y}]. +.It Ic menuset-unloadxyvar ( -- ) +Like menuset-loadxyvar except it unsets the menuset variable. +If the global +.Va menuset_use_name +is true, unsets ${affix}${type}_${var}[${x}][${y}]. +Otherwise, unsets ${type}set${affix}_${var}[${x}][${y}]. +.It Ic menuset-loadansixyvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-loadxyvar. +.It Ic menuset-unloadansixyvar ( -- ) +Sets $type to +.Dq ansi +and calls menuset-unloadxyvar. +.It Ic menuset-loadmenuxyvar ( -- ) +Sets $type to +.Dq menu +and calls menuset-loadxyvar. +.It Ic menuset-unloadmenuxyvar ( -- ) +Sets $type to +.Dq menu +and calls menuset-unloadxyvar. +.It Ic menuset-setnum-namevar ( N -- C-Addr/U ) +Takes a single integer on the stack and replaces it with a string (in c-addr/u +format) whose value is +.Dq menuset_nameN . +For example, if given 1 returns +.Dq menuset_name1 . +.It Ic menuset-cleanup ( N -- ) +Unsets all the various temporary variables, currently +.Va type , +.Va var , +.Va x , +.Va y , +and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 19:50:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29AD98DE; Tue, 6 Nov 2012 19:50:46 +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 0E4E88FC0A; Tue, 6 Nov 2012 19:50:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6Jojgs037719; Tue, 6 Nov 2012 19:50:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6JojEf037718; Tue, 6 Nov 2012 19:50:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211061950.qA6JojEf037718@svn.freebsd.org> From: Devin Teske Date: Tue, 6 Nov 2012 19:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242668 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 19:50:46 -0000 Author: dteske Date: Tue Nov 6 19:50:45 2012 New Revision: 242668 URL: http://svnweb.freebsd.org/changeset/base/242668 Log: Fix c/p error in comment. Approved by: adrian (co-mentor) (implicit) Modified: head/sys/boot/forth/menusets.4th Modified: head/sys/boot/forth/menusets.4th ============================================================================== --- head/sys/boot/forth/menusets.4th Tue Nov 6 19:26:36 2012 (r242667) +++ head/sys/boot/forth/menusets.4th Tue Nov 6 19:50:45 2012 (r242668) @@ -524,7 +524,7 @@ create menuset_y 1 allot s" set var=options" evaluate menuset-loadmenuvar - \ ... menu_options ... + \ ... menu_optionstext ... s" set var=optionstext" evaluate menuset-loadmenuvar From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 19:51:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45F8FA75; Tue, 6 Nov 2012 19:51: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 271008FC08; Tue, 6 Nov 2012 19:51:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6JptD5037949; Tue, 6 Nov 2012 19:51:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6Jpt2J037948; Tue, 6 Nov 2012 19:51:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211061951.qA6Jpt2J037948@svn.freebsd.org> From: Devin Teske Date: Tue, 6 Nov 2012 19:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242669 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 19:51:55 -0000 Author: dteske Date: Tue Nov 6 19:51:54 2012 New Revision: 242669 URL: http://svnweb.freebsd.org/changeset/base/242669 Log: Fix funny comment. Approved by: adrian (co-mentor) (implicit) Modified: head/sys/boot/forth/menusets.4th Modified: head/sys/boot/forth/menusets.4th ============================================================================== --- head/sys/boot/forth/menusets.4th Tue Nov 6 19:50:45 2012 (r242668) +++ head/sys/boot/forth/menusets.4th Tue Nov 6 19:51:54 2012 (r242669) @@ -444,7 +444,7 @@ create menuset_y 1 allot \ dealing with variable-length strings easier. \ \ menuset_use_name is true or false - \ $affix should be use appropriated w/respect to menuset_use_name + \ $affix should be used appropriately w/respect to menuset_use_name \ \ ... menu_init ... From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 20:22:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3FC88CF; Tue, 6 Nov 2012 20:22: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 A89788FC0C; Tue, 6 Nov 2012 20:22:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6KMdVR043065; Tue, 6 Nov 2012 20:22:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6KMd7M043063; Tue, 6 Nov 2012 20:22:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211062022.qA6KMd7M043063@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 Nov 2012 20:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242671 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 20:22:39 -0000 Author: np Date: Tue Nov 6 20:22:39 2012 New Revision: 242671 URL: http://svnweb.freebsd.org/changeset/base/242671 Log: Make sure the inp hasn't been dropped before trying to access its socket and tcpcb. MFC after: 3 days Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Nov 6 19:54:24 2012 (r242670) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Nov 6 20:22:39 2012 (r242671) @@ -982,7 +982,6 @@ do_abort_req(struct sge_iq *iq, const st struct sge_wrq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; - struct socket *so; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1008,7 +1007,6 @@ do_abort_req(struct sge_iq *iq, const st INP_WLOCK(inp); tp = intotcpcb(inp); - so = inp->inp_socket; CTR6(KTR_CXGBE, "%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d", @@ -1026,10 +1024,16 @@ do_abort_req(struct sge_iq *iq, const st } toep->flags |= TPF_ABORT_SHUTDOWN; - so_error_set(so, abort_status_to_errno(tp, cpl->status)); - tp = tcp_close(tp); - if (tp == NULL) - INP_WLOCK(inp); /* re-acquire */ + if ((inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) == 0) { + struct socket *so = inp->inp_socket; + + if (so != NULL) + so_error_set(so, abort_status_to_errno(tp, + cpl->status)); + tp = tcp_close(tp); + if (tp == NULL) + INP_WLOCK(inp); /* re-acquire */ + } final_cpl_received(toep); done: From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 21:07:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5827D90E; Tue, 6 Nov 2012 21:07:05 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC1D8FC08; Tue, 6 Nov 2012 21:07:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6L75Sc049710; Tue, 6 Nov 2012 21:07:05 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6L75At049708; Tue, 6 Nov 2012 21:07:05 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201211062107.qA6L75At049708@svn.freebsd.org> From: Guy Helmer Date: Tue, 6 Nov 2012 21:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242673 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:07:05 -0000 Author: ghelmer Date: Tue Nov 6 21:07:04 2012 New Revision: 242673 URL: http://svnweb.freebsd.org/changeset/base/242673 Log: Work around a race in bpfread() by validating the hold buffer pointer before freeing it. Otherwise, we can lose a buffer and cause a panic in catchpacket(). Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Nov 6 20:30:23 2012 (r242672) +++ head/sys/net/bpf.c Tue Nov 6 21:07:04 2012 (r242673) @@ -954,10 +954,13 @@ bpfread(struct cdev *dev, struct uio *ui error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio); BPFD_LOCK(d); - d->bd_fbuf = d->bd_hbuf; - d->bd_hbuf = NULL; - d->bd_hlen = 0; - bpf_buf_reclaimed(d); + if (d->bd_hbuf != NULL) { + /* Free the hold buffer only if it is still valid. */ + d->bd_fbuf = d->bd_hbuf; + d->bd_hbuf = NULL; + d->bd_hlen = 0; + bpf_buf_reclaimed(d); + } BPFD_UNLOCK(d); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 21:13:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E159CAD5; Tue, 6 Nov 2012 21:13:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C288D8FC0A; Tue, 6 Nov 2012 21:13:50 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so988586lbd.13 for ; Tue, 06 Nov 2012 13:13:48 -0800 (PST) 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=oWbmlHSrjzT9A/T6jQMCdHuBrxnj2HIIwNrIdY6pvrE=; b=JRGeD+46+Y0U4efgylFOJ8zcMuBzNDujpMcwVflAwqFWTopTBurwMn3smskUPZXmyT /5XCWJUg6Wuooi41qyA2fdPM9bBSnVTjOqB+9lnLrbuQ8eaq7v4LCQEhiitCAl9Y3mGT trdanQBGcEwfpBIE2apBPcbdkFGHmSIkYIcd11CuNTLDpS7ZEyjMbbu2x4JflFSP4jRH UD1pplurGZiYNwH4PkL7ixqKuHT0jFuu4wc7Aw6L27NBLwwOUhw6Nltl+3N2qnGoy7E8 jFTT32EwNxbS1SMck5TEjvmy0ckFWgljOrd/47jh4gn92q25i2ttB7saM6WpW5qHSHFS Fqbg== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr2410942lab.9.1352236428741; Tue, 06 Nov 2012 13:13:48 -0800 (PST) Received: by 10.112.144.101 with HTTP; Tue, 6 Nov 2012 13:13:48 -0800 (PST) In-Reply-To: <201211060410.qA64AWC0075490@svn.freebsd.org> References: <201211060410.qA64AWC0075490@svn.freebsd.org> Date: Tue, 6 Nov 2012 13:13:48 -0800 Message-ID: Subject: Re: svn commit: r242655 - head/sys/kern From: Garrett Cooper To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:13:52 -0000 On Mon, Nov 5, 2012 at 8:10 PM, Alfred Perlstein wrote: > Author: alfred > Date: Tue Nov 6 04:10:32 2012 > New Revision: 242655 > URL: http://svnweb.freebsd.org/changeset/base/242655 > > Log: > export VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS via sysctl. > > On several platforms the are determined by too many nested #defines to be > easily discernible. This will aid in development of auto-tuning. > > Modified: > head/sys/kern/kern_malloc.c > This should be vm_offset > Modified: head/sys/kern/kern_malloc.c > > ============================================================================== > --- head/sys/kern/kern_malloc.c Tue Nov 6 02:43:41 2012 (r242654) > +++ head/sys/kern/kern_malloc.c Tue Nov 6 04:10:32 2012 (r242655) > @@ -186,6 +186,14 @@ struct { > */ > static uma_zone_t mt_zone; > > +static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > + &vm_min_kernel_address, 0, "Min kernel address"); > + > +static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > + &vm_max_kernel_address, 0, "Max kernel address"); > + > u_long vm_kmem_size; > SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, > "Size of kernel memory"); > This should probably be vm_offset_t for both values and there's already some goo in the arch specific portion of sparc64 which handles this with different type width (as noted by the tinderbox failures). Typechecking in this case per-platform should be ok with u_long outside of sparc64: /sys/amd64/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/arm/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/i386/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/ia64/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/mips/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/mips/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/powerpc/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/powerpc/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/sparc64/include/_types.h:typedef __uint64_t __vm_offset_t; $ for i in `ls /sys/*/*/*machdep*.c | xargs dirname | xargs dirname | sort -u`; do egrep -qr 'vm_(min|max)_kernel_address' $i && echo "${i##*/} derp" || echo "${i##*/} ok"; done amd64 ok arm ok dev ok i386 ok ia64 ok mips ok pc98 ok powerpc ok sparc64 derp x86 ok So maybe talking to Marius about consolidating that would be a good idea (or just applying a simple sed hack to rename the variable and move on). Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 21:16:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7235AD78; Tue, 6 Nov 2012 21:16:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5826C8FC0C; Tue, 6 Nov 2012 21:16:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6LGkaD051975; Tue, 6 Nov 2012 21:16:46 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LGk1B051973; Tue, 6 Nov 2012 21:16:46 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201211062116.qA6LGk1B051973@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 6 Nov 2012 21:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242674 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:16:46 -0000 Author: gavin Date: Tue Nov 6 21:16:45 2012 New Revision: 242674 URL: http://svnweb.freebsd.org/changeset/base/242674 Log: Merge r242396 from head: Genericise the (out of date) instructions from moving from stable to current. Modified: stable/9/UPDATING (contents, props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Nov 6 21:07:04 2012 (r242673) +++ stable/9/UPDATING Tue Nov 6 21:16:45 2012 (r242674) @@ -1423,7 +1423,7 @@ COMMON ITEMS: - To upgrade in-place from 8.x-stable to current + To upgrade in-place from stable to current ---------------------------------------------- make buildworld [9] From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 21:53:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B88389C; Tue, 6 Nov 2012 21:53:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FDB78FC18; Tue, 6 Nov 2012 21:53:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6LrH9A061270; Tue, 6 Nov 2012 21:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LrHaP061267; Tue, 6 Nov 2012 21:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201211062153.qA6LrHaP061267@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Nov 2012 21:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242677 - stable/9/sys/powerpc/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:53:17 -0000 Author: nwhitehorn Date: Tue Nov 6 21:53:17 2012 New Revision: 242677 URL: http://svnweb.freebsd.org/changeset/base/242677 Log: MFC r240860: Move the prototype for savectx from cpu.h to pcb.h, as it is on other platforms, as well as putting it in an #ifdef KERNEL block. Modified: stable/9/sys/powerpc/include/cpu.h stable/9/sys/powerpc/include/pcb.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/include/cpu.h ============================================================================== --- stable/9/sys/powerpc/include/cpu.h Tue Nov 6 21:48:45 2012 (r242676) +++ stable/9/sys/powerpc/include/cpu.h Tue Nov 6 21:53:17 2012 (r242677) @@ -98,7 +98,4 @@ void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); -/* XXX the following should not be here. */ -void savectx(struct pcb *) __returns_twice; - #endif /* _MACHINE_CPU_H_ */ Modified: stable/9/sys/powerpc/include/pcb.h ============================================================================== --- stable/9/sys/powerpc/include/pcb.h Tue Nov 6 21:48:45 2012 (r242676) +++ stable/9/sys/powerpc/include/pcb.h Tue Nov 6 21:53:17 2012 (r242677) @@ -89,6 +89,7 @@ extern struct pmap *curpm; extern struct proc *fpuproc; void makectx(struct trapframe *, struct pcb *); +void savectx(struct pcb *) __returns_twice; #endif #endif /* _MACHINE_PCB_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 21:54:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78ECAA56; Tue, 6 Nov 2012 21:54:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE018FC14; Tue, 6 Nov 2012 21:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6Lsjbq061658; Tue, 6 Nov 2012 21:54:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6LsjlM061656; Tue, 6 Nov 2012 21:54:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201211062154.qA6LsjlM061656@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Nov 2012 21:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242678 - stable/9/sys/powerpc/powermac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 21:54:45 -0000 Author: nwhitehorn Date: Tue Nov 6 21:54:45 2012 New Revision: 242678 URL: http://svnweb.freebsd.org/changeset/base/242678 Log: MFC r242315: Work around broken device tree on last-generation PowerPC iMacs (PowerMac12,1), which have a mac-io MPIC cell that indifies itself as the root PIC despite the actual root PIC being on the northbridge. No CPC945 systems have a mac-io PIC that does anything so just don't attach on CPC945 (U4) systems. Modified: stable/9/sys/powerpc/powermac/openpic_macio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- stable/9/sys/powerpc/powermac/openpic_macio.c Tue Nov 6 21:53:17 2012 (r242677) +++ stable/9/sys/powerpc/powermac/openpic_macio.c Tue Nov 6 21:54:45 2012 (r242678) @@ -94,6 +94,10 @@ openpic_macio_probe(device_t dev) if (strcmp(type, "open-pic") != 0) return (ENXIO); + /* On some U4 systems, there is a phantom MPIC in the mac-io cell */ + if (OF_finddevice("/u4") != (phandle_t)-1) + return (ENXIO); + device_set_desc(dev, OPENPIC_DEVSTR); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 22:46:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 829FFFAA; Tue, 6 Nov 2012 22:46:11 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66BD78FC08; Tue, 6 Nov 2012 22:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6MkBL5074586; Tue, 6 Nov 2012 22:46:11 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6MkBwl074584; Tue, 6 Nov 2012 22:46:11 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201211062246.qA6MkBwl074584@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 6 Nov 2012 22:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242679 - stable/9/share/syscons/keymaps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 22:46:11 -0000 Author: gavin Date: Tue Nov 6 22:46:11 2012 New Revision: 242679 URL: http://svnweb.freebsd.org/changeset/base/242679 Log: Merge r241866 from head: Add German, French, Portuguese and Spanish names for the Spanish Dvorak keymap. Modified: stable/9/share/syscons/keymaps/INDEX.keymaps Directory Properties: stable/9/share/syscons/keymaps/ (props changed) Modified: stable/9/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/9/share/syscons/keymaps/INDEX.keymaps Tue Nov 6 21:54:45 2012 (r242678) +++ stable/9/share/syscons/keymaps/INDEX.keymaps Tue Nov 6 22:46:11 2012 (r242679) @@ -381,6 +381,10 @@ ru.koi8-r.win.kbd:es:Ruso koi8-r (winkey ru.koi8-r.win.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r (winkeys) spanish.dvorak.kbd:en:Spanish Dvorak +spanish.dvorak.kbd:de:Spanisch Dvorak +spanish.dvorak.kbd:fr:Espagnol Dvorak +spanish.dvorak.kbd:pt:Espanhol Dvorak +spanish.dvorak.kbd:es:Español Dvorak spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 22:50:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A4E8313; Tue, 6 Nov 2012 22:50:44 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id BB3148FC14; Tue, 6 Nov 2012 22:50:43 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so793729pbb.13 for ; Tue, 06 Nov 2012 14:50:43 -0800 (PST) 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=Amw4HSwJGGcephSXhBcvjTN3AEOF8IKYXTP/++pchmE=; b=jMkVaBFWWHxCvGn8qkxmrVX0BsjIqbmCfyVM+YwDWKAtVXYanhHN/DiqF7Cdqn5eVA fQ7GBrmZsSYi84woS2Xs8QNIDOfFuiUT72Foa3SsLTQQdsTgh87CC2jnXBnZx+2fxhz9 re1NIQ4Vu1MipQq/kowYQP2GDaYoMknspnZs8V3OPr1pIbXOGIRvDxKNkX40R4+xCIGs gtT5eAlFF7+fa5R5AXXCYYIDK6sPqUONe9ggeSEx+I7z/gpsZxwB8X1zxdXIqL6KqTg5 qA6qfwb5UKaBmrOHuf2fc8R3FcG/jLG/DCwq/qR5Ps3sbsxddQ+Lqo2dNqKbeqh/ME04 7XWQ== MIME-Version: 1.0 Received: by 10.69.1.9 with SMTP id bc9mr7765431pbd.61.1352242243276; Tue, 06 Nov 2012 14:50:43 -0800 (PST) Received: by 10.66.148.227 with HTTP; Tue, 6 Nov 2012 14:50:43 -0800 (PST) In-Reply-To: <201210221750.q9MHot26061585@svn.freebsd.org> References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 17:50:43 -0500 Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Ben Kaduk To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 22:50:44 -0000 On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wrote: > Author: kib > Date: Mon Oct 22 17:50:54 2012 > New Revision: 241896 > URL: http://svn.freebsd.org/changeset/base/241896 > > Log: > Remove the support for using non-mpsafe filesystem modules. > > In particular, do not lock Giant conditionally when calling into the > filesystem module, remove the VFS_LOCK_GIANT() and related > macros. Stop handling buffers belonging to non-mpsafe filesystems. > > The VFS_VERSION is bumped to indicate the interface change which does > not result in the interface signatures changes. > > Conducted and reviewed by: attilio > Tested by: pho > Sorry for late reply. % --- head/sys/sys/namei.h 2011/12/29 12:28:05 228952 % +++ head/sys/sys/namei.h 2012/10/22 17:50:54 241896 % @@ -144,15 +144,11 @@ % #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ % #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ % #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ % -#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ It seems that removing the definition of MPSAFE causes out-of-tree filesystem modules to not build. Perhaps a definition can remain for some period to allow a smoother transition? Conditional on __FreeBSD_Version is the proper fix, of course, but takes longer to get everywhere. -Ben Kaduk % -#define GIANTHELD 0x02000000 /* namei() is holding giant. */ % #define AUDITVNODE1 0x04000000 /* audit the looked up vnode information */ % #define AUDITVNODE2 0x08000000 /* audit the looked up vnode information */ % #define TRAILINGSLASH 0x10000000 /* path ended in a slash */ % #define PARAMASK 0x1ffffe00 /* mask of parameter descriptors */ % % -#define NDHASGIANT(NDP) (((NDP)->ni_cnd.cn_flags & GIANTHELD) != 0) % - % /* % * Initialization of a nameidata structure. % */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 22:53:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04AB575C; Tue, 6 Nov 2012 22:53:04 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D1A928FC14; Tue, 6 Nov 2012 22:53:02 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so991040lag.13 for ; Tue, 06 Nov 2012 14:53:01 -0800 (PST) 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=CYr5pYWjbTisIv6YCY+DM0Xqb2CwKxXOQmtwxbNrCOE=; b=lkk4PTCo0XIim7ry2rHVQdN+qnBDspfxn1oi5S/eSBaGQWa2peXwO2E01/EkjUeNpP O50ay8GoutdQs6AzMCqWJuwU8elcKdcSFDdCQE1Kgauhy2B5fUwzbGB7+gLlmdjyxfOs zRc7K0mr0c1EXFwAQYW4lL8C/iX+qAemkNh/HW/dSwuuFu/nEUqTga3YRN5vi/eo3pFr qoWvtbDCuxxBAwyVh2KrgPr48O8DmygBcU+kXmU5YOzbNDAyA8nn/oHOYc5gGX8VQ8Mw EMoJfYuQkrAlbElcfwae33LEycXnWdGVPc8l7wo8LNCyJOwWAX0s+aA0Es3WOHAbRGsM ds2w== MIME-Version: 1.0 Received: by 10.112.26.67 with SMTP id j3mr1184644lbg.39.1352242381455; Tue, 06 Nov 2012 14:53:01 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 6 Nov 2012 14:53:01 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 22:53:01 +0000 X-Google-Sender-Auth: IyaqHq_8uHGx4pTUEXUh5ByUiAY Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Attilio Rao To: Ben Kaduk Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 22:53:04 -0000 On Tue, Nov 6, 2012 at 10:50 PM, Ben Kaduk wrote: > On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Oct 22 17:50:54 2012 >> New Revision: 241896 >> URL: http://svn.freebsd.org/changeset/base/241896 >> >> Log: >> Remove the support for using non-mpsafe filesystem modules. >> >> In particular, do not lock Giant conditionally when calling into the >> filesystem module, remove the VFS_LOCK_GIANT() and related >> macros. Stop handling buffers belonging to non-mpsafe filesystems. >> >> The VFS_VERSION is bumped to indicate the interface change which does >> not result in the interface signatures changes. >> >> Conducted and reviewed by: attilio >> Tested by: pho >> > > Sorry for late reply. > > % --- head/sys/sys/namei.h 2011/12/29 12:28:05 228952 > % +++ head/sys/sys/namei.h 2012/10/22 17:50:54 241896 > % @@ -144,15 +144,11 @@ > % #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ > % #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ > % #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ > % -#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ > > It seems that removing the definition of MPSAFE causes out-of-tree > filesystem modules to not build. > Perhaps a definition can remain for some period to allow a smoother transition? > Conditional on __FreeBSD_Version is the proper fix, of course, but > takes longer to get everywhere. Hi Ben, no, ports/thirdy part should be adjusted on the -CURRENT ABI. Leaving MPSAFE would just leave confusion and a way to *not do* the conversion. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:02:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CDDF145; Tue, 6 Nov 2012 23:02:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id AF5808FC0C; Tue, 6 Nov 2012 23:02:13 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA6N215W071421; Wed, 7 Nov 2012 01:02:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-DKIM: OpenDKIM Filter v2.5.2 kib.kiev.ua qA6N215W071421 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA6N21Pt071420; Wed, 7 Nov 2012 01:02:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 7 Nov 2012 01:02:01 +0200 From: Konstantin Belousov To: Ben Kaduk Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... Message-ID: <20121106230201.GN73505@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eVN8q1r3v0Uw6/qa" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:02:14 -0000 --eVN8q1r3v0Uw6/qa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 06, 2012 at 05:50:43PM -0500, Ben Kaduk wrote: > On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wr= ote: > > Author: kib > > Date: Mon Oct 22 17:50:54 2012 > > New Revision: 241896 > > URL: http://svn.freebsd.org/changeset/base/241896 > > > > Log: > > Remove the support for using non-mpsafe filesystem modules. > > > > In particular, do not lock Giant conditionally when calling into the > > filesystem module, remove the VFS_LOCK_GIANT() and related > > macros. Stop handling buffers belonging to non-mpsafe filesystems. > > > > The VFS_VERSION is bumped to indicate the interface change which does > > not result in the interface signatures changes. > > > > Conducted and reviewed by: attilio > > Tested by: pho > > >=20 > Sorry for late reply. >=20 > % --- head/sys/sys/namei.h 2011/12/29 12:28:05 228952 > % +++ head/sys/sys/namei.h 2012/10/22 17:50:54 241896 > % @@ -144,15 +144,11 @@ > % #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. = */ > % #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ > % #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ > % -#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ >=20 > It seems that removing the definition of MPSAFE causes out-of-tree > filesystem modules to not build. > Perhaps a definition can remain for some period to allow a smoother trans= ition? No, it shall not be left or restored, since its functionality is removed. > Conditional on __FreeBSD_Version is the proper fix, of course, but > takes longer to get everywhere. --eVN8q1r3v0Uw6/qa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCZlukACgkQC3+MBN1Mb4gj8wCgheQ4WQkMvoU3aoFU/4kGZqjj ap0AoIpozcNUlUgeuHvhHVlY8VY8TjEP =wQm4 -----END PGP SIGNATURE----- --eVN8q1r3v0Uw6/qa-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:03:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19FFB2C4; Tue, 6 Nov 2012 23:03:34 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id C1C448FC15; Tue, 6 Nov 2012 23:03:33 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so740269pad.13 for ; Tue, 06 Nov 2012 15:03:33 -0800 (PST) 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=wZQNMIUh5x3w3DNoo8oNKU1aoWSoKBZcpPpEMFsNJEQ=; b=lnUjz6asq2N/EYDNfXXl9LxzTlgv75n9qP1v/CutcA3rCj+oeZwKfWSCyAb4Bdq94f XrxbQGji2D+x9vsdnyWt4j3Yb75HMzkkHU5glNgIgUHrcwzIAu/3W4qpa/z3EvjfNhQO YIYWd+thEn/qI5AjxPvd+tcKAn66v48pvw056trD65dPGsz/TpJcR5BlXNdzqamNynRR oSjucs+P/5ZLZgaZR8SDQ69B1Yy4dgfqy19q2hVzmRVpUoNe5tjJAcn0vi7Cod8tNlZY UDuMmvqTLi1eS7FJOT1JJdkr6XNxSo6ZyfZoN+ZNdgCGhlyxB3dSlaoYnYwMX7S/l8xP bcEw== MIME-Version: 1.0 Received: by 10.68.229.194 with SMTP id ss2mr8026552pbc.17.1352243013065; Tue, 06 Nov 2012 15:03:33 -0800 (PST) Received: by 10.66.148.227 with HTTP; Tue, 6 Nov 2012 15:03:33 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 18:03:33 -0500 Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Ben Kaduk To: attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:03:34 -0000 On Tue, Nov 6, 2012 at 5:53 PM, Attilio Rao wrote: > On Tue, Nov 6, 2012 at 10:50 PM, Ben Kaduk wrote: >> On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wrote: > Hi Ben, > no, ports/thirdy part should be adjusted on the -CURRENT ABI. > Leaving MPSAFE would just leave confusion and a way to *not do* the conversion. Hi Attilio, I agree that port/thirdparty filesystems must be adjusted to the -current ABI. If the only change is ABI, not API, though, recompiling is sufficient; no code changes are needed. But the present state of affairs is that correct, working (MPSAFE) code is broken, and there was no possibility to make it correct for the new ABI prior to the ABI change. It seems rather inconsiderate of the users of -current (and we really want people to continue to run -current!) to gratuitously break the API (well, KPI) as well as KBI, when KPI change is not immediately necessary. I must tell the user to include "#define MPSAFE (0)" as a workaround until a patch can be committed to the port, let alone the upstream! The 10.0 release is a bit off, yet; can we not spare a few months for lag between KBI change and KPI change to allow third-parties who are paying attention to get a smooth transition? "Rebuild the port" is much easier than "observe errors, dink around for a while investigating, patch the code, and rebuild the port." MPSAFE deorbit is a long-term project (which I am very happy to see happen; thank you both Attilio and Kostantin and all!), but this step seems rushed. Why must KPI change occur in lockstep with KBI change? -Ben From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:04:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D796436; Tue, 6 Nov 2012 23:04:24 +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 0370A8FC12; Tue, 6 Nov 2012 23:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6N4NVG079680; Tue, 6 Nov 2012 23:04:23 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6N4Nhi079678; Tue, 6 Nov 2012 23:04:23 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211062304.qA6N4Nhi079678@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 6 Nov 2012 23:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242680 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:04:24 -0000 Author: mjg Date: Tue Nov 6 23:04:23 2012 New Revision: 242680 URL: http://svnweb.freebsd.org/changeset/base/242680 Log: Fix possible spurious sbunlock in sctp_sorecvmsg. Reviewed by: tuexen Approved by: trasz (mentor) MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Nov 6 22:46:11 2012 (r242679) +++ head/sys/netinet/sctputil.c Tue Nov 6 23:04:23 2012 (r242680) @@ -5197,10 +5197,10 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); - sockbuf_lock = 1; if (error) { goto release_unlocked; } + sockbuf_lock = 1; restart: From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:04:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50FE8548 for ; Tue, 6 Nov 2012 23:04:32 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 38DAE8FC15 for ; Tue, 6 Nov 2012 23:04:28 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id c10so490426eaa.13 for ; Tue, 06 Nov 2012 15:04:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=IL8nZA9n06W9rmFgnhzI6KXFuydRJm4uLGZQR/S1ORs=; b=E/xIG4t822hgPZ/UnK3DK8QxIqp8oh3OSp00fOrk0jjEJsXmnp7H3K0+XVzIhVnktK a3mNsb9dhPv5x8aCtdfyCBGTLZRKzHk2D7QXV6Awzs8OCuwHwyVhxv+icyqPrOZwsimT hy+M8FRYbhZa3FgVvD0rFxrkKoOfdVeQr2/1uxRSGDAV0/9IhnMJF4Q5RWYVqVIV2+jz o6oeiXzaHGUeySWp73+coN6DZrRDU3J4fJQBClNHsORb5msnQ586/sxM+cxbZFgYrBnh 6tHJERiytQgd0f0jjJNjAna/fbB7PQXVYmvzdpQbd0q02+DNE1WDVhLr4ahFEfc3I8JU Q89g== Received: by 10.14.1.69 with SMTP id 45mr8442521eec.23.1352243067622; Tue, 06 Nov 2012 15:04:27 -0800 (PST) Received: from rnote.ddteam.net (167-32-133-95.pool.ukrtel.net. [95.133.32.167]) by mx.google.com with ESMTPS id k2sm59586694eep.15.2012.11.06.15.04.25 (version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 15:04:26 -0800 (PST) Date: Wed, 7 Nov 2012 01:04:20 +0200 From: Aleksandr Rybalko To: Marcel Moolenaar Subject: Re: svn commit: r242523 - head/sys/dev/usb/controller Message-Id: <20121107010420.d239164b.ray@ddteam.net> In-Reply-To: <201211032105.qA3L5WAm044392@svn.freebsd.org> References: <201211032105.qA3L5WAm044392@svn.freebsd.org> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk2oxSKJP4grNUjuYJQ6BcTYceDDQQoP9enUwE1q5xS0aGk4zDwPtKLR/Z/Cd5xyUmIUWuU Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:04:32 -0000 On Sat, 3 Nov 2012 21:05:32 +0000 (UTC) Marcel Moolenaar wrote: > Author: marcel > Date: Sat Nov 3 21:05:32 2012 > New Revision: 242523 > URL: http://svn.freebsd.org/changeset/base/242523 > > Log: > Allow using the embedded EHCI host controller in Freescale SoCs > by adding the missing bits. See ehci_fsl.c for their use. > > Modified: > head/sys/dev/usb/controller/ehci.c > head/sys/dev/usb/controller/ehci.h > ----------------8<------------------ Thanks, it's help in i.MX515 case too. WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:10:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B88DA14; Tue, 6 Nov 2012 23:10:08 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 449DC8FC12; Tue, 6 Nov 2012 23:10:06 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1076978lbd.13 for ; Tue, 06 Nov 2012 15:10:05 -0800 (PST) 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=hGDLuGtL4B9ZY2wBDuYHykN3/DAA7cUs/j1bb0JjmUc=; b=gv0RkKEM4vQV/GjgASWjn0yNFls6A/Mu71MaMmRX7NwbQ5GZzHZtI7lA9Yd8YA6gQl M1Azd6NQHpaWedrrqpBj3hfAU22bfj4tY3t+rMFkWhcuC4vOM2b5enxpT7TAEd+ILf3o 5njctLoLeiTOfD9HYD3Ar0d4Y/jJE2EfrvUWWAEpnlTPvMGokGzFSevhOn1MGXMOeOVN Q4OA2QTNMdXiu6yt5BMEbc3DSExMipn7zPG6uLRrlR5TOhcOitKjjpdpOZ8LzyWxlJv9 N0h30PPqvk/9q+CieIKYDAUDnLFn5X9bMvxFDm5oIxt/fjfPInkPbI83xgw7zOTPCaMC GUzA== MIME-Version: 1.0 Received: by 10.112.36.200 with SMTP id s8mr1181097lbj.92.1352243405152; Tue, 06 Nov 2012 15:10:05 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 6 Nov 2012 15:10:05 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 23:10:05 +0000 X-Google-Sender-Auth: U84Q2CkAOzQNUjtvt7F3lHk1Wp4 Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Attilio Rao To: Ben Kaduk Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:10:08 -0000 On Tue, Nov 6, 2012 at 11:03 PM, Ben Kaduk wrote: > On Tue, Nov 6, 2012 at 5:53 PM, Attilio Rao wrote: >> On Tue, Nov 6, 2012 at 10:50 PM, Ben Kaduk wrote: >>> On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wrote: >> Hi Ben, >> no, ports/thirdy part should be adjusted on the -CURRENT ABI. >> Leaving MPSAFE would just leave confusion and a way to *not do* the conversion. > > Hi Attilio, > > I agree that port/thirdparty filesystems must be adjusted to the > -current ABI. If the only change is ABI, not API, though, recompiling > is sufficient; no code changes are needed. > But the present state of affairs is that correct, working (MPSAFE) > code is broken, and there was no possibility to make it correct for > the new ABI prior to the ABI change. It seems rather inconsiderate of > the users of -current (and we really want people to continue to run > -current!) to gratuitously break the API (well, KPI) as well as KBI, > when KPI change is not immediately necessary. I must tell the user to > include "#define MPSAFE (0)" as a workaround until a patch can be > committed to the port, let alone the upstream! The 10.0 release is a > bit off, yet; can we not spare a few months for lag between KBI change > and KPI change to allow third-parties who are paying attention to get > a smooth transition? "Rebuild the port" is much easier than "observe > errors, dink around for a while investigating, patch the code, and > rebuild the port." > MPSAFE deorbit is a long-term project (which I am very happy to see > happen; thank you both Attilio and Kostantin and all!), but this step > seems rushed. Why must KPI change occur in lockstep with KBI change? The point is that KPI/KBI of -CURRENT can change as long as __FreeBSD_version is bumped (and if you really want to know my opinion, I already see this as a forceful thing because it would not be necessary in my mind, but I second the will of the majority of developers). So, if the KPI/KBI changes all the thirdy part code, ports and everything else must adapt. MPSAFE flag is not any longer supported and code needs to be ported appropriately to -CURRENT interface. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:17:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88D9FBEA; Tue, 6 Nov 2012 23:17:33 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 360AA8FC08; Tue, 6 Nov 2012 23:17:32 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so436948dad.13 for ; Tue, 06 Nov 2012 15:17:32 -0800 (PST) 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=wwDkkNh38YLvPAL1xom2ws5MyjgPN/o/xmE8CqWasds=; b=gArMwpP/PQ9W0s+K8tCwLG7QIm13UZpaUXpkIo9hMtkNU0meSPOjB5QsI2c6yT6gbJ dVA8Umq1pLpVJlz2nvIkqgJ3IKZeUAZ8nUyiXXyQpsIbmv0OW2jVw1xtsDKKeUu0KL5b F0556ISCgJsXHbpJowGjDFn/gTawXmKZJhkHF82ALmxY4ZRSV2XeviaUsAL+PzVG99bE r3ZbZOPD3YQcjQyPrNeE/p0uNmn+h5qhfcBYA7y8iFV80gCSp6d/s3UEJm+YlKhcC2w8 BXq+vsHIXaQFSXthnHGlhE/8tS6je3D6XXHdk1cssJ+v3CrZp29+n9vfGGfjJBd2Syqf xqDg== MIME-Version: 1.0 Received: by 10.66.78.104 with SMTP id a8mr6918335pax.38.1352243852495; Tue, 06 Nov 2012 15:17:32 -0800 (PST) Received: by 10.66.148.227 with HTTP; Tue, 6 Nov 2012 15:17:32 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 18:17:32 -0500 Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Ben Kaduk To: attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:17:33 -0000 I do not wish to belabor the point; we all have better things to do with our time. Hopefully this is my last message on the topic. On Tue, Nov 6, 2012 at 6:10 PM, Attilio Rao wrote: > The point is that KPI/KBI of -CURRENT can change as long as > __FreeBSD_version is bumped (and if you really want to know my > opinion, I already see this as a forceful thing because it would not > be necessary in my mind, but I second the will of the majority of > developers). So, if the KPI/KBI changes all the thirdy part code, > ports and everything else must adapt. Yes, everything must adapt to changes in -current. I am arguing that, if it is easy to do so, we should make the user experience for *ordinary users* running -current as nice as possible. If we do not have ordinary users running current, then our code does not get real-world testing until RC builds, or even the .0 release. I think it is well-accepted that we want to have the code in -current get real-world testing; making the user experience nicer helps this to happen. To me, it seems that the user experience is nicer if the KPI change is delayed from the KBI change. We have mechanisms in place that can enforce __FreeBSD_Version of kernel modules must match the version of the running kernel, so I do not see how this procedure would lead to silent binary incompatibility. > MPSAFE flag is not any longer supported and code needs to be ported > appropriately to -CURRENT interface. That is the present state of affairs, yes. I am asking only, "think of the users; can we make things easier for them?". Maybe not in this case, but as something to keep in mind for the future. Thanks, Ben From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:20:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D28A2D75; Tue, 6 Nov 2012 23:20:35 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id A725E8FC12; Tue, 6 Nov 2012 23:20:34 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1083722lbd.13 for ; Tue, 06 Nov 2012 15:20:33 -0800 (PST) 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=63t3aHAiJhP6WyufSFWyYtWfozfQG08PG4TFbDpYf4c=; b=iF2y4V1SxIM85o+fXe9N1KhMPHUz5szQOlCwEeG4x6b64ag1oRC7K2DxF6H3rOb3bP +6SlPPzhk3cUUqVT2is1yLRzVaqonS9UpuLYVBFv5lx2oXBaI0LjEDBsTsx0oME6j8Nj rh0GRtzhNWI7WBTU0o0OlupA4nBqjKoD7sUa4Ur1htZlyCwbAJffPheFSeogFgEsP5Eg h4duoV/lSJcsS+L2tX7s6gj+DMYwpNTw1giYVryL1Ykk+bJpL0LcjR1hfPVRPxFa8l7U sfELQ6d9RWqMAutta6eh6SUofwVgEYKorHcgALb5ZtnGJfU2xS3FYKIWoxqVm0WGtO09 3MhQ== MIME-Version: 1.0 Received: by 10.112.28.98 with SMTP id a2mr1142342lbh.110.1352244033124; Tue, 06 Nov 2012 15:20:33 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 6 Nov 2012 15:20:33 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Tue, 6 Nov 2012 23:20:33 +0000 X-Google-Sender-Auth: 3ToqKg28ESJtnhM1vks475t4Dh8 Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Attilio Rao To: Ben Kaduk Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:20:36 -0000 On Tue, Nov 6, 2012 at 11:17 PM, Ben Kaduk wrote: > I do not wish to belabor the point; we all have better things to do > with our time. Hopefully this is my last message on the topic. > > On Tue, Nov 6, 2012 at 6:10 PM, Attilio Rao wrote: > >> The point is that KPI/KBI of -CURRENT can change as long as >> __FreeBSD_version is bumped (and if you really want to know my >> opinion, I already see this as a forceful thing because it would not >> be necessary in my mind, but I second the will of the majority of >> developers). So, if the KPI/KBI changes all the thirdy part code, >> ports and everything else must adapt. > > Yes, everything must adapt to changes in -current. I am arguing that, > if it is easy to do so, we should make the user experience for > *ordinary users* running -current as nice as possible. If we do not > have ordinary users running current, then our code does not get > real-world testing until RC builds, or even the .0 release. I think > it is well-accepted that we want to have the code in -current get > real-world testing; making the user experience nicer helps this to > happen. To me, it seems that the user experience is nicer if the KPI > change is delayed from the KBI change. We have mechanisms in place > that can enforce __FreeBSD_Version of kernel modules must match the > version of the running kernel, so I do not see how this procedure > would lead to silent binary incompatibility. The courtesy you are mentioning here is the __FreeBSD_Version. Having stricter rule would just meaning doing under-performing and unclean job. > >> MPSAFE flag is not any longer supported and code needs to be ported >> appropriately to -CURRENT interface. > > That is the present state of affairs, yes. I am asking only, "think > of the users; can we make things easier for them?". > Maybe not in this case, but as something to keep in mind for the future. I can understand your concern, but people using -CURRENT must be well aware of the fact that this is a development branch and they cannot expect too many safety belt mechanisms to be in place. I think that the current model (break KBI/KPI at will, give ports/thirdy part a way to recognize it via __FreeBSD_Version and move on) is optimal because it doesn't limit the developer neither leaves the user completely without a landmark on how to fix the problem. It is all balancing in finding compromises :) Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:25:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD8416B; Tue, 6 Nov 2012 23:25:07 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C140F8FC08; Tue, 6 Nov 2012 23:25:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA6NP6NV085011; Tue, 6 Nov 2012 23:25:06 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA6NP6fa085004; Tue, 6 Nov 2012 23:25:06 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201211062325.qA6NP6fa085004@svn.freebsd.org> From: Doug Ambrisko Date: Tue, 6 Nov 2012 23:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242681 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:25:08 -0000 Author: ambrisko Date: Tue Nov 6 23:25:06 2012 New Revision: 242681 URL: http://svnweb.freebsd.org/changeset/base/242681 Log: - Extend the prior commit to use the generic SCSI command building function use that for JBOD and Thunderbolt disk write command. Now we only have one implementation in mfi. - Fix dumping on Thunderbolt cards. Polled IO commands do not seem to be normally acknowledged by changing cmd_status to MFI_STAT_OK. In order to get acknowledgement of the IO is complete, the Thunderbolt command queue needs to be run through. I added a flag MFI_CMD_SCSI to indicate this command is being polled and to complete the Thunderbolt wrapper and indicate the result. This flag needs to be set in the JBOD case in case if that us using Thunderbolt card. When in the polling loop check for completed commands. - Remove mfi_tbolt_is_ldio and just do the check when needed. - Fix an issue when attaching of disk device happens when a device is already scheduled to be attached but hasn't attached. - add a tunable to allow raw disk attachment to CAM via: hw.mfi.allow_cam_disk_passthrough=1 - fixup aborting of commands (AEN and LD state change). Use a generic abort function and only wait the command being aborted not both. Thunderbolt cards don't seem to abort commands so the abort times out. Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_syspd.c head/sys/dev/mfi/mfi_tbolt.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfi.c Tue Nov 6 23:25:06 2012 (r242681) @@ -106,11 +106,9 @@ static void mfi_add_sys_pd_complete(stru static struct mfi_command * mfi_bio_command(struct mfi_softc *); static void mfi_bio_complete(struct mfi_command *); static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); -static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, - uint64_t lba, uint8_t byte2, int readop); static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); -static int mfi_abort(struct mfi_softc *, struct mfi_command *); +static int mfi_abort(struct mfi_softc *, struct mfi_command **); static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *); static void mfi_timeout(void *); static int mfi_user_command(struct mfi_softc *, @@ -376,6 +374,8 @@ mfi_attach(struct mfi_softc *sc) sx_init(&sc->mfi_config_lock, "MFI config"); TAILQ_INIT(&sc->mfi_ld_tqh); TAILQ_INIT(&sc->mfi_syspd_tqh); + TAILQ_INIT(&sc->mfi_ld_pend_tqh); + TAILQ_INIT(&sc->mfi_syspd_pend_tqh); TAILQ_INIT(&sc->mfi_evt_queue); TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc); TASK_INIT(&sc->mfi_map_sync_task, 0, mfi_handle_map_sync, sc); @@ -697,6 +697,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr_tbolt; sc->mfi_enable_intr(sc); } else { if ((error = mfi_comms_init(sc)) != 0) @@ -707,6 +708,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr; sc->mfi_enable_intr(sc); } if ((error = mfi_get_controller_info(sc)) != 0) @@ -1281,6 +1283,17 @@ mfi_shutdown(struct mfi_softc *sc) struct mfi_command *cm; int error; + + if (sc->mfi_aen_cm) + sc->cm_aen_abort = 1; + if (sc->mfi_aen_cm != NULL) + mfi_abort(sc, &sc->mfi_aen_cm); + + if (sc->mfi_map_sync_cm) + sc->cm_map_abort = 1; + if (sc->mfi_map_sync_cm != NULL) + mfi_abort(sc, &sc->mfi_map_sync_cm); + mtx_lock(&sc->mfi_io_lock); error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_SHUTDOWN, NULL, 0); if (error) { @@ -1288,12 +1301,6 @@ mfi_shutdown(struct mfi_softc *sc) return (error); } - if (sc->mfi_aen_cm != NULL) - mfi_abort(sc, sc->mfi_aen_cm); - - if (sc->mfi_map_sync_cm != NULL) - mfi_abort(sc, sc->mfi_map_sync_cm); - dcmd = &cm->cm_frame->dcmd; dcmd->header.flags = MFI_FRAME_DIR_NONE; cm->cm_flags = MFI_CMD_POLLED; @@ -1315,6 +1322,7 @@ mfi_syspdprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_pd_list *pdlist = NULL; struct mfi_system_pd *syspd, *tmp; + struct mfi_system_pending *syspd_pend; int error, i, found; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1355,6 +1363,10 @@ mfi_syspdprobe(struct mfi_softc *sc) if (syspd->pd_id == pdlist->addr[i].device_id) found = 1; } + TAILQ_FOREACH(syspd_pend, &sc->mfi_syspd_pend_tqh, pd_link) { + if (syspd_pend->pd_id == pdlist->addr[i].device_id) + found = 1; + } if (found == 0) mfi_add_sys_pd(sc, pdlist->addr[i].device_id); } @@ -1390,6 +1402,7 @@ mfi_ldprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_ld_list *list = NULL; struct mfi_disk *ld; + struct mfi_disk_pending *ld_pend; int error, i; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1418,6 +1431,10 @@ mfi_ldprobe(struct mfi_softc *sc) if (ld->ld_id == list->ld_list[i].ld.v.target_id) goto skip_add; } + TAILQ_FOREACH(ld_pend, &sc->mfi_ld_pend_tqh, ld_link) { + if (ld_pend->ld_id == list->ld_list[i].ld.v.target_id) + goto skip_add; + } mfi_add_ld(sc, list->ld_list[i].ld.v.target_id); skip_add:; } @@ -1620,9 +1637,7 @@ mfi_aen_register(struct mfi_softc *sc, i < current_aen.members.evt_class) current_aen.members.evt_class = prior_aen.members.evt_class; - mtx_lock(&sc->mfi_io_lock); - mfi_abort(sc, sc->mfi_aen_cm); - mtx_unlock(&sc->mfi_io_lock); + mfi_abort(sc, &sc->mfi_aen_cm); } } @@ -1814,10 +1829,17 @@ mfi_add_ld(struct mfi_softc *sc, int id) struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_disk_pending *ld_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + ld_pend = malloc(sizeof(*ld_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (ld_pend != NULL) { + ld_pend->ld_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_ld_pend_tqh, ld_pend, ld_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); if (error) { @@ -1858,11 +1880,13 @@ mfi_add_ld_complete(struct mfi_command * hdr = &cm->cm_frame->header; ld_info = cm->cm_private; - if (hdr->cmd_status != MFI_STAT_OK) { + if (sc->cm_map_abort || hdr->cmd_status != MFI_STAT_OK) { free(ld_info, M_MFIBUF); + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); return; } + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); mtx_unlock(&sc->mfi_io_lock); @@ -1887,10 +1911,17 @@ static int mfi_add_sys_pd(struct mfi_sof struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_pd_info *pd_info = NULL; + struct mfi_system_pending *syspd_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + syspd_pend = malloc(sizeof(*syspd_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (syspd_pend != NULL) { + syspd_pend->pd_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_syspd_pend_tqh, syspd_pend, pd_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_GET_INFO, (void **)&pd_info, sizeof(*pd_info)); if (error) { @@ -1985,9 +2016,12 @@ mfi_bio_command(struct mfi_softc *sc) return cm; } -static int -mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, - uint64_t lba, uint8_t byte2, int readop) +/* + * mostly copied from cam/scsi/scsi_all.c:scsi_read_write + */ + +int +mfi_build_cdb(int readop, uint8_t byte2, u_int64_t lba, u_int32_t block_count, uint8_t *cdb) { int cdb_len; @@ -1997,7 +2031,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* We can fit in a 6 byte cdb */ struct scsi_rw_6 *scsi_cmd; - scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_6 *)cdb; scsi_cmd->opcode = readop ? READ_6 : WRITE_6; scsi_ulto3b(lba, scsi_cmd->addr); scsi_cmd->length = block_count & 0xff; @@ -2007,7 +2041,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* Need a 10 byte CDB */ struct scsi_rw_10 *scsi_cmd; - scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_10 *)cdb; scsi_cmd->opcode = readop ? READ_10 : WRITE_10; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); @@ -2020,7 +2054,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram /* Block count is too big for 10 byte CDB use a 12 byte CDB */ struct scsi_rw_12 *scsi_cmd; - scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_12 *)cdb; scsi_cmd->opcode = readop ? READ_12 : WRITE_12; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); @@ -2035,7 +2069,7 @@ mfi_build_syspd_cdb(struct mfi_pass_fram */ struct scsi_rw_16 *scsi_cmd; - scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; + scsi_cmd = (struct scsi_rw_16 *)cdb; scsi_cmd->opcode = readop ? READ_16 : WRITE_16; scsi_cmd->byte2 = byte2; scsi_u64to8b(lba, scsi_cmd->addr); @@ -2053,15 +2087,15 @@ mfi_build_syspdio(struct mfi_softc *sc, { struct mfi_command *cm; struct mfi_pass_frame *pass; - int flags = 0; + uint32_t context = 0; + int flags = 0, blkcount = 0, readop; uint8_t cdb_len; - uint32_t block_count, context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) return (NULL); /* Zero out the MFI frame */ - context = cm->cm_frame->header.context; + context = cm->cm_frame->header.context; bzero(cm->cm_frame, sizeof(union mfi_frame)); cm->cm_frame->header.context = context; pass = &cm->cm_frame->pass; @@ -2070,22 +2104,24 @@ mfi_build_syspdio(struct mfi_softc *sc, switch (bio->bio_cmd & 0x03) { case BIO_READ: flags = MFI_CMD_DATAIN; + readop = 1; break; case BIO_WRITE: flags = MFI_CMD_DATAOUT; + readop = 0; break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command"); + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ - block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; /* Fill the LBA and Transfer length in CDB */ - cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, 0, - flags == MFI_CMD_DATAIN); - + cdb_len = mfi_build_cdb(readop, 0, bio->bio_pblkno, blkcount, + pass->cdb); pass->header.target_id = (uintptr_t)bio->bio_driver1; + pass->header.lun_id = 0; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; @@ -2132,7 +2168,7 @@ mfi_build_ldio(struct mfi_softc *sc, str break; default: /* TODO: what about BIO_DELETE??? */ - panic("Unsupported bio command"); + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2422,15 +2458,14 @@ mfi_complete(struct mfi_softc *sc, struc } static int -mfi_abort(struct mfi_softc *sc, struct mfi_command *cm_abort) +mfi_abort(struct mfi_softc *sc, struct mfi_command **cm_abort) { struct mfi_command *cm; struct mfi_abort_frame *abort; int i = 0; uint32_t context = 0; - mtx_assert(&sc->mfi_io_lock, MA_OWNED); - + mtx_lock(&sc->mfi_io_lock); if ((cm = mfi_dequeue_free(sc)) == NULL) { return (EBUSY); } @@ -2444,29 +2479,27 @@ mfi_abort(struct mfi_softc *sc, struct m abort->header.cmd = MFI_CMD_ABORT; abort->header.flags = 0; abort->header.scsi_status = 0; - abort->abort_context = cm_abort->cm_frame->header.context; - abort->abort_mfi_addr_lo = (uint32_t)cm_abort->cm_frame_busaddr; + abort->abort_context = (*cm_abort)->cm_frame->header.context; + abort->abort_mfi_addr_lo = (uint32_t)(*cm_abort)->cm_frame_busaddr; abort->abort_mfi_addr_hi = - (uint32_t)((uint64_t)cm_abort->cm_frame_busaddr >> 32); + (uint32_t)((uint64_t)(*cm_abort)->cm_frame_busaddr >> 32); cm->cm_data = NULL; cm->cm_flags = MFI_CMD_POLLED; - if (sc->mfi_aen_cm) - sc->cm_aen_abort = 1; - if (sc->mfi_map_sync_cm) - sc->cm_map_abort = 1; mfi_mapcmd(sc, cm); mfi_release_command(cm); - while (i < 5 && sc->mfi_aen_cm != NULL) { - msleep(&sc->mfi_aen_cm, &sc->mfi_io_lock, 0, "mfiabort", + mtx_unlock(&sc->mfi_io_lock); + while (i < 5 && *cm_abort != NULL) { + tsleep(cm_abort, 0, "mfiabort", 5 * hz); i++; } - while (i < 5 && sc->mfi_map_sync_cm != NULL) { - msleep(&sc->mfi_map_sync_cm, &sc->mfi_io_lock, 0, "mfiabort", - 5 * hz); - i++; + if (*cm_abort != NULL) { + /* Force a complete if command didn't abort */ + mtx_lock(&sc->mfi_io_lock); + (*cm_abort)->cm_complete(*cm_abort); + mtx_unlock(&sc->mfi_io_lock); } return (0); @@ -2522,7 +2555,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * { struct mfi_command *cm; struct mfi_pass_frame *pass; - int error; + int error, readop, cdb_len; uint32_t blkcount; if ((cm = mfi_dequeue_free(sc)) == NULL) @@ -2531,21 +2564,24 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; + + readop = 0; blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + cdb_len = mfi_build_cdb(readop, 0, lba, blkcount, pass->cdb); pass->header.target_id = id; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = len; - pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, 0); + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_data = virt; cm->cm_len = len; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; - cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT; + cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT | MFI_CMD_SCSI; error = mfi_mapcmd(sc, cm); bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap, @@ -2745,16 +2781,24 @@ mfi_check_command_post(struct mfi_softc } } -static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) +static int +mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) { - struct mfi_config_data *conf_data=(struct mfi_config_data *)cm->cm_data; + struct mfi_config_data *conf_data; struct mfi_command *ld_cm = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_ld_config *ld; + char *p; int error = 0; - if ((cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) && - (conf_data->ld[0].params.isSSCD == 1)) { - error = 1; + conf_data = (struct mfi_config_data *)cm->cm_data; + + if (cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) { + p = (char *)conf_data->array; + p += conf_data->array_size * conf_data->array_count; + ld = (struct mfi_ld_config *)p; + if (ld->params.isSSCD == 1) + error = 1; } else if (cm->cm_frame->dcmd.opcode == MFI_DCMD_LD_DELETE) { error = mfi_dcmd_command (sc, &ld_cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfi_cam.c Tue Nov 6 23:25:06 2012 (r242681) @@ -79,6 +79,11 @@ static void mfip_cam_poll(struct cam_sim static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); +static int mfi_allow_disks = 0; +TUNABLE_INT("hw.mfi.allow_cam_disk_passthrough", &mfi_allow_disks); +SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RD, + &mfi_allow_disks, 0, "event message locale"); + static devclass_t mfip_devclass; static device_method_t mfip_methods[] = { DEVMETHOD(device_probe, mfip_probe), @@ -349,7 +354,8 @@ mfip_done(struct mfi_command *cm) command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { device = csio->data_ptr[0] & 0x1f; - if ((device == T_DIRECT) || (device == T_PROCESSOR)) + if ((!mfi_allow_disks && device == T_DIRECT) || + (device == T_PROCESSOR)) csio->data_ptr[0] = (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } @@ -392,6 +398,9 @@ mfip_done(struct mfi_command *cm) static void mfip_cam_poll(struct cam_sim *sim) { - return; + struct mfip_softc *sc = cam_sim_softc(sim); + struct mfi_softc *mfisc = sc->mfi_sc; + + mfisc->mfi_intr_ptr(mfisc); } Modified: head/sys/dev/mfi/mfi_disk.c ============================================================================== --- head/sys/dev/mfi/mfi_disk.c Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfi_disk.c Tue Nov 6 23:25:06 2012 (r242681) @@ -93,6 +93,7 @@ mfi_disk_attach(device_t dev) { struct mfi_disk *sc; struct mfi_ld_info *ld_info; + struct mfi_disk_pending *ld_pend; uint64_t sectors; uint32_t secsize; char *state; @@ -111,6 +112,13 @@ mfi_disk_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->ld_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->ld_controller->mfi_ld_tqh, sc, ld_link); + TAILQ_FOREACH(ld_pend, &sc->ld_controller->mfi_ld_pend_tqh, + ld_link) { + TAILQ_REMOVE(&sc->ld_controller->mfi_ld_pend_tqh, + ld_pend, ld_link); + free(ld_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->ld_controller->mfi_io_lock); switch (ld_info->ld_config.params.state) { @@ -131,16 +139,16 @@ mfi_disk_attach(device_t dev) break; } - if ( strlen(ld_info->ld_config.properties.name) == 0 ) { - device_printf(dev, - "%juMB (%ju sectors) RAID volume (no label) is %s\n", - sectors / (1024 * 1024 / secsize), sectors, state); - } else { - device_printf(dev, - "%juMB (%ju sectors) RAID volume '%s' is %s\n", - sectors / (1024 * 1024 / secsize), sectors, - ld_info->ld_config.properties.name, state); - } + if ( strlen(ld_info->ld_config.properties.name) == 0 ) { + device_printf(dev, + "%juMB (%ju sectors) RAID volume (no label) is %s\n", + sectors / (1024 * 1024 / secsize), sectors, state); + } else { + device_printf(dev, + "%juMB (%ju sectors) RAID volume '%s' is %s\n", + sectors / (1024 * 1024 / secsize), sectors, + ld_info->ld_config.properties.name, state); + } sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; Modified: head/sys/dev/mfi/mfi_syspd.c ============================================================================== --- head/sys/dev/mfi/mfi_syspd.c Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfi_syspd.c Tue Nov 6 23:25:06 2012 (r242681) @@ -89,7 +89,6 @@ DRIVER_MODULE(mfisyspd, mfi, mfi_syspd_d static int mfi_syspd_probe(device_t dev) { - return (0); } @@ -98,12 +97,12 @@ mfi_syspd_attach(device_t dev) { struct mfi_system_pd *sc; struct mfi_pd_info *pd_info; + struct mfi_system_pending *syspd_pend; uint64_t sectors; uint32_t secsize; sc = device_get_softc(dev); pd_info = device_get_ivars(dev); - sc->pd_dev = dev; sc->pd_id = pd_info->ref.v.device_id; sc->pd_unit = device_get_unit(dev); @@ -115,6 +114,13 @@ mfi_syspd_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); + TAILQ_FOREACH(syspd_pend, &sc->pd_controller->mfi_syspd_pend_tqh, + pd_link) { + TAILQ_REMOVE(&sc->pd_controller->mfi_syspd_pend_tqh, + syspd_pend, pd_link); + free(syspd_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->pd_controller->mfi_io_lock); device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", sectors / (1024 * 1024 / secsize), sectors); @@ -139,6 +145,7 @@ mfi_syspd_attach(device_t dev) disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); + return (0); } Modified: head/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- head/sys/dev/mfi/mfi_tbolt.c Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfi_tbolt.c Tue Nov 6 23:25:06 2012 (r242681) @@ -69,13 +69,10 @@ uint8_t mfi_build_mpt_pass_thru(struct mfi_softc *sc, struct mfi_command *mfi_cmd); union mfi_mpi2_request_descriptor *mfi_build_and_issue_cmd(struct mfi_softc *sc, struct mfi_command *mfi_cmd); -int mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd); void mfi_tbolt_build_ldio(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd); static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, pMpi25IeeeSgeChain64_t sgl_ptr, struct mfi_cmd_tbolt *cmd); -static int mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command - *mfi_cmd, uint8_t *cdb); void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status); @@ -502,6 +499,7 @@ mfi_tbolt_alloc_cmd(struct mfi_softc *sc + i * MEGASAS_MAX_SZ_CHAIN_FRAME); cmd->sg_frame_phys_addr = sc->sg_frame_busaddr + i * MEGASAS_MAX_SZ_CHAIN_FRAME; + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&(sc->mfi_cmd_tbolt_tqh), cmd, next); } @@ -574,11 +572,11 @@ void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status) { - switch (status) { case MFI_STAT_OK: - mfi_cmd->cm_frame->header.cmd_status = 0; - mfi_cmd->cm_frame->dcmd.header.cmd_status = 0; + mfi_cmd->cm_frame->header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_frame->dcmd.header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_error = MFI_STAT_OK; break; case MFI_STAT_SCSI_IO_FAILED: @@ -618,6 +616,7 @@ mfi_tbolt_return_cmd(struct mfi_softc *s { mtx_assert(&sc->mfi_io_lock, MA_OWNED); + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&sc->mfi_cmd_tbolt_tqh, cmd, next); } @@ -667,16 +666,26 @@ mfi_tbolt_complete_cmd(struct mfi_softc extStatus = cmd_mfi->cm_frame->dcmd.header.scsi_status; map_tbolt_cmd_status(cmd_mfi, status, extStatus); - /* remove command from busy queue if not polled */ - TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { - if (cmd_mfi_check == cmd_mfi) { - mfi_remove_busy(cmd_mfi); - break; + if (cmd_mfi->cm_flags & MFI_CMD_SCSI && + (cmd_mfi->cm_flags & MFI_CMD_POLLED) != 0) { + /* polled LD/SYSPD IO command */ + mfi_tbolt_return_cmd(sc, cmd_tbolt); + /* XXX mark okay for now DJA */ + cmd_mfi->cm_frame->header.cmd_status = MFI_STAT_OK; + } else { + + /* remove command from busy queue if not polled */ + TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { + if (cmd_mfi_check == cmd_mfi) { + mfi_remove_busy(cmd_mfi); + break; + } } + + /* complete the command */ + mfi_complete(sc, cmd_mfi); + mfi_tbolt_return_cmd(sc, cmd_tbolt); } - cmd_mfi->cm_error = 0; - mfi_complete(sc, cmd_mfi); - mfi_tbolt_return_cmd(sc, cmd_tbolt); sc->last_reply_idx++; if (sc->last_reply_idx >= sc->mfi_max_fw_cmds) { @@ -811,13 +820,13 @@ mfi_tbolt_build_ldio(struct mfi_softc *s MFI_FRAME_DIR_READ) io_info.isRead = 1; - io_request->RaidContext.timeoutValue - = MFI_FUSION_FP_DEFAULT_TIMEOUT; - io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; - io_request->DevHandle = device_id; - cmd->request_desc->header.RequestFlags - = (MFI_REQ_DESCRIPT_FLAGS_LD_IO - << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + io_request->RaidContext.timeoutValue + = MFI_FUSION_FP_DEFAULT_TIMEOUT; + io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; + io_request->DevHandle = device_id; + cmd->request_desc->header.RequestFlags + = (MFI_REQ_DESCRIPT_FLAGS_LD_IO + << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if ((io_request->IoFlags == 6) && (io_info.numBlocks == 0)) io_request->RaidContext.RegLockLength = 0x100; io_request->DataLength = mfi_cmd->cm_frame->io.header.data_len @@ -825,40 +834,36 @@ mfi_tbolt_build_ldio(struct mfi_softc *s } int -mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd) -{ - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ - || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - return 1; - else - return 0; -} - -int mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd) { - uint32_t device_id; + struct mfi_mpi2_request_raid_scsi_io *io_request; uint32_t sge_count; - uint8_t cdb[32], cdb_len; - - memset(cdb, 0, 32); - struct mfi_mpi2_request_raid_scsi_io *io_request = cmd->io_request; - - device_id = mfi_cmd->cm_frame->header.target_id; + uint8_t cdb_len; + int readop; + u_int64_t lba; - /* Have to build CDB here for TB as BSD don't have a scsi layer */ - if ((cdb_len = mfi_tbolt_build_cdb(sc, mfi_cmd, cdb)) == 1) + io_request = cmd->io_request; + if (!(mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ + || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE)) return 1; - /* Just the CDB length,rest of the Flags are zero */ - io_request->IoFlags = cdb_len; - memcpy(io_request->CDB.CDB32, cdb, 32); + mfi_tbolt_build_ldio(sc, mfi_cmd, cmd); - if (mfi_tbolt_is_ldio(mfi_cmd)) - mfi_tbolt_build_ldio(sc, mfi_cmd , cmd); + /* Convert to SCSI command CDB */ + bzero(io_request->CDB.CDB32, sizeof(io_request->CDB.CDB32)); + if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) + readop = 0; else - return 1; + readop = 1; + + lba = mfi_cmd->cm_frame->io.lba_hi; + lba = (lba << 32) + mfi_cmd->cm_frame->io.lba_lo; + cdb_len = mfi_build_cdb(readop, 0, lba, + mfi_cmd->cm_frame->io.header.data_len, io_request->CDB.CDB32); + + /* Just the CDB length, rest of the Flags are zero */ + io_request->IoFlags = cdb_len; /* * Construct SGL @@ -883,84 +888,12 @@ mfi_tbolt_build_io(struct mfi_softc *sc, io_request->SenseBufferLowAddress = mfi_cmd->cm_sense_busaddr; io_request->SenseBufferLength = MFI_SENSE_LEN; + io_request->RaidContext.Status = MFI_STAT_INVALID_STATUS; + io_request->RaidContext.exStatus = MFI_STAT_INVALID_STATUS; + return 0; } -static int -mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command *mfi_cmd, - uint8_t *cdb) -{ - uint32_t lba_lo, lba_hi, num_lba; - uint8_t cdb_len; - - if (mfi_cmd == NULL || cdb == NULL) - return 1; - num_lba = mfi_cmd->cm_frame->io.header.data_len; - lba_lo = mfi_cmd->cm_frame->io.lba_lo; - lba_hi = mfi_cmd->cm_frame->io.lba_hi; - - if (lba_hi == 0 && (num_lba <= 0xFF) && (lba_lo <= 0x1FFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 6 or Write 6 */ - cdb[0] = (uint8_t) (0x0A); - else - cdb[0] = (uint8_t) (0x08); - - cdb[4] = (uint8_t) num_lba; - cdb[3] = (uint8_t) (lba_lo & 0xFF); - cdb[2] = (uint8_t) (lba_lo >> 8); - cdb[1] = (uint8_t) ((lba_lo >> 16) & 0x1F); - cdb_len = 6; - } - else if (lba_hi == 0 && (num_lba <= 0xFFFF) && (lba_lo <= 0xFFFFFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 10 or Write 10 */ - cdb[0] = (uint8_t) (0x2A); - else - cdb[0] = (uint8_t) (0x28); - cdb[8] = (uint8_t) (num_lba & 0xFF); - cdb[7] = (uint8_t) (num_lba >> 8); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 10; - } else if ((num_lba > 0xFFFF) && (lba_hi == 0)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 12 or Write 12 */ - cdb[0] = (uint8_t) (0xAA); - else - cdb[0] = (uint8_t) (0xA8); - cdb[9] = (uint8_t) (num_lba & 0xFF); - cdb[8] = (uint8_t) (num_lba >> 8); - cdb[7] = (uint8_t) (num_lba >> 16); - cdb[6] = (uint8_t) (num_lba >> 24); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 12; - } else { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - cdb[0] = (uint8_t) (0x8A); - else - cdb[0] = (uint8_t) (0x88); - cdb[13] = (uint8_t) (num_lba & 0xFF); - cdb[12] = (uint8_t) (num_lba >> 8); - cdb[11] = (uint8_t) (num_lba >> 16); - cdb[10] = (uint8_t) (num_lba >> 24); - cdb[9] = (uint8_t) (lba_lo & 0xFF); - cdb[8] = (uint8_t) (lba_lo >> 8); - cdb[7] = (uint8_t) (lba_lo >> 16); - cdb[6] = (uint8_t) (lba_lo >> 24); - cdb[5] = (uint8_t) (lba_hi & 0xFF); - cdb[4] = (uint8_t) (lba_hi >> 8); - cdb[3] = (uint8_t) (lba_hi >> 16); - cdb[2] = (uint8_t) (lba_hi >> 24); - cdb_len = 16; - } - return cdb_len; -} static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, @@ -1100,8 +1033,7 @@ mfi_tbolt_send_frame(struct mfi_softc *s if ((cm->cm_flags & MFI_CMD_POLLED) == 0) { cm->cm_timestamp = time_uptime; mfi_enqueue_busy(cm); - } - else { /* still get interrupts for it */ + } else { /* still get interrupts for it */ hdr->cmd_status = MFI_STAT_INVALID_STATUS; hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; } @@ -1118,31 +1050,49 @@ mfi_tbolt_send_frame(struct mfi_softc *s } else device_printf(sc->mfi_dev, "DJA NA XXX SYSPDIO\n"); - } - else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || + } else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || hdr->cmd == MFI_CMD_LD_READ || hdr->cmd == MFI_CMD_LD_WRITE) { + cm->cm_flags |= MFI_CMD_SCSI; if ((req_desc = mfi_build_and_issue_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "LDIO Failed \n"); return 1; } - } else - if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { + } else if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "Mapping from MFI to MPT " "Failed\n"); return 1; - } + } + + if (cm->cm_flags & MFI_CMD_SCSI) { + /* + * LD IO needs to be posted since it doesn't get + * acknowledged via a status update so have the + * controller reply via mfi_tbolt_complete_cmd. + */ + hdr->flags &= ~MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + } + MFI_WRITE4(sc, MFI_ILQP, (req_desc->words & 0xFFFFFFFF)); MFI_WRITE4(sc, MFI_IHQP, (req_desc->words >>0x20)); if ((cm->cm_flags & MFI_CMD_POLLED) == 0) return 0; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } + /* This is a polled command, so busy-wait for it to complete. */ while (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { DELAY(1000); tm -= 1; if (tm <= 0) - break; + break; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } } if (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { @@ -1375,7 +1325,7 @@ mfi_tbolt_sync_map_info(struct mfi_softc free(ld_sync, M_MFIBUF); goto out; } - + context = cmd->cm_frame->header.context; bzero(cmd->cm_frame, sizeof(union mfi_frame)); cmd->cm_frame->header.context = context; Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Tue Nov 6 23:04:23 2012 (r242680) +++ head/sys/dev/mfi/mfivar.h Tue Nov 6 23:25:06 2012 (r242681) @@ -106,6 +106,7 @@ struct mfi_command { #define MFI_ON_MFIQ_READY (1<<6) #define MFI_ON_MFIQ_BUSY (1<<7) #define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7)) +#define MFI_CMD_SCSI (1<<8) uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; @@ -126,6 +127,11 @@ struct mfi_disk { #define MFI_DISK_FLAGS_DISABLED 0x02 }; +struct mfi_disk_pending { + TAILQ_ENTRY(mfi_disk_pending) ld_link; + int ld_id; +}; + struct mfi_system_pd { TAILQ_ENTRY(mfi_system_pd) pd_link; device_t pd_dev; @@ -137,6 +143,11 @@ struct mfi_system_pd { int pd_flags; }; +struct mfi_system_pending { + TAILQ_ENTRY(mfi_system_pending) pd_link; + int pd_id; +}; + struct mfi_evt_queue_elm { TAILQ_ENTRY(mfi_evt_queue_elm) link; struct mfi_evt_detail detail; @@ -285,6 +296,8 @@ struct mfi_softc { TAILQ_HEAD(,mfi_disk) mfi_ld_tqh; TAILQ_HEAD(,mfi_system_pd) mfi_syspd_tqh; + TAILQ_HEAD(,mfi_disk_pending) mfi_ld_pend_tqh; + TAILQ_HEAD(,mfi_system_pending) mfi_syspd_pend_tqh; eventhandler_tag mfi_eh; struct cdev *mfi_cdev; @@ -303,6 +316,7 @@ struct mfi_softc { uint32_t frame_cnt); int (*mfi_adp_reset)(struct mfi_softc *sc); int (*mfi_adp_check_reset)(struct mfi_softc *sc); + void (*mfi_intr_ptr)(void *sc); /* ThunderBolt */ uint32_t mfi_tbolt; @@ -421,7 +435,8 @@ extern int mfi_tbolt_reset(struct mfi_so extern void mfi_tbolt_sync_map_info(struct mfi_softc *sc); extern void mfi_handle_map_sync(void *context, int pending); extern int mfi_dcmd_command(struct mfi_softc *, struct mfi_command **, - uint32_t, void **, size_t); + uint32_t, void **, size_t); +extern int mfi_build_cdb(int, uint8_t, u_int64_t, u_int32_t, uint8_t *); #define MFIQ_ADD(sc, qname) \ do { \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:38:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A4B8B31; Tue, 6 Nov 2012 23:38:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 41B4E8FC0A; Tue, 6 Nov 2012 23:38:17 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so443695dad.13 for ; Tue, 06 Nov 2012 15:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=lvs8lFnutf52ga0+aNIXUm51vXOFXVg5ofZueMrZ5rI=; b=zV0p0fzF2Rr6G86PKlPAwA2HFmFXkgmMiCHoY5yBzJhT6LLOR5jX4qQ5Ii2LxxfUSd MnVwh9ikGb4QstQNMcn5wbCZzV8HgSN1fKBYTdmAB5onCRaFBOE9VMTfnA1HHi1C2cOs W5QabO64shrU3u3ga50qo1ut1P2WC9dJxgHucRhwYvjM5i7FlEhYHmRb1PyDbjSqd9eu PDkTwPOmQW+ZNMbNzusmv7g3+TaZsbK2B134oCDpEryLFYlE61TUKxrbvumadPUTt625 u0J9Bh/5LrLz8sCM7Y5ElNjwz8GEny9r2HDFtIpOu46RzNGUIrfs4A0SYenE4bgY9uyv 6ZWg== Received: by 10.66.86.165 with SMTP id q5mr917984paz.18.1352245096677; Tue, 06 Nov 2012 15:38:16 -0800 (PST) Received: from mavbook.mavhome.dp.ua (drawbridge.ixsystems.com. [206.40.55.65]) by mx.google.com with ESMTPS id tm8sm13041747pbc.48.2012.11.06.15.38.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 15:38:15 -0800 (PST) Sender: Alexander Motin Message-ID: <50999F66.1020402@FreeBSD.org> Date: Wed, 07 Nov 2012 01:38:14 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... References: <201210221750.q9MHot26061585@svn.freebsd.org> In-Reply-To: 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, Konstantin Belousov , Ben Kaduk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:38:17 -0000 On 07.11.2012 01:20, Attilio Rao wrote: > On Tue, Nov 6, 2012 at 11:17 PM, Ben Kaduk wrote: >> I do not wish to belabor the point; we all have better things to do >> with our time. Hopefully this is my last message on the topic. >> >> On Tue, Nov 6, 2012 at 6:10 PM, Attilio Rao wrote: >> >>> The point is that KPI/KBI of -CURRENT can change as long as >>> __FreeBSD_version is bumped (and if you really want to know my >>> opinion, I already see this as a forceful thing because it would not >>> be necessary in my mind, but I second the will of the majority of >>> developers). So, if the KPI/KBI changes all the thirdy part code, >>> ports and everything else must adapt. >> >> Yes, everything must adapt to changes in -current. I am arguing that, >> if it is easy to do so, we should make the user experience for >> *ordinary users* running -current as nice as possible. If we do not >> have ordinary users running current, then our code does not get >> real-world testing until RC builds, or even the .0 release. I think >> it is well-accepted that we want to have the code in -current get >> real-world testing; making the user experience nicer helps this to >> happen. To me, it seems that the user experience is nicer if the KPI >> change is delayed from the KBI change. We have mechanisms in place >> that can enforce __FreeBSD_Version of kernel modules must match the >> version of the running kernel, so I do not see how this procedure >> would lead to silent binary incompatibility. > > The courtesy you are mentioning here is the __FreeBSD_Version. Having > stricter rule would just meaning doing under-performing and unclean > job. > >> >>> MPSAFE flag is not any longer supported and code needs to be ported >>> appropriately to -CURRENT interface. >> >> That is the present state of affairs, yes. I am asking only, "think >> of the users; can we make things easier for them?". >> Maybe not in this case, but as something to keep in mind for the future. > > I can understand your concern, but people using -CURRENT must be well > aware of the fact that this is a development branch and they cannot > expect too many safety belt mechanisms to be in place. > > I think that the current model (break KBI/KPI at will, give > ports/thirdy part a way to recognize it via __FreeBSD_Version and move > on) is optimal because it doesn't limit the developer neither leaves > the user completely without a landmark on how to fix the problem. > > It is all balancing in finding compromises :) I would like to support Ben's position. We may not expect that all the world is tracking our development in real time and adapt to our changes at the same exact moment. As I understand, before this one change MPSAFE flag was mandatory to have. After that one change MPSAFE is missing and so must to be removed. Yes, in perspective that part of code in external sources will be wrapped with respective ifdef's, but could we give world some time window to adapt, leaving constant doing nothing in tree? What is the price of having single define, comparing to headache even for one user who was brave enough to run HEAD? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Nov 6 23:47:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8D5C186; Tue, 6 Nov 2012 23:47:07 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 41A9A8FC12; Tue, 6 Nov 2012 23:47:05 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1099185lbd.13 for ; Tue, 06 Nov 2012 15:47:04 -0800 (PST) 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=bYalc62H9VlAVEWlfnRALIJOZL9JyRtVBue3UsiBMGM=; b=OpbFB/ZL96BVChvplc13k3/FZ8wXPm0Rn/y7kfvKXDuXQa0fOh8YGlb/rRA1XTIoNh qJujnBVGnB8aWV/neEirxlc2K/JP2IfH2HPKuSdXMRwRuEfi60xAd5TV6sQ0iGNLHHne qPtFIF3uzaQoMK15gr789+MkYzZla0c5MXMnQm3Re/8x5lroAQSsIGJQ5RsUdUOMkupk v3BoFQS8Ki0D6X8/hdBoDyNjRhd9L8P72SRQ+VOX4PU/IOUdSkTGSGHiADDoxOfmDL/B o2RUB5JX3aAUIMnSa+y4owTD/93czrEcPhdChpD6WazQJcMB9K7NAMieXmPK4pQpnV8Z e8Ug== MIME-Version: 1.0 Received: by 10.112.82.103 with SMTP id h7mr1195532lby.50.1352245624739; Tue, 06 Nov 2012 15:47:04 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 6 Nov 2012 15:47:04 -0800 (PST) In-Reply-To: <50999F66.1020402@FreeBSD.org> References: <201210221750.q9MHot26061585@svn.freebsd.org> <50999F66.1020402@FreeBSD.org> Date: Tue, 6 Nov 2012 23:47:04 +0000 X-Google-Sender-Auth: IaQaqObNR3PIQ_pMovd3xVedZOA Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Attilio Rao To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Ben Kaduk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 23:47:07 -0000 On Tue, Nov 6, 2012 at 11:38 PM, Alexander Motin wrote: > On 07.11.2012 01:20, Attilio Rao wrote: >> >> On Tue, Nov 6, 2012 at 11:17 PM, Ben Kaduk wrote: >>> >>> I do not wish to belabor the point; we all have better things to do >>> with our time. Hopefully this is my last message on the topic. >>> >>> On Tue, Nov 6, 2012 at 6:10 PM, Attilio Rao wrote: >>> >>>> The point is that KPI/KBI of -CURRENT can change as long as >>>> __FreeBSD_version is bumped (and if you really want to know my >>>> opinion, I already see this as a forceful thing because it would not >>>> be necessary in my mind, but I second the will of the majority of >>>> developers). So, if the KPI/KBI changes all the thirdy part code, >>>> ports and everything else must adapt. >>> >>> >>> Yes, everything must adapt to changes in -current. I am arguing that, >>> if it is easy to do so, we should make the user experience for >>> *ordinary users* running -current as nice as possible. If we do not >>> have ordinary users running current, then our code does not get >>> real-world testing until RC builds, or even the .0 release. I think >>> it is well-accepted that we want to have the code in -current get >>> real-world testing; making the user experience nicer helps this to >>> happen. To me, it seems that the user experience is nicer if the KPI >>> change is delayed from the KBI change. We have mechanisms in place >>> that can enforce __FreeBSD_Version of kernel modules must match the >>> version of the running kernel, so I do not see how this procedure >>> would lead to silent binary incompatibility. >> >> >> The courtesy you are mentioning here is the __FreeBSD_Version. Having >> stricter rule would just meaning doing under-performing and unclean >> job. >> >>> >>>> MPSAFE flag is not any longer supported and code needs to be ported >>>> appropriately to -CURRENT interface. >>> >>> >>> That is the present state of affairs, yes. I am asking only, "think >>> of the users; can we make things easier for them?". >>> Maybe not in this case, but as something to keep in mind for the future. >> >> >> I can understand your concern, but people using -CURRENT must be well >> aware of the fact that this is a development branch and they cannot >> expect too many safety belt mechanisms to be in place. >> >> I think that the current model (break KBI/KPI at will, give >> ports/thirdy part a way to recognize it via __FreeBSD_Version and move >> on) is optimal because it doesn't limit the developer neither leaves >> the user completely without a landmark on how to fix the problem. >> >> It is all balancing in finding compromises :) > > > I would like to support Ben's position. We may not expect that all the world > is tracking our development in real time and adapt to our changes at the > same exact moment. As I understand, before this one change MPSAFE flag was > mandatory to have. After that one change MPSAFE is missing and so must to be > removed. Yes, in perspective that part of code in external sources will be > wrapped with respective ifdef's, but could we give world some time window to > adapt, leaving constant doing nothing in tree? What is the price of having > single define, comparing to headache even for one user who was brave enough > to run HEAD? This is bad for specifically a reason: it won't give people reason to clean up their code and align to the new KPI. They will just stick with the broken code and the compat stub and will live with it until we don't remove also the compat stub. And then they could ask for another "compat windows" again and then over and over. I think this is all nosense, really. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 00:19:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D71888ED; Wed, 7 Nov 2012 00:19:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B72C18FC0C; Wed, 7 Nov 2012 00:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70JUf3098814; Wed, 7 Nov 2012 00:19:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70JUQc098811; Wed, 7 Nov 2012 00:19:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211070019.qA70JUQc098811@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 7 Nov 2012 00:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242683 - head/etc/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:19:30 -0000 Author: marcel Date: Wed Nov 7 00:19:30 2012 New Revision: 242683 URL: http://svnweb.freebsd.org/changeset/base/242683 Log: The first line must contain "Content-Type:". Move the $FreeBSD$ keyword line to the comment block underneath. Submitted by: Garrett Cooper Modified: head/etc/atf/FreeBSD.conf head/etc/atf/common.conf Modified: head/etc/atf/FreeBSD.conf ============================================================================== --- head/etc/atf/FreeBSD.conf Tue Nov 6 23:42:54 2012 (r242682) +++ head/etc/atf/FreeBSD.conf Wed Nov 7 00:19:30 2012 (r242683) @@ -1,6 +1,6 @@ -# $FreeBSD$ Content-Type: application/X-atf-config; version="1" +# $FreeBSD$ # # Configuration file for the FreeBSD test suite. # Modified: head/etc/atf/common.conf ============================================================================== --- head/etc/atf/common.conf Tue Nov 6 23:42:54 2012 (r242682) +++ head/etc/atf/common.conf Wed Nov 7 00:19:30 2012 (r242683) @@ -1,6 +1,6 @@ -# $FreeBSD$ Content-Type: application/X-atf-config; version="1" +# $FreeBSD$ # # Sample configuration file for properties affecting all test suites. # From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 00:23:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF26FBB1; Wed, 7 Nov 2012 00:23:51 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C39068FC14; Wed, 7 Nov 2012 00:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70Npai099783; Wed, 7 Nov 2012 00:23:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70NpBw099781; Wed, 7 Nov 2012 00:23:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211070023.qA70NpBw099781@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 7 Nov 2012 00:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242684 - head/lib/atf/libatf-c++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:23:52 -0000 Author: marcel Date: Wed Nov 7 00:23:51 2012 New Revision: 242684 URL: http://svnweb.freebsd.org/changeset/base/242684 Log: Remove -L from LDADD, it doesn't belong there. Add it to LDFLAGS instead. Submitted by: Garrett Cooper Modified: head/lib/atf/libatf-c++/Makefile Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Wed Nov 7 00:19:30 2012 (r242683) +++ head/lib/atf/libatf-c++/Makefile Wed Nov 7 00:23:51 2012 (r242684) @@ -32,7 +32,9 @@ SHLIB_MAJOR= 1 # libatf-c++ depends on the C version of the ATF library to build. DPADD= ${LIBATFC} -LDADD= -L${.OBJDIR}/../libatf-c -latf-c +LDADD= -latf-c + +LDFLAGS+= -L${.OBJDIR}/../libatf-c .PATH: ${ATF} .PATH: ${ATF}/atf-c++ From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 00:30:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7959EA7; Wed, 7 Nov 2012 00:30:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB4318FC08; Wed, 7 Nov 2012 00:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70UPXb001402; Wed, 7 Nov 2012 00:30:25 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70UPYu001396; Wed, 7 Nov 2012 00:30:25 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201211070030.qA70UPYu001396@svn.freebsd.org> From: Sean Bruno Date: Wed, 7 Nov 2012 00:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242685 - in stable/9: lib/libpmc sys/dev/hwpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:30:26 -0000 Author: sbruno Date: Wed Nov 7 00:30:25 2012 New Revision: 242685 URL: http://svnweb.freebsd.org/changeset/base/242685 Log: MFC r241974 Cleanup and rename some variables in libpmc and hwpmc. Testing MFC of merge to root of stable/9 with peter@ lurking. Modified: stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgexeon.3 stable/9/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/libpmc.c Wed Nov 7 00:30:25 2012 (r242685) @@ -718,7 +718,7 @@ static struct pmc_masks iap_rsp_mask_sb_ PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), - PMCMASK(RES_SNOOP_SNPI_NONE, (1ULL << 31)), + PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)), PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -135,7 +135,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridge.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.sandybridge.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -138,7 +138,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/lib/libpmc/pmc.sandybridgexeon.3 ============================================================================== --- stable/9/lib/libpmc/pmc.sandybridgexeon.3 Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/lib/libpmc/pmc.sandybridgexeon.3 Wed Nov 7 00:30:25 2012 (r242685) @@ -135,7 +135,7 @@ S-state. F-state. .It Li RES_SUPPLIER_LOCAL Local DRAM Controller. -.It Li RES_SNOOP_SNPI_NONE +.It Li RES_SNOOP_SNP_NONE No details on snoop-related information. .It Li RES_SNOOP_SNP_NO_NEEDED No snoop was needed to satisfy the request. Modified: stable/9/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/9/sys/dev/hwpmc/pmc_events.h Wed Nov 7 00:23:51 2012 (r242684) +++ stable/9/sys/dev/hwpmc/pmc_events.h Wed Nov 7 00:30:25 2012 (r242685) @@ -2640,7 +2640,7 @@ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_C __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_04H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_10H) \ __PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ -__PMC_EV_ALIAS("LOAD_HIT_PER.HW_PF", IAP_EVENT_4CH_02H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ __PMC_EV_ALIAS("HW_PRE_REQ.DL1_MISS", IAP_EVENT_4EH_02H) \ __PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ __PMC_EV_ALIAS("L1D.ALLOCATED_IN_M", IAP_EVENT_51H_02H) \ @@ -2777,7 +2777,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", IAP_EVENT_D2H_08H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", IAP_EVENT_D4H_02H) \ __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ -__PMC_EV_ALIAS("L2_TRANS.RF0", IAP_EVENT_F0H_02H) \ +__PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \ __PMC_EV_ALIAS("L2_TRANS.CODE_RD", IAP_EVENT_F0H_04H) \ __PMC_EV_ALIAS("L2_TRANS.ALL_PF", IAP_EVENT_F0H_08H) \ __PMC_EV_ALIAS("L2_TRANS.L1D_WB", IAP_EVENT_F0H_10H) \ @@ -2787,7 +2787,7 @@ __PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", __PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \ __PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \ __PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \ -__PMC_EV_ALIAS("L2_LINES-IN.ALL", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ __PMC_EV_ALIAS("L2_LINES_OUT.PF_CLEAN", IAP_EVENT_F2H_04H) \ @@ -2855,7 +2855,7 @@ __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_C __PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_04H) \ __PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_10H) \ __PMC_EV_ALIAS("LOAD_HIT_PRE.SW_PF", IAP_EVENT_4CH_01H) \ -__PMC_EV_ALIAS("LOAD_HIT_PER.HW_PF", IAP_EVENT_4CH_02H) \ +__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \ __PMC_EV_ALIAS("HW_PRE_REQ.DL1_MISS", IAP_EVENT_4EH_02H) \ __PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \ __PMC_EV_ALIAS("L1D.ALLOCATED_IN_M", IAP_EVENT_51H_02H) \ @@ -3005,7 +3005,7 @@ __PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", __PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \ __PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \ __PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \ -__PMC_EV_ALIAS("L2_LINES-IN.ALL", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ __PMC_EV_ALIAS("L2_LINES_OUT.PF_CLEAN", IAP_EVENT_F2H_04H) \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 00:40:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C19C81D1; Wed, 7 Nov 2012 00:40:01 +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 A746B8FC08; Wed, 7 Nov 2012 00:40:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70e1mF003606; Wed, 7 Nov 2012 00:40:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70e1R7003604; Wed, 7 Nov 2012 00:40:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211070040.qA70e1R7003604@svn.freebsd.org> From: Eitan Adler Date: Wed, 7 Nov 2012 00:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242686 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:40:01 -0000 Author: eadler Date: Wed Nov 7 00:40:01 2012 New Revision: 242686 URL: http://svnweb.freebsd.org/changeset/base/242686 Log: MFC r242576: Prefer the use of stdbool to custom defines. Approved by: cperciva (implicit) Modified: stable/9/games/fortune/fortune/fortune.c Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/fortune.c ============================================================================== --- stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:30:25 2012 (r242685) +++ stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:40:01 2012 (r242686) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,9 +63,8 @@ __FBSDID("$FreeBSD$"); #include "strfile.h" #include "pathnames.h" -#define TRUE 1 -#define FALSE 0 -#define bool short +#define TRUE true +#define FALSE false #define MINW 6 /* minimum wait if desired */ #define CPERS 20 /* # of chars for each sec */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 00:41:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F002E349; Wed, 7 Nov 2012 00:41:07 +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 D3E408FC08; Wed, 7 Nov 2012 00:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA70f72G003912; Wed, 7 Nov 2012 00:41:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA70f7CW003909; Wed, 7 Nov 2012 00:41:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211070041.qA70f7CW003909@svn.freebsd.org> From: Eitan Adler Date: Wed, 7 Nov 2012 00:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242687 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 00:41:08 -0000 Author: eadler Date: Wed Nov 7 00:41:07 2012 New Revision: 242687 URL: http://svnweb.freebsd.org/changeset/base/242687 Log: MFC r242577: Make OK_TO_WRITE_TO_DISK an envrionment variable instead of a compile time option. While here, don't differ based on the existence of LOCK_EX which doesn't seem to have ever made a difference on FreeBSD. Approved by: cperciva (implicit) Modified: stable/9/games/fortune/fortune/fortune.6 stable/9/games/fortune/fortune/fortune.c Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/fortune.6 ============================================================================== --- stable/9/games/fortune/fortune/fortune.6 Wed Nov 7 00:40:01 2012 (r242686) +++ stable/9/games/fortune/fortune/fortune.6 Wed Nov 7 00:41:07 2012 (r242687) @@ -170,6 +170,9 @@ looks for data files. If not set it will default to .Pa /usr/games/fortune . If none of the directories specified exist, it will print a warning and exit. +.It Ev FORTUNE_SAVESTATE +If set, fortune will save some state about what fortune +it was up to on disk. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/games/fortune/*" Modified: stable/9/games/fortune/fortune/fortune.c ============================================================================== --- stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:40:01 2012 (r242686) +++ stable/9/games/fortune/fortune/fortune.c Wed Nov 7 00:41:07 2012 (r242687) @@ -107,6 +107,7 @@ bool Offend = FALSE; /* offensive fortu bool All_forts = FALSE; /* any fortune allowed */ bool Equal_probs = FALSE; /* scatter un-allocted prob equally */ bool Match = FALSE; /* dump fortunes matching a pattern */ +static bool WriteToDisk = false; /* use files on disk to save state */ #ifdef DEBUG bool Debug = FALSE; /* print debug messages */ #endif @@ -170,9 +171,10 @@ static regex_t Re_pat; int main(int argc, char *argv[]) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ + + if (getenv("FORTUNE_SAVESTATE") != NULL) + WriteToDisk = true; (void) setlocale(LC_ALL, ""); @@ -190,26 +192,22 @@ main(int argc, char *argv[]) display(Fortfile); -#ifdef OK_TO_WRITE_DISK - if ((fd = creat(Fortfile->posfile, 0666)) < 0) { - perror(Fortfile->posfile); - exit(1); + if (WriteToDisk) { + if ((fd = creat(Fortfile->posfile, 0666)) < 0) { + perror(Fortfile->posfile); + exit(1); + } + /* + * if we can, we exclusive lock, but since it isn't very + * important, we just punt if we don't have easy locking + * available. + */ + flock(fd, LOCK_EX); + write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); + if (!Fortfile->was_pos_file) + chmod(Fortfile->path, 0666); + flock(fd, LOCK_UN); } -#ifdef LOCK_EX - /* - * if we can, we exclusive lock, but since it isn't very - * important, we just punt if we don't have easy locking - * available. - */ - (void) flock(fd, LOCK_EX); -#endif /* LOCK_EX */ - write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); - if (!Fortfile->was_pos_file) - (void) chmod(Fortfile->path, 0666); -#ifdef LOCK_EX - (void) flock(fd, LOCK_UN); -#endif /* LOCK_EX */ -#endif /* OK_TO_WRITE_DISK */ if (Wait) { if (Fort_len == 0) (void) fortlen(); @@ -587,9 +585,8 @@ over: fp->next = *head; *head = fp; } -#ifdef OK_TO_WRITE_DISK - fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) + fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); return (TRUE); } @@ -691,10 +688,9 @@ all_forts(FILEDESC *fp, char *offensive) obscene->name = ++sp; obscene->datfile = datfile; obscene->posfile = posfile; - obscene->read_tbl = FALSE; -#ifdef OK_TO_WRITE_DISK - obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ + obscene->read_tbl = false; + if (WriteToDisk) + obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); } /* @@ -824,12 +820,13 @@ is_fortfile(const char *file, char **dat else free(datfile); if (posp != NULL) { -#ifdef OK_TO_WRITE_DISK - *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ - (void) strcat(*posp, ".pos"); -#else - *posp = NULL; -#endif /* OK_TO_WRITE_DISK */ + if (WriteToDisk) { + *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ + strcat(*posp, ".pos"); + } + else { + *posp = NULL; + } } DPRINTF(2, (stderr, "TRUE\n")); @@ -1110,23 +1107,21 @@ open_dat(FILEDESC *fp) void get_pos(FILEDESC *fp) { -#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ assert(fp->read_tbl); if (fp->pos == POS_UNKNOWN) { -#ifdef OK_TO_WRITE_DISK - if ((fd = open(fp->posfile, O_RDONLY)) < 0 || - read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + if (WriteToDisk) { + if ((fd = open(fp->posfile, O_RDONLY)) < 0 || + read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) + fp->pos = arc4random_uniform(fp->tbl.str_numstr); + else if (fp->pos >= fp->tbl.str_numstr) + fp->pos %= fp->tbl.str_numstr; + if (fd >= 0) + close(fd); + } + else fp->pos = arc4random_uniform(fp->tbl.str_numstr); - else if (fp->pos >= fp->tbl.str_numstr) - fp->pos %= fp->tbl.str_numstr; - if (fd >= 0) - (void) close(fd); -#else - fp->pos = arc4random_uniform(fp->tbl.str_numstr); -#endif /* OK_TO_WRITE_DISK */ } if (++(fp->pos) >= fp->tbl.str_numstr) fp->pos -= fp->tbl.str_numstr; From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 02:14:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6BC156A; Wed, 7 Nov 2012 02:14:03 +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 B7A798FC08; Wed, 7 Nov 2012 02:14:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA72E3uG022996; Wed, 7 Nov 2012 02:14:03 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA72E3o6022988; Wed, 7 Nov 2012 02:14:03 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211070214.qA72E3o6022988@svn.freebsd.org> From: Devin Teske Date: Wed, 7 Nov 2012 02:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242688 - in head/sys/boot: common i386/loader ia64/common pc98/loader powerpc/ofw powerpc/ps3 sparc64/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 02:14:04 -0000 Author: dteske Date: Wed Nov 7 02:14:03 2012 New Revision: 242688 URL: http://svnweb.freebsd.org/changeset/base/242688 Log: Hook in new files menusets.4th and manual. Approved by: adrian (co-mentor) (implicit) Modified: head/sys/boot/common/Makefile.inc head/sys/boot/i386/loader/Makefile head/sys/boot/ia64/common/Makefile head/sys/boot/pc98/loader/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/common/Makefile.inc Wed Nov 7 02:14:03 2012 (r242688) @@ -64,6 +64,7 @@ MAN+= ../forth/delay.4th.8 MAN+= ../forth/loader.conf.5 MAN+= ../forth/loader.4th.8 MAN+= ../forth/menu.4th.8 +MAN+= ../forth/menusets.4th.8 MAN+= ../forth/version.4th.8 .endif Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/i386/loader/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -103,7 +103,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th FILES+= brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) Modified: head/sys/boot/ia64/common/Makefile ============================================================================== --- head/sys/boot/ia64/common/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/ia64/common/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -35,7 +35,7 @@ loader.help: help.common FILES+= loader.4th support.4th loader.conf FILES+= screen.4th frames.4th FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th .if !exists(${DESTDIR}/boot/loader.rc) FILES+= loader.rc .endif Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/pc98/loader/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -88,7 +88,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th FILES+= brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/powerpc/ofw/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -105,7 +105,7 @@ loader.help: help.common help.ofw FILES= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/powerpc/ps3/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -116,7 +116,7 @@ loader.help: help.common help.ps3 FILES= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Wed Nov 7 00:41:07 2012 (r242687) +++ head/sys/boot/sparc64/loader/Makefile Wed Nov 7 02:14:03 2012 (r242688) @@ -99,7 +99,7 @@ loader.help: help.common help.sparc64 FILES= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th -FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 06:23:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE9367DD; Wed, 7 Nov 2012 06:23:23 +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 93B6B8FC08; Wed, 7 Nov 2012 06:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA76NNWd063823; Wed, 7 Nov 2012 06:23:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA76NN3W063819; Wed, 7 Nov 2012 06:23:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211070623.qA76NN3W063819@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 Nov 2012 06:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242689 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 06:23:23 -0000 Author: adrian Date: Wed Nov 7 06:23:23 2012 New Revision: 242689 URL: http://svnweb.freebsd.org/changeset/base/242689 Log: Add new HAL configuration features for the updated AR9300 HAL. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_debug.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Nov 7 02:14:03 2012 (r242688) +++ head/sys/dev/ath/ath_hal/ah.h Wed Nov 7 06:23:23 2012 (r242689) @@ -1215,6 +1215,9 @@ typedef struct int ath_hal_enable_ani; /* should set this.. */ int ath_hal_cwm_ignore_ext_cca; int ath_hal_show_bb_panic; + int ath_hal_ant_ctrl_comm2g_switch_enable; + int ath_hal_ext_atten_margin_cfg; + int ath_hal_war70c; } HAL_OPS_CONFIG; /* Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Wed Nov 7 02:14:03 2012 (r242688) +++ head/sys/dev/ath/ath_hal/ah_debug.h Wed Nov 7 06:23:23 2012 (r242689) @@ -52,6 +52,7 @@ enum { HAL_DEBUG_CHANNEL = 0x02000000, HAL_DEBUG_QUEUE = 0x04000000, HAL_DEBUG_PRINT_REG = 0x08000000, + HAL_DEBUG_FCS_RTT = 0x10000000, HAL_DEBUG_UNMASKABLE = 0x80000000, /* always printed */ HAL_DEBUG_ANY = 0xffffffff Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Nov 7 02:14:03 2012 (r242688) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Nov 7 06:23:23 2012 (r242689) @@ -276,7 +276,9 @@ typedef struct { halApmEnable : 1, halIntrMitigation : 1, hal49GhzSupport : 1, - halAntDivCombSupport : 1; + halAntDivCombSupport : 1, + halAntDivCombSupportOrg : 1, + halRadioRetentionSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 06:29:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CB33C35; Wed, 7 Nov 2012 06:29:45 +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 5A7A88FC14; Wed, 7 Nov 2012 06:29:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA76Tju4065008; Wed, 7 Nov 2012 06:29:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA76TjiS065006; Wed, 7 Nov 2012 06:29:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211070629.qA76TjiS065006@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 Nov 2012 06:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242690 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 06:29:45 -0000 Author: adrian Date: Wed Nov 7 06:29:45 2012 New Revision: 242690 URL: http://svnweb.freebsd.org/changeset/base/242690 Log: Disable my software queue TIM and PS handling for now. ps-poll is totally broken in its current form. This should unbreak things enough to let people use PS-POLL devices, but leave it in place for me to finish PS-POLL handling. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Nov 7 06:23:23 2012 (r242689) +++ head/sys/dev/ath/if_ath.c Wed Nov 7 06:29:45 2012 (r242690) @@ -117,6 +117,15 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ATH_DEBUG +#include +#endif + +/* + * Only enable this if you're working on PS-POLL support. + */ +#undef ATH_SW_PSQ + /* * ATH_BCBUF determines the number of vap's that can transmit * beacons and also (currently) the number of vap's that can @@ -877,6 +886,13 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */ /* + * Setup the ALQ logging if required + */ +#ifdef ATH_DEBUG + if_ath_alq_init(&sc->sc_alq, device_get_nameunit(sc->sc_dev)); +#endif + + /* * Setup dynamic sysctl's now that country code and * regdomain are available from the hal. */ @@ -936,6 +952,10 @@ ath_detach(struct ath_softc *sc) #endif ath_rate_detach(sc->sc_rc); +#ifdef ATH_DEBUG + if_ath_alq_tidyup(&sc->sc_alq); +#endif + ath_dfs_detach(sc); ath_desc_free(sc); ath_txdma_teardown(sc); @@ -5424,6 +5444,7 @@ ath_dfs_tasklet(void *p, int npending) static void ath_node_powersave(struct ieee80211_node *ni, int enable) { +#ifdef ATH_SW_PSQ struct ath_node *an = ATH_NODE(ni); struct ieee80211com *ic = ni->ni_ic; struct ath_softc *sc = ic->ic_ifp->if_softc; @@ -5443,6 +5464,12 @@ ath_node_powersave(struct ieee80211_node /* Update net80211 state */ avp->av_node_ps(ni, enable); +#else + struct ath_vap *avp = ATH_VAP(ni->ni_vap); + + /* Update net80211 state */ + avp->av_node_ps(ni, enable); +#endif/* ATH_SW_PSQ */ } /* @@ -5483,6 +5510,7 @@ ath_node_powersave(struct ieee80211_node static int ath_node_set_tim(struct ieee80211_node *ni, int enable) { +#ifdef ATH_SW_PSQ struct ieee80211com *ic = ni->ni_ic; struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_node *an = ATH_NODE(ni); @@ -5567,6 +5595,11 @@ ath_node_set_tim(struct ieee80211_node * } return (changed); +#else + struct ath_vap *avp = ATH_VAP(ni->ni_vap); + + return (avp->av_set_tim(ni, enable)); +#endif /* ATH_SW_PSQ */ } /* @@ -5594,6 +5627,7 @@ void ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, int enable) { +#ifdef ATH_SW_PSQ struct ath_node *an; struct ath_vap *avp; @@ -5657,6 +5691,9 @@ ath_tx_update_tim(struct ath_softc *sc, ATH_NODE_UNLOCK(an); } } +#else + return; +#endif /* ATH_SW_PSQ */ } MODULE_VERSION(if_ath, 1); From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 06:53:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BD25F46; Wed, 7 Nov 2012 06:53:45 +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 0D7178FC14; Wed, 7 Nov 2012 06:53:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA76ri4M069108; Wed, 7 Nov 2012 06:53:44 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA76riEB069106; Wed, 7 Nov 2012 06:53:44 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211070653.qA76riEB069106@svn.freebsd.org> From: Kevin Lo Date: Wed, 7 Nov 2012 06:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242691 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 06:53:45 -0000 Author: kevlo Date: Wed Nov 7 06:53:44 2012 New Revision: 242691 URL: http://svnweb.freebsd.org/changeset/base/242691 Log: Nm ipsec Modified: head/share/man/man4/ipsec.4 Modified: head/share/man/man4/ipsec.4 ============================================================================== --- head/share/man/man4/ipsec.4 Wed Nov 7 06:29:45 2012 (r242690) +++ head/share/man/man4/ipsec.4 Wed Nov 7 06:53:44 2012 (r242691) @@ -33,7 +33,7 @@ .Dt IPSEC 4 .Os .Sh NAME -.Nm IPsec +.Nm ipsec .Nd Internet Protocol Security protocol .Sh SYNOPSIS .Cd "options IPSEC" From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 07:01:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73D4A19D; Wed, 7 Nov 2012 07:01:00 +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 5739B8FC14; Wed, 7 Nov 2012 07:01:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7710GR070484; Wed, 7 Nov 2012 07:01:00 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7710wr070475; Wed, 7 Nov 2012 07:01:00 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211070701.qA7710wr070475@svn.freebsd.org> From: Kevin Lo Date: Wed, 7 Nov 2012 07:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242692 - in head: lib/msun/src secure/usr.bin/bdes sys/arm/lpc sys/dev/bktr sys/dev/nxge/xgehal sys/dev/sound/pci sys/kern sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 07:01:00 -0000 Author: kevlo Date: Wed Nov 7 07:00:59 2012 New Revision: 242692 URL: http://svnweb.freebsd.org/changeset/base/242692 Log: Fix typo; s/ouput/output Modified: head/lib/msun/src/k_rem_pio2.c head/secure/usr.bin/bdes/bdes.1 head/sys/arm/lpc/lpc_gpio.c head/sys/dev/bktr/bktr_audio.c head/sys/dev/nxge/xgehal/xgehal-device.c head/sys/dev/sound/pci/emu10kx.c head/sys/kern/tty.c head/sys/netinet/tcp_output.c Modified: head/lib/msun/src/k_rem_pio2.c ============================================================================== --- head/lib/msun/src/k_rem_pio2.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/lib/msun/src/k_rem_pio2.c Wed Nov 7 07:00:59 2012 (r242692) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); * z = (z-x[i])*2**24 * * - * y[] ouput result in an array of double precision numbers. + * y[] output result in an array of double precision numbers. * The dimension of y[] is: * 24-bit precision 1 * 53-bit precision 2 Modified: head/secure/usr.bin/bdes/bdes.1 ============================================================================== --- head/secure/usr.bin/bdes/bdes.1 Wed Nov 7 06:53:44 2012 (r242691) +++ head/secure/usr.bin/bdes/bdes.1 Wed Nov 7 07:00:59 2012 (r242692) @@ -141,7 +141,7 @@ or in CFB mode. .It Fl o Ar N Use .Ar N Ns \-bit -ouput feedback (OFB) mode. +output feedback (OFB) mode. Currently .Ar N must be a multiple of 8 between 8 and 64 inclusive (this does not conform Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/arm/lpc/lpc_gpio.c Wed Nov 7 07:00:59 2012 (r242692) @@ -33,7 +33,7 @@ * - Port3 with: * - 26 input pins (GPI_00..GPI_09 + GPI_15..GPI_23 + GPI_25 + GPI_27..GPI_28) * - 24 output pins (GPO_00..GPO_23) - * - 6 input/ouput pins (GPIO_00..GPIO_05) + * - 6 input/output pins (GPIO_00..GPIO_05) * * Pins are mapped to logical pin number as follows: * [0..9] -> GPI_00..GPI_09 (port 3) Modified: head/sys/dev/bktr/bktr_audio.c ============================================================================== --- head/sys/dev/bktr/bktr_audio.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/dev/bktr/bktr_audio.c Wed Nov 7 07:00:59 2012 (r242692) @@ -498,7 +498,7 @@ void msp_autodetect( bktr_ptr_t bktr ) { } - /* MSP3415D SPECIAL CASE Use the Tuner's Mono audio ouput for the MSP */ + /* MSP3415D SPECIAL CASE Use the Tuner's Mono audio output for the MSP */ /* (for Hauppauge 44xxx card with Tuner Type 0x2a) */ else if ( ( (strncmp("3415D", bktr->msp_version_string, 5) == 0) &&(bktr->msp_use_mono_source == 1) Modified: head/sys/dev/nxge/xgehal/xgehal-device.c ============================================================================== --- head/sys/dev/nxge/xgehal/xgehal-device.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/dev/nxge/xgehal/xgehal-device.c Wed Nov 7 07:00:59 2012 (r242692) @@ -6793,7 +6793,7 @@ _again: } else { /* * Logging Error messages in the excess temperature, - * Bias current, laser ouput for three cycle + * Bias current, laser output for three cycle */ __hal_updt_stats_xpak(hldev); hldev->stats.sw_dev_err_stats.xpak_counter.tick_period = 0; Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/dev/sound/pci/emu10kx.c Wed Nov 7 07:00:59 2012 (r242692) @@ -3168,7 +3168,7 @@ emu_pci_attach(device_t dev) sc->output_base = 0x20; /* * XXX 5.1 Analog outputs are inside efxc address space! - * They use ouput+0x11/+0x12 (=efxc+1/+2). + * They use output+0x11/+0x12 (=efxc+1/+2). * Don't use this efx registers for recording on SB Live! 5.1! */ sc->efxc_base = 0x30; Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/kern/tty.c Wed Nov 7 07:00:59 2012 (r242692) @@ -114,7 +114,7 @@ tty_watermarks(struct tty *tp) /* Set low watermark at 10% (when 90% is available). */ tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10; - /* Provide an ouput buffer for 0.2 seconds of data. */ + /* Provide an output buffer for 0.2 seconds of data. */ bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX); ttyoutq_setsize(&tp->t_outq, tp, bs); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Nov 7 06:53:44 2012 (r242691) +++ head/sys/netinet/tcp_output.c Wed Nov 7 07:00:59 2012 (r242692) @@ -127,7 +127,7 @@ static void inline hhook_run_tcp_est_out static void inline cc_after_idle(struct tcpcb *tp); /* - * Wrapper for the TCP established ouput helper hook. + * Wrapper for the TCP established output helper hook. */ static void inline hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 07:11:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EE243EF; Wed, 7 Nov 2012 07:11:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id C530C8FC08; Wed, 7 Nov 2012 07:11:48 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qA77BkZx089945; Wed, 7 Nov 2012 11:11:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qA77BkZ4089944; Wed, 7 Nov 2012 11:11:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Nov 2012 11:11:46 +0400 From: Gleb Smirnoff To: Attilio Rao Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... Message-ID: <20121107071146.GC84182@FreeBSD.org> References: <201210221750.q9MHot26061585@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 07:11:49 -0000 On Tue, Nov 06, 2012 at 10:53:01PM +0000, Attilio Rao wrote: A> no, ports/thirdy part should be adjusted on the -CURRENT ABI. btw, shouldn't the fusefs ports be patched, so that sysutils/fusefs-kmod is no longer built and installed on __FreeBSD_version >= 1000021 ? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 07:30:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8427717; Wed, 7 Nov 2012 07:30:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0288FC0C; Wed, 7 Nov 2012 07:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA77Ue8R075689; Wed, 7 Nov 2012 07:30:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA77UeK7075686; Wed, 7 Nov 2012 07:30:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211070730.qA77UeK7075686@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 7 Nov 2012 07:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242693 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 07:30:40 -0000 Author: glebius Date: Wed Nov 7 07:30:40 2012 New Revision: 242693 URL: http://svnweb.freebsd.org/changeset/base/242693 Log: It may happen that pfsync holds the last reference on a state. In this case keys had already been freed. If encountering such state, then just release last reference. Not sure this can happen as a runtime race, but can be reproduced by the following scenario: - enable pfsync - disable pfsync - wait some time - enable pfsync Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Wed Nov 7 07:00:59 2012 (r242692) +++ head/sys/netpfil/pf/if_pfsync.c Wed Nov 7 07:30:40 2012 (r242693) @@ -1545,6 +1545,16 @@ pfsync_sendout(int schedswi) KASSERT(st->sync_state == q, ("%s: st->sync_state == q", __func__)); + if (st->timeout == PFTM_UNLINKED) { + /* + * This happens if pfsync was once + * stopped, and then re-enabled + * after long time. Theoretically + * may happen at usual runtime, too. + */ + pf_release_state(st); + continue; + } /* * XXXGL: some of write methods do unlocked reads * of state data :( From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 07:35:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D9BB9BD; Wed, 7 Nov 2012 07:35:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01F998FC0A; Wed, 7 Nov 2012 07:35:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA77Z5b0076519; Wed, 7 Nov 2012 07:35:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA77Z5XM076517; Wed, 7 Nov 2012 07:35:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211070735.qA77Z5XM076517@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 7 Nov 2012 07:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242694 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 07:35:06 -0000 Author: glebius Date: Wed Nov 7 07:35:05 2012 New Revision: 242694 URL: http://svnweb.freebsd.org/changeset/base/242694 Log: Merge rev. 1.125 from OpenBSD: date: 2009/06/12 02:03:51; author: dlg; state: Exp; lines: +59 -69 rewrite the way states from pfsync are merged into the local state tree and the conditions on which pfsync will notify its peers on a stale update. each side (ie, the sending and receiving side) of the state update is compared separately. any side that is further along than the local state tree is merged. if any side is further along in the local state table, an update is sent out telling the peers about it. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Wed Nov 7 07:30:40 2012 (r242693) +++ head/sys/netpfil/pf/if_pfsync.c Wed Nov 7 07:35:05 2012 (r242694) @@ -47,6 +47,7 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions + * 1.125 - rewrite merge or stale processing * 1.128 - cleanups * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks @@ -774,7 +775,7 @@ static int pfsync_upd_tcp(struct pf_state *st, struct pfsync_state_peer *src, struct pfsync_state_peer *dst) { - int sfail = 0; + int sync = 0; PF_STATE_LOCK_ASSERT(st); @@ -783,27 +784,22 @@ pfsync_upd_tcp(struct pf_state *st, stru * for syn-proxy states. Neither should the * sequence window slide backwards. */ - if (st->src.state > src->state && + if ((st->src.state > src->state && (st->src.state < PF_TCPS_PROXY_SRC || - src->state >= PF_TCPS_PROXY_SRC)) - sfail = 1; - else if (SEQ_GT(st->src.seqlo, ntohl(src->seqlo))) - sfail = 3; - else if (st->dst.state > dst->state) { - /* There might still be useful - * information about the src state here, - * so import that part of the update, - * then "fail" so we send the updated - * state back to the peer who is missing - * our what we know. */ + src->state >= PF_TCPS_PROXY_SRC)) || + SEQ_GT(st->src.seqlo, ntohl(src->seqlo))) + sync++; + else pf_state_peer_ntoh(src, &st->src); - /* XXX do anything with timeouts? */ - sfail = 7; - } else if (st->dst.state >= TCPS_SYN_SENT && - SEQ_GT(st->dst.seqlo, ntohl(dst->seqlo))) - sfail = 4; - return (sfail); + if (st->dst.state > dst->state || + (st->dst.state >= TCPS_SYN_SENT && + SEQ_GT(st->dst.seqlo, ntohl(dst->seqlo)))) + sync++; + else + pf_state_peer_ntoh(dst, &st->dst); + + return (sync); } static int @@ -811,9 +807,8 @@ pfsync_in_upd(struct pfsync_pkt *pkt, st { struct pfsync_softc *sc = V_pfsyncif; struct pfsync_state *sa, *sp; - struct pf_state_key *sk; struct pf_state *st; - int sfail; + int sync; struct mbuf *mp; int len = count * sizeof(*sp); @@ -855,29 +850,33 @@ pfsync_in_upd(struct pfsync_pkt *pkt, st PFSYNC_UNLOCK(sc); } - sk = st->key[PF_SK_WIRE]; /* XXX right one? */ - sfail = 0; - if (sk->proto == IPPROTO_TCP) - sfail = pfsync_upd_tcp(st, &sp->src, &sp->dst); + if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) + sync = pfsync_upd_tcp(st, &sp->src, &sp->dst); else { + sync = 0; + /* * Non-TCP protocol state machine always go * forwards */ if (st->src.state > sp->src.state) - sfail = 5; - else if (st->dst.state > sp->dst.state) - sfail = 6; + sync++; + else + pf_state_peer_ntoh(&sp->src, &st->src); + if (st->dst.state > sp->dst.state) + sync++; + else + pf_state_peer_ntoh(&sp->dst, &st->dst); + } + if (sync < 2) { + pfsync_alloc_scrub_memory(&sp->dst, &st->dst); + pf_state_peer_ntoh(&sp->dst, &st->dst); + st->expire = time_uptime; + st->timeout = sp->timeout; } + st->pfsync_time = time_uptime; - if (sfail) { - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("pfsync: %s stale update (%d)" - " id: %016llx creatorid: %08x\n", - (sfail < 7 ? "ignoring" : "partial"), - sfail, (unsigned long long)be64toh(st->id), - ntohl(st->creatorid)); - } + if (sync) { V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); @@ -887,12 +886,6 @@ pfsync_in_upd(struct pfsync_pkt *pkt, st PFSYNC_UNLOCK(sc); continue; } - pfsync_alloc_scrub_memory(&sp->dst, &st->dst); - pf_state_peer_ntoh(&sp->src, &st->src); - pf_state_peer_ntoh(&sp->dst, &st->dst); - st->expire = time_uptime; - st->timeout = sp->timeout; - st->pfsync_time = time_uptime; PF_STATE_UNLOCK(st); } @@ -904,12 +897,9 @@ pfsync_in_upd_c(struct pfsync_pkt *pkt, { struct pfsync_softc *sc = V_pfsyncif; struct pfsync_upd_c *ua, *up; - struct pf_state_key *sk; struct pf_state *st; - int len = count * sizeof(*up); - int sfail; - + int sync; struct mbuf *mp; int offp, i; @@ -951,28 +941,33 @@ pfsync_in_upd_c(struct pfsync_pkt *pkt, PFSYNC_UNLOCK(sc); } - sk = st->key[PF_SK_WIRE]; /* XXX right one? */ - sfail = 0; - if (sk->proto == IPPROTO_TCP) - sfail = pfsync_upd_tcp(st, &up->src, &up->dst); + if (st->key[PF_SK_WIRE]->proto == IPPROTO_TCP) + sync = pfsync_upd_tcp(st, &up->src, &up->dst); else { + sync = 0; + /* - * Non-TCP protocol state machine always go forwards + * Non-TCP protocol state machine always go + * forwards */ if (st->src.state > up->src.state) - sfail = 5; - else if (st->dst.state > up->dst.state) - sfail = 6; + sync++; + else + pf_state_peer_ntoh(&up->src, &st->src); + if (st->dst.state > up->dst.state) + sync++; + else + pf_state_peer_ntoh(&up->dst, &st->dst); + } + if (sync < 2) { + pfsync_alloc_scrub_memory(&up->dst, &st->dst); + pf_state_peer_ntoh(&up->dst, &st->dst); + st->expire = time_uptime; + st->timeout = up->timeout; } + st->pfsync_time = time_uptime; - if (sfail) { - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("pfsync: ignoring stale update " - "(%d) id: %016llx " - "creatorid: %08x\n", sfail, - (unsigned long long)be64toh(st->id), - ntohl(st->creatorid)); - } + if (sync) { V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); @@ -982,12 +977,6 @@ pfsync_in_upd_c(struct pfsync_pkt *pkt, PFSYNC_UNLOCK(sc); continue; } - pfsync_alloc_scrub_memory(&up->dst, &st->dst); - pf_state_peer_ntoh(&up->src, &st->src); - pf_state_peer_ntoh(&up->dst, &st->dst); - st->expire = time_uptime; - st->timeout = up->timeout; - st->pfsync_time = time_uptime; PF_STATE_UNLOCK(st); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 08:13:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AF7C5A2; Wed, 7 Nov 2012 08:13:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E900C8FC08; Wed, 7 Nov 2012 08:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA78DuAY084063; Wed, 7 Nov 2012 08:13:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA78Dua2084061; Wed, 7 Nov 2012 08:13:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211070813.qA78Dua2084061@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 7 Nov 2012 08:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242695 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 08:13:57 -0000 Author: hselasky Date: Wed Nov 7 08:13:56 2012 New Revision: 242695 URL: http://svnweb.freebsd.org/changeset/base/242695 Log: Patch to improve USB serial console. MFC after: 1 weeks Submitted by: Bruce Evans Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 07:35:05 2012 (r242694) +++ head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 08:13:56 2012 (r242695) @@ -425,16 +425,13 @@ ucom_attach_tty(struct ucom_super_softc if ((ucom_cons_softc == NULL) && (ssc->sc_unit == ucom_cons_unit) && (sc->sc_subunit == ucom_cons_subunit)) { - struct termios t; - DPRINTF("unit %d subunit %d is console", ssc->sc_unit, sc->sc_subunit); + DPRINTF("unit %d subunit %d is console", + ssc->sc_unit, sc->sc_subunit); ucom_cons_softc = sc; - memset(&t, 0, sizeof(t)); - t.c_ispeed = ucom_cons_baud; - t.c_ospeed = t.c_ispeed; - t.c_cflag = CS8; + tty_init_console(tp, ucom_cons_baud); UCOM_MTX_LOCK(ucom_cons_softc); ucom_cons_rx_low = 0; @@ -443,7 +440,7 @@ ucom_attach_tty(struct ucom_super_softc ucom_cons_tx_high = 0; sc->sc_flag |= UCOM_FLAG_CONSOLE; ucom_open(ucom_cons_softc->sc_tty); - ucom_param(ucom_cons_softc->sc_tty, &t); + ucom_param(ucom_cons_softc->sc_tty, &tp->t_termios_init_in); UCOM_MTX_UNLOCK(ucom_cons_softc); } @@ -1186,17 +1183,22 @@ ucom_param(struct tty *tp, struct termio if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) { /* XXX the TTY layer should call "open()" first! */ - + /* + * Not quite: Its ordering is partly backwards, but + * some parameters must be set early in ttydev_open(), + * possibly before calling ttydevsw_open(). + */ error = ucom_open(tp); - if (error) { + if (error) goto done; - } + opened = 1; } DPRINTF("sc = %p\n", sc); /* Check requested parameters. */ if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) { + /* XXX c_ospeed == 0 is perfectly valid. */ DPRINTF("mismatch ispeed and ospeed\n"); error = EINVAL; goto done; From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 08:29:41 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DAE9EA2; Wed, 7 Nov 2012 08:29:41 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [IPv6:2a01:4f8:162:1142::2]) by mx1.freebsd.org (Postfix) with ESMTP id 291C28FC08; Wed, 7 Nov 2012 08:29:40 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 56983EF17; Wed, 7 Nov 2012 09:29:39 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MnMUsp4PdRc0; Wed, 7 Nov 2012 09:29:37 +0100 (CET) Received: from nibbler-osx-wlan.fritz.box (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id F3C16EF0E; Wed, 7 Nov 2012 09:29:36 +0100 (CET) Message-ID: <509A1BEF.9010106@smeets.im> Date: Wed, 07 Nov 2012 09:29:35 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... References: <201210221750.q9MHot26061585@svn.freebsd.org> <20121107071146.GC84182@FreeBSD.org> In-Reply-To: <20121107071146.GC84182@FreeBSD.org> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig68281EB22B55A424E9B25188" Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 08:29:41 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig68281EB22B55A424E9B25188 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 07.11.12 08:11, Gleb Smirnoff wrote: > On Tue, Nov 06, 2012 at 10:53:01PM +0000, Attilio Rao wrote: > A> no, ports/thirdy part should be adjusted on the -CURRENT ABI. >=20 > btw, shouldn't the fusefs ports be patched, so that sysutils/fusefs-kmo= d > is no longer built and installed on __FreeBSD_version >=3D 1000021 ? >=20 I have a patch [1] for that, but it touches all of the fuse ports and bsd.port.mk, and as we are in a Feature freeze and any change that touches bsd.port.mk needs an exp-run i chose to wait until after the 9.1 release. Florian [1] http://tb.smeets.im/~flo/fuse.diff --------------enig68281EB22B55A424E9B25188 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlCaG+8ACgkQapo8P8lCvwmddQCZAaFBe6U4QslrK5/g1xTVoytD bvgAoL5GMAWTiH0ROW7e17GzWmmg/XPs =dIlp -----END PGP SIGNATURE----- --------------enig68281EB22B55A424E9B25188-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 08:30:17 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EFA9205; Wed, 7 Nov 2012 08:30:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id A8B918FC22; Wed, 7 Nov 2012 08:30:16 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qA78UETY090483; Wed, 7 Nov 2012 12:30:14 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qA78UD0b090482; Wed, 7 Nov 2012 12:30:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Nov 2012 12:30:13 +0400 From: Gleb Smirnoff To: Florian Smeets Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... Message-ID: <20121107083013.GD84182@FreeBSD.org> References: <201210221750.q9MHot26061585@svn.freebsd.org> <20121107071146.GC84182@FreeBSD.org> <509A1BEF.9010106@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <509A1BEF.9010106@smeets.im> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 08:30:17 -0000 On Wed, Nov 07, 2012 at 09:29:35AM +0100, Florian Smeets wrote: F> On 07.11.12 08:11, Gleb Smirnoff wrote: F> > On Tue, Nov 06, 2012 at 10:53:01PM +0000, Attilio Rao wrote: F> > A> no, ports/thirdy part should be adjusted on the -CURRENT ABI. F> > F> > btw, shouldn't the fusefs ports be patched, so that sysutils/fusefs-kmod F> > is no longer built and installed on __FreeBSD_version >= 1000021 ? F> > F> F> I have a patch [1] for that, but it touches all of the fuse ports and F> bsd.port.mk, and as we are in a Feature freeze and any change that F> touches bsd.port.mk needs an exp-run i chose to wait until after the 9.1 F> release. Florian, thanks for taking care of that! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 15:47:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59D0AFFF; Wed, 7 Nov 2012 15:47:37 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40DE08FC0C; Wed, 7 Nov 2012 15:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7FlbMJ057677; Wed, 7 Nov 2012 15:47:37 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7FlbC1057675; Wed, 7 Nov 2012 15:47:37 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201211071547.qA7FlbC1057675@svn.freebsd.org> From: Isabell Long Date: Wed, 7 Nov 2012 15:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242696 - head/usr.sbin/wpa/wpa_supplicant X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 15:47:37 -0000 Author: issyl0 (doc committer) Date: Wed Nov 7 15:47:36 2012 New Revision: 242696 URL: http://svnweb.freebsd.org/changeset/base/242696 Log: Document all of the options that wpa_supplicant accepts. PR: docs/171755 Reviewed by: gavin Approved by: gabor (mentor) MFC after: 5 days Modified: head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Modified: head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Wed Nov 7 08:13:56 2012 (r242695) +++ head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Wed Nov 7 15:47:36 2012 (r242696) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2008 +.Dd November 7, 2012 .Dt WPA_SUPPLICANT 8 .Os .Sh NAME @@ -32,9 +32,26 @@ .Nd "WPA/802.11i Supplicant for wireless network devices" .Sh SYNOPSIS .Nm -.Op Fl BdehLqsvw +.Op Fl BdhKLqstuvW +.Op Fl b Ar br_ifname +.Fl c Ar config-file +.Op Fl C Ar ctrl +.Op Fl D Ar driver +.Op Fl f Ar debug file +.Op Fl g Ar global ctrl +.Fl i Ar ifname +.Op Fl o Ar override driver +.Op Fl O Ar override ctrl +.Op Fl P Ar pid file +.Oo Fl N .Fl i Ar ifname .Fl c Ar config-file +.Op Fl C Ar ctrl +.Op Fl D driver +.Op Fl p Ar driver_param +.Op Fl b Ar br_ifname +.No ... +.Oc .Sh DESCRIPTION The .Nm @@ -87,15 +104,36 @@ utility, using .Sh OPTIONS The following options are available: .Bl -tag -width indent +.It Fl b +Optional bridge interface name. +.It Fl B +Detach from the controlling terminal and run as a daemon process +in the background. .It Fl d Enable debugging messages. If this option is supplied twice, more verbose messages are displayed. -.It Fl e -Use an external IEEE 802.1X Supplicant program and disable the -internal Supplicant. -This option is not normally used. +.It Fl D +Driver name (can be multiple drivers: nl80211,wext). +.It Fl f +Log output to debug file instead of stdout. +.It Fl g +Global ctrl_interface. .It Fl h Show help text. +.It Fl K +Include key information in debugging output. +.It Fl L +Display the license for this program on the terminal and exit. +.It Fl N +Start describing a new interface. +.It Fl o +Overrides driver parameter for new interfaces. +.It Fl O +Override ctrl_interface parameter for new interfaces. +.It Fl p +Specify driver parameters. +.It Fl P +File in which to save the process PID. .It Fl q Decrease debugging verbosity (i.e., counteract the use of the .Fl d @@ -104,23 +142,14 @@ flag). Send log messages through .Xr syslog 3 instead of to the terminal. +.It Fl t +Include timestamp in debug messages. +.It Fl u +Enable DBus control interface. .It Fl v Display version information on the terminal and exit. -.It Fl w -If the specified interface is not present, wait for it to be -added; e.g.\& a cardbus device to be inserted. -This option is not normally used; instead, -.Xr devd 8 -should be configured to launch -.Nm -when a device is created. -.It Fl B -Detach from the controlling terminal and run as a daemon process -in the background. -.It Fl K -Include key information in debugging output. -.It Fl L -Display the license for this program on the terminal and exit. +.It Fl W +Wait for a control interface monitor before starting. .El .Sh SEE ALSO .Xr an 4 , From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 15:59:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9B6E408; Wed, 7 Nov 2012 15:59:24 +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 BCF568FC08; Wed, 7 Nov 2012 15:59:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7FxOVk059398; Wed, 7 Nov 2012 15:59:24 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7FxO9R059396; Wed, 7 Nov 2012 15:59:24 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211071559.qA7FxO9R059396@svn.freebsd.org> From: Warren Block Date: Wed, 7 Nov 2012 15:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242697 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 15:59:25 -0000 Author: wblock (doc committer) Date: Wed Nov 7 15:59:24 2012 New Revision: 242697 URL: http://svnweb.freebsd.org/changeset/base/242697 Log: Add devd.conf(5) and devd(8) to SEE ALSO xrefs. Give users a pointer to seemingly mysterious actions that are not done by ifconfig itself, but by devd triggering on events caused by ifconfig. PR: docs/173405 Submitted by: Mateusz Kwiatkowski MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Nov 7 15:47:36 2012 (r242696) +++ head/sbin/ifconfig/ifconfig.8 Wed Nov 7 15:59:24 2012 (r242697) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd November 7, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2714,7 +2714,9 @@ tried to alter an interface's configurat .Xr pfsync 4 , .Xr polling 4 , .Xr vlan 4 , +.Xr devd.conf 5 , .\" .Xr eon 5 , +.Xr devd 8 , .Xr rc 8 , .Xr routed 8 , .Xr jail 8 , From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 16:34:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8507245F; Wed, 7 Nov 2012 16:34:09 +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 6AD7B8FC0C; Wed, 7 Nov 2012 16:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7GY94H064742; Wed, 7 Nov 2012 16:34:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7GY9cJ064740; Wed, 7 Nov 2012 16:34:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211071634.qA7GY9cJ064740@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 Nov 2012 16:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242698 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 16:34:09 -0000 Author: adrian Date: Wed Nov 7 16:34:09 2012 New Revision: 242698 URL: http://svnweb.freebsd.org/changeset/base/242698 Log: Don't compile in my (not yet committed) ath_alq code unless ATH_DEBUG_ALQ is defined. This will unbreak ATH_DEBUG builds. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Nov 7 15:59:24 2012 (r242697) +++ head/sys/dev/ath/if_ath.c Wed Nov 7 16:34:09 2012 (r242698) @@ -117,7 +117,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ #include #endif @@ -888,7 +888,7 @@ ath_attach(u_int16_t devid, struct ath_s /* * Setup the ALQ logging if required */ -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ if_ath_alq_init(&sc->sc_alq, device_get_nameunit(sc->sc_dev)); #endif @@ -952,7 +952,7 @@ ath_detach(struct ath_softc *sc) #endif ath_rate_detach(sc->sc_rc); -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ if_ath_alq_tidyup(&sc->sc_alq); #endif From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 16:52:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34385C74; Wed, 7 Nov 2012 16:52:02 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1F2C8FC08; Wed, 7 Nov 2012 16:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Gq1ga067271; Wed, 7 Nov 2012 16:52:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Gq1aU067269; Wed, 7 Nov 2012 16:52:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211071652.qA7Gq1aU067269@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 7 Nov 2012 16:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242699 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 16:52:02 -0000 Author: jh Date: Wed Nov 7 16:52:01 2012 New Revision: 242699 URL: http://svnweb.freebsd.org/changeset/base/242699 Log: MFC r238991: Disallow sectorsize larger than MAXPHYS and mediasize smaller than sectorsize. PR: 169947 Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Wed Nov 7 16:34:09 2012 (r242698) +++ stable/9/sys/dev/md/md.c Wed Nov 7 16:52:01 2012 (r242699) @@ -1081,7 +1081,7 @@ mdcreate_swap(struct md_s *sc, struct md * Range check. Disallow negative sizes or any size less then the * size of a page. Then round to a page. */ - if (sc->mediasize == 0 || (sc->mediasize % PAGE_SIZE) != 0) + if (sc->mediasize <= 0 || (sc->mediasize % PAGE_SIZE) != 0) return (EDOM); /* @@ -1122,6 +1122,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd struct md_ioctl *mdio; struct md_s *sc; int error, i; + unsigned sectsize; if (md_debug) printf("mdctlioctl(%s %lx %p %x %p)\n", @@ -1150,6 +1151,12 @@ xmdctlioctl(struct cdev *dev, u_long cmd default: return (EINVAL); } + if (mdio->md_sectorsize == 0) + sectsize = DEV_BSIZE; + else + sectsize = mdio->md_sectorsize; + if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) + return (EINVAL); if (mdio->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdio->md_type); else { @@ -1162,10 +1169,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd if (mdio->md_options & MD_AUTOUNIT) mdio->md_unit = sc->unit; sc->mediasize = mdio->md_mediasize; - if (mdio->md_sectorsize == 0) - sc->sectorsize = DEV_BSIZE; - else - sc->sectorsize = mdio->md_sectorsize; + sc->sectorsize = sectsize; error = EDOOFUS; switch (sc->type) { case MD_MALLOC: From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 16:59:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52609232; Wed, 7 Nov 2012 16:59:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 360308FC12; Wed, 7 Nov 2012 16:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7GxDjK068375; Wed, 7 Nov 2012 16:59:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7GxDrg068372; Wed, 7 Nov 2012 16:59:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201211071659.qA7GxDrg068372@svn.freebsd.org> From: Warner Losh Date: Wed, 7 Nov 2012 16:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242700 - in head/sys/arm: arm at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 16:59:13 -0000 Author: imp Date: Wed Nov 7 16:59:12 2012 New Revision: 242700 URL: http://svnweb.freebsd.org/changeset/base/242700 Log: Minor cosmetic changes to bring atmel's initarm and the default initarm for FDT closer together. More to follow. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Nov 7 16:52:01 2012 (r242699) +++ head/sys/arm/arm/machdep.c Wed Nov 7 16:59:12 2012 (r242700) @@ -1206,6 +1206,9 @@ initarm(struct arm_boot_params *abp) pcpu0_init(); + /* Do basic tuning, hz etc */ + init_param1(); + /* Calculate number of L2 tables needed for mapping vm_page_array */ l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); l2size = (l2size >> L1_S_SHIFT) + 1; @@ -1219,17 +1222,16 @@ initarm(struct arm_boot_params *abp) /* Make it divisible by 4 */ l2size = (l2size + 3) & ~3; -#define KERNEL_TEXT_BASE (KERNBASE) freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_va, (np)); \ +#define valloc_pages(var, np) \ + alloc_pages((var).pv_va, (np)); \ (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); -#define alloc_pages(var, np) \ - (var) = freemempos; \ - freemempos += (np * PAGE_SIZE); \ +#define alloc_pages(var, np) \ + (var) = freemempos; \ + freemempos += (np * PAGE_SIZE); \ memset((char *)(var), 0, ((np) * PAGE_SIZE)); while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) @@ -1266,9 +1268,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); - - init_param1(); - valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* @@ -1323,8 +1322,7 @@ initarm(struct arm_boot_params *abp) err_devmap = platform_devmap_init(); pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | - DOMAIN_CLIENT); + cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); pmap_pa = kernel_l1pt.pv_pa; setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); @@ -1403,7 +1401,6 @@ initarm(struct arm_boot_params *abp) */ physmap_init(availmem_regions, availmem_regions_sz); - /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Nov 7 16:52:01 2012 (r242699) +++ head/sys/arm/at91/at91_machdep.c Wed Nov 7 16:59:12 2012 (r242700) @@ -496,9 +496,9 @@ initarm(struct arm_boot_params *abp) } } /* - * Allocate a page for the system page mapped to V0x00000000 - * This page will just contain the system vectors and can be - * shared by all processes. + * Allocate a page for the system page mapped to 0x00000000 + * or 0xffff0000. This page will just contain the system vectors + * and can be shared by all processes. */ valloc_pages(systempage, 1); @@ -565,10 +565,10 @@ initarm(struct arm_boot_params *abp) } pmap_devmap_bootstrap(l1pagetable, at91_devmap); - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); + cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); - cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); + cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); at91_soc_id(); From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 18:44:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F96D7EF; Wed, 7 Nov 2012 18:44:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 045EC8FC08; Wed, 7 Nov 2012 18:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Ii5He083059; Wed, 7 Nov 2012 18:44:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Ii5e9083057; Wed, 7 Nov 2012 18:44:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211071844.qA7Ii5e9083057@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 7 Nov 2012 18:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242702 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 18:44:06 -0000 Author: hselasky Date: Wed Nov 7 18:44:05 2012 New Revision: 242702 URL: http://svnweb.freebsd.org/changeset/base/242702 Log: The tty_inwakeup callback appears to be called both locked and unlocked. Handle the required locking automatically for now. MFC after: 1 weeks Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 17:41:17 2012 (r242701) +++ head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:44:05 2012 (r242702) @@ -788,15 +788,20 @@ ucom_inwakeup(struct tty *tp) { struct ucom_softc *sc = tty_softc(tp); uint16_t pos; + int locked; if (sc == NULL) return; - tty_lock(tp); + locked = mtx_owned(sc->sc_mtx); + + if (locked == 0) + tty_lock(tp); if (ttydisc_can_bypass(tp) != 0 || (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { - tty_unlock(tp); + if (locked == 0) + tty_unlock(tp); return; } @@ -821,7 +826,8 @@ ucom_inwakeup(struct tty *tp) (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) ucom_rts(sc, 0); - tty_unlock(tp); + if (locked == 0) + tty_unlock(tp); } static int From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 18:59:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23C1BCFF; Wed, 7 Nov 2012 18:59:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06C0A8FC08; Wed, 7 Nov 2012 18:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Ixgvd085222; Wed, 7 Nov 2012 18:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7IxgjE085220; Wed, 7 Nov 2012 18:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211071859.qA7IxgjE085220@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 7 Nov 2012 18:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242703 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 18:59:43 -0000 Author: hselasky Date: Wed Nov 7 18:59:42 2012 New Revision: 242703 URL: http://svnweb.freebsd.org/changeset/base/242703 Log: Add lock asserts instead of "auto-locking". MFC after: 1 weeks Suggested by: ed @ Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:44:05 2012 (r242702) +++ head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:59:42 2012 (r242703) @@ -788,20 +788,16 @@ ucom_inwakeup(struct tty *tp) { struct ucom_softc *sc = tty_softc(tp); uint16_t pos; - int locked; if (sc == NULL) return; - locked = mtx_owned(sc->sc_mtx); + UCOM_MTX_ASSERT(sc, MA_OWNED); - if (locked == 0) - tty_lock(tp); + DPRINTF("tp=%p\n", tp); if (ttydisc_can_bypass(tp) != 0 || (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { - if (locked == 0) - tty_unlock(tp); return; } @@ -825,9 +821,6 @@ ucom_inwakeup(struct tty *tp) if ((sc->sc_jitterbuf_in == pos) && (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) ucom_rts(sc, 0); - - if (locked == 0) - tty_unlock(tp); } static int From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 19:26:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8143E576; Wed, 7 Nov 2012 19:26:32 +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 656F78FC16; Wed, 7 Nov 2012 19:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7JQWHu089375; Wed, 7 Nov 2012 19:26:32 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7JQWIA089373; Wed, 7 Nov 2012 19:26:32 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211071926.qA7JQWIA089373@svn.freebsd.org> From: Warren Block Date: Wed, 7 Nov 2012 19:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242704 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 19:26:32 -0000 Author: wblock (doc committer) Date: Wed Nov 7 19:26:32 2012 New Revision: 242704 URL: http://svnweb.freebsd.org/changeset/base/242704 Log: Remove fifteen-year-old notes on media selection (suggested by simon@). Add commas after "e.g." and "i.e.". Change "silent" to "silence" in wireless create section (reviewed by adri@). MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Nov 7 18:59:42 2012 (r242703) +++ head/sbin/ifconfig/ifconfig.8 Wed Nov 7 19:26:32 2012 (r242704) @@ -142,7 +142,7 @@ The link-level address is specified as a series of colon-separated hex digits. This can be used to -e.g.\& set a new MAC address on an ethernet interface, though the +e.g.,\& set a new MAC address on an ethernet interface, though the mechanism used is not ethernet-specific. If the interface is already up when this option is used, it will be briefly brought down and @@ -301,7 +301,7 @@ Specify interface FIB. A FIB .Ar fib_number is assigned to all frames or packets received on that interface. -The FIB is not inherited, e.g. vlans or other sub-interfaces will use +The FIB is not inherited, e.g., vlans or other sub-interfaces will use the default FIB (0) irrespective of the parent interface's FIB. The kernel needs to be tuned to support more than the default FIB using the @@ -1003,7 +1003,7 @@ For example, if a device is capable of o with 802.11n and 802.11g then one can specify that g-only use should be used by specifying ``6:g''. Similarly the channel width can be specified by appending it -with ``/''; e.g. ``6/40'' specifies a 40MHz wide channel, +with ``/''; e.g., ``6/40'' specifies a 40MHz wide channel, These attributes can be combined as in: ``6:ht/40''. The full set of flags specified following a ``:'' are: .Cm a @@ -1036,7 +1036,7 @@ and In addition, a 40MHz HT channel specification may include the location of the extension channel by appending ``+'' or ``-'' for above and below, -respectively; e.g. ``2437:ht/40+'' specifies 40MHz wide HT operation +respectively; e.g., ``2437:ht/40+'' specifies 40MHz wide HT operation with the center channel at frequency 2437 and the extension channel above. .It Cm country Ar name Set the country code to use in calculating the regulatory constraints @@ -1046,7 +1046,7 @@ will operation on the channels, and the can be used on a channel are defined by this setting. Country/Region codes are specified as a 2-character abbreviation defined by ISO 3166 or using a longer, but possibly ambiguous, spelling; -e.g. "ES" and "Spain". +e.g., "ES" and "Spain". The set of country codes are taken from /etc/regdomain.xml and can also be viewed with the ``list countries'' request. Note that not all devices support changing the country code from a default @@ -1063,7 +1063,7 @@ DFS embodies several facilities includin radar signals, dynamic transmit power control, and channel selection according to a least-congested criteria. DFS support is mandatory for some 5GHz frequencies in certain -locales (e.g. ETSI). +locales (e.g., ETSI). By default DFS is enabled according to the regulatory definitions specified in /etc/regdomain.xml and the current country code, regdomain, and channel. @@ -1168,7 +1168,7 @@ Enable Dynamic WDS (DWDS) support. DWDS is a facility by which 4-address traffic can be carried between stations operating in infrastructure mode. A station first associates to an access point and authenticates using -normal procedures (e.g. WPA). +normal procedures (e.g., WPA). Then 4-address frames are passed to carry traffic for stations operating on either side of the wireless link. DWDS extends the normal WDS mechanism by leveraging existing security @@ -1186,7 +1186,7 @@ When DWDS is enabled on a station, traff different from the peer station are encapsulated in a 4-address frame and transmitted to the peer. All 4-address traffic uses the security information of the stations -(e.g. cryptographic keys). +(e.g., cryptographic keys). A station is associated using 802.11n facilities may transport 4-address traffic using these same mechanisms; this depends on available resources and capabilities of the device. @@ -1236,7 +1236,7 @@ Stations negotiate use of these faciliti when they associate. To disable all use of 802.11n use .Fl ht . -To disable use of HT20 (e.g. to force only HT40 use) use +To disable use of HT20 (e.g., to force only HT40 use) use .Fl ht20 . To disable use of HT40 use .Fl ht40 . @@ -1250,7 +1250,7 @@ Auto Channel Selection is used to locate HT configuration controls whether legacy, HT20, or HT40 operation is setup on the selected channel. If a fixed channel is specified for a station then HT configuration can -be given as part of the channel specification; e.g. 6:ht/20 to setup +be given as part of the channel specification; e.g., 6:ht/20 to setup HT20 operation on channel 6. .It Cm htcompat Enable use of compatibility support for pre-802.11n devices (default). @@ -1506,13 +1506,13 @@ The default setting is 6 but drivers may they choose. .It Cm mcastrate Ar rate Set the rate for transmitting multicast/broadcast frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. This rate should be valid for the current operating conditions; if an invalid rate is specified drivers are free to chose an appropriate rate. .It Cm mgtrate Ar rate Set the rate for transmitting management and/or control frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. .It Cm outdoor Set the location to use in calculating regulatory constraints. The location is also advertised in beacon and probe response frames @@ -1672,7 +1672,7 @@ request can be used to show recent scan initiating a new scan. .It Cm scanvalid Ar threshold Set the maximum time the scan cache contents are considered valid; -i.e. will be used without first triggering a scan operation to +i.e., will be used without first triggering a scan operation to refresh the data. The .Ar threshold @@ -1734,7 +1734,7 @@ When operating with TDMA, setup a BSS wi slots. The slot count may be at most 8. The current implementation is only tested with two stations -(i.e. point to point applications). +(i.e., point to point applications). This setting is only meaningful when a station is configured as slot 0; other stations adopt this setting from the BSS they join. By default @@ -1758,7 +1758,7 @@ is set to 10 milliseconds. When operating with TDMA, setup a BSS such that beacons are transmitted every .Ar intval superframes to synchronize the TDMA slot timing. -A superframe is defined as the number of slots times the slot length; e.g. +A superframe is defined as the number of slots times the slot length; e.g., a BSS with two slots of 10 milliseconds has a 20 millisecond superframe. The beacon interval may not be zero. A lower setting of @@ -1784,7 +1784,7 @@ the driver will use the setting closest Not all adapters support changing the transmit power. .It Cm ucastrate Ar rate Set a fixed rate for transmitting unicast frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. This rate should be valid for the current operating conditions; if an invalid rate is specified drivers are free to chose an appropriate rate. @@ -2519,7 +2519,7 @@ protocol on an interface: Set the virtual host ID. This is a required setting to initiate .Xr carp 4 . -If the virtual host ID doesn't exist yet, it is created and attached to the +If the virtual host ID does not exist yet, it is created and attached to the interface, otherwise configuration of an existing vhid is adjusted. If the .Cm vhid @@ -2628,9 +2628,6 @@ The flag disables this behavior. .Pp Only the super-user may modify the configuration of a network interface. -.Sh NOTES -The media selection system is relatively new and only some drivers support -it (or have need for it). .Sh EXAMPLES Assign the IPv4 address .Li 192.0.2.10 , From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 19:32:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A26BE812; Wed, 7 Nov 2012 19:32:21 +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 85AF18FC1D; Wed, 7 Nov 2012 19:32:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7JWL1b090259; Wed, 7 Nov 2012 19:32:21 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7JWLvc090257; Wed, 7 Nov 2012 19:32:21 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201211071932.qA7JWLvc090257@svn.freebsd.org> From: Warren Block Date: Wed, 7 Nov 2012 19:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242705 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 19:32:21 -0000 Author: wblock (doc committer) Date: Wed Nov 7 19:32:21 2012 New Revision: 242705 URL: http://svnweb.freebsd.org/changeset/base/242705 Log: Actually change "silent" to "silence" this time (reviewed by adri@). MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Nov 7 19:26:32 2012 (r242704) +++ head/sbin/ifconfig/ifconfig.8 Wed Nov 7 19:32:21 2012 (r242705) @@ -1115,7 +1115,7 @@ specifies the number of beacon intervals and must be in the range 1 to 15. By default DTIM is 1 (i.e., DTIM occurs at each beacon). .It Cm quiet -Enable the use of quiet IE. Hostap will use this to silent other +Enable the use of quiet IE. Hostap will use this to silence other stations to reduce interference for radar detection when operating on 5GHz frequency and doth support is enabled. Use From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 19:46:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5DA3C91; Wed, 7 Nov 2012 19:46:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A0FD78FC15; Wed, 7 Nov 2012 19:46:35 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so1552003pbb.13 for ; Wed, 07 Nov 2012 11:46:35 -0800 (PST) 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=xC5JEBxxLLfOQp0t4tfhEVGPWbz5geh9BbT3qgdDhcg=; b=rcbMwa0qC3fs33ctWQ4E9ln5scTGqDG1yc19UFMayOXU1vC3wEA23MfbrY9nedF5Ex 3c6hVyIFHjA84pC8W3ZcstwRLGqYswLkaiXfsLuV/+0p82v/D4EQFtGhGLc0uR9om2kI JluAVy6xp0a1VoUzhD3BsqmGoNmzjOccpItffRz74N02U0sp0RUaXEOhUp0QfjC6oxRo ZaTLAkhVVNpsht6VQyWUON2m7c7t7yRayapPju/E/T5j66xACfrvt69uAxxKGaS96hC7 UDAedfE8DZ+lSgN5icGDTZiW1JJKgJfsLwdADjRjo7/c73B31vik+tx0zlG9V0UWKqIj 99Fw== MIME-Version: 1.0 Received: by 10.68.137.41 with SMTP id qf9mr16646331pbb.103.1352317594883; Wed, 07 Nov 2012 11:46:34 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Wed, 7 Nov 2012 11:46:34 -0800 (PST) In-Reply-To: <201211071859.qA7IxgjE085220@svn.freebsd.org> References: <201211071859.qA7IxgjE085220@svn.freebsd.org> Date: Wed, 7 Nov 2012 11:46:34 -0800 X-Google-Sender-Auth: 0ejgLdiWQj3m1_5k1ANrYCRHt7E Message-ID: Subject: Re: svn commit: r242703 - head/sys/dev/usb/serial From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 19:46:36 -0000 Thanks for this. The auto-locking method is .. highly wrong/suspect. Please don't do that. :) Adrian On 7 November 2012 10:59, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Nov 7 18:59:42 2012 > New Revision: 242703 > URL: http://svnweb.freebsd.org/changeset/base/242703 > > Log: > Add lock asserts instead of "auto-locking". > > MFC after: 1 weeks > Suggested by: ed @ > > Modified: > head/sys/dev/usb/serial/usb_serial.c > > Modified: head/sys/dev/usb/serial/usb_serial.c > ============================================================================== > --- head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:44:05 2012 (r242702) > +++ head/sys/dev/usb/serial/usb_serial.c Wed Nov 7 18:59:42 2012 (r242703) > @@ -788,20 +788,16 @@ ucom_inwakeup(struct tty *tp) > { > struct ucom_softc *sc = tty_softc(tp); > uint16_t pos; > - int locked; > > if (sc == NULL) > return; > > - locked = mtx_owned(sc->sc_mtx); > + UCOM_MTX_ASSERT(sc, MA_OWNED); > > - if (locked == 0) > - tty_lock(tp); > + DPRINTF("tp=%p\n", tp); > > if (ttydisc_can_bypass(tp) != 0 || > (sc->sc_flag & UCOM_FLAG_HL_READY) == 0) { > - if (locked == 0) > - tty_unlock(tp); > return; > } > > @@ -825,9 +821,6 @@ ucom_inwakeup(struct tty *tp) > if ((sc->sc_jitterbuf_in == pos) && > (sc->sc_flag & UCOM_FLAG_RTS_IFLOW)) > ucom_rts(sc, 0); > - > - if (locked == 0) > - tty_unlock(tp); > } > > static int From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 19:51:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F809F3A; Wed, 7 Nov 2012 19:51:53 +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 4C02D8FC17; Wed, 7 Nov 2012 19:51:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7JprVe093324; Wed, 7 Nov 2012 19:51:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7JprrP093321; Wed, 7 Nov 2012 19:51:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211071951.qA7JprrP093321@svn.freebsd.org> From: Dimitry Andric Date: Wed, 7 Nov 2012 19:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242706 - in head/sys/boot/pc98: boot2 cdboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 19:51:53 -0000 Author: dim Date: Wed Nov 7 19:51:53 2012 New Revision: 242706 URL: http://svnweb.freebsd.org/changeset/base/242706 Log: Put in a band-aid to get the pc98 bootstraps building, now clang is the default compiler. This has two parts: - Make sys/boot/pc98/boot2 always build with gcc for now, until we can figure out a way to shrink it enough when building with clang. - Since sys/boot/p98/cdboot uses .code16 directives, which are not yet supported by clang's integrated assembler, use -no-integrated-as, similar to sys/boot/i386/cdboot. Reviewed by: nyan MFC after: 1 week Modified: head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/cdboot/Makefile Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Wed Nov 7 19:32:21 2012 (r242705) +++ head/sys/boot/pc98/boot2/Makefile Wed Nov 7 19:51:53 2012 (r242706) @@ -3,7 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big -CC:=${CC:C/^(.*\/)?clang$/gcc/1} +CC:= gcc FILES= boot boot1 boot2 Modified: head/sys/boot/pc98/cdboot/Makefile ============================================================================== --- head/sys/boot/pc98/cdboot/Makefile Wed Nov 7 19:32:21 2012 (r242705) +++ head/sys/boot/pc98/cdboot/Makefile Wed Nov 7 19:51:53 2012 (r242706) @@ -13,3 +13,7 @@ ORG= 0x0000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.cdboot.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 20:03:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A31B8319; Wed, 7 Nov 2012 20:03:45 +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 87B328FC14; Wed, 7 Nov 2012 20:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7K3jJC095135; Wed, 7 Nov 2012 20:03:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7K3jP1095133; Wed, 7 Nov 2012 20:03:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211072003.qA7K3jP1095133@svn.freebsd.org> From: Dimitry Andric Date: Wed, 7 Nov 2012 20:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242707 - head/usr.bin/clang/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 20:03:45 -0000 Author: dim Date: Wed Nov 7 20:03:45 2012 New Revision: 242707 URL: http://svnweb.freebsd.org/changeset/base/242707 Log: Belatedly add links from /usr/bin/clang to /usr/bin/CC, like it has been done for g++. MFC after: 3 days Modified: head/usr.bin/clang/clang/Makefile Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Wed Nov 7 19:51:53 2012 (r242706) +++ head/usr.bin/clang/clang/Makefile Wed Nov 7 20:03:45 2012 (r242707) @@ -20,9 +20,11 @@ MLINKS= clang.1 clang++.1 \ .if ${MK_CLANG_IS_CC} != "no" LINKS+= ${BINDIR}/clang ${BINDIR}/cc \ ${BINDIR}/clang ${BINDIR}/c++ \ + ${BINDIR}/clang ${BINDIR}/CC \ ${BINDIR}/clang ${BINDIR}/cpp MLINKS+= clang.1 cc.1 \ clang.1 c++.1 \ + clang.1 CC.1 \ clang.1 cpp.1 .endif From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 20:59:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09D7B496; Wed, 7 Nov 2012 20:59:01 +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 C90128FC16; Wed, 7 Nov 2012 20:59:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Kx0M8003686; Wed, 7 Nov 2012 20:59:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Kx02i003682; Wed, 7 Nov 2012 20:59:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211072059.qA7Kx02i003682@svn.freebsd.org> From: Michael Tuexen Date: Wed, 7 Nov 2012 20:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242708 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 20:59:01 -0000 Author: tuexen Date: Wed Nov 7 20:59:00 2012 New Revision: 242708 URL: http://svnweb.freebsd.org/changeset/base/242708 Log: Improve PR-SCTP if used in combination with NR-SACK. Based on work done by Mohammad Rajiullah. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Nov 7 20:03:45 2012 (r242707) +++ head/sys/netinet/sctp_constants.h Wed Nov 7 20:59:00 2012 (r242708) @@ -370,6 +370,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_MARKED 20010 #define SCTP_FORWARD_TSN_SKIP 30010 +#define SCTP_DATAGRAM_NR_MARKED 40010 /* chunk output send from locations */ #define SCTP_OUTPUT_FROM_USR_SEND 0 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Nov 7 20:03:45 2012 (r242707) +++ head/sys/netinet/sctp_indata.c Wed Nov 7 20:59:00 2012 (r242708) @@ -2985,6 +2985,7 @@ sctp_process_segment_range(struct sctp_t } /* NR Sack code here */ if (nr_sacking) { + tp1->sent = SCTP_DATAGRAM_NR_MARKED; if (tp1->data) { /* * sa_ignore @@ -3600,7 +3601,8 @@ sctp_try_advance_peer_ack_point(struct s } TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && - tp1->sent != SCTP_DATAGRAM_RESEND) { + tp1->sent != SCTP_DATAGRAM_RESEND && + tp1->sent != SCTP_DATAGRAM_NR_MARKED) { /* no chance to advance, out of here */ break; } @@ -3653,7 +3655,8 @@ sctp_try_advance_peer_ack_point(struct s * the chunk, advance our peer ack point and we can check * the next chunk. */ - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { /* advance PeerAckPoint goes forward */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 21:25:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B887B989; Wed, 7 Nov 2012 21:25:32 +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 7D4938FC08; Wed, 7 Nov 2012 21:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7LPWg9008001; Wed, 7 Nov 2012 21:25:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7LPWCd007998; Wed, 7 Nov 2012 21:25:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211072125.qA7LPWCd007998@svn.freebsd.org> From: Michael Tuexen Date: Wed, 7 Nov 2012 21:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242709 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 21:25:32 -0000 Author: tuexen Date: Wed Nov 7 21:25:32 2012 New Revision: 242709 URL: http://svnweb.freebsd.org/changeset/base/242709 Log: Add some missing changes missed in the last commit. MFC after: 1 week X-MFC with: 242708 Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Nov 7 20:59:00 2012 (r242708) +++ head/sys/netinet/sctp_indata.c Wed Nov 7 21:25:32 2012 (r242709) @@ -2975,9 +2975,10 @@ sctp_process_segment_range(struct sctp_t * All chunks NOT UNSENT fall through here and are marked * (leave PR-SCTP ones that are to skip alone though) */ - if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + if ((tp1->sent != SCTP_FORWARD_TSN_SKIP) && + (tp1->sent != SCTP_DATAGRAM_NR_MARKED)) { tp1->sent = SCTP_DATAGRAM_MARKED; - + } if (tp1->rec.data.chunk_was_revoked) { /* deflate the cwnd */ tp1->whoTo->cwnd -= tp1->book_size; @@ -3607,7 +3608,8 @@ sctp_try_advance_peer_ack_point(struct s break; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, asoc->advanced_peer_ack_point, tp1->rec.data.TSN_seq, 0, 0); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Nov 7 20:59:00 2012 (r242708) +++ head/sys/netinet/sctp_output.c Wed Nov 7 21:25:32 2012 (r242709) @@ -10152,7 +10152,8 @@ sctp_fill_in_rest: unsigned int cnt_of_skipped = 0; TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { - if (at->sent != SCTP_FORWARD_TSN_SKIP) { + if ((at->sent != SCTP_FORWARD_TSN_SKIP) && + (at->sent != SCTP_DATAGRAM_NR_MARKED)) { /* no more to look at */ break; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 21:44:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FAEBF56; Wed, 7 Nov 2012 21:44:04 +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 804C48FC0A; Wed, 7 Nov 2012 21:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Li4LU011195; Wed, 7 Nov 2012 21:44:04 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Li4aL011194; Wed, 7 Nov 2012 21:44:04 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211072144.qA7Li4aL011194@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 7 Nov 2012 21:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242710 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 21:44:04 -0000 Author: sjg Date: Wed Nov 7 21:44:04 2012 New Revision: 242710 URL: http://svnweb.freebsd.org/changeset/base/242710 Log: Latest progs.mk from crufty.net for ATF Approved by: marcel (mentor) Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Nov 7 21:25:32 2012 (r242709) +++ head/share/mk/bsd.progs.mk Wed Nov 7 21:44:04 2012 (r242710) @@ -1,350 +1,88 @@ -# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 # $FreeBSD$ - -.include - -.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm - -.if ${MK_MAN} == "no" -NO_MAN= +# $Id: progs.mk,v 1.11 2012/11/06 17:18:54 sjg Exp $ +# +# @(#) Copyright (c) 2006, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +.MAIN: all + +.if defined(PROGS) + +# In meta mode, we can capture dependenices for _one_ of the progs. +# if makefile doesn't nominate one, we use the first. +.ifndef UPDATE_DEPENDFILE_PROG +UPDATE_DEPENDFILE_PROG = ${PROGS:[1]} +.export UPDATE_DEPENDFILE_PROG +.endif + +.ifndef PROG +# They may have asked us to build just one +.for t in ${PROGS} +.if make($t) +PROG ?= $t .endif - -# Legacy knobs -.if defined(PROG) || defined(PROG_CXX) -. if defined(PROG) -PROGS= ${PROG} -. endif -. if defined(PROG_CXX) -PROGS= ${PROG_CXX} -PROGS_CXX= ${PROG_CXX} -. endif -# Loop once to keep pattern and avoid namespace pollution -. for _P in ${PROGS} -. if defined(INTERNALPROG) -INTERNALPROG.${_P}= -. endif -. if !defined(NO_MAN) -. if defined(MAN) -MAN.${_P}= ${MAN} -. else -. for sect in 1 1aout 2 3 4 5 6 7 8 9 -. if defined(MAN${sect}) -MAN.${_P}= ${MAN${sect}} -. endif -. endfor -. endif -. endif # defined(NO_MAN) -. if defined(NLSNAME) && !empty(NLSNAME) -NLSNAME.${P}:= ${NLSNAME} -. endif -. if defined(OBJS) -OBJS.${_P}:= ${OBJS} -. endif -. if defined(PRECIOUSPROG) -PRECIOUSPROG.${_P}= -. endif -. if defined(PROGNAME) -PROGNAME.${_P}= ${PROGNAME} -. endif -. if defined(SRCS) -SRCS.${_P}:= ${SRCS} -. endif -. endfor -.else # !defined(PROG) && !defined(PROG_CXX) -. if defined(PROGS_CXX) && !empty(PROGS_CXX) -PROGS+= ${PROGS_CXX} -. endif -.endif # defined(PROG) || defined(PROG_CXX) - -.if defined(PROGS_CXX) && !empty(PROGS_CXX) -. for _P in ${PROGS_CXX} -PROG_CXX.${_P}= -. endfor +.endfor .endif -# Avoid recursive variables -.undef NLSNAME - -.if defined(COPTS) -CFLAGS+=${COPTS} -.endif +.if defined(PROG) +# just one of many +PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +.for v in ${PROG_VARS:O:u} +$v += ${${v}_${PROG}:U${${v}.${PROG}}} +.endfor -.if defined(DEBUG_FLAGS) -. if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -. endif -CFLAGS+=${DEBUG_FLAGS} -CXXFLAGS+=${DEBUG_FLAGS} +# for meta mode, there can be only one! +.if ${PROG} == ${UPDATE_DEPENDFILE_PROG:Uno} +UPDATE_DEPENDFILE ?= yes .endif +UPDATE_DEPENDFILE ?= NO -STRIP?= -s +# ensure that we don't clobber each other's dependencies +DEPENDFILE?= .depend.${PROG} +# prog.mk will do the rest +.else +all: ${PROGS} -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -NO_WERROR= +# We cannot capture dependencies for meta mode here +UPDATE_DEPENDFILE = NO +# nor can we safely run in parallel. +.NOTPARALLEL: .endif - -.for _P in ${PROGS} - -BINDIR.${_P}?= ${BINDIR} -BINGRP.${_P}?= ${BINGRP} -BINMODE.${_P}?= ${BINMODE} -BINOWN.${_P}?= ${BINOWN} - -CFLAGS.${_P}+= ${CFLAGS} -CXXFLAGS.${_P}+= ${CXXFLAGS} -DPADD.${_P}+= ${DPADD} -LDADD.${_P}+= ${LDADD} -LDFLAGS.${_P}+= ${LDFLAGS} - -INSTALLFLAGS.${_P}?= ${INSTALLFLAGS} - -. if defined(PRECIOUSPROG.${_P}) -. if !defined(NO_FSCHG) && !defined(NO_FSCHG.${_P}) -INSTALLFLAGS.${_P}+= -fschg -. endif -INSTALLFLAGS.${_P}+= -S -. endif - -NO_SHARED.${_P}?= ${NO_SHARED} - -. if !defined(NLSDIR.${_P}) -NLSDIR.${_P}:= ${NLSDIR} -. endif -. undef NLSDIR - -. if !empty(NO_SHARED.${_P}) && ${NO_SHARED.${_P}:tl} != "no" -LDFLAGS.${_P}+= -static -. endif - -. if defined(SRCS.${_P}) - -_SRCS:= ${SRCS.${_P}} -OBJS.${_P}+= ${_SRCS:N*.h:R:S/$/.o/g} - -. if target(beforelinking) -${_P}: ${OBJS.${_P}} beforelinking -. else -${_P}: ${OBJS.${_P}} -. endif -. if defined(PROG_CXX.${_P}) - ${CXX} ${CXXFLAGS.${_P}} ${LDFLAGS.${_P}} -o ${.TARGET} ${OBJS.${_P}} \ - ${LDADD.${_P}} -. else - ${CC} ${CFLAGS.${_P}} ${LDFLAGS.${_P}} -o ${.TARGET} ${OBJS.${_P}} \ - ${LDADD.${_P}} -. endif -. if ${MK_CTF} != "no" - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS.${_P}} -. endif - -. else # !defined(SRCS.${_P}) - -. if !target(${_P}) -. if defined(PROG_CXX.${_P}) -SRCS.${_P}?= ${_P}.cc -. else -SRCS.${_P}?= ${_P}.c -. endif - -# Always make an intermediate object file because: -# - it saves time rebuilding when only the library has changed -# - the name of the object gets put into the executable symbol table instead of -# the name of a variable temporary object. -# - it's useful to keep objects around for crunching. -OBJS.${_P}:= ${_P}.o - -. if target(beforelinking) -${_P}: ${OBJS.${_P}} beforelinking -. else -${_P}: ${OBJS.${_P}} -. endif # target(beforelinking) -. if defined(PROG_CXX.${_P}) - ${CXX} ${CXXFLAGS.${_P}} ${LDFLAGS.${_P}} -o ${.TARGET} ${OBJS.${_P}} \ - ${LDADD.${_P}} -. else - ${CC} ${CFLAGS.${_P}} ${LDFLAGS.${_P}} -o ${.TARGET} ${OBJS.${_P}} \ - ${LDADD.${_P}} -. endif -. if ${MK_CTF} != "no" - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS.${_P}} -. endif - -. endif # !target(${_P}) - -. endif # defined(SRCS.${_P}) - -CLEANFILES+= ${OBJS.${_P}} - -.endfor # for _P in ${PROGS} - -all: objwarn ${PROGS} ${SCRIPTS} - -.if !defined(NO_MAN) -. for _P in ${PROGS} -MAN.${_P}?= ${_P}.1 -MAN:= ${MAN.${_P}} -. include -. endfor -. if target(_manpages) # bsd.man.mk was included -all: _manpages -. endif .endif -CLEANFILES+= ${PROGS} - -.include - -_EXTRADEPEND: -.for _P in ${PROGS} -. if !empty(LDFLAGS.${P}:M-nostdlib) -. if !empty(DPADD.${_P}) - echo ${_P}: ${DPADD.${_P}} >> ${DEPENDFILE} -. endif -. else - echo ${_P}: ${LIBC} ${DPADD.${_P}} >> ${DEPENDFILE} -. if defined(PROG_CXX.${_P}) -. if !empty(CXXFLAGS.${P}:M-stdlib=libc++) - echo ${_P}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} -. else - echo ${_P}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} -. endif -. endif -. endif -.endfor - -.if !target(install) - -. if !target(realinstall) - -. for _P in ${PROGS} - -. if !defined(INTERNALPROG.${_P}) - -.ORDER: beforeinstall _proginstall.${_P} -_proginstall.${_P}: -. if defined(PROGNAME.${_P}) - ${INSTALL} ${STRIP} -o ${BINOWN.${_P}} -g ${BINGRP.${_P}} \ - -m ${BINMODE.${_P}} ${INSTALLFLAGS.${_P}} ${_P} \ - ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} -. else - ${INSTALL} ${STRIP} -o ${BINOWN.${_P}} -g ${BINGRP.${_P}} \ - -m ${BINMODE.${_P}} ${INSTALLFLAGS.${_P}} ${_P} \ - ${DESTDIR}${BINDIR.${_P}} -. endif - -realinstall: _proginstall.${_P} - -. endif # !defined(INTERNALPROG.${_P}) +# handle being called [bsd.]progs.mk +.include <${.PARSEFILE:S,progs,prog,}> -. endfor # for _P in ${PROGS} +.ifndef PROG +PROGS_TARGETS += clean -. endif # !target(realinstall) - -. if defined(SCRIPTS) && !empty(SCRIPTS) -SCRIPTSDIR?= ${BINDIR} -SCRIPTSOWN?= ${BINOWN} -SCRIPTSGRP?= ${BINGRP} -SCRIPTSMODE?= ${BINMODE} - -. for S in ${SCRIPTS} - -realinstall: scriptsinstall -.ORDER: beforeinstall scriptsinstall - -. if defined(SCRIPTSNAME) -SCRIPTSNAME_${S}?= ${SCRIPTSNAME} -. else -SCRIPTSNAME_${S}?= ${S:T:R} -. endif - -SCRIPTSDIR_${S}?= ${SCRIPTSDIR} -SCRIPTSOWN_${S}?= ${SCRIPTSOWN} -SCRIPTSGRP_${S}?= ${SCRIPTSGRP} -SCRIPTSMODE_${S}?= ${SCRIPTSMODE} - -scriptsinstall: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}} - -${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S} - ${INSTALL} -o ${SCRIPTSOWN_${S}} \ - -g ${SCRIPTSGRP_${S}} \ - -m ${SCRIPTSMODE_${S}} \ - ${.ALLSRC} \ - ${.TARGET} - -. endfor # for S in ${SCRIPTS} - -. endif # defined(SCRIPTS) && !empty(SCRIPTS) - -.endif # !target(install) - -.if !defined(NO_MAN) -. if target(_manpages) # bsd.man.mk was included -realinstall: _maninstall -. endif +.for p in ${PROGS} +.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) +# bsd.prog.mk may need to know this +x.$p= PROG_CXX=$p .endif -# Wrap bsd.nls.mk because I can't force that Makefile snippet to work only with -# ${PROGS}. -.for _P in ${PROGS} -NLSNAME.${_P}?= ${_P} -NLS:= ${NLS.${_P}} -NLSDIR:= ${NLSDIR.${_P}} -NLSNAME:= ${NLSNAME.${_P}} -.include -.endfor +$p ${p}_p: .PHONY .MAKE + (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} PROG=$p ${x.$p}) -.include -.include -.include - -.if !target(lint) -. for _P in ${PROGS} -. if !target(lint.${_P}) -. if defined(PROG_CXX.${_P}) -lint.${_P}: -. else -_CFLAGS:= ${CFLAGS.${_P}} -_SRCS:= ${SRCS.${_P}} -lint.${_P}: ${_SRCS:M*.c} - ${LINT} ${LINTFLAGS} ${_CFLAGS:M-[DIU]*} ${.ALLSRC} -. endif -. endif -lint: lint.${_P} - -. endfor -.endif # !target(lint) - -.for _P in ${PROGS} -CFLAGS:= ${CFLAGS.${_P}} -CXXFLAGS:= ${CXXFLAGS.${_P}} -# XXX: Pollutes DPADD.${_P} and LDADD.${_P} above -#DPADD:= ${DPADD.${_P}} -#LDADD:= ${LDADD.${_P}} -SRCS:= ${SRCS.${_P}} -. include -# bsd.dep.mk mangles SRCS -SRCS.${_P}:= ${SRCS} -. undef DPADD LDADD +.for t in ${PROGS_TARGETS:O:u} +$p.$t: .PHONY .MAKE + (cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} PROG=$p ${x.$p} ${@:E}) +.endfor .endfor -# XXX: emulate the old bsd.prog.mk by allowing Makefiles that didn't set -# ${PROG*} to function with this Makefile snippet. -.if empty(PROGS) -. include -.endif - -.if !exists(${.OBJDIR}/${DEPENDFILE}) -. for _P in ${PROGS} -_SRCS:= ${SRCS.${_P}} -${OBJS.${_P}}: ${_SRCS:M*.h} -. endfor -.endif - -.include - -.include +.for t in ${PROGS_TARGETS:O:u} +$t: ${PROGS:%=%.$t} +.endfor -.if defined(PORTNAME) -.include .endif From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:02:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18546677; Wed, 7 Nov 2012 22:02:03 +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 F10098FC14; Wed, 7 Nov 2012 22:02:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7M22jS014104; Wed, 7 Nov 2012 22:02:02 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7M22S9014101; Wed, 7 Nov 2012 22:02:02 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211072202.qA7M22S9014101@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 7 Nov 2012 22:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242711 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:02:03 -0000 Author: sjg Date: Wed Nov 7 22:02:02 2012 New Revision: 242711 URL: http://svnweb.freebsd.org/changeset/base/242711 Log: Enable ATF testing. Submitted by: Garrett Cooper Approved by: marcel (mentor) Added: head/share/mk/atf.test.mk (contents, props changed) head/share/mk/bsd.test.mk (contents, props changed) Modified: head/share/mk/bsd.subdir.mk Added: head/share/mk/atf.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/atf.test.mk Wed Nov 7 22:02:02 2012 (r242711) @@ -0,0 +1,148 @@ +# $NetBSD$ +# $FreeBSD$ +# + +.include + +ATF_TESTS:= + +.if make(*test) +TESTSDIR?= . +.endif + +.if defined(ATF_TESTS_SUBDIRS) +# Only visit subdirs when building, etc because ATF does this it on its own. +.if !make(atf-test) +SUBDIR+= ${ATF_TESTS_SUBDIRS} +.endif +ATF_TESTS+= ${ATF_TESTS_SUBDIRS} + +.include +.endif + +.if defined(TESTS_C) +ATF_TESTS+= ${TESTS_C} +.for _T in ${TESTS_C} +SRCS.${_T}?= ${_T}.c +DPADD.${_T}+= ${LIBATF_C} +LDADD.${_T}+= -latf-c +.endfor +.endif + +.if defined(TESTS_CXX) +ATF_TESTS+= ${TESTS_CXX} +.for _T in ${TESTS_CXX} +SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} +DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} +LDADD.${_T}+= -latf-c++ -latf-c +.endfor +.endif + +.if defined(TESTS_SH) +ATF_TESTS+= ${TESTS_SH} +.for _T in ${TESTS_SH} +CLEANFILES+= ${_T} ${_T}.tmp +TESTS_SH_SRC_${_T}?= ${_T}.sh +${_T}: ${TESTS_SH_SRC_${_T}} + echo '#! /usr/bin/atf-sh' > ${.TARGET}.tmp + cat ${.ALLSRC} >> ${.TARGET}.tmp + chmod +x ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} +.endfor +.endif + +ATFFILE?= auto + +.if ${ATFFILE:tl} != "no" +FILES+= Atffile +FILESDIR_Atffile= ${TESTSDIR} + +.if ${ATFFILE:tl} == "auto" +CLEANFILES+= Atffile Atffile.tmp + +Atffile: Makefile + @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \ + echo; \ + echo '# Automatically generated by atf-test.mk.'; \ + echo; \ + echo 'prop: test-suite = "'`uname -o`'"'; \ + echo; \ + for tp in ${ATF_TESTS}; do \ + echo "tp: $${tp}"; \ + done; } >Atffile.tmp + @mv Atffile.tmp Atffile +.endif +.endif + +# Generate support variables for atf-test. +# +# atf-test can only work for native builds, i.e. a build host of a particular +# OS building a release for the same OS version and architecture. The target +# runs ATF, which is on the build host, and the tests execute code built for +# the target host. +# +# Due to the dependencies of the binaries built by the source tree and how they +# are used by tests, it is highly possible for a execution of "make test" to +# report bogus results unless the new binaries are put in place. + +# XXX (gcooper): Executing ATF from outside the source tree is improper; it +# should be built as part of the OS toolchain build for the host OS and +# executed from there. +ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin +TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH} + +ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc +ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp +ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ +ATF_CONFDIR?= ${DESTDIR}/etc +ATF_INCLUDEDIR?= ${DESTDIR}/usr/include +ATF_LIBDIR?= ${DESTDIR}/usr/lib +ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec +ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf +ATF_SHELL?= ${DESTDIR}/bin/sh +LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g} + +ATF_ENV_VARS= \ + ATF_BUILD_CC \ + ATF_BUILD_CPP \ + ATF_BUILD_CXX \ + ATF_CONFDIR \ + ATF_INCLUDEDIR \ + ATF_LIBDIR \ + ATF_LIBEXECDIR \ + ATF_PKGDATADIR \ + ATF_SHELL \ + +.for v in ${ATF_ENV_VARS} +.if !empty($v) +TESTS_ENV+= $v=${$v} +.endif +.endfor + +_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo +_TESTS_LOG= ${.OBJDIR}/atf-run.log +CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG} + +ATF_BIN?= ${DESTDIR}/usr/bin +ATF_REPORT?= ${ATF_BIN}/atf-report +ATF_RUN?= ${ATF_BIN}/atf-run + +.PHONY: realtest +realtest: +.if defined(TESTSDIR) + @set -e; \ + cd ${DESTDIR}${TESTSDIR}; \ + rm -f ${_TESTS_FIFO}; \ + mkfifo ${_TESTS_FIFO}; \ + tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \ + set +e; \ + ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \ + result=$${?}; \ + wait; \ + rm -f ${_TESTS_FIFO}; \ + echo; \ + echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \ + exit $${result} +.endif + +.include Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Nov 7 21:44:04 2012 (r242710) +++ head/share/mk/bsd.subdir.mk Wed Nov 7 22:02:02 2012 (r242711) @@ -29,6 +29,9 @@ # maninstall, manlint, obj, objlink, realinstall, regress, tags # +.if !target(____) +____: + .include DISTRIBUTION?= base @@ -92,3 +95,5 @@ afterinstall: install: beforeinstall realinstall afterinstall .ORDER: beforeinstall realinstall afterinstall .endif + +.endif Added: head/share/mk/bsd.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.test.mk Wed Nov 7 22:02:02 2012 (r242711) @@ -0,0 +1,79 @@ +# $NetBSD: bsd.test.mk,v 1.21 2012/08/25 22:21:16 jmmv Exp $ +# $FreeBSD$ + +.include + +.if defined(TESTS_C) +PROGS+= ${TESTS_C} +.for _T in ${TESTS_C} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +.endfor +.endif + +.if defined(TESTS_CXX) +PROGS_CXX+= ${TESTS_CXX} +PROGS+= ${TESTS_CXX} +.for _T in ${TESTS_CXX} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +.endfor +.endif + +.if defined(TESTS_SH) +SCRIPTS+= ${TESTS_SH} +.for _T in ${TESTS_SH} +SCRIPTSDIR_${_T}= ${TESTSDIR} +.endfor +.endif + +TESTSBASE?= ${DESTDIR}/usr/tests + +# it is rare for test cases to have man pages +.if !defined(MAN) +WITHOUT_MAN=yes +.export WITHOUT_MAN +.endif + +# tell progs.mk we might want to install things +PROG_VARS+= BINDIR +PROGS_TARGETS+= install + +.if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) +.include +.endif + +beforetest: .PHONY +.if defined(TESTSDIR) +.if ${TESTSDIR} == ${TESTSBASE} +# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and +# it does not cover all the tests (e.g. it misses testing software in external). + @echo "*** Sorry, you cannot use make test from src/tests. Install the" + @echo "*** tests into their final location and run them from ${TESTSBASE}" + @false +.else + @echo "*** Using this test does not preclude you from running the tests" + @echo "*** installed in ${TESTSBASE}. This test run may raise false" + @echo "*** positives and/or false negatives." +.endif +.else + @echo "*** No TESTSDIR defined; nothing to do." + @false +.endif + @echo + +.if !target(realtest) +realtest: .PHONY + @echo "$@ not defined; skipping" +.endif + +test: .PHONY +.ORDER: beforetest realtest +test: beforetest realtest + +.if target(aftertest) +.ORDER: realtest aftertest +test: aftertest +.endif + +.include From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:02:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DC29807; Wed, 7 Nov 2012 22:02:54 +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 39F608FC0A; Wed, 7 Nov 2012 22:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7M2sUn014258; Wed, 7 Nov 2012 22:02:54 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7M2ss8014256; Wed, 7 Nov 2012 22:02:54 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211072202.qA7M2ss8014256@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 7 Nov 2012 22:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242712 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:02:54 -0000 Author: sjg Date: Wed Nov 7 22:02:53 2012 New Revision: 242712 URL: http://svnweb.freebsd.org/changeset/base/242712 Log: Add ATF and reformat to ease reviews Approved by: marcel (mentor) Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Wed Nov 7 22:02:02 2012 (r242711) +++ head/share/mk/Makefile Wed Nov 7 22:02:53 2012 (r242712) @@ -1,20 +1,50 @@ # $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/8/93 -FILES= bsd.README -FILES+= bsd.arch.inc.mk -FILES+= bsd.compat.mk bsd.compiler.mk bsd.cpu.mk -FILES+= bsd.dep.mk bsd.doc.mk bsd.dtrace.mk -FILES+= bsd.endian.mk -FILES+= bsd.files.mk bsd.crunchgen.mk bsd.incs.mk bsd.info.mk bsd.init.mk -FILES+= bsd.kmod.mk -FILES+= bsd.lib.mk bsd.libnames.mk bsd.links.mk bsd.man.mk bsd.nls.mk -FILES+= bsd.obj.mk bsd.own.mk -FILES+= bsd.port.mk bsd.port.options.mk bsd.port.post.mk -FILES+= bsd.port.pre.mk bsd.port.subdir.mk bsd.prog.mk -FILES+= bsd.snmpmod.mk bsd.subdir.mk bsd.sys.mk bsd.symver.mk -FILES+= sys.mk version_gen.awk +.include + +FILES= \ + bsd.README \ + bsd.arch.inc.mk \ + bsd.compat.mk \ + bsd.compiler.mk \ + bsd.cpu.mk \ + bsd.crunchgen.mk \ + bsd.dep.mk \ + bsd.doc.mk \ + bsd.dtrace.mk \ + bsd.endian.mk \ + bsd.files.mk \ + bsd.incs.mk \ + bsd.info.mk \ + bsd.init.mk \ + bsd.kmod.mk \ + bsd.lib.mk \ + bsd.libnames.mk \ + bsd.links.mk \ + bsd.man.mk \ + bsd.nls.mk \ + bsd.obj.mk \ + bsd.own.mk \ + bsd.port.mk \ + bsd.port.options.mk \ + bsd.port.post.mk \ + bsd.port.pre.mk \ + bsd.port.subdir.mk \ + bsd.prog.mk \ + bsd.snmpmod.mk \ + bsd.subdir.mk \ + bsd.symver.mk \ + bsd.sys.mk \ + bsd.test.mk \ + sys.mk \ + version_gen.awk + NO_OBJ= FILESDIR= ${BINDIR}/mk +.if ${MK_ATF} != "no" +FILES+= atf.test.mk +.endif + .include From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:03:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD3E399C; Wed, 7 Nov 2012 22:03:59 +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 888AA8FC08; Wed, 7 Nov 2012 22:03:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7M3xh0014447; Wed, 7 Nov 2012 22:03:59 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7M3xCc014445; Wed, 7 Nov 2012 22:03:59 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211072203.qA7M3xCc014445@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 7 Nov 2012 22:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242713 - head/lib/libcrypt/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:03:59 -0000 Author: sjg Date: Wed Nov 7 22:03:59 2012 New Revision: 242713 URL: http://svnweb.freebsd.org/changeset/base/242713 Log: Simple unit-tests for libcrypt, to show how easy it is. Approved by: marcel (mentor) Added: head/lib/libcrypt/tests/ head/lib/libcrypt/tests/Makefile (contents, props changed) head/lib/libcrypt/tests/crypt_tests.c (contents, props changed) Added: head/lib/libcrypt/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcrypt/tests/Makefile Wed Nov 7 22:03:59 2012 (r242713) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +# exercise libcrypt + +TESTS_C= crypt_tests + +CFLAGS+= -I${.CURDIR:H} +LDADD+= -L${.OBJDIR:H} -lcrypt + +.include Added: head/lib/libcrypt/tests/crypt_tests.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcrypt/tests/crypt_tests.c Wed Nov 7 22:03:59 2012 (r242713) @@ -0,0 +1,54 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#define LEET "0.s0.l33t" + +ATF_TC(md5); +ATF_TC_HEAD(md5, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Tests the MD5 based password hash"); +} + +ATF_TC_BODY(md5, tc) +{ + const char want[] = "$1$deadbeef$0Huu6KHrKLVWfqa4WljDE0"; + char *pw; + + pw = crypt(LEET, want); + ATF_CHECK_STREQ(pw, want); +} + +ATF_TC(invalid); +ATF_TC_HEAD(invalid, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Tests that invalid password fails"); +} + +ATF_TC_BODY(invalid, tc) +{ + const char want[] = "$1$cafebabe$0Huu6KHrKLVWfqa4WljDE0"; + char *pw; + + pw = crypt(LEET, want); + ATF_CHECK(strcmp(pw, want) != 0); +} + +/* + * This function must not do anything except enumerate + * the test cases, else atf-run is likely to be upset. + */ +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, md5); + ATF_TP_ADD_TC(tp, invalid); + return atf_no_error(); +} From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:11:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B3A8D29; Wed, 7 Nov 2012 22:11:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF2F8FC15; Wed, 7 Nov 2012 22:11:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7MBdtm016229; Wed, 7 Nov 2012 22:11:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7MBc9f016222; Wed, 7 Nov 2012 22:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211072211.qA7MBc9f016222@svn.freebsd.org> From: Michael Tuexen Date: Wed, 7 Nov 2012 22:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242714 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:11:39 -0000 Author: tuexen Date: Wed Nov 7 22:11:38 2012 New Revision: 242714 URL: http://svnweb.freebsd.org/changeset/base/242714 Log: Add per outgoing stream accounting for chunks in the send and sent queue. This provides no functional change, but is a preparation for an upcoming stream reset improvement. Done with rrs@. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctp_indata.c Wed Nov 7 22:11:38 2012 (r242714) @@ -3963,7 +3963,15 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - tp1->sent = SCTP_DATAGRAM_ACKED; + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->data) { /* sa_ignore NO_NULL_CHK */ @@ -4699,10 +4707,14 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } - if (tp1->sent == SCTP_DATAGRAM_UNSENT) { - /* no more sent on list */ - SCTP_PRINTF("Warning, tp1->sent == %d and its now acked?\n", - tp1->sent); + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->pr_sctp_on) { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctp_input.c Wed Nov 7 22:11:38 2012 (r242714) @@ -311,6 +311,13 @@ sctp_process_init(struct sctp_init_chunk if (chk->rec.data.stream_number >= newcnt) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctp_pcb.c Wed Nov 7 22:11:38 2012 (r242714) @@ -4949,6 +4949,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* sent queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->data) { if (so) { Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctp_structs.h Wed Nov 7 22:11:38 2012 (r242714) @@ -588,6 +588,7 @@ union scheduling_parameters { struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; + uint32_t chunks_on_queues; uint16_t stream_no; uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctp_timer.c Wed Nov 7 22:11:38 2012 (r242714) @@ -440,6 +440,11 @@ sctp_recover_sent_list(struct sctp_tcb * if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Nov 7 22:03:59 2012 (r242713) +++ head/sys/netinet/sctputil.c Wed Nov 7 22:11:38 2012 (r242714) @@ -3727,6 +3727,15 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, @@ -3743,6 +3752,13 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:15:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1FB1ECC; Wed, 7 Nov 2012 22:15:28 +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 867868FC12; Wed, 7 Nov 2012 22:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7MFSVV017267; Wed, 7 Nov 2012 22:15:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7MFSYX017265; Wed, 7 Nov 2012 22:15:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211072215.qA7MFSYX017265@svn.freebsd.org> From: Dimitry Andric Date: Wed, 7 Nov 2012 22:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242715 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:15:28 -0000 Author: dim Date: Wed Nov 7 22:15:28 2012 New Revision: 242715 URL: http://svnweb.freebsd.org/changeset/base/242715 Log: For kernel builds with PROFLEVEL >= 1, such as LINT, don't attempt to use the -falign-functions option if the compiler is clang, as the flag is not supported. MFC after: 1 week Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Nov 7 22:11:38 2012 (r242714) +++ head/sys/conf/kern.pre.mk Wed Nov 7 22:15:28 2012 (r242715) @@ -102,7 +102,10 @@ CLANG_NO_IAS= -no-integrated-as .endif .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -CFLAGS+= -DGPROF -falign-functions=16 +CFLAGS+= -DGPROF +.if ${COMPILER_TYPE} != "clang" +CFLAGS+= -falign-functions=16 +.endif .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF PROF= -pg -mprofiler-epilogue From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:37:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 679E3540; Wed, 7 Nov 2012 22:37:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DD57B8FC0C; Wed, 7 Nov 2012 22:37:48 +0000 (UTC) Message-ID: <509AE28E.4020908@FreeBSD.org> Date: Wed, 07 Nov 2012 17:37:02 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121031 Thunderbird/16.0.2 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r242715 - head/sys/conf References: <201211072215.qA7MFSYX017265@svn.freebsd.org> In-Reply-To: <201211072215.qA7MFSYX017265@svn.freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:37:49 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-11-07 17:15:28 -0500, Dimitry Andric wrote: > Author: dim Date: Wed Nov 7 22:15:28 2012 New Revision: 242715 > URL: http://svnweb.freebsd.org/changeset/base/242715 > > Log: For kernel builds with PROFLEVEL >= 1, such as LINT, don't > attempt to use the -falign-functions option if the compiler is > clang, as the flag is not supported. > > MFC after: 1 week > > Modified: head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > > - --- head/sys/conf/kern.pre.mk Wed Nov 7 22:11:38 2012 (r242714) > +++ head/sys/conf/kern.pre.mk Wed Nov 7 22:15:28 2012 (r242715) @@ > -102,7 +102,10 @@ CLANG_NO_IAS= -no-integrated-as .endif > > .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -CFLAGS+= -DGPROF > -falign-functions=16 +CFLAGS+= -DGPROF +.if ${COMPILER_TYPE} != > "clang" +CFLAGS+= -falign-functions=16 +.endif .if ${PROFLEVEL} >= > 2 CFLAGS+= -DGPROF4 -DGUPROF PROF= -pg -mprofiler-epilogue FYI, PROF needs a similar work-around: % clang -c -pg -mprofiler-epilogue test.c clang: warning: argument unused during compilation: '-mprofiler-epilogue' Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCa4o4ACgkQmlay1b9qnVMT+ACfZvPjmeamcED3OPT2W71TQzMB msgAnROGgvnbfgjqqxePq/nKRxh462Eo =Wyq/ -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:43:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2842876B; Wed, 7 Nov 2012 22:43:10 +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 0ADB18FC0C; Wed, 7 Nov 2012 22:43:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Mh9w7021564; Wed, 7 Nov 2012 22:43:09 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Mh9QR021562; Wed, 7 Nov 2012 22:43:09 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201211072243.qA7Mh9QR021562@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 7 Nov 2012 22:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242716 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:43:10 -0000 Author: ray Date: Wed Nov 7 22:43:09 2012 New Revision: 242716 URL: http://svnweb.freebsd.org/changeset/base/242716 Log: Disable automatic attachment of arswitch. It can't be auto-detected (like PHYs do) and cause a problems trying to attach another instance to child mdio. Submitted by: Luiz Otavio O Souza Approved by: adrian (menthor) Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Nov 7 22:15:28 2012 (r242715) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Nov 7 22:43:09 2012 (r242716) @@ -77,16 +77,6 @@ static void arswitch_tick(void *arg); static int arswitch_ifmedia_upd(struct ifnet *); static void arswitch_ifmedia_sts(struct ifnet *, struct ifmediareq *); -static void -arswitch_identify(driver_t *driver, device_t parent) -{ - device_t child; - - if (device_find_child(parent, driver->name, -1) == NULL) { - child = BUS_ADD_CHILD(parent, 0, driver->name, -1); - } -} - static int arswitch_probe(device_t dev) { @@ -557,7 +547,6 @@ arswitch_ifmedia_sts(struct ifnet *ifp, static device_method_t arswitch_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, arswitch_identify), DEVMETHOD(device_probe, arswitch_probe), DEVMETHOD(device_attach, arswitch_attach), DEVMETHOD(device_detach, arswitch_detach), From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:43:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 878288DD; Wed, 7 Nov 2012 22:43:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 33A378FC0A; Wed, 7 Nov 2012 22:43:51 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:17e:8599:3fcc:63a7] (unknown [IPv6:2001:7b8:3a7:0:17e:8599:3fcc:63a7]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 956F25C59; Wed, 7 Nov 2012 23:43:43 +0100 (CET) Message-ID: <509AE41F.6010908@FreeBSD.org> Date: Wed, 07 Nov 2012 23:43:43 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jung-uk Kim Subject: Re: svn commit: r242715 - head/sys/conf References: <201211072215.qA7MFSYX017265@svn.freebsd.org> <509AE28E.4020908@FreeBSD.org> In-Reply-To: <509AE28E.4020908@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:43:51 -0000 On 2012-11-07 23:37, Jung-uk Kim wrote: ... > FYI, PROF needs a similar work-around: > > % clang -c -pg -mprofiler-epilogue test.c > clang: warning: argument unused during compilation: '-mprofiler-epilogue' Yeah, I was just going to commit that. Thanks! :) From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:45:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AC28AC6; Wed, 7 Nov 2012 22:45: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 1FFE48FC18; Wed, 7 Nov 2012 22:45:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7MjY3x021971; Wed, 7 Nov 2012 22:45:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7MjYRq021968; Wed, 7 Nov 2012 22:45:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211072245.qA7MjYRq021968@svn.freebsd.org> From: Dimitry Andric Date: Wed, 7 Nov 2012 22:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242717 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:45:35 -0000 Author: dim Date: Wed Nov 7 22:45:34 2012 New Revision: 242717 URL: http://svnweb.freebsd.org/changeset/base/242717 Log: For kernel builds with PROFLEVEL >= 2, such as LINT, don't attempt to use the -mprofiler-epilogue option if the compiler is clang, as the flag is not supported. While here, fix up the value indentations. MFC after: 1 week Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Nov 7 22:43:09 2012 (r242716) +++ head/sys/conf/kern.pre.mk Wed Nov 7 22:45:34 2012 (r242717) @@ -108,9 +108,12 @@ CFLAGS+= -falign-functions=16 .endif .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF -PROF= -pg -mprofiler-epilogue +PROF= -pg +.if ${COMPILER_TYPE} != "clang" +PROF+= -mprofiler-epilogue +.endif .else -PROF= -pg +PROF= -pg .endif .endif DEFINED_PROF= ${PROF} From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:46:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31BDAC48; Wed, 7 Nov 2012 22:46:31 +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 F03C08FC08; Wed, 7 Nov 2012 22:46:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7MkU3H022143; Wed, 7 Nov 2012 22:46:30 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7MkUEe022140; Wed, 7 Nov 2012 22:46:30 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201211072246.qA7MkUEe022140@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 7 Nov 2012 22:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242718 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:46:31 -0000 Author: ray Date: Wed Nov 7 22:46:30 2012 New Revision: 242718 URL: http://svnweb.freebsd.org/changeset/base/242718 Log: Hint miibus to attach arswitch on AP91, AP93 and RSPRO boards. Submitted by: Luiz Otavio O Souza Approved by: adrian (menthor) Modified: head/sys/mips/conf/AP91.hints head/sys/mips/conf/AP93.hints head/sys/mips/conf/RSPRO.hints Modified: head/sys/mips/conf/AP91.hints ============================================================================== --- head/sys/mips/conf/AP91.hints Wed Nov 7 22:45:34 2012 (r242717) +++ head/sys/mips/conf/AP91.hints Wed Nov 7 22:46:30 2012 (r242718) @@ -30,6 +30,7 @@ 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 Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Wed Nov 7 22:45:34 2012 (r242717) +++ head/sys/mips/conf/AP93.hints Wed Nov 7 22:46:30 2012 (r242718) @@ -25,6 +25,7 @@ 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 Modified: head/sys/mips/conf/RSPRO.hints ============================================================================== --- head/sys/mips/conf/RSPRO.hints Wed Nov 7 22:45:34 2012 (r242717) +++ head/sys/mips/conf/RSPRO.hints Wed Nov 7 22:46:30 2012 (r242718) @@ -17,6 +17,7 @@ hint.arge.1.fduplex=1 # hint.arge.1.phymask=0x0 # no directly mapped PHYs hint.arge.1.miimode=3 # RGMII +hint.arswitch.0.at="mdio0" hint.arswitch.0.is_7240=0 hint.arswitch.0.numphys=4 hint.arswitch.0.phy4cpu=1 From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 22:53:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10AE4F10; Wed, 7 Nov 2012 22:53:47 +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 E7ED18FC0C; Wed, 7 Nov 2012 22:53:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7MrkPO023246; Wed, 7 Nov 2012 22:53:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7MrkKI023244; Wed, 7 Nov 2012 22:53:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211072253.qA7MrkKI023244@svn.freebsd.org> From: Alexander Motin Date: Wed, 7 Nov 2012 22:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242719 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 22:53:47 -0000 Author: mav Date: Wed Nov 7 22:53:46 2012 New Revision: 242719 URL: http://svnweb.freebsd.org/changeset/base/242719 Log: Announce diagnostic page 7 (Element Descriptor) support. Modified: head/sys/dev/ahci/ahciem.c Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Wed Nov 7 22:46:30 2012 (r242718) +++ head/sys/dev/ahci/ahciem.c Wed Nov 7 22:53:46 2012 (r242719) @@ -399,10 +399,11 @@ ahci_em_emulate_ses_on_led(device_t dev, ccb->ataio.cmd.sector_count >= 2) { bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0; - scsi_ulto2b(3, page->hdr.length); + scsi_ulto2b(4, page->hdr.length); buf[4] = 0; buf[5] = 1; buf[6] = 2; + buf[7] = 7; ccb->ccb_h.status = CAM_REQ_CMP; goto out; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 23:12:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ACEE605; Wed, 7 Nov 2012 23:12:54 +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 EC9828FC16; Wed, 7 Nov 2012 23:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7NCrTM026152; Wed, 7 Nov 2012 23:12:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7NCrvp026150; Wed, 7 Nov 2012 23:12:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211072312.qA7NCrvp026150@svn.freebsd.org> From: Alexander Motin Date: Wed, 7 Nov 2012 23:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242720 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 23:12:54 -0000 Author: mav Date: Wed Nov 7 23:12:53 2012 New Revision: 242720 URL: http://svnweb.freebsd.org/changeset/base/242720 Log: Use information about suported diagnostic pages to avoid reading optional Element Descriptor page if it is not supported. This removes one error message from verbose logs during boot on systems with some enclosures. Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Wed Nov 7 22:53:46 2012 (r242719) +++ head/sys/cam/scsi/scsi_enc_ses.c Wed Nov 7 23:12:53 2012 (r242720) @@ -363,6 +363,7 @@ typedef struct ses_softc { uint32_t ses_flags; #define SES_FLAG_TIMEDCOMP 0x01 #define SES_FLAG_ADDLSTATUS 0x02 +#define SES_FLAG_DESC 0x04 ses_control_reqlist_t ses_requests; ses_control_reqlist_t ses_pending_requests; @@ -1271,7 +1272,10 @@ ses_process_pages(enc_softc_t *enc, stru err = 0; for (i = 0; i < length; i++) { - if (page->params[i] == SesAddlElementStatus) { + if (page->params[i] == SesElementDescriptor) { + ses->ses_flags |= SES_FLAG_DESC; + break; + } else if (page->params[i] == SesAddlElementStatus) { ses->ses_flags |= SES_FLAG_ADDLSTATUS; break; } @@ -1486,7 +1490,8 @@ out: ses_cache_free(enc, enc_cache); else { enc_update_request(enc, SES_UPDATE_GETSTATUS); - enc_update_request(enc, SES_UPDATE_GETELMDESCS); + if (ses->ses_flags & SES_FLAG_DESC) + enc_update_request(enc, SES_UPDATE_GETELMDESCS); if (ses->ses_flags & SES_FLAG_ADDLSTATUS) enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); enc_update_request(enc, SES_PUBLISH_CACHE); From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 23:15:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCEAB791; Wed, 7 Nov 2012 23:15:36 +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 AB77A8FC0A; Wed, 7 Nov 2012 23:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7NFaFX026710; Wed, 7 Nov 2012 23:15:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7NFaD6026709; Wed, 7 Nov 2012 23:15:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211072315.qA7NFaD6026709@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 7 Nov 2012 23:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242721 - head/tools/regression/bin/sh/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 23:15:37 -0000 Author: jilles Date: Wed Nov 7 23:15:36 2012 New Revision: 242721 URL: http://svnweb.freebsd.org/changeset/base/242721 Log: sh: Test that a redefined alias works. Added: head/tools/regression/bin/sh/parser/alias9.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/alias9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias9.0 Wed Nov 7 23:15:36 2012 (r242721) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +alias alias0=: +alias alias0=exit +eval 'alias0 0' +exit 1 From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 23:37:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BD49EDB; Wed, 7 Nov 2012 23:37:25 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E587D8FC0C; Wed, 7 Nov 2012 23:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7NbO0r030232; Wed, 7 Nov 2012 23:37:24 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7NbOLX030229; Wed, 7 Nov 2012 23:37:24 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211072337.qA7NbOLX030229@svn.freebsd.org> From: Greg Lehey Date: Wed, 7 Nov 2012 23:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242722 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 23:37:25 -0000 Author: grog Date: Wed Nov 7 23:37:24 2012 New Revision: 242722 URL: http://svnweb.freebsd.org/changeset/base/242722 Log: Sort option parsing as far as practical. Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Nov 7 23:15:36 2012 (r242721) +++ head/bin/ls/ls.c Wed Nov 7 23:37:24 2012 (r242722) @@ -192,17 +192,9 @@ main(int argc, char *argv[]) f_longform = 0; f_stream = 0; break; - case 'B': - f_nonprint = 0; - f_octal = 1; - f_octal_escape = 0; - break; case 'C': f_sortacross = f_longform = f_singlecol = 0; break; - case 'D': - f_timeformat = optarg; - break; case 'l': f_longform = 1; f_singlecol = 0; @@ -229,16 +221,43 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; - case 'F': + case 'a': + fts_options |= FTS_SEEDOT; + /* FALLTHROUGH */ + case 'A': + f_listdot = 1; + break; + /* The -t and -S options override each other. */ + case 'S': + f_sizesort = 1; + f_timesort = 0; + break; + case 't': + f_timesort = 1; + f_sizesort = 0; + break; + /* Other flags. Please keep alphabetic. */ + case 'B': + f_nonprint = 0; + f_octal = 1; + f_octal_escape = 0; + break; + case 'D': + f_timeformat = optarg; + break; + case 'F': f_type = 1; f_slash = 0; break; + case 'G': + setenv("CLICOLOR", "", 1); + break; case 'H': fts_options |= FTS_COMFOLLOW; f_nofollow = 0; break; - case 'G': - setenv("CLICOLOR", "", 1); + case 'I': + f_noautodot = 1; break; case 'L': fts_options &= ~FTS_PHYSICAL; @@ -254,14 +273,19 @@ main(int argc, char *argv[]) case 'R': f_recursive = 1; break; - case 'a': - fts_options |= FTS_SEEDOT; - /* FALLTHROUGH */ - case 'A': - f_listdot = 1; + case 'T': + f_sectime = 1; break; - case 'I': - f_noautodot = 1; + case 'W': + f_whiteout = 1; + break; + case 'Z': + f_label = 1; + break; + case 'b': + f_nonprint = 0; + f_octal = 0; + f_octal_escape = 1; break; /* The -d option turns off the -R option. */ case 'd': @@ -309,34 +333,11 @@ main(int argc, char *argv[]) case 's': f_size = 1; break; - case 'T': - f_sectime = 1; - break; - /* The -t and -S options override each other. */ - case 't': - f_timesort = 1; - f_sizesort = 0; - break; - case 'S': - f_sizesort = 1; - f_timesort = 0; - break; - case 'W': - f_whiteout = 1; - break; - case 'b': - f_nonprint = 0; - f_octal = 0; - f_octal_escape = 1; - break; case 'w': f_nonprint = 0; f_octal = 0; f_octal_escape = 0; break; - case 'Z': - f_label = 1; - break; default: case '?': usage(); From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 23:45:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F35FA1BD; Wed, 7 Nov 2012 23:45:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4A348FC0A; Wed, 7 Nov 2012 23:45:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7Nj9Fa031425; Wed, 7 Nov 2012 23:45:09 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7Nj9Cj031412; Wed, 7 Nov 2012 23:45:09 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201211072345.qA7Nj9Cj031412@svn.freebsd.org> From: Justin Hibbits Date: Wed, 7 Nov 2012 23:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242723 - in head: cddl/contrib/opensolaris/lib/libdtrace/powerpc cddl/lib cddl/lib/libdtrace cddl/usr.sbin lib lib/libproc sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 23:45:10 -0000 Author: jhibbits Date: Wed Nov 7 23:45:09 2012 New Revision: 242723 URL: http://svnweb.freebsd.org/changeset/base/242723 Log: Implement DTrace for PowerPC. This includes both 32-bit and 64-bit. There is one known issue: Some probes will display an error message along the lines of: "Invalid address (0)" I tested this with both a simple dtrace probe and dtruss on a few different binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect problems without the modules loaded. Volunteers are welcome. MFC after: 1 month Added: head/cddl/contrib/opensolaris/lib/libdtrace/powerpc/ head/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/powerpc/ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/powerpc/sys/ head/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h (contents, props changed) head/sys/cddl/dev/dtrace/powerpc/ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S (contents, props changed) head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c (contents, props changed) head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c (contents, props changed) head/sys/cddl/dev/dtrace/powerpc/regset.h (contents, props changed) Modified: head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.sbin/Makefile head/lib/Makefile head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_regs.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/lockstat/lockstat.c head/sys/cddl/dev/profile/profile.c head/sys/modules/Makefile head/sys/modules/dtrace/Makefile head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Added: head/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c Wed Nov 7 23:45:09 2012 (r242723) @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#include +#include + +/*ARGSUSED*/ +int +dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +int +dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} + +/*ARGSUSED*/ +int +dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp, + fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern) +{ + + dt_dprintf("%s: unimplemented\n", __func__); + return (DT_PROC_ERR); +} Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Wed Nov 7 23:37:24 2012 (r242722) +++ head/cddl/lib/Makefile Wed Nov 7 23:45:09 2012 (r242723) @@ -19,7 +19,8 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" _drti= drti _libdtrace= libdtrace .endif Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Wed Nov 7 23:37:24 2012 (r242722) +++ head/cddl/lib/libdtrace/Makefile Wed Nov 7 23:45:09 2012 (r242723) @@ -74,6 +74,10 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/ut CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.elif ${MACHINE_CPUARCH} == "powerpc" +CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Wed Nov 7 23:37:24 2012 (r242722) +++ head/cddl/usr.sbin/Makefile Wed Nov 7 23:45:09 2012 (r242723) @@ -25,4 +25,10 @@ _lockstat= lockstat _dtrace= dtrace .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_dtrace= dtrace +_dtruss= dtruss +_lockstat= lockstat +.endif + .include Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Nov 7 23:37:24 2012 (r242722) +++ head/lib/Makefile Wed Nov 7 23:45:09 2012 (r242723) @@ -207,6 +207,11 @@ _libproc= libproc _librtld_db= librtld_db .endif +.if ${MACHINE_CPUARCH} == "powerpc" +_libproc= libproc +_librtld_db= librtld_db +.endif + .if ${MK_OPENSSL} != "no" _libmp= libmp .endif Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Wed Nov 7 23:37:24 2012 (r242722) +++ head/lib/libproc/proc_bkpt.c Wed Nov 7 23:45:09 2012 (r242723) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #elif defined(__mips__) #define BREAKPOINT_INSTR 0xd /* break */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__powerpc__) +#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Wed Nov 7 23:37:24 2012 (r242722) +++ head/lib/libproc/proc_regs.c Wed Nov 7 23:45:09 2012 (r242723) @@ -60,6 +60,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_eip; #elif defined(__mips__) *regvalue = regs.r_regs[PC]; +#elif defined(__powerpc__) + *regvalue = regs.pc; #endif break; case REG_SP: @@ -69,6 +71,8 @@ proc_regget(struct proc_handle *phdl, pr *regvalue = regs.r_esp; #elif defined(__mips__) *regvalue = regs.r_regs[SP]; +#elif defined(__powerpc__) + *regvalue = regs.fixreg[1]; #endif break; default: @@ -99,6 +103,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_eip = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.pc = regvalue; #endif break; case REG_SP: @@ -108,6 +114,8 @@ proc_regset(struct proc_handle *phdl, pr regs.r_esp = regvalue; #elif defined(__mips__) regs.r_regs[PC] = regvalue; +#elif defined(__powerpc__) + regs.fixreg[1] = regvalue; #endif break; default: Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Nov 7 23:37:24 2012 (r242722) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Nov 7 23:45:09 2012 (r242723) @@ -235,7 +235,7 @@ static dtrace_dynvar_t dtrace_dynhash_si static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif #endif @@ -10762,7 +10762,7 @@ err: #else int i; -#if defined(__amd64__) || defined(__mips__) +#if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we * ask to malloc, so let's place a limit here before trying Added: head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Nov 7 23:45:09 2012 (r242723) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * XXX: Placeholder for PowerPC fasttrap code + */ Added: head/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h Wed Nov 7 23:45:09 2012 (r242723) @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif +/* + * XXXDTRACE: placehodler for PowerPC fasttrap stuff + */ + +typedef uint32_t fasttrap_instr_t; +#define FASTTRAP_SUNWDTRACE_SIZE 64 +#define FASTTRAP_INSTR 0x0FFFDDDD + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ Added: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Wed Nov 7 23:45:09 2012 (r242723) @@ -0,0 +1,269 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "assym.s" + +#define _ASM + +#include +#include + +#include +/* +#include +*/ + +/* + * Primitives + */ + + .text + +/* +void dtrace_membar_producer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_producer) + blr +END(dtrace_membar_producer) + +/* +void dtrace_membar_consumer(void) +*/ +ASENTRY_NOPROF(dtrace_membar_consumer) + blr +END(dtrace_membar_consumer) + +/* +dtrace_icookie_t dtrace_interrupt_disable(void) +*/ +ASENTRY_NOPROF(dtrace_interrupt_disable) + mfmsr %r3 + andi. %r0,%r3,~PSL_EE@l + mtmsr %r0 + blr +END(dtrace_interrupt_disable) + +/* +void dtrace_interrupt_enable(dtrace_icookie_t cookie) +*/ +ASENTRY_NOPROF(dtrace_interrupt_enable) + mtmsr %r3 + blr +END(dtrace_interrupt_enable) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ +ASENTRY_NOPROF(dtrace_cas32) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r0 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_cas32) + +/* +void * +dtrace_casptr(void *target, void *cmp, void *new) +*/ +ASENTRY_NOPROF(dtrace_casptr) +1: + lwarx %r0,0,%r3 + cmpw %r4,%r0 + bne 2f + stwcx. %r5,0,%r3 + bne 1b +2: mr %r3,%r0 + blr +END(dtrace_casptr) + + +/* +uintptr_t +dtrace_fulword(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fulword) +END(dtrace_fulword) + +/* +uint8_t +dtrace_fuword8_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword8_nocheck) + lbz %r3,0(%r3) + blr +END(dtrace_fuword8_nocheck) + +/* +uint16_t +dtrace_fuword16_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword16_nocheck) + lhz %r3,0(%r3) + blr +END(dtrace_fuword16_nocheck) + +/* +uint32_t +dtrace_fuword32_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword32_nocheck) + lwz %r3,0(%r3) + blr +END(dtrace_fuword32_nocheck) + +/* +uint64_t +dtrace_fuword64_nocheck(void *addr) +*/ +ASENTRY_NOPROF(dtrace_fuword64_nocheck) +#if defined(__powerpc64__) + ld %r3,0(%r3) +#else + lwz %r5,0(%r3) + lwz %r4,4(%r3) + mr %r3,%r5 +#endif + blr +END(dtrace_fuword64_nocheck) + +/* +XXX: unoptimized +void +dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ +ASENTRY_NOPROF(dtrace_copy) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f +2: + blr +END(dtrace_copy) + +/* +void +dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, + volatile uint16_t *flags) +*/ +ASENTRY_NOPROF(dtrace_copystr) + addme %r7,%r3 + addme %r8,%r4 +1: + lbzu %r3,1(%r7) + stbu %r3,1(%r8) + addme %r5,%r5 + beq 2f + or %r3,%r3,%r3 + beq 2f + andi. %r0,%r5,0x0fff + beq 2f + lwz %r0,0(%r6) + andi. %r0,%r0,CPU_DTRACE_BADADDR + beq 1b +2: + blr +END(dtrace_copystr) + +/* +void dtrace_invop_init(void) +*/ +ASENTRY_NOPROF(dtrace_invop_init) + /* XXX: impement it properly -- implement dtrace_invop_start */ + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_init) + +/* +void dtrace_invop_uninit(void) +*/ +ASENTRY_NOPROF(dtrace_invop_uninit) + li %r0,0 + li %r3,dtrace_invop_jump_addr@l + addis %r3,%r3,dtrace_invop_jump_addr@ha + stw %r0,0(%r3) + blr +END(dtrace_invop_uninit) + +/* + * The panic() and cmn_err() functions invoke vpanic() as a common entry point + * into the panic code implemented in panicsys(). vpanic() is responsible + * for passing through the format string and arguments, and constructing a + * regs structure on the stack into which it saves the current register + * values. If we are not dying due to a fatal trap, these registers will + * then be preserved in panicbuf as the current processor state. Before + * invoking panicsys(), vpanic() activates the first panic trigger (see + * common/os/panic.c) and switches to the panic_stack if successful. Note that + * DTrace takes a slightly different panic path if it must panic from probe + * context. Instead of calling panic, it calls into dtrace_vpanic(), which + * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and + * branches back into vpanic(). + */ + +/* +void +vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(vpanic) /* Initial stack layout: */ + +vpanic_common: + blr +END(vpanic) + + + +/* +void +dtrace_vpanic(const char *format, va_list alist) +*/ +ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */ + +#if 0 + bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */ +#endif + b vpanic_common +END(dtrace_vpanic) + +/* +uintptr_t +dtrace_caller(int aframes) +*/ +ASENTRY_NOPROF(dtrace_caller) + li %r3, -1 + blr +END(dtrace_caller) + Added: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Wed Nov 7 23:45:09 2012 (r242723) @@ -0,0 +1,534 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "regset.h" + +uint8_t dtrace_fuword8_nocheck(void *); +uint16_t dtrace_fuword16_nocheck(void *); +uint32_t dtrace_fuword32_nocheck(void *); +uint64_t dtrace_fuword64_nocheck(void *); + +/* Offset to the LR Save word (ppc32) */ +#define RETURN_OFFSET 4 +#define RETURN_OFFSET64 8 + +#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) + +greg_t +dtrace_getfp(void) +{ + return (greg_t)__builtin_frame_address(0); +} + +void +dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, + uint32_t *intrpc) +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) sp)) + break; + + callpc = *(uintptr_t *)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(uintptr_t*)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} + +static int +dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, + uintptr_t sp) +{ + proc_t *p = curproc; + int ret = 0; + + ASSERT(pcstack == NULL || pcstack_limit > 0); + + while (pc != 0) { + ret++; + if (pcstack != NULL) { + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + } + + if (sp == 0) + break; + + if (SV_PROC_FLAG(p, SV_ILP32)) { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + else { + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET64)); + sp = dtrace_fuword64((void *)sp); + } + } + + return (ret); +} + +void +dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; + int n; + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + *pcstack++ = (uint64_t)pc; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + pc = tf->lr; + } + + n = dtrace_getustack_common(pcstack, pcstack_limit, pc, sp); + ASSERT(n >= 0); + ASSERT(n <= pcstack_limit); + + pcstack += n; + pcstack_limit -= n; + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +int +dtrace_getustackdepth(void) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + int n = 0; + + if (p == NULL || (tf = curthread->td_frame) == NULL) + return (0); + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_FAULT)) + return (-1); + + pc = tf->srr0; + sp = tf->fixreg[1]; + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + /* + * In an entry probe. The frame pointer has not yet been + * pushed (that happens in the function prologue). The + * best approach is to add the current pc as a missing top + * of stack and back the pc up to the caller, which is stored + * at the current stack pointer address since the call + * instruction puts it there right before the branch. + */ + + if (SV_PROC_FLAG(p, SV_ILP32)) { + pc = dtrace_fuword32((void *) sp); + } + else + pc = dtrace_fuword64((void *) sp); + n++; + } + + n += dtrace_getustack_common(NULL, 0, pc, sp); + + return (n); +} + +void +dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) +{ + proc_t *p = curproc; + struct trapframe *tf; + uintptr_t pc, sp; + volatile uint16_t *flags = + (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; +#ifdef notyet /* XXX signal stack */ + uintptr_t oldcontext; + size_t s1, s2; +#endif + + if (*flags & CPU_DTRACE_FAULT) + return; + + if (pcstack_limit <= 0) + return; + + /* + * If there's no user context we still need to zero the stack. + */ + if (p == NULL || (tf = curthread->td_frame) == NULL) + goto zero; + + *pcstack++ = (uint64_t)p->p_pid; + pcstack_limit--; + + if (pcstack_limit <= 0) + return; + + pc = tf->srr0; + sp = tf->fixreg[1]; + +#ifdef notyet /* XXX signal stack */ + oldcontext = lwp->lwp_oldcontext; + s1 = sizeof (struct xframe) + 2 * sizeof (long); + s2 = s1 + sizeof (siginfo_t); +#endif + + if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY)) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = 0; + pcstack_limit--; + if (pcstack_limit <= 0) + return; + + if (SV_PROC_FLAG(p, SV_ILP32)) { + pc = dtrace_fuword32((void *)sp); + } + else { + pc = dtrace_fuword64((void *)sp); + } + } + + while (pc != 0) { + *pcstack++ = (uint64_t)pc; + *fpstack++ = sp; + pcstack_limit--; + if (pcstack_limit <= 0) + break; + + if (sp == 0) + break; + +#ifdef notyet /* XXX signal stack */ + if (oldcontext == sp + s1 || oldcontext == sp + s2) { + ucontext_t *ucp = (ucontext_t *)oldcontext; + greg_t *gregs = ucp->uc_mcontext.gregs; + + sp = dtrace_fulword(&gregs[REG_FP]); + pc = dtrace_fulword(&gregs[REG_PC]); + + oldcontext = dtrace_fulword(&ucp->uc_link); + } else +#endif /* XXX */ + { + if (SV_PROC_FLAG(p, SV_ILP32)) { + pc = dtrace_fuword32((void *)(sp + RETURN_OFFSET)); + sp = dtrace_fuword32((void *)sp); + } + else { + pc = dtrace_fuword64((void *)(sp + RETURN_OFFSET64)); + sp = dtrace_fuword64((void *)sp); + } + } + + /* + * This is totally bogus: if we faulted, we're going to clear + * the fault and break. This is to deal with the apparently + * broken Java stacks on x86. + */ + if (*flags & CPU_DTRACE_FAULT) { + *flags &= ~CPU_DTRACE_FAULT; + break; + } + } + +zero: + while (pcstack_limit-- > 0) + *pcstack++ = 0; +} + +/*ARGSUSED*/ +uint64_t +dtrace_getarg(int arg, int aframes) +{ + return (0); +} + +#ifdef notyet +{ + int depth = 0; + register_t sp; + vm_offset_t callpc; + pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + + if (intrpc != 0) + pcstack[depth++] = (pc_t) intrpc; + + aframes++; + + sp = dtrace_getfp(); + + while (depth < pcstack_limit) { + if (!INKERNEL((long) frame)) + break; + + callpc = *(void **)(sp + RETURN_OFFSET); + + if (!INKERNEL(callpc)) + break; + + if (aframes > 0) { + aframes--; + if ((aframes == 0) && (caller != 0)) { + pcstack[depth++] = caller; + } + } + else { + pcstack[depth++] = callpc; + } + + sp = *(void **)sp; + } + + for (; depth < pcstack_limit; depth++) { + pcstack[depth] = 0; + } +} +#endif + +int +dtrace_getstackdepth(int aframes) +{ + int depth = 0; + register_t sp; + + aframes++; + sp = dtrace_getfp(); + depth++; + for(;;) { + if (!INKERNEL((long) sp)) + break; + if (!INKERNEL((long) *(void **)sp)) + break; + depth++; + sp = *(uintptr_t *)sp; + } + if (depth < aframes) + return 0; + else + return depth - aframes; +} + +ulong_t +dtrace_getreg(struct trapframe *rp, uint_t reg) +{ + if (reg < 32) + return (rp->fixreg[reg]); + + switch (reg) { + case 33: + return (rp->lr); + case 34: + return (rp->cr); + case 35: + return (rp->xer); + case 36: + return (rp->ctr); + case 37: + return (rp->srr0); + case 38: + return (rp->srr1); + case 39: + return (rp->exc); + default: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 7 23:50:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 519C7643; Wed, 7 Nov 2012 23:50:29 +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 37F478FC08; Wed, 7 Nov 2012 23:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA7NoSs8032242; Wed, 7 Nov 2012 23:50:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA7NoSLH032240; Wed, 7 Nov 2012 23:50:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211072350.qA7NoSLH032240@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 Nov 2012 23:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242724 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2012 23:50:29 -0000 Author: adrian Date: Wed Nov 7 23:50:28 2012 New Revision: 242724 URL: http://svnweb.freebsd.org/changeset/base/242724 Log: Update AP96 to directly attach an arswitch. Modified: head/sys/mips/conf/AP96.hints Modified: head/sys/mips/conf/AP96.hints ============================================================================== --- head/sys/mips/conf/AP96.hints Wed Nov 7 23:45:09 2012 (r242723) +++ head/sys/mips/conf/AP96.hints Wed Nov 7 23:50:28 2012 (r242724) @@ -25,6 +25,14 @@ hint.arge.1.phymask=0x10 hint.arge.1.miimode=3 # RGMII hint.arge.1.mdio=mdioproxy1 # off the switch mdiobus +# AR8316 switch on MDIO0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 +hint.arswitch.0.numphys=4 +hint.arswitch.0.phy4cpu=1 +hint.arswitch.0.is_rgmii=1 +hint.arswitch.0.is_gmii=0 + # ath0 - slot 17 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 00:24:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B3DC1E8; Thu, 8 Nov 2012 00:24:27 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2C1F8FC15; Thu, 8 Nov 2012 00:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA80OQp4038490; Thu, 8 Nov 2012 00:24:26 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA80OQU2038483; Thu, 8 Nov 2012 00:24:26 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211080024.qA80OQU2038483@svn.freebsd.org> From: Greg Lehey Date: Thu, 8 Nov 2012 00:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242725 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 00:24:27 -0000 Author: grog Date: Thu Nov 8 00:24:26 2012 New Revision: 242725 URL: http://svnweb.freebsd.org/changeset/base/242725 Log: Add y flag and environment variable LS_SAMESORT to specify the same sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. MFC after: 14 days Modified: head/bin/ls/cmp.c head/bin/ls/ls.1 head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c head/bin/ls/util.c Modified: head/bin/ls/cmp.c ============================================================================== --- head/bin/ls/cmp.c Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/cmp.c Thu Nov 8 00:24:26 2012 (r242725) @@ -78,7 +78,10 @@ modcmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); - return (strcoll(a->fts_name, b->fts_name)); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else + return (strcoll(a->fts_name, b->fts_name)); } int @@ -104,7 +107,10 @@ acccmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); - return (strcoll(a->fts_name, b->fts_name)); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else + return (strcoll(a->fts_name, b->fts_name)); } int @@ -130,7 +136,10 @@ birthcmp(const FTSENT *a, const FTSENT * if (b->fts_statp->st_birthtim.tv_nsec < a->fts_statp->st_birthtim.tv_nsec) return (-1); - return (strcoll(a->fts_name, b->fts_name)); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else + return (strcoll(a->fts_name, b->fts_name)); } int @@ -156,7 +165,10 @@ statcmp(const FTSENT *a, const FTSENT *b if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); - return (strcoll(a->fts_name, b->fts_name)); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else + return (strcoll(a->fts_name, b->fts_name)); } int Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/ls.1 Thu Nov 8 00:24:26 2012 (r242725) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd September 28, 2011 +.Dd November 8, 2012 .Dt LS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1 +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, .Op Fl D Ar format .Op Ar .Sh DESCRIPTION @@ -130,6 +130,8 @@ This option is equivalent to defining .Ev CLICOLOR in the environment. (See below.) +This functionality can be compiled out by removing the definition of +.Ev COLORLS . .It Fl H Symbolic links on the command line are followed. This option is assumed if @@ -249,12 +251,35 @@ subsection below, except (if the long fo the directory totals are not output when the output is in a single column, even if multi-column output is requested. .It Fl t -Sort by time modified (most recently modified -first) before sorting the operands in lexicographical -order. +Sort by descending time modified (most recently modified first). If two files +have the same modification timestamp, sort their names in ascending +lexicographical order. +The +.Fl r +option reverses both of these sort orders. +.Pp +Note that these sort orders are contradictory: the time sequence is in +descending order, the lexicographical sort is in ascending order. +This behavior is mandated by +.St -p1003.2 . +This feature can cause problems listing files stored with sequential names on +FAT file systems, such as from digital cameras, where it is possible to have +more than one image with the same timestamp. +In such a case, the photos cannot be listed in the sequence in which +they were taken. +To ensure the same sort order for time and for lexicographical sorting, set the +environment variable +.Ev LS_SAMESORT +or use the +.Fl y +option. +This causes +.Nm +to reverse the lexicographal sort order when sorting files with the +same modification timestamp. .It Fl u Use time of last access, -instead of last modification +instead of time of last modification of the file for sorting .Pq Fl t or printing @@ -268,6 +293,15 @@ The same as .Fl C , except that the multi-column output is produced with entries sorted across, rather than down, the columns. +.It Fl y +When the +.Fl t +option is set, sort the alphabetical output in the same order as the time output. +This has the same effect as setting +.Ev LS_SAMESORT . +See the description of the +.Fl t +option for more details. .It Fl 1 (The numeric digit .Dq one . ) @@ -275,6 +309,15 @@ Force output to be one entry per line. This is the default when output is not to a terminal. +.It Fl , +(Comma) When the +.Fl l +option is set, print file sizes grouped and separated by thousands using the +non-monetary separator returned by +.Xr localeconv 3 , +typically a comma or period. +If no locale is set, or the locale does not have a non-monetary separator, this +option has no effect. .El .Pp The @@ -529,7 +572,7 @@ variable is defined. .It Ev CLICOLOR_FORCE Color sequences are normally disabled if the output is not directed to a terminal. -This can be overridden by setting this flag. +This can be overridden by setting this variable. The .Ev TERM variable still needs to reference a color capable terminal however @@ -655,6 +698,14 @@ Not all columns have changeable widths. The fields are, in order: inode, block count, number of links, user name, group name, flags, file size, file name. +.It Ev LS_SAMESORT +If this variable is set, the +.Fl t +option sorts the names of files with the same modification timestamp in the same +sense as the time sort. +See the description of the +.Fl t +option for more details. .It Ev TERM The .Ev CLICOLOR @@ -678,6 +729,7 @@ specification. .Xr getfacl 1 , .Xr sort 1 , .Xr xterm 1 , +.Xr localeconv 3 , .Xr strftime 3 , .Xr strmode 3 , .Xr termcap 5 , @@ -716,3 +768,9 @@ option description might be a feature th based on the fact that single-column output usually goes to something other than a terminal. It is debatable whether this is a design bug. +.Pp +.St -p1003.2 +mandates opposite sort orders for files with the same timestamp when +sorting with the +.Fl t +option. Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/ls.c Thu Nov 8 00:24:26 2012 (r242725) @@ -109,10 +109,11 @@ int termwidth = 80; /* default terminal int f_humanval; /* show human-readable file sizes */ int f_inode; /* print inode */ static int f_kblocks; /* print size in kilobytes */ + int f_label; /* show MAC label */ static int f_listdir; /* list actual directory, not contents */ static int f_listdot; /* list files beginning with . */ -static int f_noautodot; /* do not automatically enable -A for root */ int f_longform; /* long listing format */ +static int f_noautodot; /* do not automatically enable -A for root */ static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ @@ -122,19 +123,21 @@ static int f_numericonly; /* don't conve int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ static int f_reversesort; /* reverse whatever sort is used */ - int f_sectime; /* print the real time for all files */ + int f_samesort; /* sort time and name in same direction */ + int f_sectime; /* print full time information */ static int f_singlecol; /* use single column output */ int f_size; /* list size in short listing */ +static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ -static int f_timesort; /* sort by time vice name */ + int f_thousands; /* show file sizes with thousands separators */ char *f_timeformat; /* user-specified time format */ -static int f_sizesort; +static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ - int f_label; /* show MAC label */ + #ifdef COLORLS int f_color; /* add type in color for non-regular files */ @@ -180,8 +183,10 @@ main(int argc, char *argv[]) } fts_options = FTS_PHYSICAL; + if (getenv("LS_SAMESORT")) + f_samesort = 1; while ((ch = getopt(argc, argv, - "1ABCD:FGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { + "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* * The -1, -C, -x and -l options all override each other so @@ -237,6 +242,9 @@ main(int argc, char *argv[]) f_sizesort = 0; break; /* Other flags. Please keep alphabetic. */ + case ',': + f_thousands = 1; + break; case 'B': f_nonprint = 0; f_octal = 1; @@ -338,6 +346,9 @@ main(int argc, char *argv[]) f_octal = 0; f_octal_escape = 0; break; + case 'y': + f_samesort = 1; + break; default: case '?': usage(); @@ -850,6 +861,8 @@ label_out: d.s_size = sizelen; d.s_user = maxuser; } + if (f_thousands) /* make space for commas */ + d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/ls.h Thu Nov 8 00:24:26 2012 (r242725) @@ -49,11 +49,13 @@ extern int f_longform; /* long listing extern int f_octal; /* print unprintables in octal */ extern int f_octal_escape; /* like f_octal but use C escapes if possible */ extern int f_nonprint; /* show unprintables as ? */ +extern int f_samesort; /* sort time and name in same direction */ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ extern int f_statustime; /* use time of last mode change */ +extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ extern int f_type; /* add type character for non-regular files */ Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/print.c Thu Nov 8 00:24:26 2012 (r242725) @@ -606,7 +606,11 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); - } else + } else if (f_thousands) { /* with commas */ + /* This format assignment needed to work round gcc bug. */ + const char *format = "%*j'd "; + (void)printf(format, (u_int)width, bytes); + } else (void)printf("%*jd ", (u_int)width, bytes); } Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Wed Nov 7 23:50:28 2012 (r242724) +++ head/bin/ls/util.c Thu Nov 8 00:24:26 2012 (r242725) @@ -175,7 +175,7 @@ prn_octal(const char *s) size_t clen; unsigned char ch; int goodchar, i, len, prtlen; - + memset(&mbs, 0, sizeof(mbs)); len = 0; while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { @@ -222,9 +222,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #else - "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #endif " [file ...]\n"); exit(1); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 00:32:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C4B8982; Thu, 8 Nov 2012 00:32:37 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0615D8FC15; Thu, 8 Nov 2012 00:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA80Wakf039743; Thu, 8 Nov 2012 00:32:36 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA80Wad3039739; Thu, 8 Nov 2012 00:32:36 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201211080032.qA80Wad3039739@svn.freebsd.org> From: Doug Ambrisko Date: Thu, 8 Nov 2012 00:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242726 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 00:32:37 -0000 Author: ambrisko Date: Thu Nov 8 00:32:36 2012 New Revision: 242726 URL: http://svnweb.freebsd.org/changeset/base/242726 Log: Add support for SCSI pass through devices to be attached and detached. PR: 172864 Submitted by: rstone@ Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Thu Nov 8 00:24:26 2012 (r242725) +++ head/sys/dev/mfi/mfi.c Thu Nov 8 00:32:36 2012 (r242726) @@ -1577,6 +1577,11 @@ mfi_decode_evt(struct mfi_softc *sc, str sx_xunlock(&sc->mfi_config_lock); } } + if (sc->mfi_cam_rescan_cb != NULL && + (detail->code == MR_EVT_PD_INSERTED || + detail->code == MR_EVT_PD_REMOVED)) { + sc->mfi_cam_rescan_cb(sc, detail->args.pd.device_id); + } break; } } Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Thu Nov 8 00:24:26 2012 (r242725) +++ head/sys/dev/mfi/mfi_cam.c Thu Nov 8 00:32:36 2012 (r242726) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -63,12 +65,19 @@ __FBSDID("$FreeBSD$"); #include #include +enum mfip_state { + MFIP_STATE_NONE, + MFIP_STATE_DETACH, + MFIP_STATE_RESCAN +}; + struct mfip_softc { device_t dev; struct mfi_softc *mfi_sc; struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + enum mfip_state state; }; static int mfip_probe(device_t); @@ -76,6 +85,7 @@ static int mfip_attach(device_t); static int mfip_detach(device_t); static void mfip_cam_action(struct cam_sim *, union ccb *); static void mfip_cam_poll(struct cam_sim *); +static void mfip_cam_rescan(struct mfi_softc *, uint32_t tid); static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); @@ -122,6 +132,7 @@ mfip_attach(device_t dev) mfisc = device_get_softc(device_get_parent(dev)); sc->dev = dev; + sc->state = MFIP_STATE_NONE; sc->mfi_sc = mfisc; mfisc->mfi_cam_start = mfip_start; @@ -137,6 +148,8 @@ mfip_attach(device_t dev) return (EINVAL); } + mfisc->mfi_cam_rescan_cb = mfip_cam_rescan; + mtx_lock(&mfisc->mfi_io_lock); if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); @@ -159,6 +172,16 @@ mfip_detach(device_t dev) if (sc == NULL) return (EINVAL); + mtx_lock(&sc->mfi_sc->mfi_io_lock); + if (sc->state == MFIP_STATE_RESCAN) { + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + return (EBUSY); + } + sc->state = MFIP_STATE_DETACH; + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + + sc->mfi_sc->mfi_cam_rescan_cb = NULL; + if (sc->sim != NULL) { mtx_lock(&sc->mfi_sc->mfi_io_lock); xpt_bus_deregister(cam_sim_path(sc->sim)); @@ -266,6 +289,54 @@ mfip_cam_action(struct cam_sim *sim, uni return; } +static void +mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) +{ + union ccb *ccb; + struct mfip_softc *camsc; + struct cam_sim *sim; + device_t mfip_dev; + + mtx_lock(&Giant); + mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1); + mtx_unlock(&Giant); + if (mfip_dev == NULL) { + device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n"); + return; + } + + mtx_lock(&sc->mfi_io_lock); + camsc = device_get_softc(mfip_dev); + if (camsc->state == MFIP_STATE_DETACH) { + mtx_unlock(&sc->mfi_io_lock); + return; + } + camsc->state = MFIP_STATE_RESCAN; + mtx_unlock(&sc->mfi_io_lock); + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->mfi_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + sim = camsc->sim; + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + device_printf(sc->mfi_dev, + "Cannot create path for bus rescan.\n"); + return; + } + + xpt_rescan(ccb); + + mtx_lock(&sc->mfi_io_lock); + camsc->state = MFIP_STATE_NONE; + mtx_unlock(&sc->mfi_io_lock); +} + static struct mfi_command * mfip_start(void *data) { Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Thu Nov 8 00:24:26 2012 (r242725) +++ head/sys/dev/mfi/mfivar.h Thu Nov 8 00:32:36 2012 (r242726) @@ -303,6 +303,8 @@ struct mfi_softc { TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; struct mfi_command * (* mfi_cam_start)(void *); + void (*mfi_cam_rescan_cb)(struct mfi_softc *, + uint32_t); struct callout mfi_watchdog_callout; struct mtx mfi_io_lock; struct sx mfi_config_lock; From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 00:32:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D5E6AE6; Thu, 8 Nov 2012 00:32:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 325578FC0A; Thu, 8 Nov 2012 00:32:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA80Woi8039821; Thu, 8 Nov 2012 00:32:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA80Wo6Z039813; Thu, 8 Nov 2012 00:32:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211080032.qA80Wo6Z039813@svn.freebsd.org> From: Attilio Rao Date: Thu, 8 Nov 2012 00:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242727 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 00:32:50 -0000 Author: attilio Date: Thu Nov 8 00:32:49 2012 New Revision: 242727 URL: http://svnweb.freebsd.org/changeset/base/242727 Log: - Current caching mode is completely broken because it simply relies on timing of the operations and not real lookup, bringing too many false positives. Remove the whole mechanism. If it needs to be implemented, next time it should really be done in the proper way. - Fix VOP_GETATTR() in order to cope with userland bugs that would change the type of file and not panic. Instead it gets the entry as if it is not existing. Reported and tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616 Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_file.c Thu Nov 8 00:32:49 2012 (r242727) @@ -192,7 +192,6 @@ out: atomic_subtract_acq_int(&fuse_fh_count, 1); fufh->fh_id = (uint64_t)-1; fufh->fh_type = FUFH_INVALID; - fuse_invalidate_attr(vp); return err; } Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_internal.c Thu Nov 8 00:32:49 2012 (r242727) @@ -371,26 +371,6 @@ fuse_internal_readdir_processdata(struct /* remove */ -#ifdef XXXIP -static int -fuse_internal_remove_callback(struct vnode *vp, void *cargs) -{ - struct vattr *vap; - uint64_t target_nlink; - - vap = VTOVA(vp); - - target_nlink = *(uint64_t *)cargs; - - /* somewhat lame "heuristics", but you got better ideas? */ - if ((vap->va_nlink == target_nlink) && vnode_isreg(vp)) { - fuse_invalidate_attr(vp); - } - return 0; -} - -#endif - #define INVALIDATE_CACHED_VATTRS_UPON_UNLINK 1 int fuse_internal_remove(struct vnode *dvp, @@ -426,27 +406,6 @@ fuse_internal_remove(struct vnode *dvp, err = fdisp_wait_answ(&fdi); fdisp_destroy(&fdi); - - fuse_invalidate_attr(dvp); - fuse_invalidate_attr(vp); - -#ifdef XXXIP - /* - * XXX: INVALIDATE_CACHED_VATTRS_UPON_UNLINK - * - * Consider the case where vap->va_nlink > 1 for the entity being - * removed. In our world, other in-memory vnodes that share a link - * count each with this one may not know right way that this one just - * got deleted. We should let them know, say, through a vnode_iterate() - * here and a callback that does fuse_invalidate_attr(vp) on each - * relevant vnode. - */ - if (need_invalidate && !err) { - vnode_iterate(vnode_mount(vp), 0, fuse_internal_remove_callback, - (void *)&target_nlink); - } -#endif - return err; } @@ -477,11 +436,6 @@ fuse_internal_rename(struct vnode *fdvp, err = fdisp_wait_answ(&fdi); fdisp_destroy(&fdi); - - fuse_invalidate_attr(fdvp); - if (tdvp != fdvp) { - fuse_invalidate_attr(tdvp); - } return err; } @@ -556,7 +510,6 @@ fuse_internal_newentry(struct vnode *dvp bufsize, &fdi); err = fuse_internal_newentry_core(dvp, vpp, cnp, vtype, &fdi); fdisp_destroy(&fdi); - fuse_invalidate_attr(dvp); return err; } Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_internal.h Thu Nov 8 00:32:49 2012 (r242727) @@ -138,23 +138,6 @@ uio_setresid(struct uio *uio, ssize_t re uio->uio_resid = resid; } -/* time */ - -#define fuse_timespec_add(vvp, uvp) \ - do { \ - (vvp)->tv_sec += (uvp)->tv_sec; \ - (vvp)->tv_nsec += (uvp)->tv_nsec; \ - if ((vvp)->tv_nsec >= 1000000000) { \ - (vvp)->tv_sec++; \ - (vvp)->tv_nsec -= 1000000000; \ - } \ - } while (0) - -#define fuse_timespec_cmp(tvp, uvp, cmp) \ - (((tvp)->tv_sec == (uvp)->tv_sec) ? \ - ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ - ((tvp)->tv_sec cmp (uvp)->tv_sec)) - /* miscellaneous */ static __inline__ @@ -254,17 +237,9 @@ fuse_internal_attr_fat2vat(struct mount } -#define cache_attrs(vp, fuse_out) do { \ - struct timespec uptsp_ ## __func__; \ - \ - VTOFUD(vp)->cached_attrs_valid.tv_sec = (fuse_out)->attr_valid; \ - VTOFUD(vp)->cached_attrs_valid.tv_nsec = (fuse_out)->attr_valid_nsec; \ - nanouptime(&uptsp_ ## __func__); \ - \ - fuse_timespec_add(&VTOFUD(vp)->cached_attrs_valid, &uptsp_ ## __func__); \ - \ - fuse_internal_attr_fat2vat(vnode_mount(vp), &(fuse_out)->attr, VTOVA(vp)); \ -} while (0) +#define cache_attrs(vp, fuse_out) \ + fuse_internal_attr_fat2vat(vnode_mount(vp), &(fuse_out)->attr, \ + VTOVA(vp)); /* fsync */ Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_io.c Thu Nov 8 00:32:49 2012 (r242727) @@ -159,7 +159,6 @@ fuse_io_dispatch(struct vnode *vp, struc FS_DEBUG("direct write of vnode %ju via file handle %ju\n", (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); err = fuse_write_directbackend(vp, uio, cred, fufh); - fuse_invalidate_attr(vp); } else { FS_DEBUG("buffered write of vnode %ju\n", (uintmax_t)VTOILLU(vp)); Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_node.c Thu Nov 8 00:32:49 2012 (r242727) @@ -283,16 +283,6 @@ fuse_vnode_open(struct vnode *vp, int32_ } int -fuse_isvalid_attr(struct vnode *vp) -{ - struct fuse_vnode_data *fvdat = VTOFUD(vp); - struct timespec uptsp; - - nanouptime(&uptsp); - return fuse_timespec_cmp(&uptsp, &fvdat->cached_attrs_valid, <=); -} - -int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred) { struct fuse_vnode_data *fvdat = VTOFUD(vp); @@ -337,8 +327,6 @@ fuse_vnode_savesize(struct vnode *vp, st if (err == 0) fvdat->flag &= ~FN_SIZECHANGE; - fuse_invalidate_attr(vp); - return err; } @@ -350,8 +338,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct vattr va; if ((fvdat->flag & FN_SIZECHANGE) != 0 || - (fuse_refresh_size == 0 && fvdat->filesize != 0) || - fuse_isvalid_attr(vp)) + (fuse_refresh_size == 0 && fvdat->filesize != 0)) return; VOP_GETATTR(vp, &va, cred); @@ -378,7 +365,5 @@ fuse_vnode_setsize(struct vnode *vp, str err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); } vnode_pager_setsize(vp, newsize); - fuse_invalidate_attr(vp); - return err; } Modified: head/sys/fs/fuse/fuse_node.h ============================================================================== --- head/sys/fs/fuse/fuse_node.h Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_node.h Thu Nov 8 00:32:49 2012 (r242727) @@ -83,7 +83,6 @@ struct fuse_vnode_data { uint32_t flag; /** meta **/ - struct timespec cached_attrs_valid; struct vattr cached_attrs; off_t filesize; uint64_t nlookup; @@ -100,15 +99,6 @@ struct fuse_vnode_data { extern struct vop_vector fuse_vnops; -static __inline__ -void -fuse_invalidate_attr(struct vnode *vp) -{ - if (VTOFUD(vp)) { - bzero(&VTOFUD(vp)->cached_attrs_valid, sizeof(struct timespec)); - } -} - static __inline void fuse_vnode_setparent(struct vnode *vp, struct vnode *dvp) { @@ -118,8 +108,6 @@ fuse_vnode_setparent(struct vnode *vp, s } } -int fuse_isvalid_attr(struct vnode *vp); - void fuse_vnode_destroy(struct vnode *vp); int fuse_vnode_get(struct mount *mp, Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Thu Nov 8 00:32:36 2012 (r242726) +++ head/sys/fs/fuse/fuse_vnops.c Thu Nov 8 00:32:49 2012 (r242727) @@ -482,17 +482,6 @@ fuse_vnop_getattr(struct vop_getattr_arg /* Note that we are not bailing out on a dead file system just yet. */ - /* look for cached attributes */ - if (fuse_isvalid_attr(vp)) { - if (vap != VTOVA(vp)) { - memcpy(vap, VTOVA(vp), sizeof(*vap)); - } - if ((fvdat->flag & FN_SIZECHANGE) != 0) { - vap->va_size = fvdat->filesize; - } - debug_printf("return cached: inode=%ju\n", (uintmax_t)VTOI(vp)); - return 0; - } if (!(dataflags & FSESS_INITED)) { if (!vnode_isvroot(vp)) { fdata_set_dead(fuse_get_mpdata(vnode_mount(vp))); @@ -519,6 +508,11 @@ fuse_vnop_getattr(struct vop_getattr_arg if (vap != VTOVA(vp)) { memcpy(vap, VTOVA(vp), sizeof(*vap)); } + if (vap->va_type != vnode_vtype(vp)) { + fuse_internal_vnode_disappear(vp); + err = ENOENT; + goto out; + } if ((fvdat->flag & FN_SIZECHANGE) != 0) vap->va_size = fvdat->filesize; @@ -534,7 +528,6 @@ fuse_vnop_getattr(struct vop_getattr_arg fuse_vnode_setsize(vp, cred, new_filesize); } } - KASSERT(vnode_vtype(vp) == vap->va_type, ("stale vnode")); debug_printf("fuse_getattr e: returning 0\n"); out: @@ -635,9 +628,6 @@ fuse_vnop_link(struct vop_link_args *ap) feo = fdi.answ; err = fuse_internal_checkentry(feo, vnode_vtype(vp)); - fuse_invalidate_attr(tdvp); - fuse_invalidate_attr(vp); - out: fdisp_destroy(&fdi); return err; @@ -1085,8 +1075,6 @@ fuse_vnop_mkdir(struct vop_mkdir_args *a struct componentname *cnp = ap->a_cnp; struct vattr *vap = ap->a_vap; - int err = 0; - struct fuse_mkdir_in fmdi; fuse_trace_printf_vnop(); @@ -1096,13 +1084,8 @@ fuse_vnop_mkdir(struct vop_mkdir_args *a } fmdi.mode = MAKEIMODE(vap->va_type, vap->va_mode); - err = fuse_internal_newentry(dvp, vpp, cnp, FUSE_MKDIR, &fmdi, - sizeof(fmdi), VDIR); - - if (err == 0) { - fuse_invalidate_attr(dvp); - } - return err; + return (fuse_internal_newentry(dvp, vpp, cnp, FUSE_MKDIR, &fmdi, + sizeof(fmdi), VDIR)); } /* @@ -1367,10 +1350,8 @@ fuse_vnop_remove(struct vop_remove_args err = fuse_internal_remove(dvp, vp, cnp, FUSE_UNLINK); - if (err == 0) { + if (err == 0) fuse_internal_vnode_disappear(vp); - fuse_invalidate_attr(dvp); - } return err; } @@ -1423,11 +1404,8 @@ fuse_vnop_rename(struct vop_rename_args sx_xlock(&data->rename_lock); err = fuse_internal_rename(fdvp, fcnp, tdvp, tcnp); if (err == 0) { - fuse_invalidate_attr(fdvp); - if (tdvp != fdvp) { + if (tdvp != fdvp) fuse_vnode_setparent(fvp, tdvp); - fuse_invalidate_attr(tdvp); - } if (tvp != NULL) fuse_vnode_setparent(tvp, NULL); } @@ -1482,10 +1460,8 @@ fuse_vnop_rmdir(struct vop_rmdir_args *a } err = fuse_internal_remove(dvp, vp, ap->a_cnp, FUSE_RMDIR); - if (err == 0) { + if (err == 0) fuse_internal_vnode_disappear(vp); - fuse_invalidate_attr(dvp); - } return err; } @@ -1593,14 +1569,10 @@ fuse_vnop_setattr(struct vop_setattr_arg vap->va_vaflags & VA_UTIMES_NULL) { err = fuse_internal_access(vp, VWRITE, &facp, td, cred); } - if (err) { - fuse_invalidate_attr(vp); + if (err) goto out; - } - if ((err = fdisp_wait_answ(&fdi))) { - fuse_invalidate_attr(vp); + if ((err = fdisp_wait_answ(&fdi))) goto out; - } vtyp = IFTOVT(((struct fuse_attr_out *)fdi.answ)->attr.mode); if (vnode_vtype(vp) != vtyp) { @@ -1624,7 +1596,6 @@ fuse_vnop_setattr(struct vop_setattr_arg out: fdisp_destroy(&fdi); if (!err && sizechanged) { - fuse_invalidate_attr(vp); fuse_vnode_setsize(vp, cred, newsize); VTOFUD(vp)->flag &= ~FN_SIZECHANGE; } @@ -1715,10 +1686,6 @@ fuse_vnop_symlink(struct vop_symlink_arg err = fuse_internal_newentry_core(dvp, vpp, cnp, VLNK, &fdi); fdisp_destroy(&fdi); - - if (err == 0) { - fuse_invalidate_attr(dvp); - } return err; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 00:54:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9282F2D8; Thu, 8 Nov 2012 00:54: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 77E098FC08; Thu, 8 Nov 2012 00:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA80shDD043194; Thu, 8 Nov 2012 00:54:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA80shkv043192; Thu, 8 Nov 2012 00:54:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211080054.qA80shkv043192@svn.freebsd.org> From: Xin LI Date: Thu, 8 Nov 2012 00:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242728 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 00:54:43 -0000 Author: delphij Date: Thu Nov 8 00:54:43 2012 New Revision: 242728 URL: http://svnweb.freebsd.org/changeset/base/242728 Log: ICMPV6_FILTER should read ICMP6_FILTER. Submitted by: Frédéric Perrin MFC after: 2 weeks Modified: head/share/man/man4/icmp6.4 Modified: head/share/man/man4/icmp6.4 ============================================================================== --- head/share/man/man4/icmp6.4 Thu Nov 8 00:32:49 2012 (r242727) +++ head/share/man/man4/icmp6.4 Thu Nov 8 00:54:43 2012 (r242728) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2004 +.Dd November 7, 2012 .Dt ICMP6 4 .Os .Sh NAME @@ -234,7 +234,7 @@ calls may be used to obtain and install option level .Dv IPPROTO_ICMPV6 and name -.Dv ICMPV6_FILTER +.Dv ICMP6_FILTER with a pointer to the .Vt icmp6_filter structure as the option value. From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:24:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F3D1793; Thu, 8 Nov 2012 01:24:07 +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 E5A748FC12; Thu, 8 Nov 2012 01:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81O6Sp047708; Thu, 8 Nov 2012 01:24:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81O6Co047704; Thu, 8 Nov 2012 01:24:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080124.qA81O6Co047704@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242729 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:24:07 -0000 Author: mm Date: Thu Nov 8 01:24:06 2012 New Revision: 242729 URL: http://svnweb.freebsd.org/changeset/base/242729 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13849:3468a95b27cd (illumos ZFS issues #3145, #3212, #3258) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Thu Nov 8 00:54:43 2012 (r242728) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Thu Nov 8 01:24:06 2012 (r242729) @@ -188,6 +188,7 @@ uint64_t zfs_arc_meta_limit = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; +int zfs_disable_dup_eviction = 0; /* * Note that buffers can be in one of 6 states: @@ -290,6 +291,9 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_duplicate_buffers; + kstat_named_t arcstat_duplicate_buffers_size; + kstat_named_t arcstat_duplicate_reads; } arc_stats_t; static arc_stats_t arc_stats = { @@ -345,7 +349,10 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 } + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "duplicate_buffers", KSTAT_DATA_UINT64 }, + { "duplicate_buffers_size", KSTAT_DATA_UINT64 }, + { "duplicate_reads", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -1360,6 +1367,17 @@ arc_buf_clone(arc_buf_t *from) hdr->b_buf = buf; arc_get_data_buf(buf); bcopy(from->b_data, buf->b_data, size); + + /* + * This buffer already exists in the arc so create a duplicate + * copy for the caller. If the buffer is associated with user data + * then track the size and number of duplicates. These stats will be + * updated as duplicate buffers are created and destroyed. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMP(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, size); + } hdr->b_datacnt += 1; return (buf); } @@ -1458,6 +1476,16 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ ASSERT3U(state->arcs_size, >=, size); atomic_add_64(&state->arcs_size, -size); buf->b_data = NULL; + + /* + * If we're destroying a duplicate buffer make sure + * that the appropriate statistics are updated. + */ + if (buf->b_hdr->b_datacnt > 1 && + buf->b_hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, -size); + } ASSERT(buf->b_hdr->b_datacnt > 0); buf->b_hdr->b_datacnt -= 1; } @@ -1642,6 +1670,48 @@ arc_buf_size(arc_buf_t *buf) } /* + * Called from the DMU to determine if the current buffer should be + * evicted. In order to ensure proper locking, the eviction must be initiated + * from the DMU. Return true if the buffer is associated with user data and + * duplicate buffers still exist. + */ +boolean_t +arc_buf_eviction_needed(arc_buf_t *buf) +{ + arc_buf_hdr_t *hdr; + boolean_t evict_needed = B_FALSE; + + if (zfs_disable_dup_eviction) + return (B_FALSE); + + mutex_enter(&buf->b_evict_lock); + hdr = buf->b_hdr; + if (hdr == NULL) { + /* + * We are in arc_do_user_evicts(); let that function + * perform the eviction. + */ + ASSERT(buf->b_data == NULL); + mutex_exit(&buf->b_evict_lock); + return (B_FALSE); + } else if (buf->b_data == NULL) { + /* + * We have already been added to the arc eviction list; + * recommend eviction. + */ + ASSERT3P(hdr, ==, &arc_eviction_hdr); + mutex_exit(&buf->b_evict_lock); + return (B_TRUE); + } + + if (hdr->b_datacnt > 1 && hdr->b_type == ARC_BUFC_DATA) + evict_needed = B_TRUE; + + mutex_exit(&buf->b_evict_lock); + return (evict_needed); +} + +/* * Evict buffers from list until we've removed the specified number of * bytes. Move the removed buffers to the appropriate evict state. * If the recycle flag is set, then attempt to "recycle" a buffer: @@ -2626,8 +2696,10 @@ arc_read_done(zio_t *zio) abuf = buf; for (acb = callback_list; acb; acb = acb->acb_next) { if (acb->acb_done) { - if (abuf == NULL) + if (abuf == NULL) { + ARCSTAT_BUMP(arcstat_duplicate_reads); abuf = arc_buf_clone(buf); + } acb->acb_buf = abuf; abuf = NULL; } @@ -3166,6 +3238,16 @@ arc_release(arc_buf_t *buf, void *tag) ASSERT3U(*size, >=, hdr->b_size); atomic_add_64(size, -hdr->b_size); } + + /* + * We're releasing a duplicate user data buffer, update + * our statistics accordingly. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, + -hdr->b_size); + } hdr->b_datacnt -= 1; arc_cksum_verify(buf); arc_buf_unwatch(buf); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Thu Nov 8 00:54:43 2012 (r242728) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Thu Nov 8 01:24:06 2012 (r242729) @@ -2089,7 +2089,24 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, dbuf_evict(db); } else { VERIFY(arc_buf_remove_ref(db->db_buf, db) == 0); - if (!DBUF_IS_CACHEABLE(db)) + + /* + * A dbuf will be eligible for eviction if either the + * 'primarycache' property is set or a duplicate + * copy of this buffer is already cached in the arc. + * + * In the case of the 'primarycache' a buffer + * is considered for eviction if it matches the + * criteria set in the property. + * + * To decide if our buffer is considered a + * duplicate, we must call into the arc to determine + * if multiple buffers are referencing the same + * block on-disk. If so, then we simply evict + * ourselves. + */ + if (!DBUF_IS_CACHEABLE(db) || + arc_buf_eviction_needed(db->db_buf)) dbuf_clear(db); else mutex_exit(&db->db_mtx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Thu Nov 8 00:54:43 2012 (r242728) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Thu Nov 8 01:24:06 2012 (r242729) @@ -99,6 +99,7 @@ int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); +boolean_t arc_buf_eviction_needed(arc_buf_t *buf); #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf); #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:24:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B83A794; Thu, 8 Nov 2012 01:24:07 +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 0E0EB8FC15; Thu, 8 Nov 2012 01:24:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81O6n6047714; Thu, 8 Nov 2012 01:24:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81O6OC047712; Thu, 8 Nov 2012 01:24:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080124.qA81O6OC047712@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242729 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:24:07 -0000 Author: mm Date: Thu Nov 8 01:24:06 2012 New Revision: 242729 URL: http://svnweb.freebsd.org/changeset/base/242729 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13849:3468a95b27cd (illumos ZFS issues #3145, #3212, #3258) Modified: vendor/illumos/dist/cmd/ztest/ztest.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Thu Nov 8 00:54:43 2012 (r242728) +++ vendor/illumos/dist/cmd/ztest/ztest.c Thu Nov 8 01:24:06 2012 (r242729) @@ -119,8 +119,8 @@ #include #include -#define ZTEST_FD_DATA 3 -#define ZTEST_FD_RAND 4 +static int ztest_fd_data = -1; +static int ztest_fd_rand = -1; typedef struct ztest_shared_hdr { uint64_t zh_hdr_size; @@ -708,14 +708,17 @@ process_options(int argc, char **argv) UINT64_MAX >> 2); if (strlen(altdir) > 0) { - char cmd[MAXNAMELEN]; - char realaltdir[MAXNAMELEN]; + char *cmd; + char *realaltdir; char *bin; char *ztest; char *isa; int isalen; - (void) realpath(getexecname(), cmd); + cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + + VERIFY(NULL != realpath(getexecname(), cmd)); if (0 != access(altdir, F_OK)) { ztest_dump_core = B_FALSE; fatal(B_TRUE, "invalid alternate ztest path: %s", @@ -746,6 +749,9 @@ process_options(int argc, char **argv) fatal(B_TRUE, "invalid alternate lib directory %s", zo->zo_alt_libpath); } + + umem_free(cmd, MAXPATHLEN); + umem_free(realaltdir, MAXPATHLEN); } } @@ -762,10 +768,12 @@ ztest_random(uint64_t range) { uint64_t r; + ASSERT3S(ztest_fd_rand, >=, 0); + if (range == 0) return (0); - if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r)) + if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r)) fatal(1, "short read from /dev/urandom"); return (r % range); @@ -4695,7 +4703,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 if (islog) (void) rw_unlock(&ztest_name_lock); } else { + /* + * Ideally we would like to be able to randomly + * call vdev_[on|off]line without holding locks + * to force unpredictable failures but the side + * effects of vdev_[on|off]line prevent us from + * doing so. We grab the ztest_vdev_lock here to + * prevent a race between injection testing and + * aux_vdev removal. + */ + VERIFY(mutex_lock(&ztest_vdev_lock) == 0); (void) vdev_online(spa, guid0, 0, NULL); + VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); } } @@ -5650,20 +5669,16 @@ ztest_init(ztest_shared_t *zs) } static void -setup_fds(void) +setup_data_fd(void) { - int fd; - - char *tmp = tempnam(NULL, NULL); - fd = open(tmp, O_RDWR | O_CREAT, 0700); - ASSERT3U(fd, ==, ZTEST_FD_DATA); - (void) unlink(tmp); - free(tmp); + static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX"; - fd = open("/dev/urandom", O_RDONLY); - ASSERT3U(fd, ==, ZTEST_FD_RAND); + ztest_fd_data = mkstemp(ztest_name_data); + ASSERT3S(ztest_fd_data, >=, 0); + (void) unlink(ztest_name_data); } + static int shared_data_size(ztest_shared_hdr_t *hdr) { @@ -5685,10 +5700,10 @@ setup_hdr(void) ztest_shared_hdr_t *hdr; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t))); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t))); hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t); hdr->zh_opts_size = sizeof (ztest_shared_opts_t); @@ -5699,7 +5714,7 @@ setup_hdr(void) hdr->zh_ds_count = ztest_opts.zo_datasets; size = shared_data_size(hdr); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size)); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, size)); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); } @@ -5712,14 +5727,14 @@ setup_data(void) uint8_t *buf; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); size = shared_data_size(hdr); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); buf = (uint8_t *)hdr; @@ -5738,12 +5753,13 @@ exec_child(char *cmd, char *libpath, boo { pid_t pid; int status; - char cmdbuf[MAXPATHLEN]; + char *cmdbuf = NULL; pid = fork(); if (cmd == NULL) { - (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf)); + cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN); cmd = cmdbuf; } @@ -5752,9 +5768,16 @@ exec_child(char *cmd, char *libpath, boo if (pid == 0) { /* child */ char *emptyargv[2] = { cmd, NULL }; + char fd_data_str[12]; struct rlimit rl = { 1024, 1024 }; (void) setrlimit(RLIMIT_NOFILE, &rl); + + (void) close(ztest_fd_rand); + VERIFY3U(11, >=, + snprintf(fd_data_str, 12, "%d", ztest_fd_data)); + VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1)); + (void) enable_extended_FILE_stdio(-1, -1); if (libpath != NULL) VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1)); @@ -5763,6 +5786,11 @@ exec_child(char *cmd, char *libpath, boo fatal(B_TRUE, "exec failed: %s", cmd); } + if (cmdbuf != NULL) { + umem_free(cmdbuf, MAXPATHLEN); + cmd = NULL; + } + while (waitpid(pid, &status, 0) != pid) continue; if (statusp != NULL) @@ -5827,39 +5855,41 @@ main(int argc, char **argv) char timebuf[100]; char numbuf[6]; spa_t *spa; - char cmd[MAXNAMELEN]; + char *cmd; boolean_t hasalt; - - boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR)); - ASSERT(ischild || errno == EBADF); + char *fd_data_str = getenv("ZTEST_FD_DATA"); (void) setvbuf(stdout, NULL, _IOLBF, 0); dprintf_setup(&argc, argv); - if (!ischild) { + ztest_fd_rand = open("/dev/urandom", O_RDONLY); + ASSERT3S(ztest_fd_rand, >=, 0); + + if (!fd_data_str) { process_options(argc, argv); - setup_fds(); + setup_data_fd(); setup_hdr(); setup_data(); bcopy(&ztest_opts, ztest_shared_opts, sizeof (*ztest_shared_opts)); } else { + ztest_fd_data = atoi(fd_data_str); setup_data(); bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts)); } ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count); /* Override location of zpool.cache */ - (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", - ztest_opts.zo_dir); + VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache", + ztest_opts.zo_dir), !=, -1); ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t), UMEM_NOFAIL); zs = ztest_shared; - if (ischild) { + if (fd_data_str) { metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang; metaslab_df_alloc_threshold = zs->zs_metaslab_df_alloc_threshold; @@ -5882,7 +5912,8 @@ main(int argc, char **argv) (u_longlong_t)ztest_opts.zo_time); } - (void) strlcpy(cmd, getexecname(), sizeof (cmd)); + cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL); + (void) strlcpy(cmd, getexecname(), MAXNAMELEN); zs->zs_do_init = B_TRUE; if (strlen(ztest_opts.zo_alt_ztest) != 0) { @@ -6023,5 +6054,7 @@ main(int argc, char **argv) kills, iters - kills, (100.0 * kills) / MAX(1, iters)); } + umem_free(cmd, MAXNAMELEN); + return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:28:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A1F1D41; Thu, 8 Nov 2012 01:28:40 +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 252BD8FC15; Thu, 8 Nov 2012 01:28:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81Sexv048415; Thu, 8 Nov 2012 01:28:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81Seoh048412; Thu, 8 Nov 2012 01:28:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080128.qA81Seoh048412@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242730 - in vendor-sys/illumos/dist/uts/common: . fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:28:40 -0000 Author: mm Date: Thu Nov 8 01:28:39 2012 New Revision: 242730 URL: http://svnweb.freebsd.org/changeset/base/242730 Log: Update vendor-sys/illumos/dist to illumos-gate 13866:040f4b0699ee (no FreeBSD-relevant changes - illumos issue #3301) Modified: vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Thu Nov 8 01:24:06 2012 (r242729) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Thu Nov 8 01:28:39 2012 (r242730) @@ -21,7 +21,7 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. # @@ -1944,6 +1944,16 @@ NXGE_HCALL_OBJS = \ nxge_hcall.o # +# Virtio modules +# + +# Virtio core +VIRTIO_OBJS = virtio.o + +# Virtio block driver +VIOBLK_OBJS = vioblk.o + +# # kiconv modules # KICONV_EMEA_OBJS += kiconv_emea.o Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Thu Nov 8 01:24:06 2012 (r242729) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Thu Nov 8 01:28:39 2012 (r242730) @@ -168,7 +168,7 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi /* * When opening a disk device, we want to preserve the user's original * intent. We always want to open the device by the path the user gave - * us, even if it is one of multiple paths to the save device. But we + * us, even if it is one of multiple paths to the same device. But we * also want to be able to survive disks being removed/recabled. * Therefore the sequence of opening devices is: * From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:35:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C382EEF; Thu, 8 Nov 2012 01:35:02 +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 6211F8FC08; Thu, 8 Nov 2012 01:35:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81Z2aD049400; Thu, 8 Nov 2012 01:35:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81Z2tT049398; Thu, 8 Nov 2012 01:35:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211080135.qA81Z2tT049398@svn.freebsd.org> From: Kevin Lo Date: Thu, 8 Nov 2012 01:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242731 - head/sys/modules/nxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:35:02 -0000 Author: kevlo Date: Thu Nov 8 01:35:02 2012 New Revision: 242731 URL: http://svnweb.freebsd.org/changeset/base/242731 Log: Use .PATH instead of VPATH. Reviewed by: gnn,rwatson Modified: head/sys/modules/nxge/Makefile Modified: head/sys/modules/nxge/Makefile ============================================================================== --- head/sys/modules/nxge/Makefile Thu Nov 8 01:28:39 2012 (r242730) +++ head/sys/modules/nxge/Makefile Thu Nov 8 01:35:02 2012 (r242731) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../dev/nxge -VPATH = ${.CURDIR}/../../dev/nxge/xgehal +.PATH: ${.CURDIR}/../../dev/nxge/xgehal CFLAGS_NXGE = From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:36:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E5F0DE; Thu, 8 Nov 2012 01:36:07 +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 E29288FC0A; Thu, 8 Nov 2012 01:36:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81a6YY049618; Thu, 8 Nov 2012 01:36:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81a6lA049604; Thu, 8 Nov 2012 01:36:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080136.qA81a6lA049604@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242732 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zinject vendor/illumos/dist/lib/libzpool/common vendor/illumos/... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:36:07 -0000 Author: mm Date: Thu Nov 8 01:36:06 2012 New Revision: 242732 URL: http://svnweb.freebsd.org/changeset/base/242732 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13869:921a99998bb4 (illumos ZFS issue #3246 ZFS I/O deadman thread) Note: illumos disables deadman logic by default on vmware and sparc Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_boot.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio_inject.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zinject/translate.c vendor/illumos/dist/cmd/zinject/zinject.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Nov 8 01:36:06 2012 (r242732) @@ -5983,6 +5983,10 @@ spa_sync(spa_t *spa, uint64_t txg) tx = dmu_tx_create_assigned(dp, txg); + spa->spa_sync_starttime = gethrtime(); + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, + spa->spa_sync_starttime + spa->spa_deadman_synctime)); + /* * If we are upgrading to SPA_VERSION_RAIDZ_DEFLATE this txg, * set spa_deflate if we have no raid-z vdevs. @@ -6111,6 +6115,8 @@ spa_sync(spa_t *spa, uint64_t txg) } dmu_tx_commit(tx); + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, CY_INFINITY)); + /* * Clear the dirty config list. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Nov 8 01:36:06 2012 (r242732) @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -249,6 +250,26 @@ int zfs_flags = 0; */ int zfs_recover = 0; +extern int zfs_txg_synctime_ms; + +/* + * Expiration time in units of zfs_txg_synctime_ms. This value has two + * meanings. First it is used to determine when the spa_deadman logic + * should fire. By default the spa_deadman will fire if spa_sync has + * not completed in 1000 * zfs_txg_synctime_ms (i.e. 1000 seconds). + * Secondly, the value determines if an I/O is considered "hung". + * Any I/O that has not completed in zfs_deadman_synctime is considered + * "hung" resulting in a system panic. + * 1000 zfs_txg_synctime_ms (i.e. 1000 seconds). + */ +uint64_t zfs_deadman_synctime = 1000ULL; + +/* + * Override the zfs deadman behavior via /etc/system. By default the + * deadman is enabled except on VMware and sparc deployments. + */ +int zfs_deadman_enabled = -1; + /* * ========================================================================== @@ -418,6 +439,23 @@ spa_lookup(const char *name) } /* + * Fires when spa_sync has not completed within zfs_deadman_synctime_ms. + * If the zfs_deadman_enabled flag is set then it inspects all vdev queues + * looking for potentially hung I/Os. + */ +void +spa_deadman(void *arg) +{ + spa_t *spa = arg; + + zfs_dbgmsg("slow spa_sync: started %llu seconds ago, calls %llu", + (gethrtime() - spa->spa_sync_starttime) / NANOSEC, + ++spa->spa_deadman_calls); + if (zfs_deadman_enabled) + vdev_deadman(spa->spa_root_vdev); +} + +/* * Create an uninitialized spa_t with the given name. Requires * spa_namespace_lock. The caller must ensure that the spa_t doesn't already * exist by calling spa_lookup() first. @@ -427,6 +465,8 @@ spa_add(const char *name, nvlist_t *conf { spa_t *spa; spa_config_dirent_t *dp; + cyc_handler_t hdlr; + cyc_time_t when; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -458,6 +498,25 @@ spa_add(const char *name, nvlist_t *conf spa->spa_proc = &p0; spa->spa_proc_state = SPA_PROC_NONE; + hdlr.cyh_func = spa_deadman; + hdlr.cyh_arg = spa; + hdlr.cyh_level = CY_LOW_LEVEL; + + spa->spa_deadman_synctime = zfs_deadman_synctime * + zfs_txg_synctime_ms * MICROSEC; + + /* + * This determines how often we need to check for hung I/Os after + * the cyclic has already fired. Since checking for hung I/Os is + * an expensive operation we don't want to check too frequently. + * Instead wait for 5 synctimes before checking again. + */ + when.cyt_interval = 5ULL * zfs_txg_synctime_ms * MICROSEC; + when.cyt_when = CY_INFINITY; + mutex_enter(&cpu_lock); + spa->spa_deadman_cycid = cyclic_add(&hdlr, &when); + mutex_exit(&cpu_lock); + refcount_create(&spa->spa_refcount); spa_config_lock_init(spa); @@ -540,6 +599,12 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_load_info); spa_config_set(spa, NULL); + mutex_enter(&cpu_lock); + if (spa->spa_deadman_cycid != CYCLIC_NONE) + cyclic_remove(spa->spa_deadman_cycid); + mutex_exit(&cpu_lock); + spa->spa_deadman_cycid = CYCLIC_NONE; + refcount_destroy(&spa->spa_refcount); spa_config_lock_destroy(spa); @@ -1507,6 +1572,12 @@ spa_prev_software_version(spa_t *spa) } uint64_t +spa_deadman_synctime(spa_t *spa) +{ + return (spa->spa_deadman_synctime); +} + +uint64_t dva_get_dsize_sync(spa_t *spa, const dva_t *dva) { uint64_t asize = DVA_GET_ASIZE(dva); @@ -1600,7 +1671,9 @@ spa_init(int mode) spa_mode_global = mode; -#ifndef _KERNEL +#ifdef _KERNEL + spa_arch_init(); +#else if (spa_mode_global != FREAD && dprintf_find_string("watch")) { arc_procfd = open("/proc/self/ctl", O_WRONLY); if (arc_procfd == -1) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Thu Nov 8 01:36:06 2012 (r242732) @@ -604,6 +604,7 @@ extern boolean_t spa_suspended(spa_t *sp extern uint64_t spa_bootfs(spa_t *spa); extern uint64_t spa_delegation(spa_t *spa); extern objset_t *spa_meta_objset(spa_t *spa); +extern uint64_t spa_deadman_synctime(spa_t *spa); /* Miscellaneous support routines */ extern void spa_activate_mos_feature(spa_t *spa, const char *feature); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_boot.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_boot.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_boot.h Thu Nov 8 01:36:06 2012 (r242732) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPA_BOOT_H #define _SYS_SPA_BOOT_H @@ -35,6 +39,8 @@ extern "C" { extern char *spa_get_bootprop(char *prop); extern void spa_free_bootprop(char *prop); +extern void spa_arch_init(void); + #ifdef __cplusplus } #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Nov 8 01:36:06 2012 (r242732) @@ -227,6 +227,10 @@ struct spa { uint64_t spa_feat_for_write_obj; /* required to write to pool */ uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ + cyclic_id_t spa_deadman_cycid; /* cyclic id */ + uint64_t spa_deadman_calls; /* number of deadman calls */ + uint64_t spa_sync_starttime; /* starting time fo spa_sync */ + uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* * spa_refcnt & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Thu Nov 8 01:36:06 2012 (r242732) @@ -79,6 +79,7 @@ extern void vdev_metaslab_fini(vdev_t *v extern void vdev_metaslab_set_size(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); +extern void vdev_deadman(vdev_t *vd); extern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Thu Nov 8 01:36:06 2012 (r242732) @@ -104,6 +104,8 @@ struct vdev_queue { avl_tree_t vq_read_tree; avl_tree_t vq_write_tree; avl_tree_t vq_pending_tree; + uint64_t vq_io_complete_ts; + uint64_t vq_io_delta_ts; kmutex_t vq_lock; }; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h Thu Nov 8 01:36:06 2012 (r242732) @@ -22,8 +22,10 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -67,6 +69,7 @@ extern "C" { #include #include #include +#include #define CPU_SEQID (CPU->cpu_seqid) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h Thu Nov 8 01:36:06 2012 (r242732) @@ -240,12 +240,24 @@ typedef struct zinject_record { uint32_t zi_iotype; int32_t zi_duration; uint64_t zi_timer; + uint32_t zi_cmd; + uint32_t zi_pad; } zinject_record_t; #define ZINJECT_NULL 0x1 #define ZINJECT_FLUSH_ARC 0x2 #define ZINJECT_UNLOAD_SPA 0x4 +typedef enum zinject_type { + ZINJECT_UNINITIALIZED, + ZINJECT_DATA_FAULT, + ZINJECT_DEVICE_FAULT, + ZINJECT_LABEL_FAULT, + ZINJECT_IGNORED_WRITES, + ZINJECT_PANIC, + ZINJECT_DELAY_IO, +} zinject_type_t; + typedef struct zfs_share { uint64_t z_exportdata; uint64_t z_sharedata; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Thu Nov 8 01:36:06 2012 (r242732) @@ -21,8 +21,6 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - */ -/* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -403,6 +401,7 @@ struct zio { uint64_t io_offset; uint64_t io_deadline; + uint64_t io_timestamp; avl_node_t io_offset_node; avl_node_t io_deadline_node; avl_tree_t *io_vdev_tree; @@ -548,6 +547,7 @@ extern int zio_handle_fault_injection(zi extern int zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error); extern int zio_handle_label_injection(zio_t *zio, int error); extern void zio_handle_ignored_writes(zio_t *zio); +extern uint64_t zio_handle_io_delay(zio_t *zio); /* * Checksum ereport functions Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Thu Nov 8 01:36:06 2012 (r242732) @@ -3153,3 +3153,41 @@ vdev_split(vdev_t *vd) } vdev_propagate_state(cvd); } + +void +vdev_deadman(vdev_t *vd) +{ + for (int c = 0; c < vd->vdev_children; c++) { + vdev_t *cvd = vd->vdev_child[c]; + + vdev_deadman(cvd); + } + + if (vd->vdev_ops->vdev_op_leaf) { + vdev_queue_t *vq = &vd->vdev_queue; + + mutex_enter(&vq->vq_lock); + if (avl_numnodes(&vq->vq_pending_tree) > 0) { + spa_t *spa = vd->vdev_spa; + zio_t *fio; + uint64_t delta; + + /* + * Look at the head of all the pending queues, + * if any I/O has been outstanding for longer than + * the spa_deadman_synctime we panic the system. + */ + fio = avl_first(&vq->vq_pending_tree); + delta = ddi_get_lbolt64() - fio->io_timestamp; + if (delta > NSEC_TO_TICK(spa_deadman_synctime(spa))) { + zfs_dbgmsg("SLOW IO: zio timestamp %llu, " + "delta %llu, last io %llu", + fio->io_timestamp, delta, + vq->vq_io_complete_ts); + fm_panic("I/O to pool '%s' appears to be " + "hung.", spa_name(spa)); + } + } + mutex_exit(&vq->vq_lock); + } +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c Thu Nov 8 01:36:06 2012 (r242732) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -288,6 +292,7 @@ again: zio_buf_alloc(size), size, fio->io_type, ZIO_PRIORITY_AGG, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); + aio->io_timestamp = fio->io_timestamp; nio = fio; do { @@ -359,7 +364,8 @@ vdev_queue_io(zio_t *zio) mutex_enter(&vq->vq_lock); - zio->io_deadline = (ddi_get_lbolt64() >> zfs_vdev_time_shift) + + zio->io_timestamp = ddi_get_lbolt64(); + zio->io_deadline = (zio->io_timestamp >> zfs_vdev_time_shift) + zio->io_priority; vdev_queue_io_add(vq, zio); @@ -384,10 +390,16 @@ vdev_queue_io_done(zio_t *zio) { vdev_queue_t *vq = &zio->io_vd->vdev_queue; + if (zio_injection_enabled) + delay(SEC_TO_TICK(zio_handle_io_delay(zio))); + mutex_enter(&vq->vq_lock); avl_remove(&vq->vq_pending_tree, zio); + vq->vq_io_complete_ts = ddi_get_lbolt64(); + vq->vq_io_delta_ts = vq->vq_io_complete_ts - zio->io_timestamp; + for (int i = 0; i < zfs_vdev_ramp_rate; i++) { zio_t *nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending); if (nio == NULL) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio_inject.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio_inject.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio_inject.c Thu Nov 8 01:36:06 2012 (r242732) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -147,14 +148,8 @@ zio_handle_fault_injection(zio_t *zio, i for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - /* Ignore device errors and panic injection */ - if (handler->zi_record.zi_guid != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_DATA_FAULT) continue; /* If this handler matches, return EIO */ @@ -197,10 +192,7 @@ zio_handle_label_injection(zio_t *zio, i uint64_t start = handler->zi_record.zi_start; uint64_t end = handler->zi_record.zi_end; - /* Ignore device only faults or panic injection */ - if (handler->zi_record.zi_start == 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_LABEL_FAULT) continue; /* @@ -246,13 +238,7 @@ zio_handle_device_injection(vdev_t *vd, for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* - * Ignore label specific faults, panic injection - * or fake writes - */ - if (handler->zi_record.zi_start != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_DEVICE_FAULT) continue; if (vd->vdev_guid == handler->zi_record.zi_guid) { @@ -316,10 +302,8 @@ zio_handle_ignored_writes(zio_t *zio) handler = list_next(&inject_handlers, handler)) { /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; /* @@ -355,11 +339,8 @@ spa_handle_ignored_writes(spa_t *spa) for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; if (handler->zi_record.zi_duration > 0) { @@ -379,6 +360,34 @@ spa_handle_ignored_writes(spa_t *spa) rw_exit(&inject_lock); } +uint64_t +zio_handle_io_delay(zio_t *zio) +{ + vdev_t *vd = zio->io_vd; + inject_handler_t *handler; + uint64_t seconds = 0; + + if (zio_injection_enabled == 0) + return (0); + + rw_enter(&inject_lock, RW_READER); + + for (handler = list_head(&inject_handlers); handler != NULL; + handler = list_next(&inject_handlers, handler)) { + + if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO) + continue; + + if (vd->vdev_guid == handler->zi_record.zi_guid) { + seconds = handler->zi_record.zi_timer; + break; + } + + } + rw_exit(&inject_lock); + return (seconds); +} + /* * Create a new handler for the given record. We add it to the list, adding * a reference to the spa_t in the process. We increment zio_injection_enabled, From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:36:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 304D6DF; Thu, 8 Nov 2012 01:36:07 +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 11D908FC0C; Thu, 8 Nov 2012 01:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81a6Uk049627; Thu, 8 Nov 2012 01:36:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81a6Bs049623; Thu, 8 Nov 2012 01:36:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080136.qA81a6Bs049623@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242732 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zinject vendor/illumos/dist/lib/libzpool/common vendor/illumos/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:36:07 -0000 Author: mm Date: Thu Nov 8 01:36:06 2012 New Revision: 242732 URL: http://svnweb.freebsd.org/changeset/base/242732 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13869:921a99998bb4 (illumos ZFS issue #3246 ZFS I/O deadman thread) Note: illumos disables deadman logic by default on vmware and sparc Modified: vendor/illumos/dist/cmd/zinject/translate.c vendor/illumos/dist/cmd/zinject/zinject.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_boot.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio_inject.c Modified: vendor/illumos/dist/cmd/zinject/translate.c ============================================================================== --- vendor/illumos/dist/cmd/zinject/translate.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor/illumos/dist/cmd/zinject/translate.c Thu Nov 8 01:36:06 2012 (r242732) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -472,6 +473,20 @@ translate_device(const char *pool, const &record->zi_guid) == 0); } + /* + * Device faults can take on three different forms: + * 1). delayed or hanging I/O + * 2). zfs label faults + * 3). generic disk faults + */ + if (record->zi_timer != 0) { + record->zi_cmd = ZINJECT_DELAY_IO; + } else if (label_type != TYPE_INVAL) { + record->zi_cmd = ZINJECT_LABEL_FAULT; + } else { + record->zi_cmd = ZINJECT_DEVICE_FAULT; + } + switch (label_type) { case TYPE_LABEL_UBERBLOCK: record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]); Modified: vendor/illumos/dist/cmd/zinject/zinject.c ============================================================================== --- vendor/illumos/dist/cmd/zinject/zinject.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor/illumos/dist/cmd/zinject/zinject.c Thu Nov 8 01:36:06 2012 (r242732) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -600,7 +601,7 @@ main(int argc, char **argv) } while ((c = getopt(argc, argv, - ":aA:b:d:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { + ":aA:b:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { switch (c) { case 'a': flags |= ZINJECT_FLUSH_ARC; @@ -626,6 +627,15 @@ main(int argc, char **argv) case 'd': device = optarg; break; + case 'D': + record.zi_timer = strtoull(optarg, &end, 10); + if (errno != 0 || *end != '\0') { + (void) fprintf(stderr, "invalid i/o delay " + "value: '%s'\n", optarg); + usage(); + return (1); + } + break; case 'e': if (strcasecmp(optarg, "io") == 0) { error = EIO; @@ -690,6 +700,7 @@ main(int argc, char **argv) case 'p': (void) strlcpy(record.zi_func, optarg, sizeof (record.zi_func)); + record.zi_cmd = ZINJECT_PANIC; break; case 'q': quiet = 1; @@ -763,13 +774,15 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (record.zi_duration != 0) + record.zi_cmd = ZINJECT_IGNORED_WRITES; + if (cancel != NULL) { /* * '-c' is invalid with any other options. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "cancel (-c) incompatible with " "any other options\n"); usage(); @@ -801,8 +814,7 @@ main(int argc, char **argv) * for doing injection, so handle it separately here. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "device (-d) incompatible with " "data error injection\n"); usage(); @@ -836,7 +848,7 @@ main(int argc, char **argv) } else if (raw != NULL) { if (range != NULL || type != TYPE_INVAL || level != 0 || - record.zi_func[0] != '\0' || record.zi_duration != 0) { + record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "raw (-b) format with " "any other options\n"); usage(); @@ -859,13 +871,14 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_raw(raw, &record) != 0) return (1); if (!error) error = EIO; - } else if (record.zi_func[0] != '\0') { + } else if (record.zi_cmd == ZINJECT_PANIC) { if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || device != NULL || record.zi_duration != 0) { + level != 0 || device != NULL) { (void) fprintf(stderr, "panic (-p) incompatible with " "other options\n"); usage(); @@ -883,7 +896,7 @@ main(int argc, char **argv) if (argv[1] != NULL) record.zi_type = atoi(argv[1]); dataset[0] = '\0'; - } else if (record.zi_duration != 0) { + } else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) { if (nowrites == 0) { (void) fprintf(stderr, "-s or -g meaningless " "without -I (ignore writes)\n"); @@ -937,6 +950,7 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_record(type, argv[0], range, level, &record, pool, dataset) != 0) return (1); Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Thu Nov 8 01:35:02 2012 (r242731) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Thu Nov 8 01:36:06 2012 (r242732) @@ -46,6 +46,7 @@ int aok; uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[HW_HOSTID_LEN]; +kmutex_t cpu_lock; vmem_t *zio_arena = NULL; struct utsname utsname = { @@ -790,6 +791,26 @@ ddi_strtoull(const char *str, char **npt return (0); } +/* ARGSUSED */ +cyclic_id_t +cyclic_add(cyc_handler_t *hdlr, cyc_time_t *when) +{ + return (1); +} + +/* ARGSUSED */ +void +cyclic_remove(cyclic_id_t id) +{ +} + +/* ARGSUSED */ +int +cyclic_reprogram(cyclic_id_t id, hrtime_t expiration) +{ + return (1); +} + /* * ========================================================================= * kernel emulation setup & teardown @@ -823,6 +844,8 @@ kernel_init(int mode) system_taskq_init(); + mutex_init(&cpu_lock, NULL, MUTEX_DEFAULT, NULL); + spa_init(mode); } Modified: vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Thu Nov 8 01:35:02 2012 (r242731) +++ vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Thu Nov 8 01:36:06 2012 (r242732) @@ -453,6 +453,9 @@ extern vnode_t *rootdir; extern void delay(clock_t ticks); +#define SEC_TO_TICK(sec) ((sec) * hz) +#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) + #define gethrestime_sec() time(NULL) #define gethrestime(t) \ do {\ @@ -572,6 +575,34 @@ void ksiddomain_rele(ksiddomain_t *); #define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g) \ sysevent_post_event(_c, _d, _b, "libzpool", _e, _f) +/* + * Cyclic information + */ +extern kmutex_t cpu_lock; + +typedef uintptr_t cyclic_id_t; +typedef uint16_t cyc_level_t; +typedef void (*cyc_func_t)(void *); + +#define CY_LOW_LEVEL 0 +#define CY_INFINITY INT64_MAX +#define CYCLIC_NONE ((cyclic_id_t)0) + +typedef struct cyc_time { + hrtime_t cyt_when; + hrtime_t cyt_interval; +} cyc_time_t; + +typedef struct cyc_handler { + cyc_func_t cyh_func; + void *cyh_arg; + cyc_level_t cyh_level; +} cyc_handler_t; + +extern cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *); +extern void cyclic_remove(cyclic_id_t); +extern int cyclic_reprogram(cyclic_id_t, hrtime_t); + #ifdef __cplusplus } #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:38:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 142793C2; Thu, 8 Nov 2012 01:38:31 +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 E9F2C8FC08; Thu, 8 Nov 2012 01:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81cU55050013; Thu, 8 Nov 2012 01:38:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81cU2Q050008; Thu, 8 Nov 2012 01:38:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080138.qA81cU2Q050008@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242733 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/libzp... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:38:31 -0000 Author: mm Date: Thu Nov 8 01:38:30 2012 New Revision: 242733 URL: http://svnweb.freebsd.org/changeset/base/242733 Log: Update vendor/illumos/dist and vendor/illumos-sys/dist to illumos-gate 13871:a9c12c2c1647 (zfs changes, illumos issues #3306, #3321) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h vendor/illumos/dist/man/man1m/zdb.1m vendor/illumos/dist/man/man1m/zpool.1m Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Thu Nov 8 01:36:06 2012 (r242732) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Thu Nov 8 01:38:30 2012 (r242733) @@ -322,6 +322,14 @@ extern void vdev_set_min_asize(vdev_t *v */ extern int zfs_vdev_cache_size; +/* + * The vdev_buf_t is used to translate between zio_t and buf_t, and back again. + */ +typedef struct vdev_buf { + buf_t vb_buf; /* buffer that describes the io */ + zio_t *vb_io; /* pointer back to the original zio_t */ +} vdev_buf_t; + #ifdef __cplusplus } #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Thu Nov 8 01:38:30 2012 (r242733) @@ -40,11 +40,6 @@ extern ldi_ident_t zfs_li; -typedef struct vdev_disk_buf { - buf_t vdb_buf; - zio_t *vdb_io; -} vdev_disk_buf_t; - static void vdev_disk_hold(vdev_t *vd) { @@ -397,8 +392,8 @@ vdev_disk_physio(ldi_handle_t vd_lh, cad static void vdev_disk_io_intr(buf_t *bp) { - vdev_disk_buf_t *vdb = (vdev_disk_buf_t *)bp; - zio_t *zio = vdb->vdb_io; + vdev_buf_t *vb = (vdev_buf_t *)bp; + zio_t *zio = vb->vb_io; /* * The rest of the zio stack only deals with EIO, ECKSUM, and ENXIO. @@ -410,7 +405,7 @@ vdev_disk_io_intr(buf_t *bp) if (zio->io_error == 0 && bp->b_resid != 0) zio->io_error = EIO; - kmem_free(vdb, sizeof (vdev_disk_buf_t)); + kmem_free(vb, sizeof (vdev_buf_t)); zio_interrupt(zio); } @@ -441,7 +436,7 @@ vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; vdev_disk_t *dvd = vd->vdev_tsd; - vdev_disk_buf_t *vdb; + vdev_buf_t *vb; struct dk_callback *dkc; buf_t *bp; int error; @@ -505,10 +500,10 @@ vdev_disk_io_start(zio_t *zio) return (ZIO_PIPELINE_CONTINUE); } - vdb = kmem_alloc(sizeof (vdev_disk_buf_t), KM_SLEEP); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); - vdb->vdb_io = zio; - bp = &vdb->vdb_buf; + vb->vb_io = zio; + bp = &vb->vb_buf; bioinit(bp); bp->b_flags = B_BUSY | B_NOCACHE | Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c Thu Nov 8 01:38:30 2012 (r242733) @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -140,12 +141,55 @@ vdev_file_close(vdev_t *vd) vd->vdev_tsd = NULL; } +/* + * Implements the interrupt side for file vdev types. This routine will be + * called when the I/O completes allowing us to transfer the I/O to the + * interrupt taskqs. For consistency, the code structure mimics disk vdev + * types. + */ +static void +vdev_file_io_intr(buf_t *bp) +{ + vdev_buf_t *vb = (vdev_buf_t *)bp; + zio_t *zio = vb->vb_io; + + zio->io_error = (geterror(bp) != 0 ? EIO : 0); + if (zio->io_error == 0 && bp->b_resid != 0) + zio->io_error = ENOSPC; + + kmem_free(vb, sizeof (vdev_buf_t)); + zio_interrupt(zio); +} + +static void +vdev_file_io_strategy(void *arg) +{ + buf_t *bp = arg; + vnode_t *vp = bp->b_private; + ssize_t resid; + int error; + + error = vn_rdwr((bp->b_flags & B_READ) ? UIO_READ : UIO_WRITE, + vp, bp->b_un.b_addr, bp->b_bcount, ldbtob(bp->b_lblkno), + UIO_SYSSPACE, 0, RLIM64_INFINITY, kcred, &resid); + + if (error == 0) { + bp->b_resid = resid; + biodone(bp); + } else { + bioerror(bp, error); + biodone(bp); + } +} + static int vdev_file_io_start(zio_t *zio) { + spa_t *spa = zio->io_spa; vdev_t *vd = zio->io_vd; vdev_file_t *vf = vd->vdev_tsd; - ssize_t resid; + vdev_buf_t *vb; + buf_t *bp; if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */ @@ -166,15 +210,22 @@ vdev_file_io_start(zio_t *zio) return (ZIO_PIPELINE_CONTINUE); } - zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? - UIO_READ : UIO_WRITE, vf->vf_vnode, zio->io_data, - zio->io_size, zio->io_offset, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, &resid); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); - if (resid != 0 && zio->io_error == 0) - zio->io_error = ENOSPC; + vb->vb_io = zio; + bp = &vb->vb_buf; - zio_interrupt(zio); + bioinit(bp); + bp->b_flags = (zio->io_type == ZIO_TYPE_READ ? B_READ : B_WRITE); + bp->b_bcount = zio->io_size; + bp->b_un.b_addr = zio->io_data; + bp->b_lblkno = lbtodb(zio->io_offset); + bp->b_bufsize = zio->io_size; + bp->b_private = vf->vf_vnode; + bp->b_iodone = (int (*)())vdev_file_io_intr; + + taskq_dispatch_ent(spa->spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE], + vdev_file_io_strategy, bp, 0, &zio->io_tqent); return (ZIO_PIPELINE_STOP); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Nov 8 01:38:30 2012 (r242733) @@ -2917,7 +2917,7 @@ zio_done(zio_t *zio) * Hand it off to the otherwise-unused claim taskq. */ ASSERT(zio->io_tqent.tqent_next == NULL); - (void) taskq_dispatch_ent( + taskq_dispatch_ent( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], (task_func_t *)zio_reexecute, zio, 0, &zio->io_tqent); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:38:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E2473C3; Thu, 8 Nov 2012 01:38:31 +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 1F7E78FC0A; Thu, 8 Nov 2012 01:38:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81cUGF050024; Thu, 8 Nov 2012 01:38:31 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81cU8s050017; Thu, 8 Nov 2012 01:38:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080138.qA81cU8s050017@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242733 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/libzp... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:38:31 -0000 Author: mm Date: Thu Nov 8 01:38:30 2012 New Revision: 242733 URL: http://svnweb.freebsd.org/changeset/base/242733 Log: Update vendor/illumos/dist and vendor/illumos-sys/dist to illumos-gate 13871:a9c12c2c1647 (zfs changes, illumos issues #3306, #3321) Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h vendor/illumos/dist/man/man1m/zdb.1m vendor/illumos/dist/man/man1m/zpool.1m Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/cmd/zdb/zdb.c Thu Nov 8 01:38:30 2012 (r242733) @@ -86,6 +86,7 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; +uint64_t max_inflight = 200; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -108,13 +109,14 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "poolname [object...]\n" - " %s [-divPA] [-e -p path...] dataset [object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-M inflight I/Os] poolname [object...]\n" + " %s [-divPA] [-e -p path...] [-U config] dataset " + "[object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " "poolname [vdev [metaslab...]]\n" " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" - " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" " %s -l [-uA] device\n" " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -161,6 +163,8 @@ usage(void) (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); + (void) fprintf(stderr, " -M -- " + "specify the maximum number of checksumming I/Os [default is 200]"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -2028,6 +2032,45 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0); } +static void +zdb_blkptr_done(zio_t *zio) +{ + spa_t *spa = zio->io_spa; + blkptr_t *bp = zio->io_bp; + int ioerr = zio->io_error; + zdb_cb_t *zcb = zio->io_private; + zbookmark_t *zb = &zio->io_bookmark; + + zio_data_buf_free(zio->io_data, zio->io_size); + + mutex_enter(&spa->spa_scrub_lock); + spa->spa_scrub_inflight--; + cv_broadcast(&spa->spa_scrub_io_cv); + + if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { + char blkbuf[BP_SPRINTF_LEN]; + + zcb->zcb_haderrors = 1; + zcb->zcb_errors[ioerr]++; + + if (dump_opt['b'] >= 2) + sprintf_blkptr(blkbuf, bp); + else + blkbuf[0] = '\0'; + + (void) printf("zdb_blkptr_cb: " + "Got error %d reading " + "<%llu, %llu, %lld, %llx> %s -- skipping\n", + ioerr, + (u_longlong_t)zb->zb_objset, + (u_longlong_t)zb->zb_object, + (u_longlong_t)zb->zb_level, + (u_longlong_t)zb->zb_blkid, + blkbuf); + } + mutex_exit(&spa->spa_scrub_lock); +} + /* ARGSUSED */ static int zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, @@ -2049,39 +2092,23 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { - int ioerr; size_t size = BP_GET_PSIZE(bp); - void *data = malloc(size); + void *data = zio_data_buf_alloc(size); int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; /* If it's an intent log block, failure is expected. */ if (zb->zb_level == ZB_ZIL_LEVEL) flags |= ZIO_FLAG_SPECULATIVE; - ioerr = zio_wait(zio_read(NULL, spa, bp, data, size, - NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb)); + mutex_enter(&spa->spa_scrub_lock); + while (spa->spa_scrub_inflight > max_inflight) + cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); + spa->spa_scrub_inflight++; + mutex_exit(&spa->spa_scrub_lock); - free(data); + zio_nowait(zio_read(NULL, spa, bp, data, size, + zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb)); - if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) { - zcb->zcb_haderrors = 1; - zcb->zcb_errors[ioerr]++; - - if (dump_opt['b'] >= 2) - sprintf_blkptr(blkbuf, bp); - else - blkbuf[0] = '\0'; - - (void) printf("zdb_blkptr_cb: " - "Got error %d reading " - "<%llu, %llu, %lld, %llx> %s -- skipping\n", - ioerr, - (u_longlong_t)zb->zb_objset, - (u_longlong_t)zb->zb_object, - (u_longlong_t)zb->zb_level, - (u_longlong_t)zb->zb_blkid, - blkbuf); - } } zcb->zcb_readfails = 0; @@ -2283,6 +2310,18 @@ dump_block_stats(spa_t *spa) zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); + /* + * If we've traversed the data blocks then we need to wait for those + * I/Os to complete. We leverage "The Godfather" zio to wait on + * all async I/Os to complete. + */ + if (dump_opt['c']) { + (void) zio_wait(spa->spa_async_zio_root); + spa->spa_async_zio_root = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } + if (zcb.zcb_haderrors) { (void) printf("\nError counts:\n\n"); (void) printf("\t%5s %s\n", "errno", "count"); @@ -3040,7 +3079,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); - while ((c = getopt(argc, argv, "bcdhilmsuCDRSAFLXevp:t:U:P")) != -1) { + while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3069,6 +3108,15 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'M': + max_inflight = strtoull(optarg, NULL, 0); + if (max_inflight == 0) { + (void) fprintf(stderr, "maximum number " + "of inflight I/Os must be greater " + "than 0\n"); + usage(); + } + break; case 'p': if (searchdirs == NULL) { searchdirs = umem_alloc(sizeof (char *), Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Thu Nov 8 01:38:30 2012 (r242733) @@ -238,7 +238,7 @@ get_usage(zpool_help_t idx) { case HELP_REMOVE: return (gettext("\tremove ...\n")); case HELP_REOPEN: - return (""); /* Undocumented command */ + return (gettext("\treopen \n")); case HELP_SCRUB: return (gettext("\tscrub [-s] ...\n")); case HELP_STATUS: @@ -3550,22 +3550,37 @@ zpool_do_reguid(int argc, char **argv) * zpool reopen * * Reopen the pool so that the kernel can update the sizes of all vdevs. - * - * NOTE: This command is currently undocumented. If the command is ever - * exposed then the appropriate usage() messages will need to be made. */ int zpool_do_reopen(int argc, char **argv) { + int c; int ret = 0; zpool_handle_t *zhp; char *pool; + /* check options */ + while ((c = getopt(argc, argv, "")) != -1) { + switch (c) { + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + argc--; argv++; - if (argc != 1) - return (2); + if (argc < 1) { + (void) fprintf(stderr, gettext("missing pool name\n")); + usage(B_FALSE); + } + + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } pool = argv[0]; if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Thu Nov 8 01:38:30 2012 (r242733) @@ -1012,3 +1012,48 @@ zfs_onexit_cb_data(minor_t minor, uint64 { return (0); } + +void +bioinit(buf_t *bp) +{ + bzero(bp, sizeof (buf_t)); +} + +void +biodone(buf_t *bp) +{ + if (bp->b_iodone != NULL) { + (*(bp->b_iodone))(bp); + return; + } + ASSERT((bp->b_flags & B_DONE) == 0); + bp->b_flags |= B_DONE; +} + +void +bioerror(buf_t *bp, int error) +{ + ASSERT(bp != NULL); + ASSERT(error >= 0); + + if (error != 0) { + bp->b_flags |= B_ERROR; + } else { + bp->b_flags &= ~B_ERROR; + } + bp->b_error = error; +} + + +int +geterror(struct buf *bp) +{ + int error = 0; + + if (bp->b_flags & B_ERROR) { + error = bp->b_error; + if (!error) + error = EIO; + } + return (error); +} Modified: vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Thu Nov 8 01:38:30 2012 (r242733) @@ -603,6 +603,36 @@ extern cyclic_id_t cyclic_add(cyc_handle extern void cyclic_remove(cyclic_id_t); extern int cyclic_reprogram(cyclic_id_t, hrtime_t); +/* + * Buf structure + */ +#define B_BUSY 0x0001 +#define B_DONE 0x0002 +#define B_ERROR 0x0004 +#define B_READ 0x0040 /* read when I/O occurs */ +#define B_WRITE 0x0100 /* non-read pseudo-flag */ + +typedef struct buf { + int b_flags; + size_t b_bcount; + union { + caddr_t b_addr; + } b_un; + + lldaddr_t _b_blkno; +#define b_lblkno _b_blkno._f + size_t b_resid; + size_t b_bufsize; + int (*b_iodone)(struct buf *); + int b_error; + void *b_private; +} buf_t; + +extern void bioinit(buf_t *); +extern void biodone(buf_t *); +extern void bioerror(buf_t *, int); +extern int geterror(buf_t *); + #ifdef __cplusplus } #endif Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/man/man1m/zdb.1m Thu Nov 8 01:38:30 2012 (r242733) @@ -11,6 +11,7 @@ .\" .\" .\" Copyright 2012, Richard Lowe. +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" .TH "ZDB" "1M" "February 15, 2012" "" "" @@ -19,21 +20,23 @@ .SH "SYNOPSIS" \fBzdb\fR [-CumdibcsDvhLXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] - \fIpoolname\fR [\fIobject\fR ...] + [-U \fIcache\fR] [-M \fIinflight I/Os\fR] [\fIpoolname\fR + [\fIobject\fR ...]] .P -\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] \fIdataset\fR [\fIobject\fR ...] +\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] + \fIdataset\fR [\fIobject\fR ...] .P -\fBzdb\fR -m [-LXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] \fIpoolname\fR - [\fIvdev\fR [\fImetaslab\fR ...]] +\fBzdb\fR -m [-LXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] + \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]] .P -\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] \fIpoolname\fR +\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR] .P -\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] \fIpoolname\fR +\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR .P \fBzdb\fR -l [-uA] \fIdevice\fR @@ -357,6 +360,18 @@ transactions. .sp .ne 2 .na +\fB-M \fIinflight I/Os\fR \fR +.ad +.sp .6 +.RS 4n +Limit the number of outstanding checksum I/Os to the specified value. The +default value is 200. This option affects the performance of the \fB-c\fR +option. +.RE + +.sp +.ne 2 +.na \fB-P\fR .ad .sp .6 @@ -384,8 +399,7 @@ and their associated transaction numbers .ad .sp .6 .RS 4n -Use a cache file other than \fB/etc/zfs/zpool.cache\fR. This option is only -valid with \fB-C\fR +Use a cache file other than \fB/etc/zfs/zpool.cache\fR. .RE .sp Modified: vendor/illumos/dist/man/man1m/zpool.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zpool.1m Thu Nov 8 01:36:06 2012 (r242732) +++ vendor/illumos/dist/man/man1m/zpool.1m Thu Nov 8 01:38:30 2012 (r242733) @@ -113,6 +113,11 @@ zpool \- configures ZFS storage pools .LP .nf +\fBzpool reopen\fR \fIpool\fR +.fi + +.LP +.nf \fBzpool remove\fR \fIpool\fR \fIdevice\fR ... .fi @@ -1550,8 +1555,18 @@ become available to the pool. .ad .sp .6 .RS 4n -Generates a new unique identifier for the pool. You must ensure that all devices in this pool are online and -healthy before performing this action. +Generates a new unique identifier for the pool. You must ensure that all +devices in this pool are online and healthy before performing this action. +.RE + +.sp +.ne 2 +.na +\fB\fBzpool reopen\fR \fIpool\fR +.ad +.sp .6 +.RS 4n +Reopen all the vdevs associated with the pool. .RE .sp From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:41:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 269F66C8; Thu, 8 Nov 2012 01:41:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0778A8FC0A; Thu, 8 Nov 2012 01:41:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81f45x050502; Thu, 8 Nov 2012 01:41:04 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81f4ZU050500; Thu, 8 Nov 2012 01:41:04 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201211080141.qA81f4ZU050500@svn.freebsd.org> From: Jeff Roberson Date: Thu, 8 Nov 2012 01:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242734 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:41:05 -0000 Author: jeff Date: Thu Nov 8 01:41:04 2012 New Revision: 242734 URL: http://svnweb.freebsd.org/changeset/base/242734 Log: - Implement BIO_FLUSH support around journal entries. This will not 100% solve power loss problems with dishonest write caches. However, it should improve the situation and force a full fsck when it is unable to resolve with the journal. - Resolve a case where the journal could wrap in an unsafe way causing us to prematurely lose journal entries in very specific scenarios. Discussed with: mckusick MFC after: 1 month Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 8 01:38:30 2012 (r242733) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 8 01:41:04 2012 (r242734) @@ -88,6 +88,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #ifndef SOFTUPDATES @@ -802,6 +804,7 @@ static void handle_written_jnewblk(struc static void handle_written_jblkdep(struct jblkdep *); static void handle_written_jfreefrag(struct jfreefrag *); static void complete_jseg(struct jseg *); +static void complete_jsegs(struct jseg *); static void jseg_write(struct ufsmount *ump, struct jseg *, uint8_t *); static void jaddref_write(struct jaddref *, struct jseg *, uint8_t *); static void jremref_write(struct jremref *, struct jseg *, uint8_t *); @@ -1227,6 +1230,7 @@ static struct callout softdep_callout; static int req_pending; static int req_clear_inodedeps; /* syncer process flush some inodedeps */ static int req_clear_remove; /* syncer process flush some freeblks */ +static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ /* * runtime statistics @@ -1310,6 +1314,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, cle &stat_cleanup_retries, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, cleanup_failures, CTLFLAG_RW, &stat_cleanup_failures, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, flushcache, CTLFLAG_RW, + &softdep_flushcache, 0, ""); SYSCTL_DECL(_vfs_ffs); @@ -3078,6 +3084,67 @@ softdep_flushjournal(mp) FREE_LOCK(&lk); } +static void softdep_synchronize_completed(struct bio *); +static void softdep_synchronize(struct bio *, struct ufsmount *, void *); + +static void +softdep_synchronize_completed(bp) + struct bio *bp; +{ + struct jseg *oldest; + struct jseg *jseg; + + /* + * caller1 marks the last segment written before we issued the + * synchronize cache. + */ + jseg = bp->bio_caller1; + oldest = NULL; + ACQUIRE_LOCK(&lk); + /* + * Mark all the journal entries waiting on the synchronize cache + * as completed so they may continue on. + */ + while (jseg != NULL && (jseg->js_state & COMPLETE) == 0) { + jseg->js_state |= COMPLETE; + oldest = jseg; + jseg = TAILQ_PREV(jseg, jseglst, js_next); + } + /* + * Restart deferred journal entry processing from the oldest + * completed jseg. + */ + if (oldest) + complete_jsegs(oldest); + + FREE_LOCK(&lk); + g_destroy_bio(bp); +} + +/* + * Send BIO_FLUSH/SYNCHRONIZE CACHE to the device to enforce write ordering + * barriers. The journal must be written prior to any blocks that depend + * on it and the journal can not be released until the blocks have be + * written. This code handles both barriers simultaneously. + */ +static void +softdep_synchronize(bp, ump, caller1) + struct bio *bp; + struct ufsmount *ump; + void *caller1; +{ + + bp->bio_cmd = BIO_FLUSH; + bp->bio_flags |= BIO_ORDERED; + bp->bio_data = NULL; + bp->bio_offset = ump->um_cp->provider->mediasize; + bp->bio_length = 0; + bp->bio_done = softdep_synchronize_completed; + bp->bio_caller1 = caller1; + g_io_request(bp, + (struct g_consumer *)ump->um_devvp->v_bufobj.bo_private); +} + /* * Flush some journal records to disk. */ @@ -3092,8 +3159,10 @@ softdep_process_journal(mp, needwk, flag struct worklist *wk; struct jseg *jseg; struct buf *bp; + struct bio *bio; uint8_t *data; struct fs *fs; + int shouldflush; int segwritten; int jrecmin; /* Minimum records per block. */ int jrecmax; /* Maximum records per block. */ @@ -3104,6 +3173,9 @@ softdep_process_journal(mp, needwk, flag if (MOUNTEDSUJ(mp) == 0) return; + shouldflush = softdep_flushcache; + bio = NULL; + jseg = NULL; ump = VFSTOUFS(mp); fs = ump->um_fs; jblocks = ump->softdep_jblocks; @@ -3152,6 +3224,10 @@ softdep_process_journal(mp, needwk, flag LIST_INIT(&jseg->js_entries); LIST_INIT(&jseg->js_indirs); jseg->js_state = ATTACHED; + if (shouldflush == 0) + jseg->js_state |= COMPLETE; + else if (bio == NULL) + bio = g_alloc_bio(); jseg->js_jblocks = jblocks; bp = geteblk(fs->fs_bsize, 0); ACQUIRE_LOCK(&lk); @@ -3284,6 +3360,17 @@ softdep_process_journal(mp, needwk, flag ACQUIRE_LOCK(&lk); } /* + * If we wrote a segment issue a synchronize cache so the journal + * is reflected on disk before the data is written. Since reclaiming + * journal space also requires writing a journal record this + * process also enforces a barrier before reclamation. + */ + if (segwritten && shouldflush) { + softdep_synchronize(bio, ump, + TAILQ_LAST(&jblocks->jb_segs, jseglst)); + } else if (bio) + g_destroy_bio(bio); + /* * If we've suspended the filesystem because we ran out of journal * space either try to sync it here to make some progress or * unsuspend it if we already have. @@ -3366,25 +3453,17 @@ complete_jseg(jseg) } /* - * Mark a jseg as DEPCOMPLETE and throw away the buffer. Handle jseg - * completions in order only. + * Determine which jsegs are ready for completion processing. Waits for + * synchronize cache to complete as well as forcing in-order completion + * of journal entries. */ static void -handle_written_jseg(jseg, bp) +complete_jsegs(jseg) struct jseg *jseg; - struct buf *bp; { struct jblocks *jblocks; struct jseg *jsegn; - if (jseg->js_refs == 0) - panic("handle_written_jseg: No self-reference on %p", jseg); - jseg->js_state |= DEPCOMPLETE; - /* - * We'll never need this buffer again, set flags so it will be - * discarded. - */ - bp->b_flags |= B_INVAL | B_NOCACHE; jblocks = jseg->js_jblocks; /* * Don't allow out of order completions. If this isn't the first @@ -3393,12 +3472,12 @@ handle_written_jseg(jseg, bp) if (jseg != jblocks->jb_writeseg) return; /* Iterate through available jsegs processing their entries. */ - do { + while (jseg && (jseg->js_state & ALLCOMPLETE) == ALLCOMPLETE) { jblocks->jb_oldestwrseq = jseg->js_oldseq; jsegn = TAILQ_NEXT(jseg, js_next); complete_jseg(jseg); jseg = jsegn; - } while (jseg && jseg->js_state & DEPCOMPLETE); + } jblocks->jb_writeseg = jseg; /* * Attempt to free jsegs now that oldestwrseq may have advanced. @@ -3406,6 +3485,27 @@ handle_written_jseg(jseg, bp) free_jsegs(jblocks); } +/* + * Mark a jseg as DEPCOMPLETE and throw away the buffer. Attempt to handle + * the final completions. + */ +static void +handle_written_jseg(jseg, bp) + struct jseg *jseg; + struct buf *bp; +{ + + if (jseg->js_refs == 0) + panic("handle_written_jseg: No self-reference on %p", jseg); + jseg->js_state |= DEPCOMPLETE; + /* + * We'll never need this buffer again, set flags so it will be + * discarded. + */ + bp->b_flags |= B_INVAL | B_NOCACHE; + complete_jsegs(jseg); +} + static inline struct jsegdep * inoref_jseg(inoref) struct inoref *inoref; @@ -4191,8 +4291,13 @@ free_jsegs(jblocks) jblocks->jb_oldestseg = jseg; return; } - if (!LIST_EMPTY(&jseg->js_indirs) && - jseg->js_seq >= jblocks->jb_oldestwrseq) + if (jseg->js_seq > jblocks->jb_oldestwrseq) + break; + /* + * We can free jsegs that didn't write entries when + * oldestwrseq == js_seq. + */ + if (jseg->js_cnt != 0) break; free_jseg(jseg, jblocks); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:42:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41271853; Thu, 8 Nov 2012 01:42:55 +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 256818FC08; Thu, 8 Nov 2012 01:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81gt0s050832; Thu, 8 Nov 2012 01:42:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81gsIj050822; Thu, 8 Nov 2012 01:42:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211080142.qA81gsIj050822@svn.freebsd.org> From: Martin Matuska Date: Thu, 8 Nov 2012 01:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r242735 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:42:55 -0000 Author: mm Date: Thu Nov 8 01:42:54 2012 New Revision: 242735 URL: http://svnweb.freebsd.org/changeset/base/242735 Log: Update vendor-sys/illumos/dist to illumos-gate 13879:4eac7a87eff2 (illumos ZFS issues #3329, #3330, #3331, #3335) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Thu Nov 8 01:42:54 2012 (r242735) @@ -875,8 +875,9 @@ metaslab_activate(metaslab_t *msp, uint6 if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { space_map_load_wait(sm); if (!sm->sm_loaded) { - int error = space_map_load(sm, sm_ops, SM_FREE, - &msp->ms_smo, + space_map_obj_t *smo = &msp->ms_smo; + + int error = space_map_load(sm, sm_ops, SM_FREE, smo, spa_meta_objset(msp->ms_group->mg_vd->vdev_spa)); if (error) { metaslab_group_sort(msp->ms_group, msp, 0); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Thu Nov 8 01:42:54 2012 (r242735) @@ -130,6 +130,7 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* u uint_t zio_taskq_basedc = 80; /* base duty cycle */ boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ +extern int zfs_sync_pass_deferred_free; /* * This (illegal) pool name is used when temporarily importing a spa_t in order @@ -6040,7 +6041,7 @@ spa_sync(spa_t *spa, uint64_t txg) spa_errlog_sync(spa, txg); dsl_pool_sync(dp, txg); - if (pass <= SYNC_PASS_DEFERRED_FREE) { + if (pass < zfs_sync_pass_deferred_free) { zio_t *zio = zio_root(spa, NULL, NULL, 0); bplist_iterate(free_bpl, spa_free_sync_cb, zio, tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Thu Nov 8 01:42:54 2012 (r242735) @@ -1687,6 +1687,7 @@ spa_init(int mode) refcount_init(); unique_init(); + space_map_init(); zio_init(); dmu_init(); zil_init(); @@ -1709,6 +1710,7 @@ spa_fini(void) zil_fini(); dmu_fini(); zio_fini(); + space_map_fini(); unique_fini(); refcount_fini(); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c Thu Nov 8 01:42:54 2012 (r242735) @@ -32,6 +32,23 @@ #include #include +static kmem_cache_t *space_seg_cache; + +void +space_map_init(void) +{ + ASSERT(space_seg_cache == NULL); + space_seg_cache = kmem_cache_create("space_seg_cache", + sizeof (space_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +space_map_fini(void) +{ + kmem_cache_destroy(space_seg_cache); + space_seg_cache = NULL; +} + /* * Space map routines. * NOTE: caller is responsible for all locking. @@ -124,7 +141,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); } ss_after->ss_start = ss_before->ss_start; - kmem_free(ss_before, sizeof (*ss_before)); + kmem_cache_free(space_seg_cache, ss_before); ss = ss_after; } else if (merge_before) { ss_before->ss_end = end; @@ -137,7 +154,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); ss = ss_after; } else { - ss = kmem_alloc(sizeof (*ss), KM_SLEEP); + ss = kmem_cache_alloc(space_seg_cache, KM_SLEEP); ss->ss_start = start; ss->ss_end = end; avl_insert(&sm->sm_root, ss, where); @@ -184,7 +201,7 @@ space_map_remove(space_map_t *sm, uint64 avl_remove(sm->sm_pp_root, ss); if (left_over && right_over) { - newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP); + newseg = kmem_cache_alloc(space_seg_cache, KM_SLEEP); newseg->ss_start = end; newseg->ss_end = ss->ss_end; ss->ss_end = start; @@ -197,7 +214,7 @@ space_map_remove(space_map_t *sm, uint64 ss->ss_start = end; } else { avl_remove(&sm->sm_root, ss); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); ss = NULL; } @@ -237,7 +254,7 @@ space_map_vacate(space_map_t *sm, space_ while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { if (func != NULL) func(mdest, ss->ss_start, ss->ss_end - ss->ss_start); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } sm->sm_space = 0; } @@ -409,7 +426,7 @@ space_map_sync(space_map_t *sm, uint8_t spa_t *spa = dmu_objset_spa(os); void *cookie = NULL; space_seg_t *ss; - uint64_t bufsize, start, size, run_len; + uint64_t bufsize, start, size, run_len, delta, sm_space; uint64_t *entry, *entry_map, *entry_map_end; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -438,11 +455,13 @@ space_map_sync(space_map_t *sm, uint8_t SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx)); + delta = 0; + sm_space = sm->sm_space; while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { size = ss->ss_end - ss->ss_start; start = (ss->ss_start - sm->sm_start) >> sm->sm_shift; - sm->sm_space -= size; + delta += size; size >>= sm->sm_shift; while (size) { @@ -464,7 +483,7 @@ space_map_sync(space_map_t *sm, uint8_t start += run_len; size -= run_len; } - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } if (entry != entry_map) { @@ -476,8 +495,15 @@ space_map_sync(space_map_t *sm, uint8_t smo->smo_objsize += size; } + /* + * Ensure that the space_map's accounting wasn't changed + * while we were in the middle of writing it out. + */ + VERIFY3U(sm->sm_space, ==, sm_space); + zio_buf_free(entry_map, bufsize); + sm->sm_space -= delta; VERIFY0(sm->sm_space); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Thu Nov 8 01:42:54 2012 (r242735) @@ -21,7 +21,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Thu Nov 8 01:42:54 2012 (r242735) @@ -486,14 +486,6 @@ extern int spa_scan_stop(spa_t *spa); extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ extern void spa_sync_allpools(void); -/* - * DEFERRED_FREE must be large enough that regular blocks are not - * deferred. XXX so can't we change it back to 1? - */ -#define SYNC_PASS_DEFERRED_FREE 2 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* spa namespace global mutex */ extern kmutex_t spa_namespace_lock; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h Thu Nov 8 01:42:54 2012 (r242735) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPACE_MAP_H #define _SYS_SPACE_MAP_H @@ -136,6 +140,8 @@ struct space_map_ops { typedef void space_map_func_t(space_map_t *sm, uint64_t start, uint64_t size); +extern void space_map_init(void); +extern void space_map_fini(void); extern void space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift, kmutex_t *lp); extern void space_map_destroy(space_map_t *sm); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h Thu Nov 8 01:42:54 2012 (r242735) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _ZIO_IMPL_H #define _ZIO_IMPL_H @@ -143,6 +147,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Nov 8 01:41:04 2012 (r242734) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Thu Nov 8 01:42:54 2012 (r242735) @@ -83,6 +83,22 @@ extern vmem_t *zio_alloc_arena; extern int zfs_mg_alloc_failures; /* + * The following actions directly effect the spa's sync-to-convergence logic. + * The values below define the sync pass when we start performing the action. + * Care should be taken when changing these values as they directly impact + * spa_sync() performance. Tuning these values may introduce subtle performance + * pathologies and should only be done in the context of performance analysis. + * These tunables will eventually be removed and replaced with #defines once + * enough analysis has been done to determine optimal values. + * + * The 'zfs_sync_pass_deferred_free' pass must be greater than 1 to ensure that + * regular blocks are not deferred. + */ +int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ +int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ +int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ + +/* * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ @@ -690,7 +706,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui ASSERT(!BP_IS_HOLE(bp)); ASSERT(spa_syncing_txg(spa) == txg); - ASSERT(spa_sync_pass(spa) <= SYNC_PASS_DEFERRED_FREE); + ASSERT(spa_sync_pass(spa) < zfs_sync_pass_deferred_free); zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp), NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, @@ -987,7 +1003,7 @@ zio_write_bp_init(zio_t *zio) ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); ASSERT(!BP_GET_DEDUP(bp)); - if (pass > SYNC_PASS_DONT_COMPRESS) + if (pass >= zfs_sync_pass_dont_compress) compress = ZIO_COMPRESS_OFF; /* Make sure someone doesn't change their mind on overwrites */ @@ -1016,7 +1032,7 @@ zio_write_bp_init(zio_t *zio) * There should only be a handful of blocks after pass 1 in any case. */ if (bp->blk_birth == zio->io_txg && BP_GET_PSIZE(bp) == psize && - pass > SYNC_PASS_REWRITE) { + pass >= zfs_sync_pass_rewrite) { ASSERT(psize != 0); enum zio_stage gang_stages = zio->io_pipeline & ZIO_GANG_STAGES; zio->io_pipeline = ZIO_REWRITE_PIPELINE | gang_stages; From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:46:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D13389E4; Thu, 8 Nov 2012 01:46:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9244F8FC12; Thu, 8 Nov 2012 01:46:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81kllk051450; Thu, 8 Nov 2012 01:46:47 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81klvx051448; Thu, 8 Nov 2012 01:46:47 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201211080146.qA81klvx051448@svn.freebsd.org> From: Jeff Roberson Date: Thu, 8 Nov 2012 01:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242736 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:46:47 -0000 Author: jeff Date: Thu Nov 8 01:46:47 2012 New Revision: 242736 URL: http://svnweb.freebsd.org/changeset/base/242736 Log: - Change ULE to use dynamic slice sizes for the timeshare queue in order to further reduce latency for threads in this queue. This should help as threads transition from realtime to timeshare. The latency is bound to a max of sched_slice until we have more than sched_slice / 6 threads runnable. Then the min slice is allotted to all threads and latency becomes (nthreads - 1) * min_slice. Discussed with: mav Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Nov 8 01:42:54 2012 (r242735) +++ head/sys/kern/sched_ule.c Thu Nov 8 01:46:47 2012 (r242736) @@ -189,6 +189,12 @@ static struct td_sched td_sched0; #define SCHED_INTERACT_HALF (SCHED_INTERACT_MAX / 2) #define SCHED_INTERACT_THRESH (30) +/* + * These parameters determine the slice behavior for batch work. + */ +#define SCHED_SLICE_DEFAULT_DIVISOR 10 /* ~94 ms, 12 stathz ticks. */ +#define SCHED_SLICE_MIN_DIVISOR 6 /* DEFAULT/MIN = ~16 ms. */ + /* Flags kept in td_flags. */ #define TDF_SLICEEND TDF_SCHED2 /* Thread time slice is over. */ @@ -201,9 +207,10 @@ static struct td_sched td_sched0; * preempt_thresh: Priority threshold for preemption and remote IPIs. */ static int sched_interact = SCHED_INTERACT_THRESH; -static int realstathz = 127; static int tickincr = 8 << SCHED_TICK_SHIFT; -static int sched_slice = 12; +static int realstathz = 127; /* reset during boot. */ +static int sched_slice = 10; /* reset during boot. */ +static int sched_slice_min = 1; /* reset during boot. */ #ifdef PREEMPTION #ifdef FULL_PREEMPTION static int preempt_thresh = PRI_MAX_IDLE; @@ -559,6 +566,30 @@ tdq_load_rem(struct tdq *tdq, struct thr } /* + * Bound timeshare latency by decreasing slice size as load increases. We + * consider the maximum latency as the sum of the threads waiting to run + * aside from curthread and target no more than sched_slice latency but + * no less than sched_slice_min runtime. + */ +static inline int +tdq_slice(struct tdq *tdq) +{ + int load; + + /* + * It is safe to use sys_load here because this is called from + * contexts where timeshare threads are running and so there + * cannot be higher priority load in the system. + */ + load = tdq->tdq_sysload - 1; + if (load >= SCHED_SLICE_MIN_DIVISOR) + return (sched_slice_min); + if (load <= 1) + return (sched_slice); + return (sched_slice / load); +} + +/* * Set lowpri to its exact value by searching the run-queue and * evaluating curthread. curthread may be passed as an optimization. */ @@ -1384,7 +1415,8 @@ sched_initticks(void *dummy) int incr; realstathz = stathz ? stathz : hz; - sched_slice = realstathz / 10; /* ~100ms */ + sched_slice = realstathz / SCHED_SLICE_DEFAULT_DIVISOR; + sched_slice_min = sched_slice / SCHED_SLICE_MIN_DIVISOR; hogticks = imax(1, (2 * hz * sched_slice + realstathz / 2) / realstathz); @@ -1585,7 +1617,7 @@ schedinit(void) thread0.td_sched = &td_sched0; td_sched0.ts_ltick = ticks; td_sched0.ts_ftick = ticks; - td_sched0.ts_slice = sched_slice; + td_sched0.ts_slice = 0; } /* @@ -2003,8 +2035,10 @@ sched_wakeup(struct thread *td) sched_interact_update(td); sched_pctcpu_update(ts, 0); } - /* Reset the slice value after we sleep. */ - ts->ts_slice = sched_slice; + /* + * Reset the slice value since we slept and advanced the round-robin. + */ + ts->ts_slice = 0; sched_add(td, SRQ_BORING); } @@ -2036,14 +2070,16 @@ sched_fork_thread(struct thread *td, str { struct td_sched *ts; struct td_sched *ts2; + struct tdq *tdq; + tdq = TDQ_SELF(); THREAD_LOCK_ASSERT(td, MA_OWNED); /* * Initialize child. */ ts = td->td_sched; ts2 = child->td_sched; - child->td_lock = TDQ_LOCKPTR(TDQ_SELF()); + child->td_lock = TDQ_LOCKPTR(tdq); child->td_cpuset = cpuset_ref(td->td_cpuset); ts2->ts_cpu = ts->ts_cpu; ts2->ts_flags = 0; @@ -2062,7 +2098,8 @@ sched_fork_thread(struct thread *td, str */ ts2->ts_slptime = ts->ts_slptime; ts2->ts_runtime = ts->ts_runtime; - ts2->ts_slice = 1; /* Attempt to quickly learn interactivity. */ + /* Attempt to quickly learn interactivity. */ + ts2->ts_slice = tdq_slice(tdq) - sched_slice_min; #ifdef KTR bzero(ts2->ts_name, sizeof(ts2->ts_name)); #endif @@ -2227,8 +2264,8 @@ sched_clock(struct thread *td) * Force a context switch if the current thread has used up a full * time slice (default is 100ms). */ - if (!TD_IS_IDLETHREAD(td) && --ts->ts_slice <= 0) { - ts->ts_slice = sched_slice; + if (!TD_IS_IDLETHREAD(td) && ++ts->ts_slice >= tdq_slice(tdq)) { + ts->ts_slice = 0; td->td_flags |= TDF_NEEDRESCHED | TDF_SLICEEND; } } @@ -2799,6 +2836,7 @@ sysctl_kern_quantum(SYSCTL_HANDLER_ARGS) if (new_val <= 0) return (EINVAL); sched_slice = imax(1, (new_val + period / 2) / period); + sched_slice_min = sched_slice / SCHED_SLICE_MIN_DIVISOR; hogticks = imax(1, (2 * hz * sched_slice + realstathz / 2) / realstathz); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 01:51:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6EED2B84; Thu, 8 Nov 2012 01:51:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53DF58FC08; Thu, 8 Nov 2012 01:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA81pNnw052144; Thu, 8 Nov 2012 01:51:23 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA81pNNN052142; Thu, 8 Nov 2012 01:51:23 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201211080151.qA81pNNN052142@svn.freebsd.org> From: Justin Hibbits Date: Thu, 8 Nov 2012 01:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242737 - head/sys/powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 01:51:23 -0000 Author: jhibbits Date: Thu Nov 8 01:51:23 2012 New Revision: 242737 URL: http://svnweb.freebsd.org/changeset/base/242737 Log: Add DTrace to 32-bit PowerPC GENERIC now. MFC after: 1 month Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu Nov 8 01:46:47 2012 (r242736) +++ head/sys/powerpc/conf/GENERIC Thu Nov 8 01:51:23 2012 (r242737) @@ -24,6 +24,7 @@ ident GENERIC machine powerpc powerpc makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Platform support options POWERMAC #NewWorld Apple PowerMacs @@ -68,6 +69,8 @@ options AUDIT # Security event auditi options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:01:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 992A6D79; Thu, 8 Nov 2012 02:01:04 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 792BF8FC1B; Thu, 8 Nov 2012 02:01:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8214oj053681; Thu, 8 Nov 2012 02:01:04 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8214V9053678; Thu, 8 Nov 2012 02:01:04 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211080201.qA8214V9053678@svn.freebsd.org> From: Greg Lehey Date: Thu, 8 Nov 2012 02:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242738 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:01:04 -0000 Author: grog Date: Thu Nov 8 02:01:04 2012 New Revision: 242738 URL: http://svnweb.freebsd.org/changeset/base/242738 Log: Clarify that the ' flag is an apostrophe. MFC after: 2 weeks Modified: head/lib/libc/stdio/printf.3 Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Thu Nov 8 01:51:23 2012 (r242737) +++ head/lib/libc/stdio/printf.3 Thu Nov 8 02:01:04 2012 (r242738) @@ -267,7 +267,7 @@ number produced by a signed conversion. A .Cm + overrides a space if both are used. -.It Sq Cm ' +.It So "'" Sc (apostrophe) Decimal conversions .Cm ( d , u , or From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:06:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1A64F43; Thu, 8 Nov 2012 02:06:27 +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 BA5A98FC0A; Thu, 8 Nov 2012 02:06:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA826Rat054541; Thu, 8 Nov 2012 02:06:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA826RiN054539; Thu, 8 Nov 2012 02:06:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211080206.qA826RiN054539@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 8 Nov 2012 02:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242739 - stable/9/sys/dev/ti X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:06:28 -0000 Author: yongari Date: Thu Nov 8 02:06:27 2012 New Revision: 242739 URL: http://svnweb.freebsd.org/changeset/base/242739 Log: MFC r242425: Remove TCP/UDP checksum offloading feature for IP fragmented datagrams. Traditionally upper stack fragmented packets without computing TCP/UDP checksum and these datagrams were passed to driver. But there are chances that other packets slip into the interface queue in SMP world. If this happens firmware running on MIPS 4000 processor in the controller would see mixed packets and it shall send out corrupted packets. While I'm here simplify checksum offloading setup. Modified: stable/9/sys/dev/ti/if_ti.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ti/if_ti.c ============================================================================== --- stable/9/sys/dev/ti/if_ti.c Thu Nov 8 02:01:04 2012 (r242738) +++ stable/9/sys/dev/ti/if_ti.c Thu Nov 8 02:06:27 2012 (r242739) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) /* * We can only turn on header splitting if we're using extended receive * BDs. @@ -3083,16 +3083,10 @@ ti_encap(struct ti_softc *sc, struct mbu m = *m_head; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { - if (m->m_pkthdr.csum_flags & CSUM_IP) - csum_flags |= TI_BDFLAG_IP_CKSUM; - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; - if (m->m_flags & M_LASTFRAG) - csum_flags |= TI_BDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= TI_BDFLAG_IP_FRAG; - } + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= TI_BDFLAG_IP_CKSUM; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; frag = sc->ti_tx_saved_prodidx; for (i = 0; i < nseg; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:08:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 921B213D; Thu, 8 Nov 2012 02:08:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 598438FC08; Thu, 8 Nov 2012 02:08:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA828gFN054899; Thu, 8 Nov 2012 02:08:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA828gAD054897; Thu, 8 Nov 2012 02:08:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211080208.qA828gAD054897@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 8 Nov 2012 02:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242740 - stable/8/sys/dev/ti X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:08:42 -0000 Author: yongari Date: Thu Nov 8 02:08:42 2012 New Revision: 242740 URL: http://svnweb.freebsd.org/changeset/base/242740 Log: MFC r242425: Remove TCP/UDP checksum offloading feature for IP fragmented datagrams. Traditionally upper stack fragmented packets without computing TCP/UDP checksum and these datagrams were passed to driver. But there are chances that other packets slip into the interface queue in SMP world. If this happens firmware running on MIPS 4000 processor in the controller would see mixed packets and it shall send out corrupted packets. While I'm here simplify checksum offloading setup. Modified: stable/8/sys/dev/ti/if_ti.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ti/ (props changed) Modified: stable/8/sys/dev/ti/if_ti.c ============================================================================== --- stable/8/sys/dev/ti/if_ti.c Thu Nov 8 02:06:27 2012 (r242739) +++ stable/8/sys/dev/ti/if_ti.c Thu Nov 8 02:08:42 2012 (r242740) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) /* * We can only turn on header splitting if we're using extended receive * BDs. @@ -3085,16 +3085,10 @@ ti_encap(struct ti_softc *sc, struct mbu m = *m_head; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { - if (m->m_pkthdr.csum_flags & CSUM_IP) - csum_flags |= TI_BDFLAG_IP_CKSUM; - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; - if (m->m_flags & M_LASTFRAG) - csum_flags |= TI_BDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= TI_BDFLAG_IP_FRAG; - } + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= TI_BDFLAG_IP_CKSUM; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; frag = sc->ti_tx_saved_prodidx; for (i = 0; i < nseg; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:23:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29A1D832; Thu, 8 Nov 2012 02:23:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D0AC8FC0A; Thu, 8 Nov 2012 02:23:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA82Np5F090901; Thu, 8 Nov 2012 02:23:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA82Np45090899; Thu, 8 Nov 2012 02:23:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211080223.qA82Np45090899@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Nov 2012 02:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242741 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:23:52 -0000 Author: kib Date: Thu Nov 8 02:23:51 2012 New Revision: 242741 URL: http://svnweb.freebsd.org/changeset/base/242741 Log: MFC r242556: Order the enumeration of the MNT_ flags to be the same as the order of their definitions. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:08:42 2012 (r242740) +++ stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:23:51 2012 (r242741) @@ -3018,11 +3018,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_SYNCHRONOUS); MNT_FLAG(MNT_NOEXEC); MNT_FLAG(MNT_NOSUID); + MNT_FLAG(MNT_NFS4ACLS); MNT_FLAG(MNT_UNION); MNT_FLAG(MNT_ASYNC); MNT_FLAG(MNT_SUIDDIR); MNT_FLAG(MNT_SOFTDEP); - MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_NOSYMFOLLOW); MNT_FLAG(MNT_GJOURNAL); MNT_FLAG(MNT_MULTILABEL); @@ -3030,7 +3030,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_NOATIME); MNT_FLAG(MNT_NOCLUSTERR); MNT_FLAG(MNT_NOCLUSTERW); - MNT_FLAG(MNT_NFS4ACLS); + MNT_FLAG(MNT_SUJ); MNT_FLAG(MNT_EXRDONLY); MNT_FLAG(MNT_EXPORTED); MNT_FLAG(MNT_DEFEXPORTED); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:29:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEDF39FB; Thu, 8 Nov 2012 02:29:16 +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 991198FC0C; Thu, 8 Nov 2012 02:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA82TGqA002899; Thu, 8 Nov 2012 02:29:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA82TGnX002894; Thu, 8 Nov 2012 02:29:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211080229.qA82TGnX002894@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Nov 2012 02:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242742 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:29:17 -0000 Author: kib Date: Thu Nov 8 02:29:16 2012 New Revision: 242742 URL: http://svnweb.freebsd.org/changeset/base/242742 Log: MFC r242559: Add decoding of the missed VI_ and VV_ flags to ddb "show vnode" command. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:23:51 2012 (r242741) +++ stable/9/sys/kern/vfs_subr.c Thu Nov 8 02:29:16 2012 (r242742) @@ -2878,6 +2878,8 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_ISTTY", sizeof(buf)); if (vp->v_vflag & VV_NOSYNC) strlcat(buf, "|VV_NOSYNC", sizeof(buf)); + if (vp->v_vflag & VV_ETERNALDEV) + strlcat(buf, "|VV_ETERNALDEV", sizeof(buf)); if (vp->v_vflag & VV_CACHEDLABEL) strlcat(buf, "|VV_CACHEDLABEL", sizeof(buf)); if (vp->v_vflag & VV_TEXT) @@ -2894,9 +2896,11 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VV_DELETED", sizeof(buf)); if (vp->v_vflag & VV_MD) strlcat(buf, "|VV_MD", sizeof(buf)); - flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | + if (vp->v_vflag & VV_FORCEINSMQ) + strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); + flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | VV_CACHEDLABEL | VV_TEXT | VV_COPYONWRITE | VV_SYSTEM | VV_PROCDEP | - VV_NOKNOTE | VV_DELETED | VV_MD); + VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -2909,12 +2913,14 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, "|VI_DOOMED", sizeof(buf)); if (vp->v_iflag & VI_FREE) strlcat(buf, "|VI_FREE", sizeof(buf)); + if (vp->v_iflag & VI_ACTIVE) + strlcat(buf, "|VI_ACTIVE", sizeof(buf)); if (vp->v_iflag & VI_DOINGINACT) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); flags = vp->v_iflag & ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE | - VI_DOINGINACT | VI_OWEINACT); + VI_ACTIVE | VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 02:55:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A629DD; Thu, 8 Nov 2012 02:55:31 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E99F38FC08; Thu, 8 Nov 2012 02:55:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA82tUUu088809; Thu, 8 Nov 2012 02:55:30 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA82tUQc088806; Thu, 8 Nov 2012 02:55:30 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211080255.qA82tUQc088806@svn.freebsd.org> From: Greg Lehey Date: Thu, 8 Nov 2012 02:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242743 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 02:55:31 -0000 Author: grog Date: Thu Nov 8 02:55:30 2012 New Revision: 242743 URL: http://svnweb.freebsd.org/changeset/base/242743 Log: Make parameters to -c and -k options optional. If no parameters are supplied, print information for all keywords. Improve output of -c option, in particular in conjunction with -k option. MFC after: 14 days Modified: head/usr.bin/locale/locale.1 head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.1 ============================================================================== --- head/usr.bin/locale/locale.1 Thu Nov 8 02:29:16 2012 (r242742) +++ head/usr.bin/locale/locale.1 Thu Nov 8 02:55:30 2012 (r242743) @@ -40,7 +40,7 @@ .Op Ar prefix .Nm .Op Fl ck -.Ar keyword ... +.Op Ar keyword ... .Sh DESCRIPTION The .Nm @@ -74,8 +74,12 @@ directory. Print names of all available charmaps. .It Fl k Print the names and values of all selected keywords. +If no keywords are selected, print the names and values of all defined +keywords. .It Fl c Print the category name for all selected keywords. +If no keywords are selected, print the category name for all defined +keywords. .El .Sh IMPLEMENTATION NOTES The special Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Nov 8 02:29:16 2012 (r242742) +++ head/usr.bin/locale/locale.c Thu Nov 8 02:55:30 2012 (r242743) @@ -253,12 +253,10 @@ main(int argc, char *argv[]) /* validate arguments */ if (all_locales && all_charmaps) usage(); - if ((all_locales || all_charmaps) && argc > 0) + if ((all_locales || all_charmaps) && argc > 0) usage(); if ((all_locales || all_charmaps) && (prt_categories || prt_keywords)) usage(); - if ((prt_categories || prt_keywords) && argc <= 0) - usage(); /* process '-a' */ if (all_locales) { @@ -282,13 +280,19 @@ main(int argc, char *argv[]) } /* process '-c' and/or '-k' */ - if (prt_categories || prt_keywords || argc > 0) { - setlocale(LC_ALL, ""); - while (argc > 0) { - showdetails(*argv); - argv++; - argc--; - } + if (prt_categories || prt_keywords) { + if (argc > 0) { + setlocale(LC_ALL, ""); + while (argc > 0) { + showdetails(*argv); + argv++; + argc--; + } + } else { + uint i; + for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++) + showdetails ((char *)kwinfo [i].name); + } exit(0); } @@ -303,7 +307,7 @@ usage(void) { printf("Usage: locale [ -a | -m ]\n" " locale -k list [prefix]\n" - " locale [ -ck ] keyword ...\n"); + " locale [ -ck ] [keyword ...]\n"); exit(1); } @@ -612,7 +616,10 @@ showdetails(char *kw) } if (prt_categories) { - printf("%s\n", lookup_localecat(cat)); + if (prt_keywords) + printf("%-20s ", lookup_localecat(cat)); + else + printf("%-20s\t%s\n", kw, lookup_localecat(cat)); } if (prt_keywords) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 03:17:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CDCE7D4; Thu, 8 Nov 2012 03:17:41 +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 515238FC0C; Thu, 8 Nov 2012 03:17:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA83HfHg092611; Thu, 8 Nov 2012 03:17:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA83HflE092609; Thu, 8 Nov 2012 03:17:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211080317.qA83HflE092609@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Nov 2012 03:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242744 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 03:17:41 -0000 Author: kib Date: Thu Nov 8 03:17:41 2012 New Revision: 242744 URL: http://svnweb.freebsd.org/changeset/base/242744 Log: Zero the newly allocated md(4) swap-backed page to prevent random kernel memory leakage to userspace. For the typical use, when a filesystem put on the md disk, the change only results in CPU and memory bandwidth spent to zero the page, since filsystems make sure that user never see unwritten content. But if md disk is used as raw device by userspace, the garbage is exposed. Reported by: Paul Schenkeveld MFC after: 2 weeks Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Nov 8 02:55:30 2012 (r242743) +++ head/sys/dev/md/md.c Thu Nov 8 03:17:41 2012 (r242744) @@ -677,6 +677,15 @@ mdstart_swap(struct md_s *sc, struct bio sched_unpin(); vm_page_wakeup(m); break; + } else if (rv == VM_PAGER_FAIL) { + /* + * Pager does not have the page. Zero + * the allocated page, and mark it as + * valid. Do not set dirty, the page + * can be recreated if thrown out. + */ + bzero((void *)sf_buf_kva(sf), PAGE_SIZE); + m->valid = VM_PAGE_BITS_ALL; } bcopy((void *)(sf_buf_kva(sf) + offs), p, len); cpu_flush_dcache(p, len); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 03:29:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40894D95; Thu, 8 Nov 2012 03:29:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A76A8FC0A; Thu, 8 Nov 2012 03:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA83Tt3o094534; Thu, 8 Nov 2012 03:29:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA83TtXN094532; Thu, 8 Nov 2012 03:29:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201211080329.qA83TtXN094532@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 8 Nov 2012 03:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242745 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 03:29:56 -0000 Author: bz Date: Thu Nov 8 03:29:55 2012 New Revision: 242745 URL: http://svnweb.freebsd.org/changeset/base/242745 Log: Cleanup some whitspace in this file to get it out of an upcoming patch. MFC after: 10 days Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 8 03:17:41 2012 (r242744) +++ head/sys/netinet/tcp_subr.c Thu Nov 8 03:29:55 2012 (r242745) @@ -529,11 +529,11 @@ tcp_respond(struct tcpcb *tp, void *ipge nth = (struct tcphdr *)(ip6 + 1); } else #endif /* INET6 */ - { - bcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip)); - ip = mtod(m, struct ip *); - nth = (struct tcphdr *)(ip + 1); - } + { + bcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip)); + ip = mtod(m, struct ip *); + nth = (struct tcphdr *)(ip + 1); + } bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr)); flags = TH_ACK; } else { @@ -553,10 +553,10 @@ tcp_respond(struct tcpcb *tp, void *ipge nth = (struct tcphdr *)(ip6 + 1); } else #endif /* INET6 */ - { - xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t); - nth = (struct tcphdr *)(ip + 1); - } + { + xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t); + nth = (struct tcphdr *)(ip + 1); + } if (th != nth) { /* * this is usually a case when an extension header @@ -902,14 +902,14 @@ tcp_discardcb(struct tcpcb *tp) ssthresh = 2; ssthresh *= (u_long)(tp->t_maxseg + #ifdef INET6 - (isipv6 ? sizeof (struct ip6_hdr) + - sizeof (struct tcphdr) : + (isipv6 ? sizeof (struct ip6_hdr) + + sizeof (struct tcphdr) : #endif - sizeof (struct tcpiphdr) + sizeof (struct tcpiphdr) #ifdef INET6 - ) + ) #endif - ); + ); } else ssthresh = 0; metrics.rmx_ssthresh = ssthresh; From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 04:02:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DA1648D; Thu, 8 Nov 2012 04:02:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 736778FC15; Thu, 8 Nov 2012 04:02:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA842bYE003386; Thu, 8 Nov 2012 04:02:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA842bZp003384; Thu, 8 Nov 2012 04:02:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201211080402.qA842bZp003384@svn.freebsd.org> From: Warner Losh Date: Thu, 8 Nov 2012 04:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242746 - in head/sys/arm: arm at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 04:02:37 -0000 Author: imp Date: Thu Nov 8 04:02:36 2012 New Revision: 242746 URL: http://svnweb.freebsd.org/changeset/base/242746 Log: Reduce differences between these two initarms a bit more. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Nov 8 03:29:55 2012 (r242745) +++ head/sys/arm/arm/machdep.c Thu Nov 8 04:02:36 2012 (r242746) @@ -1264,10 +1264,10 @@ initarm(struct arm_boot_params *abp) dpcpu_init((void *)dpcpu.pv_va, 0); /* Allocate stacks for all modes */ - valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); - valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); - valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); - valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); + valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU); + valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU); + valloc_pages(undstack, UND_STACK_SIZE * MAXCPU); + valloc_pages(kernelstack, KSTACK_PAGES * MAXCPU); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* @@ -1408,4 +1408,3 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } #endif - Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Nov 8 03:29:55 2012 (r242745) +++ head/sys/arm/at91/at91_machdep.c Thu Nov 8 04:02:36 2012 (r242746) @@ -96,6 +96,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef MAXCPU +#define MAXCPU 1 +#endif + /* Page table for mapping proc0 zero page */ #define KERNEL_PT_SYS 0 #define KERNEL_PT_KERN 1 @@ -454,7 +458,7 @@ initarm(struct arm_boot_params *abp) { struct pv_addr kernel_l1pt; struct pv_addr dpcpu; - int loop, i; + int i; u_int l1pagetable; vm_offset_t freemempos; vm_offset_t afterkern; @@ -482,16 +486,16 @@ initarm(struct arm_boot_params *abp) while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) freemempos += PAGE_SIZE; valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { - if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { - valloc_pages(kernel_pt_table[loop], + for (i = 0; i < NUM_KERNEL_PTS; ++i) { + if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { + valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); } else { - kernel_pt_table[loop].pv_va = freemempos - - (loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) * + kernel_pt_table[i].pv_va = freemempos - + (i % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) * L2_TABLE_SIZE_REAL; - kernel_pt_table[loop].pv_pa = - kernel_pt_table[loop].pv_va - KERNVIRTADDR + + kernel_pt_table[i].pv_pa = + kernel_pt_table[i].pv_va - KERNVIRTADDR + KERNPHYSADDR; } } @@ -507,10 +511,10 @@ initarm(struct arm_boot_params *abp) dpcpu_init((void *)dpcpu.pv_va, 0); /* Allocate stacks for all modes */ - valloc_pages(irqstack, IRQ_STACK_SIZE); - valloc_pages(abtstack, ABT_STACK_SIZE); - valloc_pages(undstack, UND_STACK_SIZE); - valloc_pages(kernelstack, KSTACK_PAGES); + valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU); + valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU); + valloc_pages(undstack, UND_STACK_SIZE * MAXCPU); + valloc_pages(kernelstack, KSTACK_PAGES * MAXCPU); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* @@ -558,9 +562,9 @@ initarm(struct arm_boot_params *abp) pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { - pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, - kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE, + for (i = 0; i < NUM_KERNEL_PTS; ++i) { + pmap_map_chunk(l1pagetable, kernel_pt_table[i].pv_va, + kernel_pt_table[i].pv_pa, L2_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 05:11:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC93F283; Thu, 8 Nov 2012 05:11:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 41B8E8FC08; Thu, 8 Nov 2012 05:11:46 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA85BaXK004698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Nov 2012 16:11:38 +1100 Date: Thu, 8 Nov 2012 16:11:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim Subject: Re: svn commit: r242715 - head/sys/conf In-Reply-To: <509AE28E.4020908@FreeBSD.org> Message-ID: <20121108151338.G2278@besplex.bde.org> References: <201211072215.qA7MFSYX017265@svn.freebsd.org> <509AE28E.4020908@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=I9g936cg c=1 sm=1 a=awvV_LfG5LcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=gUfbLjdVzhAA:10 a=6I5d2MoRAAAA:8 a=VNmf3AU00AsFbuOVZfEA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 05:11:48 -0000 On Wed, 7 Nov 2012, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2012-11-07 17:15:28 -0500, Dimitry Andric wrote: >> Author: dim Date: Wed Nov 7 22:15:28 2012 New Revision: 242715 >> URL: http://svnweb.freebsd.org/changeset/base/242715 >> >> Log: For kernel builds with PROFLEVEL >= 1, such as LINT, don't >> attempt to use the -falign-functions option if the compiler is >> clang, as the flag is not supported. This just breaks the warning. The alignment is needed for PROFLEVEL >= 1 (that is any profiling at all) to actually work. Constants in depend on it, or rather the reverse -- the alignment supports these constants. PROFLEVEL >= 2 depends more critically on the alignment, but is more completely broken. >> Modified: head/sys/conf/kern.pre.mk >> ============================================================================== >> > - --- head/sys/conf/kern.pre.mk Wed Nov 7 22:11:38 2012 (r242714) >> +++ head/sys/conf/kern.pre.mk Wed Nov 7 22:15:28 2012 (r242715) @@ >> -102,7 +102,10 @@ CLANG_NO_IAS= -no-integrated-as .endif >> >> .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -CFLAGS+= -DGPROF >> -falign-functions=16 +CFLAGS+= -DGPROF +.if ${COMPILER_TYPE} != >> "clang" +CFLAGS+= -falign-functions=16 +.endif .if ${PROFLEVEL} >= >> 2 CFLAGS+= -DGPROF4 -DGUPROF PROF= -pg -mprofiler-epilogue > > FYI, PROF needs a similar work-around: > > % clang -c -pg -mprofiler-epilogue test.c > clang: warning: argument unused during compilation: '-mprofiler-epilogue' Again, this just breaks the warning. The main part of the complete brokenness of PROFLEVEL >= 2 is that gcc doesn't ignore this option, but it just doesn't work. I got tired of fixing breakages of this a few rounds ago. A previous round used -finstrument-functions, but this generated bloated code and is much worse now since it now generates instrumentation for all the little inline functions like curthread that you don't want to instrument, unless you use large complicatins to kill their instrumentation selectively (there is an attribute for this, but there seems to be no compiler flag for a less-selective kill). clang's lack of support for other gcc flags is annoying. One such flag is -mpreferred-stack-boundary. This is important for reducing kernel stack bloat with gcc. clang has better stack alignment so it doesn't really need the flag, but using it gives anyoying warnings so you have to ifdef for it... clang also has lots of floating point bugs. Some are shared with gcc but act a little differently so that the workarounds for them in gcc don't ameliorate them. The last 3 that I noticed are: - overflowing multiplications of constants are misoptimized to infinity with no overflow. gcc has a similar bug for underflowing multiplications of constants. clang has this too. libm has many lines of work-arounds for the missing underflow but not for the missing overflow. Perhaps the missing exceptions are permitted by the default for the FENV_ACCESS pragma, and in that case the bug might be a different default. Neither gcc nor clang supports C99 here, so they have essentially null support for the pragma and null support for what it controls. gcc defaults to a setting that is fairly fail-safe, and even documents this in its info page. - clang fails to optimize division by (integer) 2 into multiplication by (floating point with the correct type) 0.5 in the case of long doubles on one supported arch (i386 IIRC). Both compilers optimize all other cases, including floats and doubles on all arches. clang with -ffast-math optimizes the broken case, but -ffast-math is generally unsafe and not even fast; it shouldn't be necessary for this, since this is one of the few floating point strength reductions that is always safe. This detail is not documented for either clang or gcc. clang doesn't even document the existence of -ffast-math in its man page. Several uncommitted libm functions use the spelling of (integer) 2 to avoid ifdefs and/or different code to get the type right for 0.5. The result is that the case of long doubles on i386 is pessimized. clang has many other efficiency and ABI problems on i386, including the next one. - clang doesn't align long doubles on i386 when this is possible. The i386 ABI is unfortunately broken for long doubles (and doubles), and only requires 4-byte alignment. However, 8-byte alignment is possible in many cases (e.g., for all auto and static objects). Both compilers use 8-byte alignment for doubles in all cases and should do the same for long doubles (or perhaps 16-byte, but that just waste space on most or all current CPUs AFAIR, even for ABI where the ABI requires at least the size of a long double to be 16). clang only does 4-byte alignment for long doubles, at least in the important case of static constants. (static constants are handled by both compilers by replacing them by unnamed objects having better locality and alignment if possible. x86 allows just a few cases where the object is an immediate constant.) I mostly don't notice other floating point bugs in clang because I noticed them before and have scattered work-arounds for them. Not very many. The largest ones involve FLT_EVAL_METHOD, float_t and double_t. On i386, these are broken in both the clang and the FreeBSD headers. The headers just use the gcc values with no ifdefs. Correct ifdefs are not easy to write because compiler pre-defines like __FLT_EVAL_METHOD are even more broken. The broken FLT_EVAL_METHOD, float_t and double_t mainly give inefficencies because they are mostly fail-safe. When you try to fix them, you get larger ABI problems. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 06:24:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37DEBC81; Thu, 8 Nov 2012 06:24:33 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id DC8CA8FC12; Thu, 8 Nov 2012 06:24:32 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 870DB1A3C55; Wed, 7 Nov 2012 22:24:31 -0800 (PST) Message-ID: <509B501F.5050109@mu.org> Date: Wed, 07 Nov 2012 22:24:31 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r242029 - head/sys/kern References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> In-Reply-To: <201210250950.57161.jhb@freebsd.org> Content-Type: multipart/mixed; boundary="------------090002040205010501030408" Cc: src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 06:24:33 -0000 This is a multi-part message in MIME format. --------------090002040205010501030408 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit [[ + peter ]] Folks, I spent quite a bit of time trying to figure out how to resolve maxusers scaling in a happy way for all. I think I came up with a solution. This solution should work for i386, and other 32 bit platforms, as well as scaling well for 64 bit (or higher) platforms that have virtually unlimited AND 64bit with limited kernel address space. Here is how it works: We calculate the maxusers value based on physical memory, and then clamp it down if physical memory exceeds kernel addressable memory. The algorithm actually remains the same for all architectures, with the exception that machines with large kernel address space it is no longer clamped at 384. I've attached a test program that lets you play with various values for VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages. (argv[1, 2, 3] respectively.) Please give me your feedback. Note a lot of the ugly types/casting is due to building this test program on i386 darwin. I will clean it up before committing. I just want to make sure this the right direction. I would like to commit this shortly. -Alfred On 10/25/12 6:50 AM, John Baldwin wrote: > On Thursday, October 25, 2012 4:05:51 am Konstantin Belousov wrote: >> On Thu, Oct 25, 2012 at 01:46:21AM +0000, Alfred Perlstein wrote: >>> Author: alfred >>> Date: Thu Oct 25 01:46:20 2012 >>> New Revision: 242029 >>> URL: http://svn.freebsd.org/changeset/base/242029 >>> >>> Log: >>> Allow autotune maxusers > 384 on 64 bit machines >>> >>> A default install on large memory machines with multiple 10gigE interfaces >>> were not being given enough mbufs to do full bandwidth TCP or NFS traffic. >>> >>> To keep the value somewhat reasonable, we scale back the number of >>> maxuers by 1/6 past the 384 point. This gives us enough mbufs for most >>> of our pretty basic 10gigE line-speed tests to complete. >>> >>> Modified: >>> head/sys/kern/subr_param.c >>> >>> Modified: head/sys/kern/subr_param.c >>> ============================================================================== >>> --- head/sys/kern/subr_param.c Thu Oct 25 01:27:01 2012 (r242028) >>> +++ head/sys/kern/subr_param.c Thu Oct 25 01:46:20 2012 (r242029) >>> @@ -278,8 +278,16 @@ init_param2(long physpages) >>> maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); >>> if (maxusers < 32) >>> maxusers = 32; >>> - if (maxusers > 384) >>> - maxusers = 384; >>> + /* >>> + * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. >>> + * Scales it down 6x for large memory machines. >>> + */ >>> + if (maxusers > 384) { >>> + if (sizeof(void *) <= 4) >>> + maxusers = 384; >>> + else >>> + maxusers = 384 + ((maxusers - 384) / 6); >>> + } >> This is unbelievably weird way to express the '64bit'. The >> #ifdef _LP64 is enough there instead of the runtime check. >> >> Also, are you sure that all our 64bit arches do not have KVA limitations ? > There is an active thread on current@ with a different patch that uses a KVA > constant to derive 384 instead. When we have updated tuning in the past > (e.g. adjusting the cap on maxvnodes), there was a bit of discussion rather > than a random drive by commit. I think we should probably hold off on making > changes here and figure out what the right way to fix this is in the thread on > current@ instead. Andre has already suggested divorcing mbuf tuning from > maxusers entirely for example. > --------------090002040205010501030408 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="maxusers.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="maxusers.c" #include #include #include #ifndef __FreeBSD__ #include #endif #define VM_MIN_KERNEL_ADDRESS atoull(argv[1]) #define VM_MAX_KERNEL_ADDRESS atoull(argv[2]) #define physpages atol(argv[3]) #define PAGE_SIZE (long long)4096 int maxusers; unsigned long long atoull(const char *str) { unsigned long long ret; if (sscanf(str, "%llu", &ret) != 1) { fprintf(stderr, "sscanf: error\n"); exit(1); } return ret; } int main(int argc, char **argv) { u_int64_t maxkvapages; long maxusers_kva; long maxusers_phys; printf("min: %llu, max: %llu\n", VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); maxkvapages = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / (long long)PAGE_SIZE; printf("VM_ADDRESS_SPACE: %llu\n", (long long)((long long)VM_MAX_KERNEL_ADDRESS - (long long)VM_MIN_KERNEL_ADDRESS)); printf("maxkvapages: %ld\n", (long)maxkvapages); maxusers_kva = maxkvapages * 3 / 4 / 512; printf("maxusers_kva: %ld\n", maxusers_kva); maxusers_phys = physpages / 512; printf("maxusers_phys: %ld\n", maxusers_phys); if (maxusers_phys > maxusers_kva) { maxusers = maxusers_kva; } else { maxusers = maxusers_phys; } printf("maxusers: %d\n", maxusers); return 0; } --------------090002040205010501030408-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 07:46:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 048A98AF for ; Thu, 8 Nov 2012 07:46:28 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 66F198FC14 for ; Thu, 8 Nov 2012 07:46:27 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so2388078lag.13 for ; Wed, 07 Nov 2012 23:46:26 -0800 (PST) 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 :cc:content-type; bh=Em99LvttzaRaWLI3dXAvuOlyn5+wDw9bth3LZ778rdk=; b=nj8thD6+1jek3ThvWxmVQErfbcuyiZSST1+ZrqYVKtB1LS6xu+JaDYubHfzkOkk4K8 5iI55qSpwsvQEyeYjXWDudbQu/CSaD3cKhwfmUXEQMjkz5N8tfgPS0a14NBhnCzUcN+Z r1O/sKl6yIlPXhS3lmA4w7qElyGY4890YSSJ8= 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 :cc:content-type:x-gm-message-state; bh=Em99LvttzaRaWLI3dXAvuOlyn5+wDw9bth3LZ778rdk=; b=UhLaCo3SnolD9P5RR5n1gS9Yt2BFCSNCPGHltcLQKE6h4aGQ3B+fX1G/NxZRGVOVDg 9th6/gsFOZo7H3Z7XDpJPOQgK5VY+JSOoUPcM3kSWD5aaNWEKfamUctYsdA+tu32D5Jn tl6RKvY7ggzx7nqSA4F0kLEPxZL7QEJWgMmy9SYqKI898nimfZOmkpQsvvmAZ1klXSsp GqiqOPqWNQU0+xQk4kmfPiy0ltGb+Kg5iI/9wZeTiDPP7+zHoBLS/3vjJ7qOAni5FKtS wCG6azWaaMCbVKZKwqwZSArVTgMspO0EmqJbsec7yrzcXN60UbOuMM7QnKV5rfnD6a2m pzZg== MIME-Version: 1.0 Received: by 10.112.42.134 with SMTP id o6mr2809527lbl.105.1352360786008; Wed, 07 Nov 2012 23:46:26 -0800 (PST) Received: by 10.112.100.230 with HTTP; Wed, 7 Nov 2012 23:46:25 -0800 (PST) In-Reply-To: <509B501F.5050109@mu.org> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> Date: Wed, 7 Nov 2012 23:46:25 -0800 Message-ID: Subject: Re: svn commit: r242029 - head/sys/kern From: Peter Wemm To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnQ4prIsRDJ5nwpZB1Uo7xNxeZNjtWHTynBsOVSzUtYsIFi1DpE9TnhiKn8n5atg5sA+Buj Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 07:46:28 -0000 On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein wrote: > [[ + peter ]] > > Folks, I spent quite a bit of time trying to figure out how to resolve > maxusers scaling in a happy way for all. > > I think I came up with a solution. > > This solution should work for i386, and other 32 bit platforms, as well as > scaling well for 64 bit (or higher) platforms that have virtually unlimited > AND 64bit with limited kernel address space. > > Here is how it works: > > We calculate the maxusers value based on physical memory, and then clamp it > down if physical memory exceeds kernel addressable memory. > > The algorithm actually remains the same for all architectures, with the > exception that machines with large kernel address space it is no longer > clamped at 384. > > I've attached a test program that lets you play with various values for > VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages. (argv[1, 2, 3] > respectively.) > > Please give me your feedback. This is still bogus. VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS have no bearing on how much space should be allocated for mbuf clusters on amd64. If anything, you want dmapbase / dmapend if you want a practical cap for amd64. Even then, jumbo clusters are >4K so they come out of kva rather than direct map. maxusers is the wrong thing for this. maxusers should, if anything, be used to set things like kern.maxproc. Preferably it should be deleted entirely and sysctl.conf should be used to change kern.maxproc. Setting limits for the mbuf / cluster pool should be a MD parameter. Trying to scale maxusers based on physical ram in order to get mbuf cluster limits set as a side effect is just plain wrong. It makes no more sense than trying to set nmbclusters based on PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order to get desirable second and third order side effects. Scale nmbclusters based on physical ram, with a MD method for capping it for when there are MD limits (eg: disproportionately small kva on an i386 PAE machine). Don't use maxusers. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 08:10:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F646DE9; Thu, 8 Nov 2012 08:10:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 841618FC08; Thu, 8 Nov 2012 08:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA88AWS3027375; Thu, 8 Nov 2012 08:10:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA88AW8Y027373; Thu, 8 Nov 2012 08:10:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201211080810.qA88AW8Y027373@svn.freebsd.org> From: Marius Strobl Date: Thu, 8 Nov 2012 08:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242747 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 08:10:32 -0000 Author: marius Date: Thu Nov 8 08:10:32 2012 New Revision: 242747 URL: http://svnweb.freebsd.org/changeset/base/242747 Log: Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address vm_offset_t as they should be. Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) +++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) @@ -186,11 +186,13 @@ struct { */ static uma_zone_t mt_zone; -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, &vm_min_kernel_address, 0, "Min kernel address"); -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; +#ifndef __sparc64__ +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; +#endif SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, &vm_max_kernel_address, 0, "Max kernel address"); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 08:54:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07DA19F2; Thu, 8 Nov 2012 08:54:46 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id DE0138FC08; Thu, 8 Nov 2012 08:54:45 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 2848D1A3CC3; Thu, 8 Nov 2012 00:54:45 -0800 (PST) Message-ID: <509B7354.2020909@mu.org> Date: Thu, 08 Nov 2012 00:54:44 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Marius Strobl Subject: Re: svn commit: r242747 - head/sys/kern References: <201211080810.qA88AW8Y027373@svn.freebsd.org> In-Reply-To: <201211080810.qA88AW8Y027373@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 08:54:46 -0000 Please define a reasonable value for VM_MAX_KERNEL_ADDRESS on sparc64, it's needed for autotuning. -Alfred On 11/8/12 12:10 AM, Marius Strobl wrote: > Author: marius > Date: Thu Nov 8 08:10:32 2012 > New Revision: 242747 > URL: http://svnweb.freebsd.org/changeset/base/242747 > > Log: > Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address > vm_offset_t as they should be. > > Modified: > head/sys/kern/kern_malloc.c > > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) > +++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) > @@ -186,11 +186,13 @@ struct { > */ > static uma_zone_t mt_zone; > > -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > &vm_min_kernel_address, 0, "Min kernel address"); > > -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +#ifndef __sparc64__ > +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +#endif > SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > &vm_max_kernel_address, 0, "Max kernel address"); > From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 09:13:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5E21172; Thu, 8 Nov 2012 09:13:37 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9026C8FC0A; Thu, 8 Nov 2012 09:13:37 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 487681A3CC3; Thu, 8 Nov 2012 01:13:37 -0800 (PST) Message-ID: <509B77C0.9060202@mu.org> Date: Thu, 08 Nov 2012 01:13:36 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r242029 - head/sys/kern References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 09:13:38 -0000 Peter, I agree. It's certainly not perfect, however it's not nearly as bogus as what was there previously. I know "maxusers" is "wrong", however what it really means, if you think about it, is "give me a scaling factor that is relative to physical ram, BUT capped at some value so as to not exhaust KVA." Yes, I grok that on certain architectures that mbufs clusters aren't pulled from KVA, but, that seems much less important than how broken it is currently.... This fix is "good enough" for the general case, and a far greater improvement than what was there previously which would make FreeBSD blow chunks on any sort of 10gigE load. I think what needs to happen here, is that the people requiring perfection think about what mess it was prior and if they themselves do not have time to make it 100% perfect, allowing someone to step in and move something a step in the right direction without overly complicating it. What is there is crap, it's old, crufty and broken, it really is. It needs to be fixed, it needs to be given a nice fat band-aid now, and when someone interested in perfection comes along, then they can make it even more awesome. I am not saying that my fix is PERFECT or the be all and end all, however it serves as a good step in the right direction on our tier 1 platforms and is easily modifiable (just replace "VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS" with some form of MD magic sauce.) Would you like me to do that? Replace the hardline calculation with some constant that each platform can configure? I'm thinking this might suffice to make purists a bit more happy: #if defined(i386) || defined(amd64) #define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) #else #define MAX_KERNEL_ADDRESS_SPACE (1024*1024*1024) #endif Given my algorithm this should result in pretty much the same for other platforms than amd64 which will then be able to grow maxusers some. I'm basically running out of time on this and I'm worried that I'll have to back it out indefinitely so that FreeBSD can't do 10gigE out of the box. -Alfred On 11/7/12 11:46 PM, Peter Wemm wrote: > On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein wrote: >> [[ + peter ]] >> >> Folks, I spent quite a bit of time trying to figure out how to resolve >> maxusers scaling in a happy way for all. >> >> I think I came up with a solution. >> >> This solution should work for i386, and other 32 bit platforms, as well as >> scaling well for 64 bit (or higher) platforms that have virtually unlimited >> AND 64bit with limited kernel address space. >> >> Here is how it works: >> >> We calculate the maxusers value based on physical memory, and then clamp it >> down if physical memory exceeds kernel addressable memory. >> >> The algorithm actually remains the same for all architectures, with the >> exception that machines with large kernel address space it is no longer >> clamped at 384. >> >> I've attached a test program that lets you play with various values for >> VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages. (argv[1, 2, 3] >> respectively.) >> >> Please give me your feedback. > This is still bogus. VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS > have no bearing on how much space should be allocated for mbuf > clusters on amd64. If anything, you want dmapbase / dmapend if you > want a practical cap for amd64. Even then, jumbo clusters are >4K so > they come out of kva rather than direct map. > > maxusers is the wrong thing for this. maxusers should, if anything, > be used to set things like kern.maxproc. Preferably it should be > deleted entirely and sysctl.conf should be used to change > kern.maxproc. > > Setting limits for the mbuf / cluster pool should be a MD parameter. > > Trying to scale maxusers based on physical ram in order to get mbuf > cluster limits set as a side effect is just plain wrong. > > It makes no more sense than trying to set nmbclusters based on > PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order > to get desirable second and third order side effects. > > Scale nmbclusters based on physical ram, with a MD method for capping > it for when there are MD limits (eg: disproportionately small kva on > an i386 PAE machine). Don't use maxusers. From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 09:22:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EE4D590; Thu, 8 Nov 2012 09:22:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A99B28FC0C; Thu, 8 Nov 2012 09:22:36 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id wz17so266246pbc.13 for ; Thu, 08 Nov 2012 01:22:36 -0800 (PST) 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=NNrCKLKDuV6rWM6Faa9/OoOSXMjA/2NDBMC+WH5KzkI=; b=lhxlKwbJKk+ztohZDUVqCi3p1P4XVEVyNgBsvC+ys7TwhZ3RGyFTGidk9teUbSwi2S xJupIVenUenkHcjb6fDG3VCwbP/RugcdrFoRavlzxyavl/qQPJwiW5/vHoqKUkef/a5/ JuHuA+DpHvTVAZxcGUKln5/B5kVeun959X0ldv1olyQ4McMr8LyP5QKNkuxdrXUmNOMZ KLIx5MWf5RGCOVttAGAigCr4riYE+RiUCxbNj1FcPfnOGP6sUIumEF8T++h2M/olwmv2 XQxvlzStHXoC5OrbeZHSWlfQQ/QDqDfi8IIyV+rCL87nRDt10pkKknD+/lPefKrzKk4k jxGw== Received: by 10.68.252.40 with SMTP id zp8mr22405385pbc.66.1352366556031; Thu, 08 Nov 2012 01:22:36 -0800 (PST) Received: from [192.168.1.33] (adsl-99-61-74-22.dsl.pltn13.sbcglobal.net. [99.61.74.22]) by mx.google.com with ESMTPS id pw2sm15649038pbb.59.2012.11.08.01.22.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Nov 2012 01:22:35 -0800 (PST) Subject: Re: svn commit: r242029 - head/sys/kern Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <509B77C0.9060202@mu.org> Date: Thu, 8 Nov 2012 01:22:33 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> <509B77C0.9060202@mu.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1283) Cc: src-committers@freebsd.org, Peter Wemm , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Konstantin Belousov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 09:22:37 -0000 On Nov 8, 2012, at 1:13 AM, Alfred Perlstein wrote: > Peter, >=20 > I agree. >=20 > It's certainly not perfect, however it's not nearly as bogus as what = was there previously. >=20 > I know "maxusers" is "wrong", however what it really means, if you = think about it, is "give me a scaling factor that is relative to = physical ram, BUT capped at some value so as to not exhaust KVA." Yes, I = grok that on certain architectures that mbufs clusters aren't pulled = from KVA, but, that seems much less important than how broken it is = currently.... >=20 > This fix is "good enough" for the general case, and a far greater = improvement than what was there previously which would make FreeBSD blow = chunks on any sort of 10gigE load. >=20 > I think what needs to happen here, is that the people requiring = perfection think about what mess it was prior and if they themselves do = not have time to make it 100% perfect, allowing someone to step in and = move something > a step in the right direction without overly complicating it. >=20 > What is there is crap, it's old, crufty and broken, it really is. It = needs to be fixed, it needs to be given a nice fat band-aid now, and = when someone interested in perfection comes along, then they can make it = even more awesome. >=20 > I am not saying that my fix is PERFECT or the be all and end all, = however it serves as a good step in the right direction on our tier 1 = platforms and is easily modifiable (just replace "VM_MAX_KERNEL_ADDRESS = - VM_MIN_KERNEL_ADDRESS" with some form of MD magic sauce.) Would you = like me to do that? Replace the hardline calculation with some constant = that each platform can configure? >=20 > I'm thinking this might suffice to make purists a bit more happy: >=20 > #if defined(i386) || defined(amd64) > #define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - = VM_MIN_KERNEL_ADDRESS) > #else > #define MAX_KERNEL_ADDRESS_SPACE (1024*1024*1024) Only 1GB for KVA on 64-bit platforms too...? > #endif >=20 > Given my algorithm this should result in pretty much the same for = other platforms than amd64 which will then be able to grow maxusers = some. >=20 > I'm basically running out of time on this and I'm worried that I'll = have to back it out indefinitely so that FreeBSD can't do 10gigE out of = the box. I agree with the philosophy being taken. Perfection shouldn't be the = enemy of the good as long as it gets close enough that things are more = useful than they are today. Thanks for championing this Alfred. The less voodoo required for FreeBSD = to function on commodity hardware, the better! -Garrett= From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 09:29:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEC507F0; Thu, 8 Nov 2012 09:29:05 +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 A47938FC08; Thu, 8 Nov 2012 09:29:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA89T5n8039663; Thu, 8 Nov 2012 09:29:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA89T5Gw039662; Thu, 8 Nov 2012 09:29:05 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211080929.qA89T5Gw039662@svn.freebsd.org> From: Kevin Lo Date: Thu, 8 Nov 2012 09:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242748 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 09:29:05 -0000 Author: kevlo Date: Thu Nov 8 09:29:05 2012 New Revision: 242748 URL: http://svnweb.freebsd.org/changeset/base/242748 Log: Add new USB device ID. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Nov 8 08:10:32 2012 (r242747) +++ head/sys/dev/usb/usbdevs Thu Nov 8 09:29:05 2012 (r242748) @@ -1545,6 +1545,7 @@ product EDIMAX EW7318USG 0x7318 USB Wire product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 +product EDIMAX EW7811UN 0x7811 EW-7811Un /* eGalax Products */ product EGALAX TPANEL 0x0001 Touch Panel From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 10:11:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A03E3A2A for ; Thu, 8 Nov 2012 10:11:33 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id E86EB8FC17 for ; Thu, 8 Nov 2012 10:11:31 +0000 (UTC) Received: (qmail 64155 invoked from network); 8 Nov 2012 11:46:38 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 8 Nov 2012 11:46:38 -0000 Message-ID: <509B854D.9020301@freebsd.org> Date: Thu, 08 Nov 2012 11:11:25 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r242029 - head/sys/kern References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 10:11:33 -0000 On 08.11.2012 08:46, Peter Wemm wrote: > On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein wrote: >> [[ + peter ]] >> >> Folks, I spent quite a bit of time trying to figure out how to resolve >> maxusers scaling in a happy way for all. >> >> I think I came up with a solution. >> >> This solution should work for i386, and other 32 bit platforms, as well as >> scaling well for 64 bit (or higher) platforms that have virtually unlimited >> AND 64bit with limited kernel address space. >> >> Here is how it works: >> >> We calculate the maxusers value based on physical memory, and then clamp it >> down if physical memory exceeds kernel addressable memory. >> >> The algorithm actually remains the same for all architectures, with the >> exception that machines with large kernel address space it is no longer >> clamped at 384. >> >> I've attached a test program that lets you play with various values for >> VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages. (argv[1, 2, 3] >> respectively.) >> >> Please give me your feedback. > > This is still bogus. VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS > have no bearing on how much space should be allocated for mbuf > clusters on amd64. If anything, you want dmapbase / dmapend if you > want a practical cap for amd64. Even then, jumbo clusters are >4K so > they come out of kva rather than direct map. > > maxusers is the wrong thing for this. maxusers should, if anything, > be used to set things like kern.maxproc. Preferably it should be > deleted entirely and sysctl.conf should be used to change > kern.maxproc. > > Setting limits for the mbuf / cluster pool should be a MD parameter. > > Trying to scale maxusers based on physical ram in order to get mbuf > cluster limits set as a side effect is just plain wrong. > > It makes no more sense than trying to set nmbclusters based on > PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order > to get desirable second and third order side effects. > > Scale nmbclusters based on physical ram, with a MD method for capping > it for when there are MD limits (eg: disproportionately small kva on > an i386 PAE machine). Don't use maxusers. ACK -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 10:41:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61434859; Thu, 8 Nov 2012 10:41:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id AC8C88FC15; Thu, 8 Nov 2012 10:41:38 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA8AfTbZ010166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Nov 2012 21:41:31 +1100 Date: Thu, 8 Nov 2012 21:41:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl Subject: Re: svn commit: r242747 - head/sys/kern In-Reply-To: <201211080810.qA88AW8Y027373@svn.freebsd.org> Message-ID: <20121108205636.O3941@besplex.bde.org> References: <201211080810.qA88AW8Y027373@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=I9g936cg c=1 sm=1 a=cAvrdy-I9ikA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=TUbLAOvDUpgFdXaIRgsA:9 a=CjuIK1q_8ugA:10 a=EMAWHSvYenz9tUQ8:21 a=ApT-BFWTfFMwBVfp:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 10:41:40 -0000 On Thu, 8 Nov 2012, Marius Strobl wrote: > Log: > Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_address > vm_offset_t as they should be. Er, they shouldn't be vm_offset_t. > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) > +++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) > @@ -186,11 +186,13 @@ struct { > */ > static uma_zone_t mt_zone; > > -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > &vm_min_kernel_address, 0, "Min kernel address"); SYSCTL_ULONG takes a u_long, not a vm_offset_t. A cast in SYSCTL_ULONG() prevents possible detection of the type mismatch from this. This is most broken on i386's with correctly-sized longs (or almost any arch with correctly-sized longs). There, vm_offset_t is 1 register wide and longs are 2 registers wide. The bugs could be moved using SYSCTL_QUAD(). Correctly-sized quads would be 4 registers wide, except quad has come to mean just a bad way of spelling long long or int64_t. > -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +#ifndef __sparc64__ > +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +#endif > SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > &vm_max_kernel_address, 0, "Max kernel address"); Since the value is a compile-time constant, u_long has a chance of holding its value even if u_long != vm_offset_t, and the old code is closer to being correct than first appeared, and the correct fix is relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX() (*). Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus SYSCTL_UQUAD() does exist. (*) Except a temporary variable is just a style bug in the above and for this. SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature of supporting either a variable or a constant arg. The above should use a constant arg and not need a variable. IIRC, the syntax for this is: SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, NULL, VM_MAX_KERNEL_ADDRESS, "Max kernel address"); subr_param.c is careful to use only basic types for all of its variables so that standard sysctls apply. Tunables have even more bugs in this area: at least at the input level kern_environment.c: - bogus quads are supported, but bogus uquads aren't - everything goes through getenv_quad(), which uses strtoq(), which is for signed values, so unsigned values are mishandled in various ways - worst sign bugs are on 64-bit arches. getenv_ulong() uses getenv_quad(), with blind casts and no overflow checking, so 64-bit values are silently truncated to QUAD_MAX (63 bits). Before that, getenv_quad() has overflow checking in its strtoq() call, but none in its multiplication, and the API is broken (strtoq(3) indicatates errors in errno, but there is no errno in the kernel). The bugs in tunables mean that sysctls that report read-only tunables can safely use SYSCTL_QUAD(). This is hard to fix cleanly without combinatorial explosion in the number of types, giving uglyness in the implementation. It is probably best to have single SYSCTL_INT() that operates on all integral types (signed and unsigned) according to its the arg type. E.g.: static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, &vm_min_kernel_address, 0, "Min kernel address"); This should expand to an uncast &vm_min_kernel_address, with auxilary data for the size and sign of that. sysctl_handle_int() should operate atomically on all integer sizes according to the size and sign info. Some SYSCTL_FOO()'s already generate size info or take a size arg, but sysctl_handle_int() only supports plain int and is abused to support u_int and is sometimes misused on sysctl data that has a size. After fixing the style bug: SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, NULL, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); The constant can have any integral type, and a the sysctl must generate size and sign info for it too. The API can probably be simplified to reduce the 2 parameters to 1. Hopefully __builtin_constant_p() can be used to decide which case applies. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 12:56:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 757DDC3E; Thu, 8 Nov 2012 12:56:27 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 158678FC14; Thu, 8 Nov 2012 12:56:27 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id BBEC91A3C55; Thu, 8 Nov 2012 04:56:25 -0800 (PST) Message-ID: <509BABF9.9040003@mu.org> Date: Thu, 08 Nov 2012 04:56:25 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r242029 - head/sys/kern References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> <509B77C0.9060202@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Peter Wemm , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Konstantin Belousov , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 12:56:27 -0000 On 11/8/12 1:22 AM, Garrett Cooper wrote: > On Nov 8, 2012, at 1:13 AM, Alfred Perlstein wrote: > >> Peter, >> >> I agree. >> >> It's certainly not perfect, however it's not nearly as bogus as what was there previously. >> >> I know "maxusers" is "wrong", however what it really means, if you think about it, is "give me a scaling factor that is relative to physical ram, BUT capped at some value so as to not exhaust KVA." Yes, I grok that on certain architectures that mbufs clusters aren't pulled from KVA, but, that seems much less important than how broken it is currently.... >> >> This fix is "good enough" for the general case, and a far greater improvement than what was there previously which would make FreeBSD blow chunks on any sort of 10gigE load. >> >> I think what needs to happen here, is that the people requiring perfection think about what mess it was prior and if they themselves do not have time to make it 100% perfect, allowing someone to step in and move something >> a step in the right direction without overly complicating it. >> >> What is there is crap, it's old, crufty and broken, it really is. It needs to be fixed, it needs to be given a nice fat band-aid now, and when someone interested in perfection comes along, then they can make it even more awesome. >> >> I am not saying that my fix is PERFECT or the be all and end all, however it serves as a good step in the right direction on our tier 1 platforms and is easily modifiable (just replace "VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS" with some form of MD magic sauce.) Would you like me to do that? Replace the hardline calculation with some constant that each platform can configure? >> >> I'm thinking this might suffice to make purists a bit more happy: >> >> #if defined(i386) || defined(amd64) >> #define MAX_KERNEL_ADDRESS_SPACE (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) >> #else >> #define MAX_KERNEL_ADDRESS_SPACE (1024*1024*1024) > Only 1GB for KVA on 64-bit platforms too...? Sure, if there's any people paying attention for these platforms they can quickly provide the necessary #define for the platform. (To make it MD as Peter suggested.) I guess I could #error until people catch up? That seems rude though. The way this works is that platforms that aren't listed get the old 384 cap, if they want more, then they can give me the #defines needed for better autotuning. Truth be told this is basically what Peter said to do, however just keeping the name maxusers. Yes maxusers is gross, but a step forward which unfortunately retains it needs to happen now. >> #endif >> >> Given my algorithm this should result in pretty much the same for other platforms than amd64 which will then be able to grow maxusers some. >> >> I'm basically running out of time on this and I'm worried that I'll have to back it out indefinitely so that FreeBSD can't do 10gigE out of the box. > I agree with the philosophy being taken. Perfection shouldn't be the enemy of the good as long as it gets close enough that things are more useful than they are today. > > Thanks for championing this Alfred. The less voodoo required for FreeBSD to function on commodity hardware, the better! > The less voodoo required to commit simple patches that take us forward the better as well. One shouldn't be tasked with redesigning rewiring an entire house just because they want to change one outlet. -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:16:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CCE359F; Thu, 8 Nov 2012 13:16:40 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E18EF8FC12; Thu, 8 Nov 2012 13:16:38 +0000 (UTC) Received: from [10.0.1.17] (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 9AE841A3D44; Thu, 8 Nov 2012 05:16:38 -0800 (PST) References: <201211080810.qA88AW8Y027373@svn.freebsd.org> <509B7354.2020909@mu.org> In-Reply-To: <509B7354.2020909@mu.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <8FB61AAC-0DA8-4C1A-B692-7A19D73A3157@mu.org> X-Mailer: iPhone Mail (9B206) From: Alfred Perlstein Subject: Re: svn commit: r242747 - head/sys/kern Date: Thu, 8 Nov 2012 05:16:37 -0800 To: Alfred Perlstein Cc: "svn-src-head@freebsd.org" , Marius Strobl , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:16:40 -0000 Never mind, I see what you did here. :) Thank you.=20 Sent from my iPhone On Nov 8, 2012, at 12:54 AM, Alfred Perlstein wrote: > Please define a reasonable value for VM_MAX_KERNEL_ADDRESS on sparc64, it'= s needed for autotuning. >=20 > -Alfred >=20 > On 11/8/12 12:10 AM, Marius Strobl wrote: >> Author: marius >> Date: Thu Nov 8 08:10:32 2012 >> New Revision: 242747 >> URL: http://svnweb.freebsd.org/changeset/base/242747 >>=20 >> Log: >> Make r242655 build on sparc64. While at it, make vm_{max,min}_kernel_ad= dress >> vm_offset_t as they should be. >>=20 >> Modified: >> head/sys/kern/kern_malloc.c >>=20 >> Modified: head/sys/kern/kern_malloc.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/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) >> +++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) >> @@ -186,11 +186,13 @@ struct { >> */ >> static uma_zone_t mt_zone; >> -static u_long vm_min_kernel_address =3D VM_MIN_KERNEL_ADDRESS; >> +static vm_offset_t vm_min_kernel_address =3D VM_MIN_KERNEL_ADDRESS; >> SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, >> &vm_min_kernel_address, 0, "Min kernel address"); >> -static u_long vm_max_kernel_address =3D VM_MAX_KERNEL_ADDRESS; >> +#ifndef __sparc64__ >> +static vm_offset_t vm_max_kernel_address =3D VM_MAX_KERNEL_ADDRESS; >> +#endif >> SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, >> &vm_max_kernel_address, 0, "Max kernel address"); >> =20 >=20 From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:33:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 428F2BFF; Thu, 8 Nov 2012 13:33:49 +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 243A68FC08; Thu, 8 Nov 2012 13:33:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DXmJp081051; Thu, 8 Nov 2012 13:33:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DXmoU081050; Thu, 8 Nov 2012 13:33:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081333.qA8DXmoU081050@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242766 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:33:49 -0000 Author: jilles Date: Thu Nov 8 13:33:48 2012 New Revision: 242766 URL: http://svnweb.freebsd.org/changeset/base/242766 Log: sh: Fix two issues when an alias is redefined: * The last character is not displayed. * If the alias ends with itself (as a word), an infinite memory-eating loop occurs. If an alias is defined initially, a space is appended to avoid recursion but this did not happen when an alias was later modified. PR: bin/173418 Submitted by: Daniel F. MFC after: 1 week Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Thu Nov 8 13:06:44 2012 (r242765) +++ head/bin/sh/alias.c Thu Nov 8 13:33:48 2012 (r242766) @@ -68,7 +68,18 @@ setalias(const char *name, const char *v if (equal(name, ap->name)) { INTOFF; ckfree(ap->val); + /* See HACK below. */ +#ifdef notyet ap->val = savestr(val); +#else + { + size_t len = strlen(val); + ap->val = ckmalloc(len + 2); + memcpy(ap->val, val, len); + ap->val[len] = ' '; + ap->val[len+1] = '\0'; + } +#endif INTON; return; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:36:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8C7EDB4; Thu, 8 Nov 2012 13:36:19 +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 B48B88FC19; Thu, 8 Nov 2012 13:36:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DaJhI081510; Thu, 8 Nov 2012 13:36:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DaJ1D081507; Thu, 8 Nov 2012 13:36:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081336.qA8DaJ1D081507@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242767 - in head/tools/regression/bin/sh: builtins parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:36:20 -0000 Author: jilles Date: Thu Nov 8 13:36:19 2012 New Revision: 242767 URL: http://svnweb.freebsd.org/changeset/base/242767 Log: sh: Add tests for modifying an alias (r242766). Note: parser/alias10.0 will eat a lot of memory/cpu time when it fails (with the old sh). Added: head/tools/regression/bin/sh/builtins/alias3.0 (contents, props changed) head/tools/regression/bin/sh/builtins/alias3.0.stdout (contents, props changed) head/tools/regression/bin/sh/parser/alias10.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/alias3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/alias3.0 Thu Nov 8 13:36:19 2012 (r242767) @@ -0,0 +1,12 @@ +# $FreeBSD$ +set -e + +unalias -a +alias foo=bar +alias bar= +alias quux="1 2 3" +alias foo=bar +alias bar= +alias quux="1 2 3" +alias +alias foo Added: head/tools/regression/bin/sh/builtins/alias3.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/alias3.0.stdout Thu Nov 8 13:36:19 2012 (r242767) @@ -0,0 +1,4 @@ +bar='' +foo=bar +quux='1 2 3' +foo=bar Added: head/tools/regression/bin/sh/parser/alias10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias10.0 Thu Nov 8 13:36:19 2012 (r242767) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +alias echo='echo' +alias echo='echo' +[ "`eval echo b`" = b ] From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:40:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C27FE2A1; Thu, 8 Nov 2012 13:40:46 +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 A72718FC0C; Thu, 8 Nov 2012 13:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DekjC082301; Thu, 8 Nov 2012 13:40:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DekYp082300; Thu, 8 Nov 2012 13:40:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081340.qA8DekYp082300@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242768 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:40:46 -0000 Author: jilles Date: Thu Nov 8 13:40:46 2012 New Revision: 242768 URL: http://svnweb.freebsd.org/changeset/base/242768 Log: MFC r242429: fcntl(2): Fix typos in name of constant "F_DUP2FD_CLOEXEC". Modified: stable/9/lib/libc/sys/fcntl.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/fcntl.2 ============================================================================== --- stable/9/lib/libc/sys/fcntl.2 Thu Nov 8 13:36:19 2012 (r242767) +++ stable/9/lib/libc/sys/fcntl.2 Thu Nov 8 13:40:46 2012 (r242768) @@ -94,7 +94,7 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed -.It Dv F_DU2PFD_CLOEXEC +.It Dv F_DUP2FD_CLOEXEC Like .Dv F_DUP2FD , but the @@ -104,7 +104,7 @@ flag associated with the new file descri The .Dv F_DUP2FD and -.Dv F_DUP2DF_CLOEXEC +.Dv F_DUP2FD_CLOEXEC constants are not portable, so they should not be used if portability is needed. Use From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:43:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A224F68A; Thu, 8 Nov 2012 13:43:20 +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 868EC8FC14; Thu, 8 Nov 2012 13:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DhKiL083196; Thu, 8 Nov 2012 13:43:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DhKZW083195; Thu, 8 Nov 2012 13:43:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081343.qA8DhKZW083195@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242770 - stable/8/lib/libc/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:43:20 -0000 Author: jilles Date: Thu Nov 8 13:43:20 2012 New Revision: 242770 URL: http://svnweb.freebsd.org/changeset/base/242770 Log: MFC r242429: fcntl(2): Fix typos in name of constant "F_DUP2FD_CLOEXEC". Modified: stable/8/lib/libc/sys/fcntl.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Thu Nov 8 13:41:42 2012 (r242769) +++ stable/8/lib/libc/sys/fcntl.2 Thu Nov 8 13:43:20 2012 (r242770) @@ -94,7 +94,7 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed -.It Dv F_DU2PFD_CLOEXEC +.It Dv F_DUP2FD_CLOEXEC Like .Dv F_DUP2FD , but the @@ -104,7 +104,7 @@ flag associated with the new file descri The .Dv F_DUP2FD and -.Dv F_DUP2DF_CLOEXEC +.Dv F_DUP2FD_CLOEXEC constants are not portable, so they should not be used if portability is needed. Use From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:47:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 963F09E8; Thu, 8 Nov 2012 13:47:32 +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 77FC18FC0A; Thu, 8 Nov 2012 13:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DlWUC083955; Thu, 8 Nov 2012 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DlWLq083954; Thu, 8 Nov 2012 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081347.qA8DlWLq083954@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242771 - stable/9/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:47:32 -0000 Author: jilles Date: Thu Nov 8 13:47:32 2012 New Revision: 242771 URL: http://svnweb.freebsd.org/changeset/base/242771 Log: MFC r242460: fopen(3): Mention that the "x" mode option is from C11. Modified: stable/9/lib/libc/stdio/fopen.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/fopen.3 ============================================================================== --- stable/9/lib/libc/stdio/fopen.3 Thu Nov 8 13:43:20 2012 (r242770) +++ stable/9/lib/libc/stdio/fopen.3 Thu Nov 8 13:47:32 2012 (r242771) @@ -267,7 +267,11 @@ and .Fn freopen functions conform to -.St -isoC . +.St -isoC , +with the exception of the +.Dq Li x +mode option which conforms to +.St -isoC-2011 . The .Fn fdopen function From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:50:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D48DD0D; Thu, 8 Nov 2012 13:50:33 +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 7FAE78FC08; Thu, 8 Nov 2012 13:50:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8DoXkS084564; Thu, 8 Nov 2012 13:50:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8DoX7P084563; Thu, 8 Nov 2012 13:50:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211081350.qA8DoX7P084563@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 8 Nov 2012 13:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242773 - stable/8/lib/libc/stdio X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:50:33 -0000 Author: jilles Date: Thu Nov 8 13:50:33 2012 New Revision: 242773 URL: http://svnweb.freebsd.org/changeset/base/242773 Log: MFC r242460: fopen(3): Mention that the "x" mode option is from C11. Modified: stable/8/lib/libc/stdio/fopen.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/fopen.3 ============================================================================== --- stable/8/lib/libc/stdio/fopen.3 Thu Nov 8 13:49:20 2012 (r242772) +++ stable/8/lib/libc/stdio/fopen.3 Thu Nov 8 13:50:33 2012 (r242773) @@ -267,7 +267,11 @@ and .Fn freopen functions conform to -.St -isoC . +.St -isoC , +with the exception of the +.Dq Li x +mode option which conforms to +.St -isoC-2011 . The .Fn fdopen function From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 13:50:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3336E6C; Thu, 8 Nov 2012 13:50:51 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 54ABA8FC12; Thu, 8 Nov 2012 13:50:50 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id qA8DomuF076623; Thu, 8 Nov 2012 14:50:48 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id qA8DomhL076622; Thu, 8 Nov 2012 14:50:48 +0100 (CET) (envelope-from marius) Date: Thu, 8 Nov 2012 14:50:48 +0100 From: Marius Strobl To: Bruce Evans Subject: Re: svn commit: r242747 - head/sys/kern Message-ID: <20121108135048.GQ80490@alchemy.franken.de> References: <201211080810.qA88AW8Y027373@svn.freebsd.org> <20121108205636.O3941@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121108205636.O3941@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 13:50:52 -0000 On Thu, Nov 08, 2012 at 09:41:29PM +1100, Bruce Evans wrote: > On Thu, 8 Nov 2012, Marius Strobl wrote: > > >Log: > > Make r242655 build on sparc64. While at it, make > > vm_{max,min}_kernel_address > > vm_offset_t as they should be. > > Er, they shouldn't be vm_offset_t. > > >Modified: head/sys/kern/kern_malloc.c > >============================================================================== > >--- head/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) > >+++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) > >@@ -186,11 +186,13 @@ struct { > > */ > >static uma_zone_t mt_zone; > > > >-static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > >+static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > >SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > > &vm_min_kernel_address, 0, "Min kernel address"); > > SYSCTL_ULONG takes a u_long, not a vm_offset_t. A cast in > SYSCTL_ULONG() prevents possible detection of the type mismatch from > this. > > This is most broken on i386's with correctly-sized longs (or almost > any arch with correctly-sized longs). There, vm_offset_t is 1 > register wide and longs are 2 registers wide. Eh, FreeBSD/i386 is ILP32, so longs are 32-bit there, as is its __vm_offset_t. > > The bugs could be moved using SYSCTL_QUAD(). Correctly-sized quads > would be 4 registers wide, except quad has come to mean just a bad > way of spelling long long or int64_t. > > >-static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > >+#ifndef __sparc64__ > >+static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > >+#endif > >SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > > &vm_max_kernel_address, 0, "Max kernel address"); > > Since the value is a compile-time constant, u_long has a chance of > holding its value even if u_long != vm_offset_t, and the old code is > closer to being correct than first appeared, and the correct fix is > relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX() > (*). Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus > SYSCTL_UQUAD() does exist. Right, SYSCTL_UINTMAX() unfortunately doesn't exist. SYSCTL_UQUAD() seemed inappropriate as it is 64-bit and we want 32-bit for ILP32 for an exact match. Using uintmax_t with SYSCTL_UQUAD() also just happens to be of the same width. >From the available combinations, using vm_offset_t with SYSCTL_ULONG() just seemed to suck the least. > > (*) Except a temporary variable is just a style bug in the above and > for this. SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature > of supporting either a variable or a constant arg. The above should > use a constant arg and not need a variable. IIRC, the syntax for this is: > > SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > NULL, VM_MAX_KERNEL_ADDRESS, "Max kernel address"); Actually, for sparc64 VM_MAX_KERNEL_ADDRESS isn't constant (and can't be). > > subr_param.c is careful to use only basic types for all of its variables > so that standard sysctls apply. > > Tunables have even more bugs in this area: at least at the input level > kern_environment.c: > - bogus quads are supported, but bogus uquads aren't > - everything goes through getenv_quad(), which uses strtoq(), which is > for signed values, so unsigned values are mishandled in various ways > - worst sign bugs are on 64-bit arches. getenv_ulong() uses getenv_quad(), > with blind casts and no overflow checking, so 64-bit values are silently > truncated to QUAD_MAX (63 bits). Before that, getenv_quad() has overflow > checking in its strtoq() call, but none in its multiplication, and the > API is broken (strtoq(3) indicatates errors in errno, but there is no > errno in the kernel). > > The bugs in tunables mean that sysctls that report read-only tunables > can safely use SYSCTL_QUAD(). > > This is hard to fix cleanly without combinatorial explosion in the number > of types, giving uglyness in the implementation. It is probably best to > have single SYSCTL_INT() that operates on all integral types (signed > and unsigned) according to its the arg type. E.g.: > > static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > &vm_min_kernel_address, 0, "Min kernel address"); > > This should expand to an uncast &vm_min_kernel_address, with auxilary > data for the size and sign of that. sysctl_handle_int() should operate > atomically on all integer sizes according to the size and sign info. > Some SYSCTL_FOO()'s already generate size info or take a size arg, but > sysctl_handle_int() only supports plain int and is abused to support > u_int and is sometimes misused on sysctl data that has a size. > > After fixing the style bug: > > SYSCTL_INT(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > NULL, VM_MIN_KERNEL_ADDRESS, "Min kernel address"); > > The constant can have any integral type, and a the sysctl must generate > size and sign info for it too. > > The API can probably be simplified to reduce the 2 parameters to 1. > Hopefully __builtin_constant_p() can be used to decide which case applies. > Marius From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 14:05:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C6917E9; Thu, 8 Nov 2012 14:05:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF008FC12; Thu, 8 Nov 2012 14:05:02 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id BD7EC216849; Thu, 8 Nov 2012 15:58:48 +0200 (EET) Date: Thu, 8 Nov 2012 15:58:48 +0200 From: Jaakko Heinonen To: Greg Lehey Subject: Re: svn commit: r242725 - head/bin/ls Message-ID: <20121108135848.GA96746@jh> References: <201211080024.qA80OQU2038483@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211080024.qA80OQU2038483@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 14:05:03 -0000 On 2012-11-08, Greg Lehey wrote: > New Revision: 242725 > - return (strcoll(a->fts_name, b->fts_name)); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > + return (strcoll(a->fts_name, b->fts_name)); Please use tabs instead of spaces in indentations. Similarly in r242722. This patch should fix some whitespace problems: %%% Index: bin/ls/ls.c =================================================================== --- bin/ls/ls.c (revision 242746) +++ bin/ls/ls.c (working copy) @@ -185,7 +185,7 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; - while ((ch = getopt(argc, argv, + while ((ch = getopt(argc, argv, "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* @@ -241,7 +241,7 @@ main(int argc, char *argv[]) f_timesort = 1; f_sizesort = 0; break; - /* Other flags. Please keep alphabetic. */ + /* Other flags. Please keep alphabetic. */ case ',': f_thousands = 1; break; @@ -250,10 +250,10 @@ main(int argc, char *argv[]) f_octal = 1; f_octal_escape = 0; break; - case 'D': - f_timeformat = optarg; - break; - case 'F': + case 'D': + f_timeformat = optarg; + break; + case 'F': f_type = 1; f_slash = 0; break; @@ -861,7 +861,7 @@ label_out: d.s_size = sizelen; d.s_user = maxuser; } - if (f_thousands) /* make space for commas */ + if (f_thousands) /* make space for commas */ d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; Index: bin/ls/cmp.c =================================================================== --- bin/ls/cmp.c (revision 242746) +++ bin/ls/cmp.c (working copy) @@ -78,9 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -107,9 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -136,9 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * if (b->fts_statp->st_birthtim.tv_nsec < a->fts_statp->st_birthtim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -165,9 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } %%% -- Jaakko From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 14:07:19 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 309DC9B8; Thu, 8 Nov 2012 14:07:19 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [178.238.39.38]) by mx1.freebsd.org (Postfix) with ESMTP id DE2E38FC15; Thu, 8 Nov 2012 14:07:18 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 99E971CC579C; Thu, 8 Nov 2012 15:07:11 +0100 (CET) Date: Thu, 8 Nov 2012 15:07:11 +0100 From: Roman Divacky To: Bruce Evans Subject: Re: svn commit: r242715 - head/sys/conf Message-ID: <20121108140711.GA7213@freebsd.org> References: <201211072215.qA7MFSYX017265@svn.freebsd.org> <509AE28E.4020908@FreeBSD.org> <20121108151338.G2278@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121108151338.G2278@besplex.bde.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, Dimitry Andric , Jung-uk Kim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 14:07:19 -0000 > - clang fails to optimize division by (integer) 2 into multiplication > by (floating point with the correct type) 0.5 in the case of long > doubles on one supported arch (i386 IIRC). Both compilers optimize > all other cases, including floats and doubles on all arches. clang > with -ffast-math optimizes the broken case, but -ffast-math is > generally unsafe and not even fast; it shouldn't be necessary for > this, since this is one of the few floating point strength reductions > that is always safe. This detail is not documented for either clang > or gcc. clang doesn't even document the existence of -ffast-math in > its man page. > > Several uncommitted libm functions use the spelling of (integer) 2 > to avoid ifdefs and/or different code to get the type right for 0.5. > The result is that the case of long doubles on i386 is pessimized. > clang has many other efficiency and ABI problems on i386, including > the next one. This just got fixed upstream http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121105/155388.html We will get it with the next import of llvm/clang. Thank you! Roman From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 15:05:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9399DC5; Thu, 8 Nov 2012 15:05:35 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C66798FC08; Thu, 8 Nov 2012 15:05:34 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so2771815lag.13 for ; Thu, 08 Nov 2012 07:05:33 -0800 (PST) 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:content-type; bh=6aItA4P6vvWHt/EAkwcTMi0KrFfF3XRRYPZ6pX68d6c=; b=VGbyLZxe4loA0hCBOfVMXD2HCWn4BBn8KQL318bUK9zIZQSeqQ6MDOsFg2BqLt4rqe pSDr/z5faXuKBF8GxWuZ3QKfNNtQW9Nc5urAPjo1+edQ+5remB1kWXwwAaouRowM/8SH hMkCh0CeL5L45UleO+a6MjOa64kGK/EL4yYDofexTz337F+radMNMtqBz8ybs21HHAMy IYMTbVxgevPdhKO8AxCKqQEWBo6/sPy8A2crD716kmCaZEL3DWiSlfbsaOSBJKu23d5v MRbfmK1z0zJbW1JrGlY+FE/uL35WLP3ZV5zki/5YhUJdKbW7RbHpqUE7cz9/zn0xcERl oxjQ== MIME-Version: 1.0 Received: by 10.152.105.103 with SMTP id gl7mr7757969lab.10.1352387132822; Thu, 08 Nov 2012 07:05:32 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 8 Nov 2012 07:05:32 -0800 (PST) In-Reply-To: <201211080032.qA80Wo6Z039813@svn.freebsd.org> References: <201211080032.qA80Wo6Z039813@svn.freebsd.org> Date: Thu, 8 Nov 2012 15:05:32 +0000 X-Google-Sender-Auth: 921VR6oheu3Ijd8BoB5Daxy5aQg Message-ID: Subject: Re: svn commit: r242727 - head/sys/fs/fuse From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 15:05:36 -0000 On 11/8/12, Attilio Rao wrote: > Author: attilio > Date: Thu Nov 8 00:32:49 2012 > New Revision: 242727 > URL: http://svnweb.freebsd.org/changeset/base/242727 > > Log: > - Current caching mode is completely broken because it simply relies > on timing of the operations and not real lookup, bringing too many > false positives. Remove the whole mechanism. If it needs to be > implemented, next time it should really be done in the proper way. > - Fix VOP_GETATTR() in order to cope with userland bugs that would > change the type of file and not panic. Instead it gets the entry as > if it is not existing. > > Reported and tested by: flo Urgh, forgot to report: Reported and helped to find by: "Alex" Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:04:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEB46288; Thu, 8 Nov 2012 16:04:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93BC78FC0A; Thu, 8 Nov 2012 16:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8G4W8s006875; Thu, 8 Nov 2012 16:04:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8G4WV5006871; Thu, 8 Nov 2012 16:04:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081604.qA8G4WV5006871@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242774 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:04:32 -0000 Author: hselasky Date: Thu Nov 8 16:04:32 2012 New Revision: 242774 URL: http://svnweb.freebsd.org/changeset/base/242774 Log: MFC r238551 and r239617: Add support for Intel Panther/Lynx Point XHCI port routing. Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c stable/9/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:04:32 2012 (r242774) @@ -84,14 +84,17 @@ __FBSDID("$FreeBSD$"); ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int xhcidebug = 0; +static int xhcidebug; +static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); - +TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif #define XHCI_INTR_ENDPT 1 @@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, } #endif +uint32_t +xhci_get_port_route(void) +{ +#ifdef USB_DEBUG + return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); +#else + return (0xFFFFFFFFU); +#endif +} + static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci.h Thu Nov 8 16:04:32 2012 (r242774) @@ -490,6 +490,7 @@ struct xhci_softc { /* prototypes */ +uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Nov 8 16:04:32 2012 (r242774) @@ -101,6 +101,8 @@ xhci_pci_match(device_t self) case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); + case 0x8c318086: + return ("Intel Lynx Point USB 3.0 controller"); default: break; @@ -245,6 +247,7 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); + uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -285,5 +288,13 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } + + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + if (device_id == 0x1e318086 /* Panther Point */ || + device_id == 0x8c318086 /* Lynx Point */) { + uint32_t temp = xhci_get_port_route(); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + } return (0); } Modified: stable/9/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhcireg.h Thu Nov 8 13:50:33 2012 (r242773) +++ stable/9/sys/dev/usb/controller/xhcireg.h Thu Nov 8 16:04:32 2012 (r242774) @@ -34,6 +34,9 @@ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ +#define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ +#define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ + /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ #define XHCI_RESERVED 0x01 /* Reserved */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:13:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09531665; Thu, 8 Nov 2012 16:13:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF3628FC12; Thu, 8 Nov 2012 16:13:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GDq4n008462; Thu, 8 Nov 2012 16:13:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GDqM0008439; Thu, 8 Nov 2012 16:13:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081613.qA8GDqM0008439@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242775 - in stable/9/sys/dev/usb: . controller input serial storage wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:13:53 -0000 Author: hselasky Date: Thu Nov 8 16:13:51 2012 New Revision: 242775 URL: http://svnweb.freebsd.org/changeset/base/242775 Log: MFC r240750, r241987 and r242126: Add missing CTLFLAG_TUN flag to tunable sysctls in the USB stack. Adjust timing parameters of FULL/LOW/HIGH speed USB enumeration and make these timing parameters tunable. This patch will fix enumeration with some USB devices. Fix a typo. Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/ohci.c stable/9/sys/dev/usb/controller/uhci.c stable/9/sys/dev/usb/controller/usb_controller.c stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/input/ukbd.c stable/9/sys/dev/usb/serial/usb_serial.c stable/9/sys/dev/usb/storage/umass.c stable/9/sys/dev/usb/usb.h stable/9/sys/dev/usb/usb_debug.c stable/9/sys/dev/usb/usb_debug.h stable/9/sys/dev/usb/usb_dev.c stable/9/sys/dev/usb/usb_device.c stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/dev/usb/usb_process.c stable/9/sys/dev/usb/usb_request.c stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_urtw.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -95,20 +95,20 @@ static int ehciiaadbug = 0; static int ehcilostintrbug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ehcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, - &ehcinohighspeed, 0, "Disable High Speed USB"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW, - &ehciiaadbug, 0, "Enable doorbell bug workaround"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW, - &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); - TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN, + &ehcinohighspeed, 0, "Disable High Speed USB"); TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehciiaadbug, 0, "Enable doorbell bug workaround"); TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug); + static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); @@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude /* Wait for reset to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); /* Terminate reset sequence. */ if (!(sc->sc_flags & EHCI_SCFLG_NORESTERM)) Modified: stable/9/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ohci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/ohci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -81,9 +81,8 @@ __FBSDID("$FreeBSD$"); static int ohcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); -SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ohcidebug, 0, "ohci debug level"); - TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); static void ohci_dumpregs(ohci_softc_t *); @@ -2344,7 +2343,7 @@ ohci_roothub_exec(struct usb_device *ude for (v = 0;; v++) { if (v < 12) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); if ((OREAD4(sc, port) & UPS_RESET) == 0) { break; Modified: stable/9/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uhci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/uhci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -86,12 +86,11 @@ static int uhcidebug = 0; static int uhcinoloop = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhcidebug, 0, "uhci debug level"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, - &uhcinoloop, 0, "uhci noloop"); - TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, + &uhcinoloop, 0, "uhci noloop"); TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); static void uhci_dumpregs(uhci_softc_t *sc); @@ -2393,7 +2392,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ UWRITE2(sc, port, x | UHCI_PORTSC_PR); usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", index, UREAD2(sc, port)); @@ -2421,7 +2420,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ for (lim = 0; lim < 12; lim++) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_reset_delay)); x = UREAD2(sc, port); Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/usb_controller.c Thu Nov 8 16:13:51 2012 (r242775) @@ -86,7 +86,7 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug static int usb_no_boot_wait = 0; TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RD|CTLFLAG_TUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); static int usb_no_suspend_wait = 0; Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Nov 8 16:13:51 2012 (r242775) @@ -88,12 +88,11 @@ static int xhcidebug; static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); - TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/input/ukbd.c Thu Nov 8 16:13:51 2012 (r242775) @@ -94,12 +94,11 @@ static int ukbd_debug = 0; static int ukbd_no_leds = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_debug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, - &ukbd_no_leds, 0, "Disables setting of keyboard leds"); - TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW | CTLFLAG_TUN, + &ukbd_no_leds, 0, "Disables setting of keyboard leds"); TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif Modified: stable/9/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/9/sys/dev/usb/serial/usb_serial.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/serial/usb_serial.c Thu Nov 8 16:13:51 2012 (r242775) @@ -127,13 +127,13 @@ static int ucom_cons_baud = 9600; static struct ucom_softc *ucom_cons_softc = NULL; TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_unit, 0, "console unit number"); TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_subunit, 0, "console subunit number"); TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_baud, 0, "console baud rate"); static usb_proc_callback_t ucom_cfg_start_transfers; Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/storage/umass.c Thu Nov 8 16:13:51 2012 (r242775) @@ -166,9 +166,8 @@ __FBSDID("$FreeBSD$"); static int umass_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); -SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &umass_debug, 0, "umass debug level"); - TUNABLE_INT("hw.usb.umass.debug", &umass_debug); #else #define DIF(...) do { } while (0) Modified: stable/9/sys/dev/usb/usb.h ============================================================================== --- stable/9/sys/dev/usb/usb.h Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb.h Thu Nov 8 16:13:51 2012 (r242775) @@ -93,31 +93,29 @@ MALLOC_DECLARE(M_USBHC); #define USB_POWER_MODE_SUSPEND 3 /* force suspend */ #define USB_POWER_MODE_RESUME 4 /* force resume */ -#if 0 /* These are the values from the USB specification. */ -#define USB_PORT_RESET_DELAY 10 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 50 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ -#define USB_PORT_POWERUP_DELAY 100 /* ms */ -#define USB_PORT_RESUME_DELAY 20 /* ms */ -#define USB_SET_ADDRESS_SETTLE 2 /* ms */ -#define USB_RESUME_DELAY (20*5) /* ms */ -#define USB_RESUME_WAIT 10 /* ms */ -#define USB_RESUME_RECOVERY 10 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 0 /* ms */ -#else +#define USB_PORT_RESET_DELAY_SPEC 10 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY_SPEC 50 /* ms */ +#define USB_PORT_RESET_RECOVERY_SPEC 10 /* ms */ +#define USB_PORT_POWERUP_DELAY_SPEC 100 /* ms */ +#define USB_PORT_RESUME_DELAY_SPEC 20 /* ms */ +#define USB_SET_ADDRESS_SETTLE_SPEC 2 /* ms */ +#define USB_RESUME_DELAY_SPEC (20*5) /* ms */ +#define USB_RESUME_WAIT_SPEC 10 /* ms */ +#define USB_RESUME_RECOVERY_SPEC 10 /* ms */ +#define USB_EXTRA_POWER_UP_TIME_SPEC 0 /* ms */ + /* Allow for marginal and non-conforming devices. */ -#define USB_PORT_RESET_DELAY 50 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ -#define USB_PORT_RESET_RECOVERY 250 /* ms */ -#define USB_PORT_POWERUP_DELAY 300 /* ms */ -#define USB_PORT_RESUME_DELAY (20*2) /* ms */ -#define USB_SET_ADDRESS_SETTLE 10 /* ms */ -#define USB_RESUME_DELAY (50*5) /* ms */ -#define USB_RESUME_WAIT 50 /* ms */ -#define USB_RESUME_RECOVERY 50 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ -#endif +#define USB_PORT_RESET_DELAY 50 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ +#define USB_PORT_RESET_RECOVERY 250 /* ms */ +#define USB_PORT_POWERUP_DELAY 300 /* ms */ +#define USB_PORT_RESUME_DELAY (20*2) /* ms */ +#define USB_SET_ADDRESS_SETTLE 10 /* ms */ +#define USB_RESUME_DELAY (50*5) /* ms */ +#define USB_RESUME_WAIT 50 /* ms */ +#define USB_RESUME_RECOVERY 50 /* ms */ +#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ #define USB_MIN_POWER 100 /* mA */ #define USB_MAX_POWER 500 /* mA */ Modified: stable/9/sys/dev/usb/usb_debug.c ============================================================================== --- stable/9/sys/dev/usb/usb_debug.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_debug.c Thu Nov 8 16:13:51 2012 (r242775) @@ -63,11 +63,59 @@ int usb_debug = 0; SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_RW, 0, "USB debugging"); -SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.debug", &usb_debug); +#ifdef USB_DEBUG +/* + * Sysctls to modify timings/delays + */ +static SYSCTL_NODE(_hw_usb, OID_AUTO, timings, CTLFLAG_RW, 0, "Timings"); +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS); + +TUNABLE_INT("hw.usb.timings.port_reset_delay", (int *)&usb_port_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_delay, sizeof(usb_port_reset_delay), + usb_timings_sysctl_handler, "IU", "Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_root_reset_delay", (int *)&usb_port_root_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_root_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_root_reset_delay, sizeof(usb_port_root_reset_delay), + usb_timings_sysctl_handler, "IU", "Root Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_reset_recovery", (int *)&usb_port_reset_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_recovery, sizeof(usb_port_reset_recovery), + usb_timings_sysctl_handler, "IU", "Port Reset Recovery"); +TUNABLE_INT("hw.usb.timings.port_powerup_delay", (int *)&usb_port_powerup_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_powerup_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_powerup_delay, sizeof(usb_port_powerup_delay), + usb_timings_sysctl_handler, "IU", "Port PowerUp Delay"); +TUNABLE_INT("hw.usb.timings.port_resume_delay", (int *)&usb_port_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_resume_delay, sizeof(usb_port_resume_delay), + usb_timings_sysctl_handler, "IU", "Port Resume Delay"); +TUNABLE_INT("hw.usb.timings.set_address_settle", (int *)&usb_set_address_settle); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, set_address_settle, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_set_address_settle, sizeof(usb_set_address_settle), + usb_timings_sysctl_handler, "IU", "Set Address Settle"); +TUNABLE_INT("hw.usb.timings.resume_delay", (int *)&usb_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_delay, sizeof(usb_resume_delay), + usb_timings_sysctl_handler, "IU", "Resume Delay"); +TUNABLE_INT("hw.usb.timings.resume_wait", (int *)&usb_resume_wait); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_wait, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_wait, sizeof(usb_resume_wait), + usb_timings_sysctl_handler, "IU", "Resume Wait"); +TUNABLE_INT("hw.usb.timings.resume_recovery", (int *)&usb_resume_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_recovery, sizeof(usb_resume_recovery), + usb_timings_sysctl_handler, "IU", "Resume Recovery"); +TUNABLE_INT("hw.usb.timings.extra_power_up_time", (int *)&usb_extra_power_up_time); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_extra_power_up_time, sizeof(usb_extra_power_up_time), + usb_timings_sysctl_handler, "IU", "Extra PowerUp Time"); +#endif + /*------------------------------------------------------------------------* * usb_dump_iface * @@ -174,3 +222,87 @@ usb_dump_xfer(struct usb_xfer *xfer) xfer->endpoint->edesc->bEndpointAddress, xfer->endpoint->edesc->bmAttributes); } + +#ifdef USB_DEBUG +unsigned int usb_port_reset_delay = USB_PORT_RESET_DELAY; +unsigned int usb_port_root_reset_delay = USB_PORT_ROOT_RESET_DELAY; +unsigned int usb_port_reset_recovery = USB_PORT_RESET_RECOVERY; +unsigned int usb_port_powerup_delay = USB_PORT_POWERUP_DELAY; +unsigned int usb_port_resume_delay = USB_PORT_RESUME_DELAY; +unsigned int usb_set_address_settle = USB_SET_ADDRESS_SETTLE; +unsigned int usb_resume_delay = USB_RESUME_DELAY; +unsigned int usb_resume_wait = USB_RESUME_WAIT; +unsigned int usb_resume_recovery = USB_RESUME_RECOVERY; +unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME; + +/*------------------------------------------------------------------------* + * usb_timings_sysctl_handler + * + * This function updates timings variables, adjusting them where necessary. + *------------------------------------------------------------------------*/ +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + int error = 0; + unsigned int val; + + /* + * Attempt to get a coherent snapshot by making a copy of the data. + */ + if (arg1) + val = *(unsigned int *)arg1; + else + val = arg2; + error = SYSCTL_OUT(req, &val, sizeof(int)); + if (error || !req->newptr) + return (error); + + if (!arg1) + return EPERM; + + error = SYSCTL_IN(req, &val, sizeof(unsigned int)); + if (error) + return (error); + + /* + * Now make sure the values are decent, and certainly no lower than + * what the USB spec prescribes. + */ + unsigned int *p = (unsigned int *)arg1; + if (p == &usb_port_reset_delay) { + if (val < USB_PORT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_root_reset_delay) { + if (val < USB_PORT_ROOT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_reset_recovery) { + if (val < USB_PORT_RESET_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_port_powerup_delay) { + if (val < USB_PORT_POWERUP_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_resume_delay) { + if (val < USB_PORT_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_set_address_settle) { + if (val < USB_SET_ADDRESS_SETTLE_SPEC) + return (EINVAL); + } else if (p == &usb_resume_delay) { + if (val < USB_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_resume_wait) { + if (val < USB_RESUME_WAIT_SPEC) + return (EINVAL); + } else if (p == &usb_resume_recovery) { + if (val < USB_RESUME_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_extra_power_up_time) { + if (val < USB_EXTRA_POWER_UP_TIME_SPEC) + return (EINVAL); + } else { + /* noop */ + } + + *p = val; + return 0; +} +#endif Modified: stable/9/sys/dev/usb/usb_debug.h ============================================================================== --- stable/9/sys/dev/usb/usb_debug.h Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_debug.h Thu Nov 8 16:13:51 2012 (r242775) @@ -59,4 +59,28 @@ void usb_dump_queue(struct usb_endpoint void usb_dump_endpoint(struct usb_endpoint *ep); void usb_dump_xfer(struct usb_xfer *xfer); +#ifdef USB_DEBUG +extern unsigned int usb_port_reset_delay; +extern unsigned int usb_port_root_reset_delay; +extern unsigned int usb_port_reset_recovery; +extern unsigned int usb_port_powerup_delay; +extern unsigned int usb_port_resume_delay; +extern unsigned int usb_set_address_settle; +extern unsigned int usb_resume_delay; +extern unsigned int usb_resume_wait; +extern unsigned int usb_resume_recovery; +extern unsigned int usb_extra_power_up_time; +#else +#define usb_port_reset_delay USB_PORT_RESET_DELAY +#define usb_port_root_reset_delay USB_PORT_ROOT_RESET_DELAY +#define usb_port_reset_recovery USB_PORT_RESET_RECOVERY +#define usb_port_powerup_delay USB_PORT_POWERUP_DELAY +#define usb_port_resume_delay USB_PORT_RESUME_DELAY +#define usb_set_address_settle USB_SET_ADDRESS_SETTLE +#define usb_resume_delay USB_RESUME_DELAY +#define usb_resume_wait USB_RESUME_WAIT +#define usb_resume_recovery USB_RESUME_RECOVERY +#define usb_extra_power_up_time USB_EXTRA_POWER_UP_TIME +#endif + #endif /* _USB_DEBUG_H_ */ Modified: stable/9/sys/dev/usb/usb_dev.c ============================================================================== --- stable/9/sys/dev/usb/usb_dev.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_dev.c Thu Nov 8 16:13:51 2012 (r242775) @@ -82,9 +82,8 @@ static int usb_fifo_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); -SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_fifo_debug, 0, "Debug Level"); - TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_device.c Thu Nov 8 16:13:51 2012 (r242775) @@ -111,7 +111,7 @@ static void usb_cdev_free(struct usb_dev int usb_template = 0; TUNABLE_INT("hw.usb.usb_template", &usb_template); -SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, &usb_template, 0, "Selected USB device side template"); /* English is default language */ @@ -120,11 +120,11 @@ static int usb_lang_id = 0x0009; static int usb_lang_mask = 0x00FF; TUNABLE_INT("hw.usb.usb_lang_id", &usb_lang_id); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_id, 0, "Preferred USB language ID"); TUNABLE_INT("hw.usb.usb_lang_mask", &usb_lang_mask); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_mask, 0, "Preferred USB language mask"); static const char* statestr[USB_STATE_MAX] = { Modified: stable/9/sys/dev/usb/usb_generic.c ============================================================================== --- stable/9/sys/dev/usb/usb_generic.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_generic.c Thu Nov 8 16:13:51 2012 (r242775) @@ -127,9 +127,8 @@ struct usb_fifo_methods usb_ugen_methods static int ugen_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); -SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug, +SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ugen_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_hub.c Thu Nov 8 16:13:51 2012 (r242775) @@ -77,9 +77,8 @@ static int uhub_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); -SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, &uhub_debug, 0, +SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhub_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif @@ -415,7 +414,7 @@ repeat: /* wait for maximum device power up time */ usb_pause_mtx(NULL, - USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); + USB_MS_TO_TICKS(usb_port_powerup_delay)); /* reset port, which implies enabling it */ @@ -979,7 +978,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc20.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1024,7 +1023,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc30.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1053,7 +1052,7 @@ uhub_attach(device_t dev) /* default number of ports */ nports = 1; /* default power delay */ - pwrdly = ((10 * UHD_PWRON_FACTOR) + USB_EXTRA_POWER_UP_TIME); + pwrdly = ((10 * UHD_PWRON_FACTOR) + usb_extra_power_up_time); break; } if (nports == 0) { @@ -2261,7 +2260,7 @@ usb_dev_resume_peer(struct usb_device *u } /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -2414,7 +2413,7 @@ repeat: NULL, udev->port_no, UHF_PORT_SUSPEND); /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); } DPRINTF("Suspend was cancelled!\n"); return; Modified: stable/9/sys/dev/usb/usb_process.c ============================================================================== --- stable/9/sys/dev/usb/usb_process.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_process.c Thu Nov 8 16:13:51 2012 (r242775) @@ -82,9 +82,8 @@ static int usb_pcount; static int usb_proc_debug; SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); -SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW, &usb_proc_debug, 0, +SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_proc_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif Modified: stable/9/sys/dev/usb/usb_request.c ============================================================================== --- stable/9/sys/dev/usb/usb_request.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/usb_request.c Thu Nov 8 16:13:51 2012 (r242775) @@ -73,21 +73,13 @@ SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail &usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set"); #ifdef USB_DEBUG -static int usb_pr_poll_delay = USB_PORT_RESET_DELAY; -static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY; - -SYSCTL_INT(_hw_usb, OID_AUTO, pr_poll_delay, CTLFLAG_RW, - &usb_pr_poll_delay, 0, "USB port reset poll delay in ms"); -SYSCTL_INT(_hw_usb, OID_AUTO, pr_recovery_delay, CTLFLAG_RW, - &usb_pr_recovery_delay, 0, "USB port reset recovery delay in ms"); - #ifdef USB_REQ_DEBUG /* The following structures are used in connection to fault injection. */ struct usb_ctrl_debug { int bus_index; /* target bus */ int dev_index; /* target address */ int ds_fail; /* fail data stage */ - int ss_fail; /* fail data stage */ + int ss_fail; /* fail status stage */ int ds_delay; /* data stage delay in ms */ int ss_delay; /* status stage delay in ms */ int bmRequestType_value; @@ -788,12 +780,6 @@ usbd_req_reset_port(struct usb_device *u uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); /* clear any leftover port reset changes first */ @@ -808,29 +794,12 @@ usbd_req_reset_port(struct usb_device *u if (err) goto done; #ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } #endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -872,13 +841,8 @@ usbd_req_reset_port(struct usb_device *u err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d reset returning error=%s\n", @@ -909,12 +873,6 @@ usbd_req_warm_reset_port(struct usb_devi uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); err = usbd_req_get_port_status(udev, mtx, &ps, port); @@ -944,30 +902,11 @@ usbd_req_warm_reset_port(struct usb_devi if (err) goto done; -#ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } -#endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -1001,13 +940,8 @@ usbd_req_warm_reset_port(struct usb_devi err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d warm reset returning error=%s\n", @@ -1566,7 +1500,7 @@ usbd_req_set_address(struct usb_device * done: /* allow device time to set new address */ usb_pause_mtx(mtx, - USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); + USB_MS_TO_TICKS(usb_set_address_settle)); return (err); } Modified: stable/9/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uath.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_uath.c Thu Nov 8 16:13:51 2012 (r242775) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, uath, CTLFLAG_RW, 0, "USB Atheros"); static int uath_countrycode = CTRY_DEFAULT; /* country code */ -SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW, &uath_countrycode, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW | CTLFLAG_TUN, &uath_countrycode, 0, "country code"); TUNABLE_INT("hw.usb.uath.countrycode", &uath_countrycode); static int uath_regdomain = 0; /* regulatory domain */ @@ -123,7 +123,7 @@ SYSCTL_INT(_hw_usb_uath, OID_AUTO, regdo #ifdef UATH_DEBUG int uath_debug = 0; -SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW, &uath_debug, 0, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uath_debug, 0, "uath debug level"); TUNABLE_INT("hw.usb.uath.debug", &uath_debug); enum { Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Thu Nov 8 16:13:51 2012 (r242775) @@ -75,7 +75,7 @@ SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG #ifdef UPGT_DEBUG int upgt_debug = 0; -SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW, &upgt_debug, +SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &upgt_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.upgt.debug", &upgt_debug); enum { Modified: stable/9/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_urtw.c Thu Nov 8 16:04:32 2012 (r242774) +++ stable/9/sys/dev/usb/wlan/if_urtw.c Thu Nov 8 16:13:51 2012 (r242775) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); #ifdef URTW_DEBUG int urtw_debug = 0; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW, &urtw_debug, 0, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &urtw_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.usb.urtw.debug", &urtw_debug); enum { @@ -89,7 +89,7 @@ enum { } while (0) #endif static int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW | CTLFLAG_TUN, &urtw_preamble_mode, 0, "set the preable mode (long or short)"); TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:17:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B1E6822; Thu, 8 Nov 2012 16:17:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56CD48FC15; Thu, 8 Nov 2012 16:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GHrtN009242; Thu, 8 Nov 2012 16:17:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GHrmw009240; Thu, 8 Nov 2012 16:17:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081617.qA8GHrmw009240@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242776 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:17:53 -0000 Author: hselasky Date: Thu Nov 8 16:17:52 2012 New Revision: 242776 URL: http://svnweb.freebsd.org/changeset/base/242776 Log: MFC r242523: Allow using the embedded EHCI host controller in Freescale SoCs by adding the missing bits. See ehci_fsl.c for their use. Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/controller/ehci.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:13:51 2012 (r242775) +++ stable/9/sys/dev/usb/controller/ehci.c Thu Nov 8 16:17:52 2012 (r242776) @@ -332,14 +332,18 @@ ehci_init(ehci_softc_t *sc) sc->sc_noport = EHCI_HCS_N_PORTS(sparams); sc->sc_bus.usbrev = USB_REV_2_0; - /* Reset the controller */ - DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); - - err = ehci_hcreset(sc); - if (err) { - device_printf(sc->sc_bus.bdev, "reset timeout\n"); - return (err); + if (!(sc->sc_flags & EHCI_SCFLG_DONTRESET)) { + /* Reset the controller */ + DPRINTF("%s: resetting\n", + device_get_nameunit(sc->sc_bus.bdev)); + + err = ehci_hcreset(sc); + if (err) { + device_printf(sc->sc_bus.bdev, "reset timeout\n"); + return (err); + } } + /* * use current frame-list-size selection 0: 1024*4 bytes 1: 512*4 * bytes 2: 256*4 bytes 3: unknown Modified: stable/9/sys/dev/usb/controller/ehci.h ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.h Thu Nov 8 16:13:51 2012 (r242775) +++ stable/9/sys/dev/usb/controller/ehci.h Thu Nov 8 16:17:52 2012 (r242776) @@ -345,6 +345,8 @@ typedef struct ehci_softc { #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ +#define EHCI_SCFLG_DONTRESET 0x0100 /* don't reset ctrl. in ehci_init() */ +#define EHCI_SCFLG_DONEINIT 0x1000 /* ehci_init() has been called. */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:31:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 217D5DD4; Thu, 8 Nov 2012 16:31:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E09178FC0A; Thu, 8 Nov 2012 16:31:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8GVDvX011603; Thu, 8 Nov 2012 16:31:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8GVDlG011602; Thu, 8 Nov 2012 16:31:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211081631.qA8GVDlG011602@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Nov 2012 16:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242777 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:31:14 -0000 Author: hselasky Date: Thu Nov 8 16:31:13 2012 New Revision: 242777 URL: http://svnweb.freebsd.org/changeset/base/242777 Log: Make the USB ethernet methods constant again in if_udav.c, so that both adapter variants can be attached at the same time. MFC after: 0 days Modified: head/sys/dev/usb/net/if_udav.c Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Nov 8 16:17:52 2012 (r242776) +++ head/sys/dev/usb/net/if_udav.c Thu Nov 8 16:31:13 2012 (r242777) @@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); -static struct usb_ether_methods udav_ue_methods = { +static const struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, .ue_start = udav_start, .ue_init = udav_init, @@ -181,6 +181,15 @@ static struct usb_ether_methods udav_ue_ .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -264,17 +273,16 @@ udav_attach(device_t dev) * The JP1082 has an unusable PHY and provides no link information. */ if (sc->sc_flags & UDAV_FLAG_NO_PHY) { - udav_ue_methods.ue_tick = NULL; - udav_ue_methods.ue_mii_upd = NULL; - udav_ue_methods.ue_mii_sts = NULL; + ue->ue_methods = &udav_ue_methods_nophy; sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; } ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 16:45:26 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4F79484; Thu, 8 Nov 2012 16:45:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 4597A8FC17; Thu, 8 Nov 2012 16:45:25 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qA8GjFit010718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Nov 2012 03:45:17 +1100 Date: Fri, 9 Nov 2012 03:45:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl Subject: Re: svn commit: r242747 - head/sys/kern In-Reply-To: <20121108135048.GQ80490@alchemy.franken.de> Message-ID: <20121109031318.J5271@besplex.bde.org> References: <201211080810.qA88AW8Y027373@svn.freebsd.org> <20121108205636.O3941@besplex.bde.org> <20121108135048.GQ80490@alchemy.franken.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=XbrRV/F5 c=1 sm=1 a=cAvrdy-I9ikA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=iHG1Lti_3uZxotbvpi0A:9 a=CjuIK1q_8ugA:10 a=iVwYAFUoKUAkmquE:21 a=OdJ_o5Oy4Jxh3Fw4:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, Marius Strobl , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 16:45:26 -0000 On Thu, 8 Nov 2012, Marius Strobl wrote: > On Thu, Nov 08, 2012 at 09:41:29PM +1100, Bruce Evans wrote: >> On Thu, 8 Nov 2012, Marius Strobl wrote: >> >>> Log: >>> Make r242655 build on sparc64. While at it, make >>> vm_{max,min}_kernel_address >>> vm_offset_t as they should be. >> >> Er, they shouldn't be vm_offset_t. >> >>> Modified: head/sys/kern/kern_malloc.c >>> ============================================================================== >>> --- head/sys/kern/kern_malloc.c Thu Nov 8 04:02:36 2012 (r242746) >>> +++ head/sys/kern/kern_malloc.c Thu Nov 8 08:10:32 2012 (r242747) >>> @@ -186,11 +186,13 @@ struct { >>> */ >>> static uma_zone_t mt_zone; >>> >>> -static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; >>> +static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; >>> SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, >>> &vm_min_kernel_address, 0, "Min kernel address"); >> >> SYSCTL_ULONG takes a u_long, not a vm_offset_t. A cast in >> SYSCTL_ULONG() prevents possible detection of the type mismatch from >> this. >> >> This is most broken on i386's with correctly-sized longs (or almost >> any arch with correctly-sized longs). There, vm_offset_t is 1 >> register wide and longs are 2 registers wide. > > Eh, FreeBSD/i386 is ILP32, so longs are 32-bit there, as is its > __vm_offset_t. Yes, it has incorrectly sized longs. It used to have a _LARGE_LONG option to give 64-bit longs, and I used this to find and fix some type errors before there were any 64-bit arches (most things compiled and parts of userland ran). >> The bugs could be moved using SYSCTL_QUAD(). Correctly-sized quads >> would be 4 registers wide, except quad has come to mean just a bad >> way of spelling long long or int64_t. >> >>> -static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; >>> +#ifndef __sparc64__ >>> +static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; >>> +#endif >>> SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, >>> &vm_max_kernel_address, 0, "Max kernel address"); >> >> Since the value is a compile-time constant, u_long has a chance of >> holding its value even if u_long != vm_offset_t, and the old code is >> closer to being correct than first appeared, and the correct fix is >> relatively easy -- just use a uintmax_t vatiable and SYSCTL_UINTMAX() >> (*). Unfortunately SYSCT_UINTMAX() doesn't exist, and the bogus >> SYSCTL_UQUAD() does exist. > > Right, SYSCTL_UINTMAX() unfortunately doesn't exist. SYSCTL_UQUAD() > seemed inappropriate as it is 64-bit and we want 32-bit for ILP32 > for an exact match. Using uintmax_t with SYSCTL_UQUAD() also just > happens to be of the same width. > From the available combinations, using vm_offset_t with SYSCTL_ULONG() > just seemed to suck the least. This is backwards, since it u_long that the API supports, so to use the API it must be assumed that vm_offset_t can be punned to a u_long, not vice versa although the difference is only logical. On sparc64, as on most or all 64-bit arches, vm_offset_t is identical to u_long, so this doesn't even involve type puns. On i386's with incorrectly-sized longs (ILP32), there is a type pun from vm_offset_t = u_int to u_long. On i386's with correctly-sized longs (I32L64P32), there is a type mismatch. In this case, making the variable u_long to match the API works correctly (when the type error is not detected), since the top 32 bits are just always zero because the sysctl is r/o so no one can can change them from their initial zero values. The reverse dosen't work, since it reads 32 bits beyond the end of the variable, giving garbage results. The overrun would be a more harmful for a r/w sysctl. MD code mostly hard-codes assumptions that vm_offset_t is u_int or u_long for printing it -- it doesn't laboriously convert vm_offset_t to uintmax_t as is strictly necessary for printing all MI typedefs. This corresponds to punning vm_offset_t to u_long here, except the assumptions are much larger in MI code. >> (*) Except a temporary variable is just a style bug in the above and >> for this. SYSCTL_UNLONG(), like all integer SYSCTL()'s, has the feature >> of supporting either a variable or a constant arg. The above should >> use a constant arg and not need a variable. IIRC, the syntax for this is: >> >> SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, >> NULL, VM_MAX_KERNEL_ADDRESS, "Max kernel address"); > > Actually, for sparc64 VM_MAX_KERNEL_ADDRESS isn't constant (and can't > be). I didn't notice that when I replied before. The declaration would have to be ifdefed, as you did but with the correct type for the MI variable. The MD variable can't have the correct type for this since it needs to remain vm_offset_t to match other APIs. Also, the ifdefs are simpler if a variable (with the same name) is used for all cases. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 17:32:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44FDC804; Thu, 8 Nov 2012 17:32:56 +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 294378FC15; Thu, 8 Nov 2012 17:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8HWu8k021115; Thu, 8 Nov 2012 17:32:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8HWu2K021114; Thu, 8 Nov 2012 17:32:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211081732.qA8HWu2K021114@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 17:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242778 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 17:32:56 -0000 Author: adrian Date: Thu Nov 8 17:32:55 2012 New Revision: 242778 URL: http://svnweb.freebsd.org/changeset/base/242778 Log: Convert this to a debug printf; it's working fine now. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Thu Nov 8 16:31:13 2012 (r242777) +++ head/sys/dev/ath/if_ath_rx_edma.c Thu Nov 8 17:32:55 2012 (r242778) @@ -282,7 +282,7 @@ static void ath_edma_recv_flush(struct ath_softc *sc) { - device_printf(sc->sc_dev, "%s: called\n", __func__); + DPRINTF(sc, ATH_DEBUG_RECV, "%s: called\n", __func__); ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt++; From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 17:43:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33D89AA6; Thu, 8 Nov 2012 17:43:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1418B8FC12; Thu, 8 Nov 2012 17:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8HhwVZ025513; Thu, 8 Nov 2012 17:43:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8HhwvK025512; Thu, 8 Nov 2012 17:43:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211081743.qA8HhwvK025512@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 17:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242779 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 17:43:59 -0000 Author: adrian Date: Thu Nov 8 17:43:58 2012 New Revision: 242779 URL: http://svnweb.freebsd.org/changeset/base/242779 Log: Implement the ATH_RESET_NOLOSS path for TX stop and start; this is needed for 802.11n TX device restarting. Remove the debug printf()s; they're no longer needed here. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 17:32:55 2012 (r242778) +++ head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 17:43:58 2012 (r242779) @@ -130,6 +130,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_ATHDEV); +static void ath_edma_tx_processq(struct ath_softc *sc, int dosched); + static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { @@ -170,7 +172,7 @@ static void ath_edma_dma_restart(struct ath_softc *sc, struct ath_txq *txq) { - device_printf(sc->sc_dev, "%s: called: txq=%p, qnum=%d\n", + DPRINTF(sc, ATH_DEBUG_RESET, "%s: called: txq=%p, qnum=%d\n", __func__, txq, txq->axq_qnum); @@ -393,7 +395,7 @@ ath_edma_tx_drain(struct ath_softc *sc, struct ifnet *ifp = sc->sc_ifp; int i; - device_printf(sc->sc_dev, "%s: called\n", __func__); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); (void) ath_stoptxdma(sc); @@ -403,17 +405,19 @@ ath_edma_tx_drain(struct ath_softc *sc, * * Otherwise, just toss everything in each TX queue. */ + if (reset_type == ATH_RESET_NOLOSS) { + ath_edma_tx_processq(sc, 0); + } else { + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_draintxq(sc, &sc->sc_txq[i]); + } + } /* XXX dump out the TX completion FIFO contents */ /* XXX dump out the frames */ - /* XXX for now, just drain */ - for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { - if (ATH_TXQ_SETUP(sc, i)) - ath_tx_draintxq(sc, &sc->sc_txq[i]); - } - IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); @@ -421,12 +425,25 @@ ath_edma_tx_drain(struct ath_softc *sc, } /* - * Process the TX status queue. + * TX completion tasklet. */ + static void ath_edma_tx_proc(void *arg, int npending) { struct ath_softc *sc = (struct ath_softc *) arg; + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", + __func__, npending); + ath_edma_tx_processq(sc, 1); +} + +/* + * Process the TX status queue. + */ +static void +ath_edma_tx_processq(struct ath_softc *sc, int dosched) +{ struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; struct ath_tx_status ts; @@ -441,17 +458,14 @@ ath_edma_tx_proc(void *arg, int npending uint32_t txstatus[32]; #endif - DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", - __func__, npending); - for (idx = 0; ; idx++) { bzero(&ts, sizeof(ts)); ATH_TXSTATUS_LOCK(sc); - status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); #ifdef ATH_DEBUG ath_hal_gettxrawtxdesc(ah, txstatus); #endif + status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); ATH_TXSTATUS_UNLOCK(sc); #ifdef ATH_DEBUG @@ -594,7 +608,7 @@ ath_edma_tx_proc(void *arg, int npending * working. */ ATH_TXQ_LOCK(txq); - if (txq->axq_fifo_depth == 0) { + if (dosched && txq->axq_fifo_depth == 0) { ath_edma_tx_fifo_fill(sc, txq); } ATH_TXQ_UNLOCK(txq); @@ -614,7 +628,8 @@ ath_edma_tx_proc(void *arg, int npending * but there's no easy way right now to only populate * the txq task for _one_ TXQ. This should be fixed. */ - taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); + if (dosched) + taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); } static void From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 17:46:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D344EF3; Thu, 8 Nov 2012 17:46:27 +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 72FF08FC08; Thu, 8 Nov 2012 17:46:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8HkRVd029250; Thu, 8 Nov 2012 17:46:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8HkRTu029249; Thu, 8 Nov 2012 17:46:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211081746.qA8HkRTu029249@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 17:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242780 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 17:46:27 -0000 Author: adrian Date: Thu Nov 8 17:46:27 2012 New Revision: 242780 URL: http://svnweb.freebsd.org/changeset/base/242780 Log: Oops, fix bogus spacing. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 17:43:58 2012 (r242779) +++ head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 17:46:27 2012 (r242780) @@ -405,14 +405,14 @@ ath_edma_tx_drain(struct ath_softc *sc, * * Otherwise, just toss everything in each TX queue. */ - if (reset_type == ATH_RESET_NOLOSS) { - ath_edma_tx_processq(sc, 0); - } else { - for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { - if (ATH_TXQ_SETUP(sc, i)) - ath_tx_draintxq(sc, &sc->sc_txq[i]); - } - } + if (reset_type == ATH_RESET_NOLOSS) { + ath_edma_tx_processq(sc, 0); + } else { + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_draintxq(sc, &sc->sc_txq[i]); + } + } /* XXX dump out the TX completion FIFO contents */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 18:07:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B87E772; Thu, 8 Nov 2012 18:07:30 +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 30DC88FC16; Thu, 8 Nov 2012 18:07:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8I7UiU035510; Thu, 8 Nov 2012 18:07:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8I7UQs035508; Thu, 8 Nov 2012 18:07:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211081807.qA8I7UQs035508@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 18:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242781 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 18:07:30 -0000 Author: adrian Date: Thu Nov 8 18:07:29 2012 New Revision: 242781 URL: http://svnweb.freebsd.org/changeset/base/242781 Log: Add my initial cut at driver-layer ALQ support. I'm using this to debug EDMA TX and RX descriptors and it's really helpful to have a non-printf() way to decode frames. I won't link this into the build until I've tidied it up a little more. This will eventually be behind ATH_DEBUG_ALQ. Added: head/sys/dev/ath/if_ath_alq.c (contents, props changed) head/sys/dev/ath/if_ath_alq.h (contents, props changed) Added: head/sys/dev/ath/if_ath_alq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_alq.c Thu Nov 8 18:07:29 2012 (r242781) @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include "opt_ah.h" +#include "opt_ath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ATH_DEBUG_ALQ +static struct ale * +if_ath_alq_get(struct if_ath_alq *alq, int len) +{ + struct ale *ale; + + if (alq->sc_alq_isactive == 0) + return (NULL); + + ale = alq_getn(alq->sc_alq_alq, len, ALQ_NOWAIT); + if (! ale) + alq->sc_alq_numlost++; + return (ale); +} + +void +if_ath_alq_init(struct if_ath_alq *alq, const char *devname) +{ + + bzero(alq, sizeof(*alq)); + + strncpy(alq->sc_alq_devname, devname, ATH_ALQ_DEVNAME_LEN); + printf("%s (%s): detached\n", __func__, alq->sc_alq_devname); + snprintf(alq->sc_alq_filename, ATH_ALQ_FILENAME_LEN, + "/tmp/ath_%s_alq.log", alq->sc_alq_devname); + + /* XXX too conservative, right? */ + alq->sc_alq_qsize = (64*1024); +} + +void +if_ath_alq_tidyup(struct if_ath_alq *alq) +{ + + if_ath_alq_stop(alq); + printf("%s (%s): detached\n", __func__, alq->sc_alq_devname); + bzero(alq, sizeof(*alq)); +} + +int +if_ath_alq_start(struct if_ath_alq *alq) +{ + int error; + + if (alq->sc_alq_isactive) + return (0); + + /* + * Create a variable-length ALQ. + */ + error = alq_open(&alq->sc_alq_alq, alq->sc_alq_filename, + curthread->td_ucred, ALQ_DEFAULT_CMODE, + alq->sc_alq_qsize, 0); + + if (error != 0) { + printf("%s (%s): failed, err=%d\n", __func__, + alq->sc_alq_devname, error); + } else { + printf("%s (%s): opened\n", __func__, alq->sc_alq_devname); + alq->sc_alq_isactive = 1; + } + return (error); +} + +int +if_ath_alq_stop(struct if_ath_alq *alq) +{ + + if (alq->sc_alq_isactive == 0) + return (0); + + printf("%s (%s): closed\n", __func__, alq->sc_alq_devname); + + alq->sc_alq_isactive = 0; + alq_close(alq->sc_alq_alq); + alq->sc_alq_alq = NULL; + + return (0); +} + +/* + * Post a debug message to the ALQ. + * + * "len" is the size of the buf payload in bytes. + */ +void +if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len, + const char *buf) +{ + struct if_ath_alq_hdr *ap; + struct ale *ale; + + if (! if_ath_alq_checkdebug(alq, op)) + return; + + /* + * Enforce some semblence of sanity on 'len'. + * Although strictly speaking, any length is possible - + * just be conservative so things don't get out of hand. + */ + if (len > ATH_ALQ_PAYLOAD_LEN) + len = ATH_ALQ_PAYLOAD_LEN; + + ale = if_ath_alq_get(alq, len + sizeof(struct if_ath_alq_hdr)); + + if (ale == NULL) + return; + + ap = (struct if_ath_alq_hdr *) ale->ae_data; + ap->threadid = (uint64_t) curthread->td_tid; + ap->tstamp = (uint32_t) ticks; + ap->op = op; + ap->len = len; + + /* + * Copy the payload _after_ the header field. + */ + memcpy(((char *) ap) + sizeof(struct if_ath_alq_hdr), + buf, + ap->len); + + alq_post(alq->sc_alq_alq, ale); +} +#endif /* ATH_DEBUG */ Added: head/sys/dev/ath/if_ath_alq.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_alq.h Thu Nov 8 18:07:29 2012 (r242781) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_ALQ_H__ +#define __IF_ATH_ALQ_H__ + +#define ATH_ALQ_FILENAME_LEN 128 +#define ATH_ALQ_DEVNAME_LEN 32 + +struct if_ath_alq { + uint32_t sc_alq_debug; /* Debug flags to report */ + struct alq * sc_alq_alq; /* alq state */ + unsigned int sc_alq_qsize; /* queue size */ + unsigned int sc_alq_numlost; /* number of "lost" entries */ + int sc_alq_isactive; + char sc_alq_devname[ATH_ALQ_DEVNAME_LEN]; + char sc_alq_filename[ATH_ALQ_FILENAME_LEN]; +}; + +#define ATH_ALQ_EDMA_TXSTATUS 1 +#define ATH_ALQ_EDMA_RXSTATUS 2 +#define ATH_ALQ_EDMA_TXDESC 3 + +/* 128 bytes in total */ +#define ATH_ALQ_PAYLOAD_LEN 112 + +struct if_ath_alq_hdr { + uint64_t threadid; + uint32_t tstamp; + uint16_t op; + uint16_t len; /* Length of (optional) payload */ +}; + +struct if_ath_alq_payload { + struct if_ath_alq_hdr hdr; + char payload[]; +}; + +#ifdef _KERNEL +static inline int +if_ath_alq_checkdebug(struct if_ath_alq *alq, uint16_t op) +{ + + return (alq->sc_alq_debug & (1 << (op - 1))); +} + +extern void if_ath_alq_init(struct if_ath_alq *alq, const char *devname); +extern void if_ath_alq_tidyup(struct if_ath_alq *alq); +extern int if_ath_alq_start(struct if_ath_alq *alq); +extern int if_ath_alq_stop(struct if_ath_alq *alq); +extern void if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, + uint16_t len, const char *buf); +#endif /* _KERNEL */ + +#endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 18:11:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F582958; Thu, 8 Nov 2012 18:11:32 +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 E61EE8FC08; Thu, 8 Nov 2012 18:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8IBV9q036207; Thu, 8 Nov 2012 18:11:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8IBVlj036201; Thu, 8 Nov 2012 18:11:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211081811.qA8IBVlj036201@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 18:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242782 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 18:11:32 -0000 Author: adrian Date: Thu Nov 8 18:11:31 2012 New Revision: 242782 URL: http://svnweb.freebsd.org/changeset/base/242782 Log: Add some hooks into the driver to attach, detach and record EDMA descriptor events. This is primarily for the TX EDMA and TX EDMA completion. I haven't yet tied it into the EDMA RX path or the legacy TX/RX path. Things that I don't quite like: * Make the pointer type 'void' in ath_softc and have if_ath_alq*() return a malloc'ed buffer. That would remove the need to include if_ath_alq.h in if_athvar.h. * The sysctl setup needs to be cleaned up. Modified: head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_ath_rx.c Thu Nov 8 18:11:31 2012 (r242782) @@ -115,6 +115,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ATH_DEBUG_ALQ +#include +#endif + /* * Calculate the receive filter according to the * operating mode and state: Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_ath_rx_edma.c Thu Nov 8 18:11:31 2012 (r242782) @@ -117,6 +117,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef ATH_DEBUG_ALQ +#include +#endif + /* * some general macros */ @@ -357,7 +361,12 @@ ath_edma_recv_proc_queue(struct ath_soft #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RECV_DESC) ath_printrxbuf(sc, bf, 0, bf->bf_rxstatus == HAL_OK); -#endif +#endif /* ATH_DEBUG */ +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_RXSTATUS)) + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_RXSTATUS, + sc->sc_rx_statuslen, (char *) ds); +#endif /* ATH_DEBUG */ if (bf->bf_rxstatus == HAL_EINPROGRESS) break; Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Nov 8 18:11:31 2012 (r242782) @@ -501,6 +501,57 @@ ath_sysctl_forcebstuck(SYSCTL_HANDLER_AR return 0; } + +static int +ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int error, enable; + + enable = (sc->sc_alq.sc_alq_isactive); + + error = sysctl_handle_int(oidp, &enable, 0, req); + if (error || !req->newptr) + return (error); + else if (enable) + error = if_ath_alq_start(&sc->sc_alq); + else + error = if_ath_alq_stop(&sc->sc_alq); + return (error); +} + +#ifdef ATH_DEBUG +/* + * Attach the ALQ debugging if required. + */ +static void +ath_sysctl_alq_attach(struct ath_softc *sc) +{ + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "alq", CTLFLAG_RD, + NULL, "Atheros ALQ logging parameters"); + child = SYSCTL_CHILDREN(tree); + + SYSCTL_ADD_STRING(ctx, child, OID_AUTO, "filename", + CTLFLAG_RW, sc->sc_alq.sc_alq_filename, 0, "ALQ filename"); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "enable", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_alq_log, "I", ""); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debugmask", CTLFLAG_RW, &sc->sc_alq.sc_alq_debug, 0, + "ALQ debug mask"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "numlost", CTLFLAG_RW, &sc->sc_alq.sc_alq_numlost, 0, + "number lost"); +} +#endif + void ath_sysctlattach(struct ath_softc *sc) { @@ -655,6 +706,10 @@ ath_sysctlattach(struct ath_softc *sc) ath_sysctl_setcca, "I", "enable CCA control"); } #endif + +#ifdef ATH_DEBUG + ath_sysctl_alq_attach(sc); +#endif } static int Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_ath_tx.c Thu Nov 8 18:11:31 2012 (r242782) @@ -101,6 +101,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef ATH_DEBUG_ALQ +#include +#endif + /* * How many retries to perform in software */ Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_ath_tx_edma.c Thu Nov 8 18:11:31 2012 (r242782) @@ -117,6 +117,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef ATH_DEBUG_ALQ +#include +#endif + /* * some general macros */ @@ -132,6 +136,37 @@ MALLOC_DECLARE(M_ATHDEV); static void ath_edma_tx_processq(struct ath_softc *sc, int dosched); +#ifdef ATH_DEBUG_ALQ +static void +ath_edma_tx_alq_post(struct ath_softc *sc, struct ath_buf *bf_first) +{ + struct ath_buf *bf; + int i, n; + const char *ds; + + /* XXX we should skip out early if debugging isn't enabled! */ + bf = bf_first; + + while (bf != NULL) { + /* XXX assume nmaps = 4! */ + /* XXX should ensure bf_nseg > 0! */ + if (bf->bf_nseg == 0) + break; + n = ((bf->bf_nseg - 1) / 4) + 1; + for (i = 0, ds = (const char *) bf->bf_desc; + i < n; + i++, ds += sc->sc_tx_desclen) { + if_ath_alq_post(&sc->sc_alq, + ATH_ALQ_EDMA_TXDESC, + 96, + ds); + } + + bf = bf->bf_next; + } +} +#endif /* ATH_DEBUG_ALQ */ + static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { @@ -149,7 +184,11 @@ ath_edma_tx_fifo_fill(struct ath_softc * #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); -#endif +#endif/* ATH_DEBUG */ +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXDESC)) + ath_edma_tx_alq_post(sc, bf); +#endif /* ATH_DEBUG_ALQ */ txq->axq_fifo_depth++; i++; } @@ -163,10 +202,6 @@ ath_edma_tx_fifo_fill(struct ath_softc * * * This should only be called as part of the chip reset path, as it * assumes the FIFO is currently empty. - * - * TODO: verify that a cold/warm reset does clear the TX FIFO, so - * writing in a partially-filled FIFO will not cause double-entries - * to appear. */ static void ath_edma_dma_restart(struct ath_softc *sc, struct ath_txq *txq) @@ -222,7 +257,11 @@ ath_edma_xmit_handoff_hw(struct ath_soft #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); -#endif /* ATH_DEBUG */ +#endif /* ATH_DEBUG */ +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXDESC)) + ath_edma_tx_alq_post(sc, bf); +#endif /* ATH_DEBUG_ALQ */ ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); @@ -368,7 +407,6 @@ ath_edma_dma_txsetup(struct ath_softc *s ath_edma_setup_txfifo(sc, i); } - return (0); } @@ -489,6 +527,13 @@ ath_edma_tx_processq(struct ath_softc *s continue; } +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS, + sc->sc_tx_statuslen, + (char *) txstatus); +#endif /* ATH_DEBUG_ALQ */ + /* * At this point we have a valid status descriptor. * The QID and descriptor ID (which currently isn't set) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Nov 8 18:07:29 2012 (r242781) +++ head/sys/dev/ath/if_athvar.h Thu Nov 8 18:11:31 2012 (r242782) @@ -42,6 +42,9 @@ #include #include #include +#ifdef ATH_DEBUG_ALQ +#include +#endif #define ATH_TIMEOUT 1000 @@ -770,6 +773,11 @@ struct ath_softc { int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ + /* ALQ */ +#ifdef ATH_DEBUG + struct if_ath_alq sc_alq; +#endif + /* TX AMPDU handling */ int (*sc_addba_request)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int, int, int); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 20:16:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6713DA7; Thu, 8 Nov 2012 20:16:59 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7161A8FC0A; Thu, 8 Nov 2012 20:16:59 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (nat-dip5.cfw-a-gci.corp.yahoo.com [209.131.62.114]) by elvis.mu.org (Postfix) with ESMTPSA id D85971A3D7F; Thu, 8 Nov 2012 12:16:58 -0800 (PST) Message-ID: <509C133A.1080601@mu.org> Date: Thu, 08 Nov 2012 12:16:58 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r242029 - head/sys/kern References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121025080551.GG35915@deviant.kiev.zoral.com.ua> <201210250950.57161.jhb@freebsd.org> <509B501F.5050109@mu.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000807030900030106000406" Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 20:17:00 -0000 This is a multi-part message in MIME format. --------------000807030900030106000406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Peter, can you let me know what you think? -Alfred On 11/7/12 11:46 PM, Peter Wemm wrote: > On Wed, Nov 7, 2012 at 10:24 PM, Alfred Perlstein wrote: >> [[ + peter ]] >> >> Folks, I spent quite a bit of time trying to figure out how to resolve >> maxusers scaling in a happy way for all. >> >> I think I came up with a solution. >> >> This solution should work for i386, and other 32 bit platforms, as well as >> scaling well for 64 bit (or higher) platforms that have virtually unlimited >> AND 64bit with limited kernel address space. >> >> Here is how it works: >> >> We calculate the maxusers value based on physical memory, and then clamp it >> down if physical memory exceeds kernel addressable memory. >> >> The algorithm actually remains the same for all architectures, with the >> exception that machines with large kernel address space it is no longer >> clamped at 384. >> >> I've attached a test program that lets you play with various values for >> VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS and physpages. (argv[1, 2, 3] >> respectively.) >> >> Please give me your feedback. > This is still bogus. VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS > have no bearing on how much space should be allocated for mbuf > clusters on amd64. If anything, you want dmapbase / dmapend if you > want a practical cap for amd64. Even then, jumbo clusters are >4K so > they come out of kva rather than direct map. > > maxusers is the wrong thing for this. maxusers should, if anything, > be used to set things like kern.maxproc. Preferably it should be > deleted entirely and sysctl.conf should be used to change > kern.maxproc. > > Setting limits for the mbuf / cluster pool should be a MD parameter. > > Trying to scale maxusers based on physical ram in order to get mbuf > cluster limits set as a side effect is just plain wrong. > > It makes no more sense than trying to set nmbclusters based on > PRINTF_BUFR_SIZE, and then trying to scale PRINTF_BUFR_SIZE in order > to get desirable second and third order side effects. > > Scale nmbclusters based on physical ram, with a MD method for capping > it for when there are MD limits (eg: disproportionately small kva on > an i386 PAE machine). Don't use maxusers. --------------000807030900030106000406 Content-Type: message/rfc822; name="Attached Message" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Attached Message" Return-Path: X-Original-To: bright@mu.org Delivered-To: bright@mu.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by elvis.mu.org (Postfix) with ESMTP id 67D781A3C55 for ; Thu, 8 Nov 2012 12:15:19 -0800 (PST) Received: from hub.freebsd.org (hub.FreeBSD.org [8.8.178.136]) by mx2.freebsd.org (Postfix) with ESMTP id 301193B5242 for ; Thu, 8 Nov 2012 20:15:19 +0000 (UTC) Received: by hub.freebsd.org (Postfix) id 17ECAC2C; Thu, 8 Nov 2012 20:15:19 +0000 (UTC) Delivered-To: alfred@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 538) id 0FF21C26; Thu, 8 Nov 2012 20:15:19 +0000 (UTC) Delivered-To: src-committers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9366CC21; Thu, 8 Nov 2012 20:15:13 +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 751B08FC17; Thu, 8 Nov 2012 20:15:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8KFDO6015306; Thu, 8 Nov 2012 20:15:13 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8KFD1O015304; Thu, 8 Nov 2012 20:15:13 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211082015.qA8KFD1O015304@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 8 Nov 2012 20:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242783 - in user/alfred/9-alfred/sys: i386/include kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: owner-src-committers@FreeBSD.org Precedence: bulk X-Loop: FreeBSD.ORG Author: alfred Date: Thu Nov 8 20:15:12 2012 New Revision: 242783 URL: http://svnweb.freebsd.org/changeset/base/242783 Log: Divorce autotune nmbclusters from maxusers. Provide arch specific override maximum. Suggested by: peter Modified: user/alfred/9-alfred/sys/i386/include/vmparam.h user/alfred/9-alfred/sys/kern/kern_mbuf.c Modified: user/alfred/9-alfred/sys/i386/include/vmparam.h ============================================================================== --- user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov 8 18:11:31 2012 (r242782) +++ user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov 8 20:15:12 2012 (r242783) @@ -202,4 +202,9 @@ #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ +#ifndef MAX_AUTOTUNE_NMBCLUSTERS +/* old maxusers max value. */ +#define MAX_AUTOTUNE_NMBCLUSTERS (1024 + 384 * 64) +#endif + #endif /* _MACHINE_VMPARAM_H_ */ Modified: user/alfred/9-alfred/sys/kern/kern_mbuf.c ============================================================================== --- user/alfred/9-alfred/sys/kern/kern_mbuf.c Thu Nov 8 18:11:31 2012 (r242782) +++ user/alfred/9-alfred/sys/kern/kern_mbuf.c Thu Nov 8 20:15:12 2012 (r242783) @@ -102,6 +102,30 @@ int nmbjumbo9; /* limits number of 9k int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +static int +nmbclusters_from_physpages(void) +{ + long factor; + long rv; + + factor = physmem / (2 * 1024 * 1024 / PAGE_SIZE); + if (factor < 32) + factor = 32; + /* after 384, switch scale to 1/4 */ + if (factor > 384) + factor = 384 + (factor - 384) / 4; + rv = 1024 + factor * 64; + /* + * allow a platform specific override to prevent exhausting + * kernel memory on large memory + small address space machines. + */ +#ifdef MAX_AUTOTUNE_NMBCLUSTERS + if (rv > MAX_AUTOTUNE_NMBCLUSTERS) + rv = MAX_AUTOTUNE_NMBCLUSTERS +#endif + return (rv); +} + /* * tunable_mbinit() has to be run before init_maxsockets() thus * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() @@ -114,7 +138,7 @@ tunable_mbinit(void *dummy) /* This has to be done before VM init. */ TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) - nmbclusters = 1024 + maxusers * 64; + nmbclusters = nmbclusters_from_physpages(); TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); if (nmbjumbop == 0) --------------000807030900030106000406-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 20:34:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9665325; Thu, 8 Nov 2012 20:34:12 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AECB18FC15; Thu, 8 Nov 2012 20:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8KYCGF018375; Thu, 8 Nov 2012 20:34:12 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8KYCUU018374; Thu, 8 Nov 2012 20:34:12 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201211082034.qA8KYCUU018374@svn.freebsd.org> From: Nick Hibma Date: Thu, 8 Nov 2012 20:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242784 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 20:34:12 -0000 Author: n_hibma Date: Thu Nov 8 20:34:12 2012 New Revision: 242784 URL: http://svnweb.freebsd.org/changeset/base/242784 Log: Not only load pccard_ether settings, also load network settings. This is only a problem when a /etc/rc.conf.d/network file is being used. PR: conf/160373 Submitted by: n_hibma MFC after: 1 week Modified: head/etc/pccard_ether Modified: head/etc/pccard_ether ============================================================================== --- head/etc/pccard_ether Thu Nov 8 20:15:12 2012 (r242783) +++ head/etc/pccard_ether Thu Nov 8 20:34:12 2012 (r242784) @@ -123,4 +123,5 @@ else fi load_rc_config pccard_ether +load_rc_config network run_rc_command $args From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 23:12:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E3323FE; Thu, 8 Nov 2012 23:12:00 +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 3BA178FC15; Thu, 8 Nov 2012 23:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8NC0k2045010; Thu, 8 Nov 2012 23:12:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8NC0Uh045009; Thu, 8 Nov 2012 23:12:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211082312.qA8NC0Uh045009@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Nov 2012 23:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242803 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 23:12:00 -0000 Author: adrian Date: Thu Nov 8 23:11:59 2012 New Revision: 242803 URL: http://svnweb.freebsd.org/changeset/base/242803 Log: Fix the build - fix up the ath_alq code to not compile by default. Modified: head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Nov 8 22:40:24 2012 (r242802) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Nov 8 23:11:59 2012 (r242803) @@ -99,6 +99,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ATH_DEBUG_ALQ +#include +#endif + static int ath_sysctl_slottime(SYSCTL_HANDLER_ARGS) { @@ -502,6 +506,7 @@ ath_sysctl_forcebstuck(SYSCTL_HANDLER_AR } +#ifdef ATH_DEBUG_ALQ static int ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS) { @@ -520,7 +525,6 @@ ath_sysctl_alq_log(SYSCTL_HANDLER_ARGS) return (error); } -#ifdef ATH_DEBUG /* * Attach the ALQ debugging if required. */ @@ -550,7 +554,7 @@ ath_sysctl_alq_attach(struct ath_softc * "numlost", CTLFLAG_RW, &sc->sc_alq.sc_alq_numlost, 0, "number lost"); } -#endif +#endif /* ATH_DEBUG_ALQ */ void ath_sysctlattach(struct ath_softc *sc) @@ -565,14 +569,14 @@ ath_sysctlattach(struct ath_softc *sc) SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "regdomain", CTLFLAG_RD, &sc->sc_eerd, 0, "EEPROM regdomain code"); -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "debug", CTLFLAG_RW, &sc->sc_debug, "control debugging printfs"); SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "ktrdebug", CTLFLAG_RW, &sc->sc_ktrdebug, "control debugging KTR"); -#endif +#endif /* ATH_DEBUG_ALQ */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "slottime", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ath_sysctl_slottime, "I", "802.11 slot time (us)"); From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 23:21:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AFC88F9; Thu, 8 Nov 2012 23:21:03 +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 F39938FC14; Thu, 8 Nov 2012 23:21:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8NL2LN046369; Thu, 8 Nov 2012 23:21:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8NL2hT046367; Thu, 8 Nov 2012 23:21:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211082321.qA8NL2hT046367@svn.freebsd.org> From: Dimitry Andric Date: Thu, 8 Nov 2012 23:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242804 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 23:21:03 -0000 Author: dim Date: Thu Nov 8 23:21:02 2012 New Revision: 242804 URL: http://svnweb.freebsd.org/changeset/base/242804 Log: Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in sio.S. This is not particularly needed for head right now, but it is intended to merge to stable/9, to fix boot2 build with clang there. Reviewed by: avg MFC after: 3 days Modified: head/sys/boot/i386/boot2/sio.S Modified: head/sys/boot/i386/boot2/sio.S ============================================================================== --- head/sys/boot/i386/boot2/sio.S Thu Nov 8 23:11:59 2012 (r242803) +++ head/sys/boot/i386/boot2/sio.S Thu Nov 8 23:21:02 2012 (r242804) @@ -40,13 +40,11 @@ sio_init: pushl %eax movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg - call sio_flush - ret + # Fallthrough /* int sio_flush(void) */ -sio_flush: xorl %eax,%eax # Return value - xorl %ecx,%ecx # Timeout +sio_flush: xorl %ecx,%ecx # Timeout movb $0x80,%ch # counter sio_flush.1: call sio_ischar # Check for character jz sio_flush.2 # Till none From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 23:45:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D152C597; Thu, 8 Nov 2012 23:45:19 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA9028FC08; Thu, 8 Nov 2012 23:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8NjJih049906; Thu, 8 Nov 2012 23:45:19 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8NjJaP049900; Thu, 8 Nov 2012 23:45:19 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211082345.qA8NjJaP049900@svn.freebsd.org> From: Greg Lehey Date: Thu, 8 Nov 2012 23:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242807 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 23:45:20 -0000 Author: grog Date: Thu Nov 8 23:45:19 2012 New Revision: 242807 URL: http://svnweb.freebsd.org/changeset/base/242807 Log: Replace spaces with tabs where appropriate. Reminded by: jh@ Modified: head/bin/ls/cmp.c head/bin/ls/extern.h head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c head/bin/ls/util.c Modified: head/bin/ls/cmp.c ============================================================================== --- head/bin/ls/cmp.c Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/cmp.c Thu Nov 8 23:45:19 2012 (r242807) @@ -78,9 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -107,9 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -136,9 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * if (b->fts_statp->st_birthtim.tv_nsec < a->fts_statp->st_birthtim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } @@ -165,9 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); - if (f_samesort) + if (f_samesort) return (strcoll(b->fts_name, a->fts_name)); - else + else return (strcoll(a->fts_name, b->fts_name)); } Modified: head/bin/ls/extern.h ============================================================================== --- head/bin/ls/extern.h Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/extern.h Thu Nov 8 23:45:19 2012 (r242807) @@ -55,12 +55,12 @@ int prn_octal(const char *); int prn_printable(const char *); #ifdef COLORLS void parsecolors(const char *cs); -void colorquit(int); +void colorquit(int); -extern char *ansi_fgcol; -extern char *ansi_bgcol; -extern char *ansi_coloff; -extern char *attrs_off; -extern char *enter_bold; +extern char *ansi_fgcol; +extern char *ansi_bgcol; +extern char *ansi_coloff; +extern char *attrs_off; +extern char *enter_bold; #endif extern int termwidth; Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/ls.c Thu Nov 8 23:45:19 2012 (r242807) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1) /* - * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width + * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width * into a number that wide in decimal. * XXX: Overflows are not considered. */ @@ -133,7 +133,7 @@ static int f_sizesort; int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ int f_thousands; /* show file sizes with thousands separators */ - char *f_timeformat; /* user-specified time format */ + char *f_timeformat; /* user-specified time format */ static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ @@ -185,7 +185,7 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; - while ((ch = getopt(argc, argv, + while ((ch = getopt(argc, argv, "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* @@ -241,7 +241,7 @@ main(int argc, char *argv[]) f_timesort = 1; f_sizesort = 0; break; - /* Other flags. Please keep alphabetic. */ + /* Other flags. Please keep alphabetic. */ case ',': f_thousands = 1; break; @@ -250,10 +250,10 @@ main(int argc, char *argv[]) f_octal = 1; f_octal_escape = 0; break; - case 'D': - f_timeformat = optarg; - break; - case 'F': + case 'D': + f_timeformat = optarg; + break; + case 'F': f_type = 1; f_slash = 0; break; @@ -534,7 +534,7 @@ traverse(int argc, char *argv[], int opt /* * If already output something, put out a newline as - * a separator. If multiple arguments, precede each + * a separator. If multiple arguments, precede each * directory with its name. */ if (output) { @@ -861,7 +861,7 @@ label_out: d.s_size = sizelen; d.s_user = maxuser; } - if (f_thousands) /* make space for commas */ + if (f_thousands) /* make space for commas */ d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; @@ -874,7 +874,7 @@ label_out: /* * Ordering for mastercmp: * If ordering the argv (fts_level = FTS_ROOTLEVEL) return non-directories - * as larger than directories. Within either group, use the sort function. + * as larger than directories. Within either group, use the sort function. * All other levels use the sort function. Error entries remain unsorted. */ static int Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/ls.h Thu Nov 8 23:45:19 2012 (r242807) @@ -49,14 +49,14 @@ extern int f_longform; /* long listing extern int f_octal; /* print unprintables in octal */ extern int f_octal_escape; /* like f_octal but use C escapes if possible */ extern int f_nonprint; /* show unprintables as ? */ -extern int f_samesort; /* sort time and name in same direction */ +extern int f_samesort; /* sort time and name in same direction */ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ extern int f_statustime; /* use time of last mode change */ extern int f_thousands; /* show file sizes with thousands separators */ -extern char *f_timeformat; /* user-specified time format */ +extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ extern int f_type; /* add type character for non-regular files */ #ifdef COLORLS Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/print.c Thu Nov 8 23:45:19 2012 (r242807) @@ -160,7 +160,7 @@ printlong(const DISPLAY *dp) strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, + (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, sp->st_nlink, dp->s_user, np->user, dp->s_group, np->group); if (f_flags) @@ -382,7 +382,7 @@ printtime(time_t ftime) format = d_first ? "%e %b %R" : "%b %e %R"; else /* mmm dd yyyy || dd mmm yyyy */ - format = d_first ? "%e %b %Y" : "%b %e %Y"; + format = d_first ? "%e %b %Y" : "%b %e %Y"; strftime(longstring, sizeof(longstring), format, localtime(&ftime)); fputs(longstring, stdout); fputc(' ', stdout); @@ -606,11 +606,11 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); - } else if (f_thousands) { /* with commas */ + } else if (f_thousands) { /* with commas */ /* This format assignment needed to work round gcc bug. */ - const char *format = "%*j'd "; + const char *format = "%*j'd "; (void)printf(format, (u_int)width, bytes); - } else + } else (void)printf("%*jd ", (u_int)width, bytes); } Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Thu Nov 8 23:42:22 2012 (r242806) +++ head/bin/ls/util.c Thu Nov 8 23:45:19 2012 (r242807) @@ -132,7 +132,7 @@ prn_printable(const char *s) * to fix this as an efficient fix would involve a lookup table. Same goes * for the rather inelegant code in prn_octal. * - * DES 1998/04/23 + * DES 1998/04/23 */ size_t @@ -200,9 +200,9 @@ prn_octal(const char *s) for (i = 0; i < prtlen; i++) { ch = (unsigned char)s[i]; putchar('\\'); - putchar('0' + (ch >> 6)); - putchar('0' + ((ch >> 3) & 7)); - putchar('0' + (ch & 7)); + putchar('0' + (ch >> 6)); + putchar('0' + ((ch >> 3) & 7)); + putchar('0' + (ch & 7)); len += 4; } } From owner-svn-src-all@FreeBSD.ORG Thu Nov 8 23:46:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDD5B70C; Thu, 8 Nov 2012 23:46:15 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A40A18FC0A; Thu, 8 Nov 2012 23:46:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA8NkFWG050074; Thu, 8 Nov 2012 23:46:15 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA8NkF63050073; Thu, 8 Nov 2012 23:46:15 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211082346.qA8NkF63050073@svn.freebsd.org> From: Greg Lehey Date: Thu, 8 Nov 2012 23:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242808 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2012 23:46:15 -0000 Author: grog Date: Thu Nov 8 23:46:15 2012 New Revision: 242808 URL: http://svnweb.freebsd.org/changeset/base/242808 Log: Replace spaces by tabs where appropriate. Reminded by: jh@ Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Nov 8 23:45:19 2012 (r242807) +++ head/usr.bin/locale/locale.c Thu Nov 8 23:46:15 2012 (r242808) @@ -31,7 +31,7 @@ * nl_langinfo(3) extensions) * * XXX: correctly handle reserved 'charmap' keyword and '-m' option (require - * localedef(1) implementation). Currently it's handled via + * localedef(1) implementation). Currently it's handled via * nl_langinfo(CODESET). */ @@ -84,27 +84,27 @@ struct _lcinfo { /* ids for values not referenced by nl_langinfo() */ #define KW_ZERO 10000 #define KW_GROUPING (KW_ZERO+1) -#define KW_INT_CURR_SYMBOL (KW_ZERO+2) -#define KW_CURRENCY_SYMBOL (KW_ZERO+3) -#define KW_MON_DECIMAL_POINT (KW_ZERO+4) -#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) -#define KW_MON_GROUPING (KW_ZERO+6) -#define KW_POSITIVE_SIGN (KW_ZERO+7) -#define KW_NEGATIVE_SIGN (KW_ZERO+8) -#define KW_INT_FRAC_DIGITS (KW_ZERO+9) -#define KW_FRAC_DIGITS (KW_ZERO+10) -#define KW_P_CS_PRECEDES (KW_ZERO+11) -#define KW_P_SEP_BY_SPACE (KW_ZERO+12) -#define KW_N_CS_PRECEDES (KW_ZERO+13) -#define KW_N_SEP_BY_SPACE (KW_ZERO+14) -#define KW_P_SIGN_POSN (KW_ZERO+15) -#define KW_N_SIGN_POSN (KW_ZERO+16) -#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) -#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) -#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) -#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) -#define KW_INT_P_SIGN_POSN (KW_ZERO+21) -#define KW_INT_N_SIGN_POSN (KW_ZERO+22) +#define KW_INT_CURR_SYMBOL (KW_ZERO+2) +#define KW_CURRENCY_SYMBOL (KW_ZERO+3) +#define KW_MON_DECIMAL_POINT (KW_ZERO+4) +#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) +#define KW_MON_GROUPING (KW_ZERO+6) +#define KW_POSITIVE_SIGN (KW_ZERO+7) +#define KW_NEGATIVE_SIGN (KW_ZERO+8) +#define KW_INT_FRAC_DIGITS (KW_ZERO+9) +#define KW_FRAC_DIGITS (KW_ZERO+10) +#define KW_P_CS_PRECEDES (KW_ZERO+11) +#define KW_P_SEP_BY_SPACE (KW_ZERO+12) +#define KW_N_CS_PRECEDES (KW_ZERO+13) +#define KW_N_SEP_BY_SPACE (KW_ZERO+14) +#define KW_P_SIGN_POSN (KW_ZERO+15) +#define KW_N_SIGN_POSN (KW_ZERO+16) +#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) +#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) +#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) +#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) +#define KW_INT_P_SIGN_POSN (KW_ZERO+21) +#define KW_INT_N_SIGN_POSN (KW_ZERO+22) struct _kwinfo { const char *name; @@ -283,16 +283,16 @@ main(int argc, char *argv[]) if (prt_categories || prt_keywords) { if (argc > 0) { setlocale(LC_ALL, ""); - while (argc > 0) { + while (argc > 0) { showdetails(*argv); - argv++; - argc--; - } - } else { + argv++; + argc--; + } + } else { uint i; - for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++) + for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++) showdetails ((char *)kwinfo [i].name); - } + } exit(0); } @@ -306,8 +306,8 @@ void usage(void) { printf("Usage: locale [ -a | -m ]\n" - " locale -k list [prefix]\n" - " locale [ -ck ] [keyword ...]\n"); + " locale -k list [prefix]\n" + " locale [ -ck ] [keyword ...]\n"); exit(1); } @@ -316,7 +316,7 @@ usage(void) * * XXX actually output of this function does not guarantee that locale * is really available to application, since it can be broken or - * inconsistent thus setlocale() will fail. Maybe add '-V' function to + * inconsistent thus setlocale() will fail. Maybe add '-V' function to * also validate these locales? */ void @@ -427,10 +427,10 @@ init_locales_list(void) } closedir(dirp); - /* make sure that 'POSIX' and 'C' locales are present in the list. + /* make sure that 'POSIX' and 'C' locales are present in the list. * POSIX 1003.1-2001 requires presence of 'POSIX' name only here, but - * we also list 'C' for constistency - */ + * we also list 'C' for constistency + */ if (sl_find(locales, "POSIX") == NULL) sl_add(locales, "POSIX"); @@ -616,10 +616,10 @@ showdetails(char *kw) } if (prt_categories) { - if (prt_keywords) + if (prt_keywords) printf("%-20s ", lookup_localecat(cat)); - else - printf("%-20s\t%s\n", kw, lookup_localecat(cat)); + else + printf("%-20s\t%s\n", kw, lookup_localecat(cat)); } if (prt_keywords) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 00:35:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50A26B7C; Fri, 9 Nov 2012 00:35:55 +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 35A728FC13; Fri, 9 Nov 2012 00:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA90ZtuY058351; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA90ZtRH058348; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211090035.qA90ZtRH058348@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 00:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242809 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 00:35:55 -0000 Author: eadler Date: Fri Nov 9 00:35:54 2012 New Revision: 242809 URL: http://svnweb.freebsd.org/changeset/base/242809 Log: MFC r242462: 10 years too late add support for "2.88MB 3.5in Extra High Density" floppies. Its unlikely that anyone actually uses these or cares about these anymore, since we support other floppy types and this change doesn't hurt - just add it. PR: conf/40777 Arrival-Date: Fri Jul 19 08:50:02 PDT 2002 Approved by: cperciva (implicit) Modified: stable/8/etc/disktab Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/disktab ============================================================================== --- stable/8/etc/disktab Thu Nov 8 23:46:15 2012 (r242808) +++ stable/8/etc/disktab Fri Nov 9 00:35:54 2012 (r242809) @@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: +fd2880|2.88MB 3.5in Extra High Density Floppy:\ + :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ + :pa#5760:oa#0:ba#4096:fa#512:\ + :pb#5760:ob#0:bb#4096:fa#512:\ + :pc#5760:oc#0:bb#4096:fa#512: + # # Stressed floppy-formats. No guarantees given. # From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 00:35:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABFF4B7D; Fri, 9 Nov 2012 00:35:55 +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 90F2A8FC15; Fri, 9 Nov 2012 00:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA90ZtkZ058377; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA90ZtVR058374; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211090035.qA90ZtVR058374@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 00:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242810 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 00:35:55 -0000 Author: eadler Date: Fri Nov 9 00:35:55 2012 New Revision: 242810 URL: http://svnweb.freebsd.org/changeset/base/242810 Log: MFC r242462: 10 years too late add support for "2.88MB 3.5in Extra High Density" floppies. Its unlikely that anyone actually uses these or cares about these anymore, since we support other floppy types and this change doesn't hurt - just add it. PR: conf/40777 Arrival-Date: Fri Jul 19 08:50:02 PDT 2002 Approved by: cperciva (implicit) Modified: stable/9/etc/disktab Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/disktab ============================================================================== --- stable/9/etc/disktab Fri Nov 9 00:35:54 2012 (r242809) +++ stable/9/etc/disktab Fri Nov 9 00:35:55 2012 (r242810) @@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: +fd2880|2.88MB 3.5in Extra High Density Floppy:\ + :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ + :pa#5760:oa#0:ba#4096:fa#512:\ + :pb#5760:ob#0:bb#4096:fa#512:\ + :pc#5760:oc#0:bb#4096:fa#512: + # # Stressed floppy-formats. No guarantees given. # From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 00:35:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2009B7E; Fri, 9 Nov 2012 00:35:55 +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 97F768FC16; Fri, 9 Nov 2012 00:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA90ZtiD058378; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA90ZtrO058376; Fri, 9 Nov 2012 00:35:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211090035.qA90ZtrO058376@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 00:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r242811 - stable/7/etc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 00:35:55 -0000 Author: eadler Date: Fri Nov 9 00:35:55 2012 New Revision: 242811 URL: http://svnweb.freebsd.org/changeset/base/242811 Log: MFC r242462: 10 years too late add support for "2.88MB 3.5in Extra High Density" floppies. Its unlikely that anyone actually uses these or cares about these anymore, since we support other floppy types and this change doesn't hurt - just add it. PR: conf/40777 Arrival-Date: Fri Jul 19 08:50:02 PDT 2002 Approved by: cperciva (implicit) Modified: stable/7/etc/disktab Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/disktab ============================================================================== --- stable/7/etc/disktab Fri Nov 9 00:35:55 2012 (r242810) +++ stable/7/etc/disktab Fri Nov 9 00:35:55 2012 (r242811) @@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: +fd2880|2.88MB 3.5in Extra High Density Floppy:\ + :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ + :pa#5760:oa#0:ba#4096:fa#512:\ + :pb#5760:ob#0:bb#4096:fa#512:\ + :pc#5760:oc#0:bb#4096:fa#512: + # # Stressed floppy-formats. No guarantees given. # From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 01:28:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CD74E13; Fri, 9 Nov 2012 01:28:11 +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 7283B8FC12; Fri, 9 Nov 2012 01:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA91SBJb066423; Fri, 9 Nov 2012 01:28:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA91SBaC066422; Fri, 9 Nov 2012 01:28:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211090128.qA91SBaC066422@svn.freebsd.org> From: Adrian Chadd Date: Fri, 9 Nov 2012 01:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242813 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 01:28:11 -0000 Author: adrian Date: Fri Nov 9 01:28:11 2012 New Revision: 242813 URL: http://svnweb.freebsd.org/changeset/base/242813 Log: Fix a very incorrect description. Modified: head/sys/dev/ath/if_ath_alq.c Modified: head/sys/dev/ath/if_ath_alq.c ============================================================================== --- head/sys/dev/ath/if_ath_alq.c Fri Nov 9 00:59:49 2012 (r242812) +++ head/sys/dev/ath/if_ath_alq.c Fri Nov 9 01:28:11 2012 (r242813) @@ -68,7 +68,7 @@ if_ath_alq_init(struct if_ath_alq *alq, bzero(alq, sizeof(*alq)); strncpy(alq->sc_alq_devname, devname, ATH_ALQ_DEVNAME_LEN); - printf("%s (%s): detached\n", __func__, alq->sc_alq_devname); + printf("%s (%s): attached\n", __func__, alq->sc_alq_devname); snprintf(alq->sc_alq_filename, ATH_ALQ_FILENAME_LEN, "/tmp/ath_%s_alq.log", alq->sc_alq_devname); From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 01:51:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE97A497; Fri, 9 Nov 2012 01:51:07 +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 94A678FC08; Fri, 9 Nov 2012 01:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA91p72F069797; Fri, 9 Nov 2012 01:51:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA91p7pg069796; Fri, 9 Nov 2012 01:51:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211090151.qA91p7pg069796@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 01:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242814 - head/sys/dev/puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 01:51:07 -0000 Author: eadler Date: Fri Nov 9 01:51:06 2012 New Revision: 242814 URL: http://svnweb.freebsd.org/changeset/base/242814 Log: Add support for Advantech PCI-1602 RS-485/RS-422 serial card PR: kern/169726 Submitted by: Jan Mikkelsen Approved by: cperciva (implicit) MFC after: 5 days Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Fri Nov 9 01:28:11 2012 (r242813) +++ head/sys/dev/puc/pucdata.c Fri Nov 9 01:51:06 2012 (r242814) @@ -630,6 +630,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_8S, 0x10, 0, -1, }, + { 0x13fe, 0x1600, 0x1602, 0x0002, + "Advantech PCI-1602", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 04:04:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9902668; Fri, 9 Nov 2012 04:04:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC5618FC0A; Fri, 9 Nov 2012 04:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA944PYe089677; Fri, 9 Nov 2012 04:04:25 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA944Pt4089675; Fri, 9 Nov 2012 04:04:25 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201211090404.qA944Pt4089675@svn.freebsd.org> From: Jeff Roberson Date: Fri, 9 Nov 2012 04:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242815 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 04:04:26 -0000 Author: jeff Date: Fri Nov 9 04:04:25 2012 New Revision: 242815 URL: http://svnweb.freebsd.org/changeset/base/242815 Log: - Correct rev 242734, segments can sometimes get stuck. Be a bit more defensive with segment state. Reported by: b. f. Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Nov 9 01:51:06 2012 (r242814) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Nov 9 04:04:25 2012 (r242815) @@ -4291,13 +4291,16 @@ free_jsegs(jblocks) jblocks->jb_oldestseg = jseg; return; } + if ((jseg->js_state & ALLCOMPLETE) != ALLCOMPLETE) + break; if (jseg->js_seq > jblocks->jb_oldestwrseq) break; /* * We can free jsegs that didn't write entries when * oldestwrseq == js_seq. */ - if (jseg->js_cnt != 0) + if (jseg->js_seq == jblocks->jb_oldestwrseq && + jseg->js_cnt != 0) break; free_jseg(jseg, jblocks); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 04:52:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86EA5C60; Fri, 9 Nov 2012 04:52:16 +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 50A3A8FC0A; Fri, 9 Nov 2012 04:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA94qGKW096682; Fri, 9 Nov 2012 04:52:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA94qGGP096681; Fri, 9 Nov 2012 04:52:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201211090452.qA94qGGP096681@svn.freebsd.org> From: Glen Barber Date: Fri, 9 Nov 2012 04:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242816 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 04:52:16 -0000 Author: gjb (doc,ports committer) Date: Fri Nov 9 04:52:15 2012 New Revision: 242816 URL: http://svnweb.freebsd.org/changeset/base/242816 Log: Belatedly (by many years!) bump the version numbers in the src/-side documentation pages. Saddened by: this file Modified: head/release/doc/share/xml/release.ent Modified: head/release/doc/share/xml/release.ent ============================================================================== --- head/release/doc/share/xml/release.ent Fri Nov 9 04:04:25 2012 (r242815) +++ head/release/doc/share/xml/release.ent Fri Nov 9 04:52:15 2012 (r242816) @@ -6,23 +6,23 @@ - + - + - + - + - + @@ -39,7 +39,7 @@ - + From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 06:58:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C5A427C; Fri, 9 Nov 2012 06:58:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDBB8FC08; Fri, 9 Nov 2012 06:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA96wOEc015810; Fri, 9 Nov 2012 06:58:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA96wON4015808; Fri, 9 Nov 2012 06:58:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090658.qA96wON4015808@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 06:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242819 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 06:58:24 -0000 Author: hselasky Date: Fri Nov 9 06:58:23 2012 New Revision: 242819 URL: http://svnweb.freebsd.org/changeset/base/242819 Log: MFC r238466 and r242777: Implement non-PHY support in the udav driver. Modified: stable/9/sys/dev/usb/net/if_udav.c stable/9/sys/dev/usb/net/if_udavreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/9/sys/dev/usb/net/if_udav.c Fri Nov 9 05:44:34 2012 (r242818) +++ stable/9/sys/dev/usb/net/if_udav.c Fri Nov 9 06:58:23 2012 (r242819) @@ -181,6 +181,15 @@ static const struct usb_ether_methods ud .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -206,7 +215,8 @@ static const STRUCT_USB_HOST_ID udav_dev {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, }; static void @@ -259,11 +269,20 @@ udav_attach(device_t dev) goto detach; } + /* + * The JP1082 has an unusable PHY and provides no link information. + */ + if (sc->sc_flags & UDAV_FLAG_NO_PHY) { + ue->ue_methods = &udav_ue_methods_nophy; + sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; + } + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) { @@ -712,7 +731,8 @@ udav_stop(struct usb_ether *ue) UDAV_LOCK_ASSERT(sc, MA_OWNED); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_flags &= ~UDAV_FLAG_LINK; + if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) + sc->sc_flags &= ~UDAV_FLAG_LINK; /* * stop all the transfers, if not already stopped: Modified: stable/9/sys/dev/usb/net/if_udavreg.h ============================================================================== --- stable/9/sys/dev/usb/net/if_udavreg.h Fri Nov 9 05:44:34 2012 (r242818) +++ stable/9/sys/dev/usb/net/if_udavreg.h Fri Nov 9 06:58:23 2012 (r242819) @@ -159,6 +159,7 @@ struct udav_softc { int sc_flags; #define UDAV_FLAG_LINK 0x0001 #define UDAV_FLAG_EXT_PHY 0x0040 +#define UDAV_FLAG_NO_PHY 0x0080 }; #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 07:05:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5797B557; Fri, 9 Nov 2012 07:05:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFD58FC19; Fri, 9 Nov 2012 07:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA975TE6017026; Fri, 9 Nov 2012 07:05:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA975T4J017021; Fri, 9 Nov 2012 07:05:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090705.qA975T4J017021@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242820 - in stable/9/sys/dev: atkbdc isci/scil usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:05:29 -0000 Author: hselasky Date: Fri Nov 9 07:05:28 2012 New Revision: 242820 URL: http://svnweb.freebsd.org/changeset/base/242820 Log: MFC r240743 and r234418: Fix some typos. Modified: stable/9/sys/dev/atkbdc/psm.c stable/9/sys/dev/isci/scil/scic_sds_phy.c stable/9/sys/dev/usb/serial/uftdi_reg.h stable/9/sys/dev/usb/serial/umodem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/atkbdc/psm.c ============================================================================== --- stable/9/sys/dev/atkbdc/psm.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/atkbdc/psm.c Fri Nov 9 07:05:28 2012 (r242820) @@ -2454,7 +2454,7 @@ proc_mmanplus(struct psm_softc *sc, pack { /* - * PS2++ protocl packet + * PS2++ protocol packet * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * @@ -3738,7 +3738,7 @@ enable_mmanplus(KBDC kbdc, struct psm_so return (FALSE); /* - * PS2++ protocl, packet type 0 + * PS2++ protocol, packet type 0 * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * Modified: stable/9/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- stable/9/sys/dev/isci/scil/scic_sds_phy.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/isci/scil/scic_sds_phy.c Fri Nov 9 07:05:28 2012 (r242820) @@ -2317,7 +2317,7 @@ void scic_sds_phy_stopped_state_enter( * entering the SCI_BASE_PHY_STATE_STARTING. * - This function sets the state handlers for the phy object base state * machine starting state. - * - The SCU hardware is requested to start OOB/SN on this protocl engine. + * - The SCU hardware is requested to start OOB/SN on this protocol engine. * - The phy starting substate machine is started. * - If the previous state was the ready state then the * SCIC_SDS_CONTROLLER is informed that the phy has gone link down. Modified: stable/9/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/usb/serial/uftdi_reg.h Fri Nov 9 07:05:28 2012 (r242820) @@ -176,7 +176,7 @@ enum { * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL * wValue: Xoff/Xon - * wIndex: Protocol/Port - hIndex is protocl / lIndex is port + * wIndex: Protocol/Port - hIndex is protocol / lIndex is port * wLength: 0 * Data: None * Modified: stable/9/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/9/sys/dev/usb/serial/umodem.c Fri Nov 9 06:58:23 2012 (r242819) +++ stable/9/sys/dev/usb/serial/umodem.c Fri Nov 9 07:05:28 2012 (r242820) @@ -139,7 +139,7 @@ static const STRUCT_USB_HOST_ID umodem_d }; /* - * As speeds for umodem deivces increase, these numbers will need to + * As speeds for umodem devices increase, these numbers will need to * be increased. They should be good for G3 speeds and below. * * TODO: The TTY buffers should be increased! From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 07:12:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BC9D74F; Fri, 9 Nov 2012 07:12:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40BB48FC0A; Fri, 9 Nov 2012 07:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA97CWIU018291; Fri, 9 Nov 2012 07:12:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA97CVUE018286; Fri, 9 Nov 2012 07:12:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090712.qA97CVUE018286@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242821 - in stable/9/sys/dev/usb: . quirk storage X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:12:32 -0000 Author: hselasky Date: Fri Nov 9 07:12:31 2012 New Revision: 242821 URL: http://svnweb.freebsd.org/changeset/base/242821 Log: MFC r241432, r242628 and r242364: Remove ancient mass storage gone checks. Add some more mass storage related quirks. Improve auto-quirk detection for mass storage devices. Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/quirk/usb_quirk.h stable/9/sys/dev/usb/storage/umass.c stable/9/sys/dev/usb/usb_msctest.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Fri Nov 9 07:12:31 2012 (r242821) @@ -390,6 +390,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(SONY, PORTABLE_HDD_V2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(STMICRO, ST72682, 0x0000, 0xffff, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(SUPERTOP, IDE, 0x0000, 0xffff, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(TAUGA, CAMERAMATE, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), @@ -517,6 +518,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_NO_GETMAXLUN] = "UQ_MSC_NO_GETMAXLUN", [UQ_MSC_NO_INQUIRY] = "UQ_MSC_NO_INQUIRY", [UQ_MSC_NO_INQUIRY_EVPD] = "UQ_MSC_NO_INQUIRY_EVPD", + [UQ_MSC_NO_PREVENT_ALLOW] = "UQ_MSC_NO_PREVENT_ALLOW", [UQ_MSC_NO_SYNC_CACHE] = "UQ_MSC_NO_SYNC_CACHE", [UQ_MSC_SHUTTLE_INIT] = "UQ_MSC_SHUTTLE_INIT", [UQ_MSC_ALT_IFACE_1] = "UQ_MSC_ALT_IFACE_1", Modified: stable/9/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/quirk/usb_quirk.h Fri Nov 9 07:12:31 2012 (r242821) @@ -75,6 +75,7 @@ enum { UQ_MSC_NO_GETMAXLUN, /* does not support get max LUN */ UQ_MSC_NO_INQUIRY, /* fake generic inq response */ UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */ + UQ_MSC_NO_PREVENT_ALLOW, /* does not support medium removal */ UQ_MSC_NO_SYNC_CACHE, /* does not support sync cache */ UQ_MSC_SHUTTLE_INIT, /* requires Shuttle init sequence */ UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */ Modified: stable/9/sys/dev/usb/storage/umass.c ============================================================================== --- stable/9/sys/dev/usb/storage/umass.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/storage/umass.c Fri Nov 9 07:12:31 2012 (r242821) @@ -174,8 +174,6 @@ TUNABLE_INT("hw.usb.umass.debug", &umass #define DPRINTF(...) do { } while (0) #endif -#define UMASS_GONE ((struct umass_softc *)1) - #define UMASS_BULK_SIZE (1 << 17) #define UMASS_CBI_DIAGNOSTIC_CMDLEN 12 /* bytes */ #define UMASS_MAX_CMDLEN MAX(12, CAM_MAX_CDBLEN) /* bytes */ @@ -363,6 +361,8 @@ typedef uint8_t (umass_transform_t)(stru * result. */ #define NO_SYNCHRONIZE_CACHE 0x4000 + /* Device does not support 'PREVENT/ALLOW MEDIUM REMOVAL'. */ +#define NO_PREVENT_ALLOW 0x8000 struct umass_softc { @@ -833,6 +833,8 @@ umass_probe_proto(device_t dev, struct u quirks |= NO_INQUIRY; if (usb_test_quirk(uaa, UQ_MSC_NO_INQUIRY_EVPD)) quirks |= NO_INQUIRY_EVPD; + if (usb_test_quirk(uaa, UQ_MSC_NO_PREVENT_ALLOW)) + quirks |= NO_PREVENT_ALLOW; if (usb_test_quirk(uaa, UQ_MSC_NO_SYNC_CACHE)) quirks |= NO_SYNCHRONIZE_CACHE; if (usb_test_quirk(uaa, UQ_MSC_SHUTTLE_INIT)) @@ -2108,7 +2110,7 @@ umass_cam_detach_sim(struct umass_softc if (sc->sc_sim != NULL) { if (xpt_bus_deregister(cam_sim_path(sc->sc_sim))) { /* accessing the softc is not possible after this */ - sc->sc_sim->softc = UMASS_GONE; + sc->sc_sim->softc = NULL; cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); } else { panic("%s: CAM layer is busy\n", @@ -2127,63 +2129,11 @@ umass_cam_action(struct cam_sim *sim, un { struct umass_softc *sc = (struct umass_softc *)sim->softc; - if (sc == UMASS_GONE || - (sc != NULL && !usbd_device_attached(sc->sc_udev))) { + if (sc == NULL) { ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } - /* - * Verify, depending on the operation to perform, that we either got - * a valid sc, because an existing target was referenced, or - * otherwise the SIM is addressed. - * - * This avoids bombing out at a printf and does give the CAM layer some - * sensible feedback on errors. - */ - switch (ccb->ccb_h.func_code) { - case XPT_SCSI_IO: - case XPT_RESET_DEV: - case XPT_GET_TRAN_SETTINGS: - case XPT_SET_TRAN_SETTINGS: - case XPT_CALC_GEOMETRY: - /* the opcodes requiring a target. These should never occur. */ - if (sc == NULL) { - DPRINTF(sc, UDMASS_GEN, "%s:%d:%d:%d:func_code 0x%04x: " - "Invalid target (target needed)\n", - DEVNAME_SIM, cam_sim_path(sc->sc_sim), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, - ccb->ccb_h.func_code); - - ccb->ccb_h.status = CAM_TID_INVALID; - xpt_done(ccb); - goto done; - } - break; - case XPT_PATH_INQ: - case XPT_NOOP: - /* - * The opcodes sometimes aimed at a target (sc is valid), - * sometimes aimed at the SIM (sc is invalid and target is - * CAM_TARGET_WILDCARD) - */ - if ((sc == NULL) && - (ccb->ccb_h.target_id != CAM_TARGET_WILDCARD)) { - DPRINTF(sc, UDMASS_SCSI, "%s:%d:%d:%d:func_code 0x%04x: " - "Invalid target (no wildcard)\n", - DEVNAME_SIM, cam_sim_path(sc->sc_sim), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, - ccb->ccb_h.func_code); - - ccb->ccb_h.status = CAM_TID_INVALID; - xpt_done(ccb); - goto done; - } - break; - default: - /* XXX Hm, we should check the input parameters */ - break; - } /* Perform the requested action */ switch (ccb->ccb_h.func_code) { @@ -2299,6 +2249,13 @@ umass_cam_action(struct cam_sim *sim, un if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { ccb->csio.dxfer_len = SHORT_INQUIRY_LENGTH; } + } else if (sc->sc_transfer.cmd_data[0] == PREVENT_ALLOW) { + if (sc->sc_quirks & NO_PREVENT_ALLOW) { + ccb->csio.scsi_status = SCSI_STATUS_OK; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + goto done; + } } else if (sc->sc_transfer.cmd_data[0] == SYNCHRONIZE_CACHE) { if (sc->sc_quirks & NO_SYNCHRONIZE_CACHE) { ccb->csio.scsi_status = SCSI_STATUS_OK; @@ -2447,7 +2404,7 @@ umass_cam_poll(struct cam_sim *sim) { struct umass_softc *sc = (struct umass_softc *)sim->softc; - if (sc == UMASS_GONE) + if (sc == NULL) return; DPRINTF(sc, UDMASS_SCSI, "CAM poll\n"); Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/usb_msctest.c Fri Nov 9 07:12:31 2012 (r242821) @@ -664,8 +664,11 @@ usb_msc_auto_quirk(struct usb_device *ud if (sid_type == 0x00) is_no_direct = 0; break; - } else if (err != ERR_CSW_FAILED) - break; /* non retryable error */ + } else if (err != ERR_CSW_FAILED) { + DPRINTF("Device is not responding " + "properly to SCSI INQUIRY command.\n"); + goto error; /* non retryable error */ + } usb_pause_mtx(NULL, hz); } Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Fri Nov 9 07:05:28 2012 (r242820) +++ stable/9/sys/dev/usb/usbdevs Fri Nov 9 07:12:31 2012 (r242821) @@ -3945,6 +3945,7 @@ product STELERA E1012 0x1012 3G modem /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator +product STMICRO ST72682 0xfada USB 2.0 Flash drive controller /* STSN products */ product STSN STSN0001 0x0001 Internet Access Device From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 07:29:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88C71E4C; Fri, 9 Nov 2012 07:29:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC828FC13; Fri, 9 Nov 2012 07:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA97TBeN021067; Fri, 9 Nov 2012 07:29:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA97TBOj021065; Fri, 9 Nov 2012 07:29:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211090729.qA97TBOj021065@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 07:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242822 - in stable/9/sys/dev: sound/usb usb usb/quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 07:29:11 -0000 Author: hselasky Date: Fri Nov 9 07:29:11 2012 New Revision: 242822 URL: http://svnweb.freebsd.org/changeset/base/242822 Log: MFC r242127, r240078, r240609, r241988, r242129, r242223, r242438, r242453, r242455 and r242458: Add full support for Fast Track Ultra 8R from M-audio. Implement support for USB Audio v2.0. Remove some redundant USB audio v1.0 debug data. Use lsusb instead. Implement support for the so-called USB feedback endpoint for USB audio devices. Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes. PR: usb/171254 Modified: stable/9/sys/dev/sound/usb/uaudio.c stable/9/sys/dev/sound/usb/uaudioreg.h stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Fri Nov 9 07:12:31 2012 (r242821) +++ stable/9/sys/dev/sound/usb/uaudio.c Fri Nov 9 07:29:11 2012 (r242822) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uaudio_debug #include @@ -115,22 +116,39 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { + const char *name; + int32_t minval; int32_t maxval; -#define MIX_MAX_CHAN 8 +#define MIX_MAX_CHAN 16 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ uint32_t mul; uint32_t ctl; - uint16_t wData[MIX_MAX_CHAN]; /* using nchan */ + int wData[MIX_MAX_CHAN]; /* using nchan */ uint16_t wIndex; uint8_t update[(MIX_MAX_CHAN + 7) / 8]; @@ -149,6 +167,9 @@ struct uaudio_mixer_node { #define MAX_SELECTOR_INPUT_PIN 256 uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN]; uint8_t class; + uint8_t val_default; + + uint8_t desc[64]; struct uaudio_mixer_node *next; }; @@ -161,12 +182,10 @@ struct uaudio_chan { struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; - struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +211,13 @@ struct uaudio_chan { uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; + + uint8_t last_sync_time; + uint8_t last_sync_state; +#define UAUDIO_SYNC_NONE 0 +#define UAUDIO_SYNC_MORE 1 +#define UAUDIO_SYNC_LESS 2 }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,13 +268,23 @@ struct umidi_chan { uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; + struct mtx *sc_mixer_lock; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; @@ -273,24 +309,28 @@ struct uaudio_softc { uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +343,7 @@ struct uaudio_format { const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +361,24 @@ static const struct uaudio_format uaudio {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -341,23 +399,23 @@ static device_attach_t uaudio_attach; static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; +static usb_callback_t uaudio_chan_play_sync_callback; static usb_callback_t uaudio_chan_record_callback; +static usb_callback_t uaudio_chan_record_sync_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB mixer ==== */ + +static int uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS); +static void uaudio_mixer_ctl_free(struct uaudio_softc *); +static void uaudio_mixer_register_sysctl(struct uaudio_softc *, device_t); +static void uaudio_mixer_reload_all(struct uaudio_softc *); +static void uaudio_mixer_controls_create_ftu(struct uaudio_softc *); + +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +436,56 @@ static uint16_t uaudio_mixer_determine_c struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,13 +502,10 @@ static int umidi_detach(device_t dev); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config - uaudio_cfg_record[UAUDIO_NCHANBUFS] = { + uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -439,10 +525,20 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_sync_callback, + }, }; static const struct usb_config - uaudio_cfg_play[UAUDIO_NCHANBUFS] = { + uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -462,6 +558,16 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_sync_callback, + }, }; static const struct usb_config @@ -555,7 +661,8 @@ uaudio_probe(device_t dev) /* lookup non-standard device */ if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { - if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) + if (uaa->info.bInterfaceClass != UICLASS_VENDOR || + usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) return (ENXIO); } @@ -614,30 +721,43 @@ uaudio_attach(device_t dev) id = usbd_get_interface_descriptor(uaa->iface); - uaudio_chan_fill_info(sc, uaa->device); - + /* must fill mixer info before channel info */ uaudio_mixer_fill_info(sc, uaa->device, id); + /* fill channel info */ + uaudio_chan_fill_info(sc, uaa->device); + DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); + if (sc->sc_mixer_count == 0) { + if (uaa->info.idVendor == USB_VENDOR_MAUDIO && + (uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA || + uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA8R)) { + DPRINTF("Generating mixer descriptors\n"); + uaudio_mixer_controls_create_ftu(sc); + } + } + DPRINTF("%d mixer controls\n", sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_rec_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -679,6 +799,10 @@ uaudio_attach(device_t dev) DPRINTF("child attach failed\n"); goto detach; } + + /* reload all mixer settings */ + uaudio_mixer_reload_all(sc); + return (0); /* success */ detach: @@ -714,9 +838,8 @@ uaudio_attach_sub(device_t dev, kobj_cla */ uaudio_pcm_setflags(dev, SD_F_SOFTPCMVOL); } - if (mixer_init(dev, mixer_class, sc)) { + if (mixer_init(dev, mixer_class, sc)) goto detach; - } sc->sc_mixer_init = 1; snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); @@ -738,6 +861,8 @@ uaudio_attach_sub(device_t dev, kobj_cla } pcm_setstatus(dev, status); + uaudio_mixer_register_sysctl(sc, dev); + return (0); /* success */ detach: @@ -779,9 +904,9 @@ uaudio_detach(device_t dev) * any. */ if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); @@ -791,6 +916,10 @@ uaudio_detach(device_t dev) umidi_detach(dev); + /* free mixer data */ + + uaudio_mixer_ctl_free(sc); + return (0); } @@ -857,28 +986,88 @@ uaudio_record_fix_fs(usb_endpoint_descri } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d rate=%u\n", + iface_no, clockid, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + (((rate - min) % res) == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1112,264 @@ uaudio_chan_fill_info_sub(struct uaudio_ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if (audio_if == 0) { + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + + /* + * Don't collect any USB audio descriptors if + * this is not an USB audio stream interface. + */ + continue; + } + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; - } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (asid.v1 == NULL || asf1d.v1 == NULL || + ed1 == NULL || sed.v1 == NULL) { + /* need more descriptors */ + continue; + } + + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + /* We ignore sync endpoint information until further. */ - /* We ignore sync endpoint information until further. */ + if (audio_rev >= UAUDIO_VERSION_30) { + goto next_ep; + } else if (audio_rev >= UAUDIO_VERSION_20) { - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + uint32_t dwFormat; + uint8_t bSubslotSize; - if (asf1d->bSamFreqType == 0) { + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + DPRINTF("Checking clock ID=%d\n", x); + + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; + + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; + + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } - - audio_if = 0; - continue; + goto next_ep; found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; + } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; } - audio_if = 0; - continue; - - found_format: - - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); - - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; - - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; - - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); - - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); + + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; - } + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; + + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; + + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); + } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1137,7 +1419,7 @@ uaudio_chan_fill_info(struct uaudio_soft * disable surround setups on FULL-speed USB * by default */ - channels = 2; + channels = 4; break; default: channels = 16; @@ -1177,72 +1459,186 @@ done: } static void -uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) +uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t total; - uint32_t blockcount; - uint32_t n; - uint32_t offset; + uint8_t buf[4]; + uint64_t temp; + int len; int actlen; - int sumlen; - - usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + int nframes; - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - return; - } + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: - if (actlen < sumlen) { - DPRINTF("short transfer, " - "%d of %d bytes\n", actlen, sumlen); - } - chn_intr(ch->pcm_ch); - case USB_ST_SETUP: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 13:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B1AA991; Fri, 9 Nov 2012 13:58:52 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 800338FC15; Fri, 9 Nov 2012 13:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9Dwqjs084464; Fri, 9 Nov 2012 13:58:52 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9Dwqpa084463; Fri, 9 Nov 2012 13:58:52 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091358.qA9Dwqpa084463@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 13:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242823 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 13:58:52 -0000 Author: rdivacky Date: Fri Nov 9 13:58:52 2012 New Revision: 242823 URL: http://svnweb.freebsd.org/changeset/base/242823 Log: Give panic format string to pacify clang warning. Modified: head/sys/dev/aac/aac_debug.c Modified: head/sys/dev/aac/aac_debug.c ============================================================================== --- head/sys/dev/aac/aac_debug.c Fri Nov 9 07:29:11 2012 (r242822) +++ head/sys/dev/aac/aac_debug.c Fri Nov 9 13:58:52 2012 (r242823) @@ -160,7 +160,7 @@ void aac_panic(struct aac_softc *sc, char *reason) { aac_print_queues(sc); - panic(reason); + panic("%s", reason); } /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 14:14:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C40D7E05; Fri, 9 Nov 2012 14:14:51 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1F458FC12; Fri, 9 Nov 2012 14:14:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9EEpdi087120; Fri, 9 Nov 2012 14:14:51 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9EEptu087119; Fri, 9 Nov 2012 14:14:51 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091414.qA9EEptu087119@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 14:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242824 - head/sys/dev/mn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 14:14:51 -0000 Author: rdivacky Date: Fri Nov 9 14:14:51 2012 New Revision: 242824 URL: http://svnweb.freebsd.org/changeset/base/242824 Log: Remove unused static mn_timeout. Modified: head/sys/dev/mn/if_mn.c Modified: head/sys/dev/mn/if_mn.c ============================================================================== --- head/sys/dev/mn/if_mn.c Fri Nov 9 13:58:52 2012 (r242823) +++ head/sys/dev/mn/if_mn.c Fri Nov 9 14:14:51 2012 (r242824) @@ -1254,24 +1254,6 @@ mn_intr(void *xsc) sc->m32x->stat = stat; } -static void -mn_timeout(void *xsc) -{ - static int round = 0; - struct mn_softc *sc; - - mn_intr(xsc); - sc = xsc; - timeout(mn_timeout, xsc, 10 * hz); - round++; - if (round == 2) { - sc->m32_mem.ccb = 0x00008004; - sc->m32x->cmd = 0x1; - } else if (round > 2) { - printf("%s: timeout\n", sc->name); - } -} - /* * PCI initialization stuff */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 14:40:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92947608; Fri, 9 Nov 2012 14:40:59 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EB528FC0C; Fri, 9 Nov 2012 14:40:58 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jm19so621047bkc.13 for ; Fri, 09 Nov 2012 06:40:57 -0800 (PST) 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=2ZgRSSqDadg08bxz+NI9MAN8DdOy29Um2WkjUzQUsVA=; b=IKblFd/IyjJICN6n0z+NGgDS8xXFqOVtVcG0KUHWIxRtdiqH2ui9nYTkBD7xSNPC0g eCf8W0edhq/YerTUSrAybXNv+huSgP+LM+ikk59lWh4zw1Z6PMY+nZxsYvUEW3pVkZAQ /Qqzs5b4xdP49O9xDOrm97Zyv1QmsZaC8XaoNSqplDQqFCCfF91C1cYNpFatK9USUSC5 z6LAktN1U8niUnvZQnw9xlzzFN9f+m+u2fwoVdAUlo4EvS5Gfzchrq75XpyohCCGgU2a A7xJXxH5dl22lLDc63vR/ZSRoLFilMBUa7ihNvAIOdXIlDm4feDpg2Qkk596CQWLc6rd Vo1Q== MIME-Version: 1.0 Received: by 10.204.151.21 with SMTP id a21mr1114997bkw.124.1352472057188; Fri, 09 Nov 2012 06:40:57 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.204.71.72 with HTTP; Fri, 9 Nov 2012 06:40:57 -0800 (PST) In-Reply-To: <201211091358.qA9Dwqpa084463@svn.freebsd.org> References: <201211091358.qA9Dwqpa084463@svn.freebsd.org> Date: Fri, 9 Nov 2012 17:40:57 +0300 X-Google-Sender-Auth: bHtNw6pZyBThnC8jPedUz2lUJYs Message-ID: Subject: Re: svn commit: r242823 - head/sys/dev/aac From: Sergey Kandaurov To: Roman Divacky Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 14:40:59 -0000 On 9 November 2012 17:58, Roman Divacky wrote: > Author: rdivacky > Date: Fri Nov 9 13:58:52 2012 > New Revision: 242823 > URL: http://svnweb.freebsd.org/changeset/base/242823 > > Log: > Give panic format string to pacify clang warning. > > Modified: > head/sys/dev/aac/aac_debug.c > > Modified: head/sys/dev/aac/aac_debug.c > ============================================================================== > --- head/sys/dev/aac/aac_debug.c Fri Nov 9 07:29:11 2012 (r242822) > +++ head/sys/dev/aac/aac_debug.c Fri Nov 9 13:58:52 2012 (r242823) > @@ -160,7 +160,7 @@ void > aac_panic(struct aac_softc *sc, char *reason) > { > aac_print_queues(sc); > - panic(reason); > + panic("%s", reason); > } > > /* Thanks. There are presumably more warnings: /sys/dev/twe/twe.c: panic(reason); /sys/dev/mly/mly.c: panic(reason); Sorry, cannot test right now. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 14:46:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D59E5818; Fri, 9 Nov 2012 14:46:23 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A12068FC0A; Fri, 9 Nov 2012 14:46:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9EkN1R092257; Fri, 9 Nov 2012 14:46:23 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9EkNfK092255; Fri, 9 Nov 2012 14:46:23 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091446.qA9EkNfK092255@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 14:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242825 - head/sys/dev/drm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 14:46:23 -0000 Author: rdivacky Date: Fri Nov 9 14:46:23 2012 New Revision: 242825 URL: http://svnweb.freebsd.org/changeset/base/242825 Log: Cast VIA_READ to (void) where the result is unused. Modified: head/sys/dev/drm/via_dma.c head/sys/dev/drm/via_dmablit.c Modified: head/sys/dev/drm/via_dma.c ============================================================================== --- head/sys/dev/drm/via_dma.c Fri Nov 9 14:14:51 2012 (r242824) +++ head/sys/dev/drm/via_dma.c Fri Nov 9 14:46:23 2012 (r242825) @@ -481,7 +481,7 @@ static int via_hook_segment(drm_via_priv VIA_WRITE(VIA_REG_TRANSET, (HC_ParaType_PreCR << 16)); VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_hi); VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_lo); - VIA_READ(VIA_REG_TRANSPACE); + (void)VIA_READ(VIA_REG_TRANSPACE); } } return paused; @@ -569,7 +569,7 @@ static void via_cmdbuf_start(drm_via_pri VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_lo); DRM_WRITEMEMORYBARRIER(); VIA_WRITE(VIA_REG_TRANSPACE, command | HC_HAGPCMNT_MASK); - VIA_READ(VIA_REG_TRANSPACE); + (void)VIA_READ(VIA_REG_TRANSPACE); dev_priv->dma_diff = 0; Modified: head/sys/dev/drm/via_dmablit.c ============================================================================== --- head/sys/dev/drm/via_dmablit.c Fri Nov 9 14:14:51 2012 (r242824) +++ head/sys/dev/drm/via_dmablit.c Fri Nov 9 14:46:23 2012 (r242825) @@ -210,7 +210,7 @@ via_fire_dmablit(struct drm_device *dev, VIA_WRITE(VIA_PCI_DMA_DPR0 + engine*0x10, vsg->chain_start); DRM_WRITEMEMORYBARRIER(); VIA_WRITE(VIA_PCI_DMA_CSR0 + engine*0x04, VIA_DMA_CSR_DE | VIA_DMA_CSR_TS); - VIA_READ(VIA_PCI_DMA_CSR0 + engine*0x04); + (void)VIA_READ(VIA_PCI_DMA_CSR0 + engine*0x04); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 14:58:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCFEEC43; Fri, 9 Nov 2012 14:58:26 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2FA78FC0C; Fri, 9 Nov 2012 14:58:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9EwQsM094248; Fri, 9 Nov 2012 14:58:26 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9EwQMc094247; Fri, 9 Nov 2012 14:58:26 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091458.qA9EwQMc094247@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 14:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242826 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 14:58:26 -0000 Author: rdivacky Date: Fri Nov 9 14:58:26 2012 New Revision: 242826 URL: http://svnweb.freebsd.org/changeset/base/242826 Log: Give device_printf format string to pacify clang warning. Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Fri Nov 9 14:46:23 2012 (r242825) +++ head/sys/dev/asmc/asmc.c Fri Nov 9 14:58:26 2012 (r242826) @@ -839,7 +839,7 @@ out: strlcat(buf, buf2, sizeof(buf)); } strlcat(buf, " \n", sizeof(buf)); - device_printf(dev, buf); + device_printf(dev, "%s", buf); } return (error); From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 15:29:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3DC2D458; Fri, 9 Nov 2012 15:29:53 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 237908FC0A; Fri, 9 Nov 2012 15:29:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9FTrLx099600; Fri, 9 Nov 2012 15:29:53 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9FTqhc099599; Fri, 9 Nov 2012 15:29:52 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091529.qA9FTqhc099599@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 15:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242827 - head/sys/dev/twa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 15:29:53 -0000 Author: rdivacky Date: Fri Nov 9 15:29:52 2012 New Revision: 242827 URL: http://svnweb.freebsd.org/changeset/base/242827 Log: Give tw_osl_dbg_printf format string to pacify clang warning. Modified: head/sys/dev/twa/tw_cl_misc.c Modified: head/sys/dev/twa/tw_cl_misc.c ============================================================================== --- head/sys/dev/twa/tw_cl_misc.c Fri Nov 9 14:58:26 2012 (r242826) +++ head/sys/dev/twa/tw_cl_misc.c Fri Nov 9 15:29:52 2012 (r242827) @@ -641,7 +641,7 @@ tw_cli_dbg_printf(TW_UINT8 dbg_level, va_end(ap); tw_osl_strcpy(print_str + tw_osl_strlen(print_str), "\n"); - tw_osl_dbg_printf(ctlr_handle, print_str); + tw_osl_dbg_printf(ctlr_handle, "%s", print_str); } #endif /* TW_OSL_DEBUG */ } From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 16:00:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11398D10; Fri, 9 Nov 2012 16:00:31 +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 D1B0E8FC08; Fri, 9 Nov 2012 16:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9G0UNQ005042; Fri, 9 Nov 2012 16:00:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9G0Umd005041; Fri, 9 Nov 2012 16:00:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211091600.qA9G0Umd005041@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 9 Nov 2012 16:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242828 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 16:00:31 -0000 Author: kib Date: Fri Nov 9 16:00:30 2012 New Revision: 242828 URL: http://svnweb.freebsd.org/changeset/base/242828 Log: Do not try to enable new features in the %cr4 if running under hypervisor. Apparently, hypervisors failed to filter out 'Standard Extended Features' report from CPUID, but deliver #gp when corresponding bit in %cr4 is toggled. This shall be reconsidered later, after hypervisors correct the bug. Reported and tested by: joel Reviewed by: avg MFC after: 2 weeks Modified: head/sys/amd64/amd64/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Fri Nov 9 15:29:52 2012 (r242827) +++ head/sys/amd64/amd64/identcpu.c Fri Nov 9 16:00:30 2012 (r242828) @@ -481,7 +481,7 @@ SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, void identify_cpu(void) { - u_int regs[4]; + u_int regs[4], cpu_stdext_disable; do_cpuid(0, regs); cpu_high = regs[0]; @@ -516,6 +516,20 @@ identify_cpu(void) if (cpu_high >= 7) { cpuid_count(7, 0, regs); cpu_stdext_feature = regs[1]; + + /* + * Some hypervisors fail to filter out unsupported + * extended features. For now, disable the + * extensions, activation of which requires setting a + * bit in CR4, and which VM monitors do not support. + */ + if (cpu_feature2 & CPUID2_HV) { + cpu_stdext_disable = CPUID_STDEXT_FSGSBASE | + CPUID_STDEXT_SMEP; + } else + cpu_stdext_disable = 0; + TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable); + cpu_stdext_feature &= ~cpu_stdext_disable; } if (cpu_vendor_id == CPU_VENDOR_INTEL || From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 16:28:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DA2FB91; Fri, 9 Nov 2012 16:28:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBBD58FC16; Fri, 9 Nov 2012 16:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9GSwnj010555; Fri, 9 Nov 2012 16:28:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9GSwDa010552; Fri, 9 Nov 2012 16:28:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211091628.qA9GSwDa010552@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 Nov 2012 16:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242829 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 16:28:59 -0000 Author: hselasky Date: Fri Nov 9 16:28:58 2012 New Revision: 242829 URL: http://svnweb.freebsd.org/changeset/base/242829 Log: Fix LOW and FULL speed USB INTERRUPT endpoint support for the DWC OTG driver. Fix a hang issue when using LOW and FULL speed BULK traffic. Make sure we don't ask for data in the last microframe. This allows using devices like USB mice and USB keyboards connected to the RPI-B. Suggested by: gonzo @ Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h head/sys/dev/usb/controller/dwc_otgreg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Fri Nov 9 16:00:30 2012 (r242828) +++ head/sys/dev/usb/controller/dwc_otg.c Fri Nov 9 16:28:58 2012 (r242829) @@ -372,6 +372,15 @@ dwc_otg_pull_down(struct dwc_otg_softc * } static void +dwc_otg_enable_sof_irq(struct dwc_otg_softc *sc) +{ + if (sc->sc_irq_mask & GINTSTS_SOF) + return; + sc->sc_irq_mask |= GINTSTS_SOF; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); +} + +static void dwc_otg_resume_irq(struct dwc_otg_softc *sc) { if (sc->sc_flags.status_suspend) { @@ -523,10 +532,6 @@ dwc_otg_host_channel_wait(struct dwc_otg if (x == 0) return (0); /* wait */ - /* assume NAK-ing is next */ - if (sc->sc_chan_state[x].hcint & HCINT_NYET) - return (0); /* wait */ - /* find new disabled channel */ for (x = 1; x != sc->sc_host_ch_max; x++) { @@ -629,8 +634,7 @@ dwc_otg_host_channel_disable(struct dwc_ /* don't re-use channel until next SOF is transmitted */ sc->sc_chan_state[x].wait_sof = 2; /* enable SOF interrupt */ - sc->sc_irq_mask |= GINTMSK_SOFMSK; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + dwc_otg_enable_sof_irq(sc); } } @@ -688,14 +692,15 @@ dwc_otg_host_setup_tx(struct dwc_otg_td DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); - if (hcint & HCINT_STALL) { + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; return (0); /* complete */ - } - - if (hcint & HCINT_ERRORS) { + } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { @@ -769,6 +774,8 @@ dwc_otg_host_setup_tx(struct dwc_otg_td return (0); /* complete */ } break; + case DWC_CHAN_ST_TX_PKT_SYNC: + goto send_pkt_sync; default: break; } @@ -780,7 +787,21 @@ send_pkt: return (0); /* complete */ } +send_pkt_sync: if (td->hcsplt != 0) { + uint32_t count; + + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + /* check for not first microframe */ + if (count != 0) { + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + /* set state */ + td->state = DWC_CHAN_ST_TX_PKT_SYNC; + dwc_otg_host_channel_free(td); + return (1); /* busy */ + } + td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; } else { @@ -961,8 +982,7 @@ not_complete: } static uint8_t -dwc_otg_host_rate_check(struct dwc_otg_td *td, - uint8_t do_inc) +dwc_otg_host_rate_check(struct dwc_otg_td *td) { struct dwc_otg_softc *sc; uint8_t ep_type; @@ -981,13 +1001,14 @@ dwc_otg_host_rate_check(struct dwc_otg_t td->hcchar |= HCCHAR_ODDFRM; else td->hcchar &= ~HCCHAR_ODDFRM; - if (do_inc) - td->tmr_val += td->tmr_res; + td->tmr_val += td->tmr_res; } else if (ep_type == UE_INTERRUPT) { - if ((sc->sc_tmr_val & 0xFF) != td->tmr_val) + uint8_t delta; + + delta = sc->sc_tmr_val - td->tmr_val; + if (delta >= 128) goto busy; - if (do_inc) - td->tmr_val += td->tmr_res; + td->tmr_val = sc->sc_tmr_val + td->tmr_res; } else if (td->did_nak != 0) { goto busy; } @@ -1010,6 +1031,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * uint32_t hcint; uint32_t hcchar; uint32_t count; + uint8_t ep_type; if (dwc_otg_host_channel_alloc(td)) return (1); /* busy */ @@ -1017,6 +1039,9 @@ dwc_otg_host_data_rx(struct dwc_otg_td * /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); + ep_type = ((td->hcchar & + HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); + hcint = sc->sc_chan_state[td->channel].hcint; DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", @@ -1026,14 +1051,15 @@ dwc_otg_host_data_rx(struct dwc_otg_td * /* check interrupt bits */ - if (hcint & HCINT_STALL) { + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; return (0); /* complete */ - } - - if (hcint & HCINT_ERRORS) { + } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { @@ -1063,7 +1089,17 @@ dwc_otg_host_data_rx(struct dwc_otg_td * switch (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) { case GRXSTSRH_IN_DATA: - DPRINTF("DATA\n"); + DPRINTF("DATA ST=%d STATUS=0x%08x\n", + (int)td->state, (int)sc->sc_last_rx_status); + + if (hcint & HCINT_SOFTWARE_ONLY) { + /* + * When using SPLIT transactions on interrupt + * endpoints, sometimes data occurs twice. + */ + DPRINTF("Data already received\n"); + break; + } td->toggle ^= 1; @@ -1131,12 +1167,16 @@ check_state: else goto receive_pkt; } - if (hcint & HCINT_NYET) { - if (td->hcsplt != 0) - goto receive_pkt; - } - if (!(hcint & HCINT_SOFTWARE_ONLY)) + if (!(hcint & HCINT_SOFTWARE_ONLY)) { + if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) { + if (!dwc_otg_host_channel_wait(td)) + break; + goto receive_pkt; + } + } break; + } if (hcint & (HCINT_ACK | HCINT_NYET)) { if (!dwc_otg_host_channel_wait(td)) break; @@ -1179,20 +1219,38 @@ check_state: case DWC_CHAN_ST_RX_SPKT: goto receive_spkt; + case DWC_CHAN_ST_RX_SPKT_SYNC: + goto receive_spkt_sync; + default: break; } goto busy; receive_pkt: - if (dwc_otg_host_rate_check(td, 1)) { + if (td->hcsplt != 0) { + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + + /* check for even microframes */ + if (count == td->curr_frame) { + td->state = DWC_CHAN_ST_RX_PKT; + dwc_otg_host_channel_free(td); + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + goto busy; + } else if (count == 0) { + /* check for start split timeout */ + goto receive_spkt; + } + + td->curr_frame = count; + td->hcsplt |= HCSPLT_COMPSPLT; + } else if (dwc_otg_host_rate_check(td)) { td->state = DWC_CHAN_ST_RX_PKT; dwc_otg_host_channel_free(td); goto busy; } - if (td->hcsplt != 0) - td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_ANE; /* receive one packet */ @@ -1213,12 +1271,42 @@ receive_pkt: goto busy; receive_spkt: - if (dwc_otg_host_rate_check(td, 0)) { + if (dwc_otg_host_rate_check(td)) { td->state = DWC_CHAN_ST_RX_SPKT; dwc_otg_host_channel_free(td); goto busy; } +receive_spkt_sync: + if (ep_type == UE_INTERRUPT || + ep_type == UE_ISOCHRONOUS) { + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + td->curr_frame = count; + + /* check for non-zero microframe */ + if (count != 0) { + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + /* set state */ + td->state = DWC_CHAN_ST_RX_SPKT_SYNC; + dwc_otg_host_channel_free(td); + goto busy; + } + } else { + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + td->curr_frame = count; + + /* check for two last frames */ + if (count >= 6) { + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + /* set state */ + td->state = DWC_CHAN_ST_RX_SPKT_SYNC; + dwc_otg_host_channel_free(td); + goto busy; + } + } + td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; @@ -1377,14 +1465,15 @@ dwc_otg_host_data_tx(struct dwc_otg_td * DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); - if (hcint & HCINT_STALL) { + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; return (0); /* complete */ - } - - if (hcint & HCINT_ERRORS) { + } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { @@ -1482,6 +1571,9 @@ dwc_otg_host_data_tx(struct dwc_otg_td * case DWC_CHAN_ST_TX_PKT: goto send_pkt; + case DWC_CHAN_ST_TX_PKT_SYNC: + goto send_pkt_sync; + case DWC_CHAN_ST_TX_CPKT: goto send_cpkt; @@ -1491,13 +1583,25 @@ dwc_otg_host_data_tx(struct dwc_otg_td * goto busy; send_pkt: - if (dwc_otg_host_rate_check(td, 1)) { + if (dwc_otg_host_rate_check(td)) { td->state = DWC_CHAN_ST_TX_PKT; dwc_otg_host_channel_free(td); goto busy; } +send_pkt_sync: if (td->hcsplt != 0) { + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + /* check for first or last microframe */ + if (count == 7 || count == 0) { + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + /* set state */ + td->state = DWC_CHAN_ST_TX_PKT_SYNC; + dwc_otg_host_channel_free(td); + goto busy; + } + td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; } else { @@ -1549,6 +1653,13 @@ send_pkt: goto busy; send_cpkt: + count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; + /* check for first microframe */ + if (count == 0) { + /* send packet again */ + goto send_pkt; + } + td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; @@ -2242,6 +2353,9 @@ dwc_otg_interrupt(struct dwc_otg_softc * if (sc->sc_irq_mask & GINTMSK_SOFMSK) { uint8_t x; uint8_t y; + + DPRINTFN(12, "SOF interrupt\n"); + for (x = y = 0; x != sc->sc_host_ch_max; x++) { if (sc->sc_chan_state[x].wait_sof != 0) { if (--(sc->sc_chan_state[x].wait_sof) != 0) @@ -2280,6 +2394,7 @@ dwc_otg_setup_standard_chain_sub(struct td->remainder = temp->len; td->tx_bytes = 0; td->error_any = 0; + td->error_stall = 0; td->npkt = 0; td->did_stall = temp->did_stall; td->short_pkt = temp->short_pkt; @@ -2531,8 +2646,8 @@ dwc_otg_setup_standard_chain(struct usb_ ival = xfer->interval / DWC_OTG_HOST_TIMER_RATE; if (ival == 0) ival = 1; - else if (ival > 255) - ival = 255; + else if (ival > 127) + ival = 127; td->tmr_val = sc->sc_tmr_val + ival; td->tmr_res = ival; } @@ -2549,8 +2664,8 @@ dwc_otg_setup_standard_chain(struct usb_ ival = xfer->interval / DWC_OTG_HOST_TIMER_RATE; if (ival == 0) ival = 1; - else if (ival > 255) - ival = 255; + else if (ival > 127) + ival = 127; td->tmr_val = sc->sc_tmr_val + ival; td->tmr_res = ival; } Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Fri Nov 9 16:00:30 2012 (r242828) +++ head/sys/dev/usb/controller/dwc_otg.h Fri Nov 9 16:28:58 2012 (r242829) @@ -60,6 +60,7 @@ struct dwc_otg_td { uint8_t errcnt; uint8_t tmr_res; uint8_t tmr_val; + uint8_t curr_frame; uint8_t ep_no; uint8_t channel; uint8_t state; @@ -69,8 +70,10 @@ struct dwc_otg_td { #define DWC_CHAN_ST_WAIT_C_ANE 3 #define DWC_CHAN_ST_RX_PKT 4 #define DWC_CHAN_ST_RX_SPKT 5 +#define DWC_CHAN_ST_RX_SPKT_SYNC 6 #define DWC_CHAN_ST_TX_PKT 4 #define DWC_CHAN_ST_TX_CPKT 5 +#define DWC_CHAN_ST_TX_PKT_SYNC 6 uint8_t error:1; uint8_t error_any:1; uint8_t error_stall:1; Modified: head/sys/dev/usb/controller/dwc_otgreg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otgreg.h Fri Nov 9 16:00:30 2012 (r242828) +++ head/sys/dev/usb/controller/dwc_otgreg.h Fri Nov 9 16:28:58 2012 (r242829) @@ -299,7 +299,7 @@ #define GRXSTSRD_DPID_DATA0 (0<<15) #define GRXSTSRD_DPID_DATA1 (2<<15) #define GRXSTSRD_DPID_DATA2 (1<<15) -#define GRXSTSRD_PID_MDATA (3<<15) +#define GRXSTSRD_DPID_MDATA (3<<15) #define GRXSTSRD_BCNT_MASK 0x00007ff0 #define GRXSTSRD_BCNT_GET(x) (((x) >> 4) & 0x7FF) #define GRXSTSRD_BCNT_SHIFT 4 From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 17:46:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 889EC7A5; Fri, 9 Nov 2012 17:46:08 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C97B8FC0C; Fri, 9 Nov 2012 17:46:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9Hk7kc023377; Fri, 9 Nov 2012 17:46:07 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9Hk7ih023376; Fri, 9 Nov 2012 17:46:07 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211091746.qA9Hk7ih023376@svn.freebsd.org> From: Roman Divacky Date: Fri, 9 Nov 2012 17:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242830 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 17:46:08 -0000 Author: rdivacky Date: Fri Nov 9 17:46:07 2012 New Revision: 242830 URL: http://svnweb.freebsd.org/changeset/base/242830 Log: Dont compile some files in drm with -finline-limit=1350. GCC 4.2.1 doesnt need that and clang does not support that. This effectively reverts r126542. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 9 16:28:58 2012 (r242829) +++ head/sys/conf/files Fri Nov 9 17:46:07 2012 (r242830) @@ -1163,15 +1163,14 @@ dev/drm/mach64_state.c optional mach64d dev/drm/mga_dma.c optional mgadrm dev/drm/mga_drv.c optional mgadrm dev/drm/mga_irq.c optional mgadrm -dev/drm/mga_state.c optional mgadrm \ - compile-with "${NORMAL_C} -finline-limit=13500" +dev/drm/mga_state.c optional mgadrm dev/drm/mga_warp.c optional mgadrm dev/drm/r128_cce.c optional r128drm \ compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION}" dev/drm/r128_drv.c optional r128drm dev/drm/r128_irq.c optional r128drm dev/drm/r128_state.c optional r128drm \ - compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} -finline-limit=13500" + compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE}" dev/drm/r300_cmdbuf.c optional radeondrm dev/drm/r600_blit.c optional radeondrm dev/drm/r600_cp.c optional radeondrm \ From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:02:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F75EEDE; Fri, 9 Nov 2012 18:02:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 092738FC0A; Fri, 9 Nov 2012 18:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9I2QgD026164; Fri, 9 Nov 2012 18:02:26 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9I2QP6026142; Fri, 9 Nov 2012 18:02:26 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211091802.qA9I2QP6026142@svn.freebsd.org> From: Attilio Rao Date: Fri, 9 Nov 2012 18:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:02:27 -0000 Author: attilio Date: Fri Nov 9 18:02:25 2012 New Revision: 242833 URL: http://svnweb.freebsd.org/changeset/base/242833 Log: Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. Porters should refer to __FreeBSD_version 1000021 for this change as it may have happened at the same timeframe. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/devfs/devfs_vfsops.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/nandfs/nandfs_vfsops.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/pseudofs/pseudofs.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/udf/udf_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/fs/unionfs/union_vnops.c head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_vfsops.c 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 Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1132,7 +1132,6 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->vfs_data = zfsvfs; vfsp->mnt_flag |= MNT_LOCAL; - vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/cd9660/cd9660_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -376,8 +376,7 @@ iso_mountfs(devvp, mp) mp->mnt_maxsymlinklen = 0; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); isomp->im_mountp = mp; isomp->im_dev = dev; Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/devfs/devfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -131,8 +131,7 @@ devfs_mount(struct mount *mp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; #ifdef MAC mp->mnt_flag |= MNT_MULTILABEL; #endif Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -665,8 +665,7 @@ ext2_mountfs(struct vnode *devvp, struct * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); return (0); out: Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -107,9 +107,6 @@ fdesc_mount(struct mount *mp) VOP_UNLOCK(rvp, 0); /* XXX -- don't mark as local to work around fts() problems */ /*mp->mnt_flag |= MNT_LOCAL;*/ - MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_MPSAFE; - MNT_IUNLOCK(mp); vfs_getnewfsid(mp); vfs_mountedfrom(mp, "fdescfs"); Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) vfs_getnewfsid(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -760,7 +760,6 @@ mountmsdosfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); if (pmp->pm_flags & MSDOSFS_LARGEFS) Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/nandfs/nandfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1383,7 +1383,6 @@ nandfs_mountfs(struct vnode *devvp, stru nmp->nm_ronly = ronly; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); nmp->nm_nandfsdev = nandfsdev; /* Add our mountpoint */ Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1136,8 +1136,7 @@ nfs_mount(struct mount *mp) out: if (!error) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_NO_IOPF; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF; MNT_IUNLOCK(mp); } return (error); Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/nullfs/null_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -189,8 +189,7 @@ nullfs_mount(struct mount *mp) } MNT_ILOCK(mp); mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & - (MNTK_MPSAFE | MNTK_SHARED_WRITES | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED); + (MNTK_SHARED_WRITES | MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED); mp->mnt_kern_flag |= MNTK_LOOKUP_EXCL_DOTDOT; MNT_IUNLOCK(mp); mp->mnt_data = xmp; Modified: head/sys/fs/pseudofs/pseudofs.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/pseudofs/pseudofs.c Fri Nov 9 18:02:25 2012 (r242833) @@ -308,7 +308,6 @@ pfs_mount(struct pfs_info *pi, struct mo MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); mp->mnt_data = pi; vfs_getnewfsid(mp); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -253,7 +253,6 @@ tmpfs_mount(struct mount *mp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); mp->mnt_data = tmp; Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/udf/udf_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -355,8 +355,7 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; udfmp->im_dev = dev; Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/unionfs/union_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -266,11 +266,6 @@ unionfs_domount(struct mount *mp) ump->um_copymode = copymode; ump->um_whitemode = whitemode; - MNT_ILOCK(mp); - if ((lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE) && - (upperrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE)) - mp->mnt_kern_flag |= MNTK_MPSAFE; - MNT_IUNLOCK(mp); mp->mnt_data = ump; /* Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/fs/unionfs/union_vnops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1867,8 +1867,7 @@ unionfs_lock(struct vop_lock1_args *ap) if ((revlock = unionfs_get_llt_revlock(vp, flags)) == 0) panic("unknown lock type: 0x%x", flags & LK_TYPE_MASK); - if ((mp->mnt_kern_flag & MNTK_MPSAFE) != 0 && - (vp->v_iflag & VI_OWEINACT) != 0) + if ((vp->v_iflag & VI_OWEINACT) != 0) flags |= LK_NOWAIT; /* Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -580,7 +580,6 @@ reiserfs_mountfs(struct vnode *devvp, st mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); #if defined(si_mountpoint) devvp->v_rdev->si_mountpoint = mp; Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/kern/uipc_mqueue.c Fri Nov 9 18:02:25 2012 (r242833) @@ -582,7 +582,6 @@ mqfs_mount(struct mount *mp) mp->mnt_data = &mqfs_data; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); vfs_getnewfsid(mp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/kern/vfs_subr.c Fri Nov 9 18:02:25 2012 (r242833) @@ -3110,7 +3110,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_SUSPEND); MNT_KERN_FLAG(MNTK_SUSPEND2); MNT_KERN_FLAG(MNTK_SUSPENDED); - MNT_KERN_FLAG(MNTK_MPSAFE); MNT_KERN_FLAG(MNTK_LOOKUP_SHARED); MNT_KERN_FLAG(MNTK_NOKNOTE); #undef MNT_KERN_FLAG Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/nfsclient/nfs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1193,7 +1193,7 @@ nfs_mount(struct mount *mp) out: if (!error) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED); + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; MNT_IUNLOCK(mp); } return (error); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/sys/mount.h Fri Nov 9 18:02:25 2012 (r242833) @@ -385,7 +385,7 @@ void __mnt_vnode_markerfree(str #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ -#define MNTK_MPSAFE 0x20000000 /* Filesystem is MPSAFE. */ +#define MNTK_UNUSED25 0x20000000 /* --available-- */ #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) @@ -1063,8 +1063,8 @@ ffs_mountfs(devvp, mp, td) * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED | MNTK_NO_IOPF; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | + MNTK_NO_IOPF; MNT_IUNLOCK(mp); #ifdef UFS_EXTATTR #ifdef UFS_EXTATTR_AUTOSTART From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:06:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8796A201; Fri, 9 Nov 2012 18:06:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 543438FC0C; Fri, 9 Nov 2012 18:06:51 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4026876lag.13 for ; Fri, 09 Nov 2012 10:06:50 -0800 (PST) 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=ZopoGox3pNUfCSf275b+e/TXW3jMDr1ZBjcDSWfHoHI=; b=wQz7Lv2uC7S9MJkJawRoo+yhDvh+3UxaPPOe0UtnfgWFOu29wgYKjuHZ3aniC4tiXa v4rhsEWLisSGK4KjucloXsoODLLXVjq1r9rTezpLBpB2ulHwlz8txIM5ZIO/cMaQIeaq PW+ZIwG/VU8LQ5V/Setf6MZOdqqBYTygFbxQjmLefLuu06EuuMzEPL4psKSoPQLJ2SKf 0JYlISHjPL0SmbJ69jbhm94KFCpqulwOd4X4055GfS5PocxVleYOVxciGV+7zSsaQJQ+ 2iKu1gqt5GiiSl+IFypngJ2ZXye6gFPQ5zHSNWwiIi645y36mTCd2ihqvQ3TlA245u2d 4sUw== MIME-Version: 1.0 Received: by 10.152.105.103 with SMTP id gl7mr11195199lab.10.1352484410006; Fri, 09 Nov 2012 10:06:50 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Fri, 9 Nov 2012 10:06:49 -0800 (PST) In-Reply-To: References: <201210221750.q9MHot26061585@svn.freebsd.org> Date: Fri, 9 Nov 2012 18:06:49 +0000 X-Google-Sender-Auth: fHZTqy9pmggbuY6ijrBzHsJpDBY Message-ID: Subject: Re: svn commit: r241896 - in head: . cddl/contrib/opensolaris/lib/libzpool/common/sys share/man/man9 sys/cam/ctl sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/openso... From: Attilio Rao To: Ben Kaduk Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:06:52 -0000 On Tue, Nov 6, 2012 at 10:50 PM, Ben Kaduk wrote: > On Mon, Oct 22, 2012 at 1:50 PM, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Oct 22 17:50:54 2012 >> New Revision: 241896 >> URL: http://svn.freebsd.org/changeset/base/241896 >> >> Log: >> Remove the support for using non-mpsafe filesystem modules. >> >> In particular, do not lock Giant conditionally when calling into the >> filesystem module, remove the VFS_LOCK_GIANT() and related >> macros. Stop handling buffers belonging to non-mpsafe filesystems. >> >> The VFS_VERSION is bumped to indicate the interface change which does >> not result in the interface signatures changes. >> >> Conducted and reviewed by: attilio >> Tested by: pho >> > > Sorry for late reply. > > % --- head/sys/sys/namei.h 2011/12/29 12:28:05 228952 > % +++ head/sys/sys/namei.h 2012/10/22 17:50:54 241896 > % @@ -144,15 +144,11 @@ > % #define ISOPEN 0x00200000 /* caller is opening; return a real vnode. */ > % #define NOCROSSMOUNT 0x00400000 /* do not cross mount points */ > % #define NOMACCHECK 0x00800000 /* do not perform MAC checks */ > % -#define MPSAFE 0x01000000 /* namei() must acquire Giant if needed. */ > > It seems that removing the definition of MPSAFE causes out-of-tree > filesystem modules to not build. > Perhaps a definition can remain for some period to allow a smoother transition? > Conditional on __FreeBSD_Version is the proper fix, of course, but > takes longer to get everywhere. Hi Ben, FYI I've now removed also MNTK_MPSAFE flag. I know this could introduce some more "turbolence" for porting thirdy part stuff, but actually this only gives one single breakage window and now people can fix correctly their port/thirdy part just once. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:11:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62AC0438; Fri, 9 Nov 2012 18:11:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id BC0618FC08; Fri, 9 Nov 2012 18:11:10 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA9IB4Jh060576; Fri, 9 Nov 2012 20:11:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-DKIM: OpenDKIM Filter v2.5.2 kib.kiev.ua qA9IB4Jh060576 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA9IB38f060575; Fri, 9 Nov 2012 20:11:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Nov 2012 20:11:03 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... Message-ID: <20121109181103.GF73505@kib.kiev.ua> References: <201211091802.qA9I2QP6026142@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nZI+t0v/pUPN+ap0" Content-Disposition: inline In-Reply-To: <201211091802.qA9I2QP6026142@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:11:11 -0000 --nZI+t0v/pUPN+ap0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 09, 2012 at 06:02:26PM +0000, Attilio Rao wrote: > Author: attilio > Date: Fri Nov 9 18:02:25 2012 > New Revision: 242833 > URL: http://svnweb.freebsd.org/changeset/base/242833 >=20 > Log: > Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. > Porters should refer to __FreeBSD_version 1000021 for this change as > it may have happened at the same timeframe. >=20 > Modified: head/sys/fs/fuse/fuse_vfsops.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/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) > +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) > @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) > =20 > vfs_getnewfsid(mp); > mp->mnt_flag |=3D MNT_LOCAL; > - mp->mnt_kern_flag |=3D MNTK_MPSAFE; > if (subtype) { > strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); > strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); mnt_flag update should happen under the mount interlock. --nZI+t0v/pUPN+ap0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCdRzcACgkQC3+MBN1Mb4hIpQCg1gH8OpKDt6m8VOyojgY8OguB ah8AoK9/ncPYRbnbAvXU+4v6OBx9ldLy =OhH2 -----END PGP SIGNATURE----- --nZI+t0v/pUPN+ap0-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:23:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C756D7D7; Fri, 9 Nov 2012 18:23:38 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD2FF8FC08; Fri, 9 Nov 2012 18:23:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9INcNA029758; Fri, 9 Nov 2012 18:23:38 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9INcxw029757; Fri, 9 Nov 2012 18:23:38 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201211091823.qA9INcxw029757@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 9 Nov 2012 18:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242834 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:23:38 -0000 Author: melifaro Date: Fri Nov 9 18:23:38 2012 New Revision: 242834 URL: http://svnweb.freebsd.org/changeset/base/242834 Log: Simplify sending keepalives. Prepare ipfw_tick() to be used by other consumers. Reviewed by: ae(basically) MFC after: 2 weeks Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 9 18:02:25 2012 (r242833) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Fri Nov 9 18:23:38 2012 (r242834) @@ -971,6 +971,31 @@ ipfw_send_pkt(struct mbuf *replyto, stru } /* + * Queue keepalive packets for given dynamic rule + */ +static struct mbuf ** +ipfw_dyn_send_ka(struct mbuf **mtailp, ipfw_dyn_rule *q) +{ + struct mbuf *m_rev, *m_fwd; + + m_rev = (q->state & ACK_REV) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, q->ack_fwd, TH_SYN); + m_fwd = (q->state & ACK_FWD) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, q->ack_rev, 0); + + if (m_rev != NULL) { + *mtailp = m_rev; + mtailp = &(*mtailp)->m_nextpkt; + } + if (m_fwd != NULL) { + *mtailp = m_fwd; + mtailp = &(*mtailp)->m_nextpkt; + } + + return (mtailp); +} + +/* * This procedure is only used to handle keepalives. It is invoked * every dyn_keepalive_period */ @@ -978,9 +1003,7 @@ static void ipfw_tick(void * vnetx) { struct mbuf *m0, *m, *mnext, **mtailp; -#ifdef INET6 - struct mbuf *m6, **m6_tailp; -#endif + struct ip *h; int i; ipfw_dyn_rule *q; #ifdef VIMAGE @@ -999,15 +1022,14 @@ ipfw_tick(void * vnetx) */ m0 = NULL; mtailp = &m0; -#ifdef INET6 - m6 = NULL; - m6_tailp = &m6; -#endif IPFW_DYN_LOCK(); for (i = 0 ; i < V_curr_dyn_buckets ; i++) { for (q = V_ipfw_dyn_v[i] ; q ; q = q->next ) { if (q->dyn_type == O_LIMIT_PARENT) continue; + if (TIME_LEQ(q->expire, time_uptime)) + continue; /* too late, rule expired */ + if (q->id.proto != IPPROTO_TCP) continue; if ( (q->state & BOTH_SYN) != BOTH_SYN) @@ -1015,55 +1037,24 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(time_uptime + V_dyn_keepalive_interval, q->expire)) continue; /* too early */ - if (TIME_LEQ(q->expire, time_uptime)) - continue; /* too late, rule expired */ - m = (q->state & ACK_REV) ? NULL : - ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, - q->ack_fwd, TH_SYN); - mnext = (q->state & ACK_FWD) ? NULL : - ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, - q->ack_rev, 0); - - switch (q->id.addr_type) { - case 4: - if (m != NULL) { - *mtailp = m; - mtailp = &(*mtailp)->m_nextpkt; - } - if (mnext != NULL) { - *mtailp = mnext; - mtailp = &(*mtailp)->m_nextpkt; - } - break; -#ifdef INET6 - case 6: - if (m != NULL) { - *m6_tailp = m; - m6_tailp = &(*m6_tailp)->m_nextpkt; - } - if (mnext != NULL) { - *m6_tailp = mnext; - m6_tailp = &(*m6_tailp)->m_nextpkt; - } - break; -#endif - } + mtailp = ipfw_dyn_send_ka(mtailp, q); } } IPFW_DYN_UNLOCK(); + + /* Send keepalive packets if any */ for (m = m0; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; - ip_output(m, NULL, NULL, 0, NULL, NULL); - } + h = mtod(m, struct ip *); + if (h->ip_v == 4) + ip_output(m, NULL, NULL, 0, NULL, NULL); #ifdef INET6 - for (m = m6; m != NULL; m = mnext) { - mnext = m->m_nextpkt; - m->m_nextpkt = NULL; - ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); - } + else + ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); #endif + } done: callout_reset_on(&V_ipfw_timeout, V_dyn_keepalive_period * hz, ipfw_tick, vnetx, 0); From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F22B6FC1; Fri, 9 Nov 2012 18:47:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id E9A1C8FC12; Fri, 9 Nov 2012 18:47:36 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4060649lag.13 for ; Fri, 09 Nov 2012 10:47:35 -0800 (PST) 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=HMBmCecJP7ZHObL9UxiZc+/9xQWeS4AoPLKJErmH2hk=; b=YGtYcyoYlJ7sIi9eQj5sjlhfaRc67jCh6K/7B3ebiTM/pZhIcW+/sHUs3e7sgJQbTo WhVIgYkWnY/S4xffK3eJMS/fB1kXe7cJs/3YgAtYQeIdK0FIjjsj/H7BKqSu6dHZz9RQ kL0foaZMhazXPnMl/DX0C9wko4ue4cBD3dEVkAsj/YcO6/AaTD1kQL3zBke+hxVWgDR2 rYAPaaOvHNGBPm00M14gVnppCjFrltgbwXGsUUXIabe3L89nQB47V8f7eECKwaDxyomH 2ww22qqM5glDb+EMaDr8PXDh+OIdT5O6vrDRcqEzZA4HnO+xUgvHjA/1DJdIPrxGFAdq VILg== MIME-Version: 1.0 Received: by 10.152.123.103 with SMTP id lz7mr11277909lab.21.1352486855578; Fri, 09 Nov 2012 10:47:35 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Fri, 9 Nov 2012 10:47:35 -0800 (PST) In-Reply-To: <20121109181103.GF73505@kib.kiev.ua> References: <201211091802.qA9I2QP6026142@svn.freebsd.org> <20121109181103.GF73505@kib.kiev.ua> Date: Fri, 9 Nov 2012 18:47:35 +0000 X-Google-Sender-Auth: EY4_GSgG3heCa-c0oCnmb6RXBLg Message-ID: Subject: Re: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:47:38 -0000 On Fri, Nov 9, 2012 at 6:11 PM, Konstantin Belousov wrote: > On Fri, Nov 09, 2012 at 06:02:26PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Fri Nov 9 18:02:25 2012 >> New Revision: 242833 >> URL: http://svnweb.freebsd.org/changeset/base/242833 >> >> Log: >> Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. >> Porters should refer to __FreeBSD_version 1000021 for this change as >> it may have happened at the same timeframe. >> >> Modified: head/sys/fs/fuse/fuse_vfsops.c >> ============================================================================== >> --- head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) >> +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) >> @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) >> >> vfs_getnewfsid(mp); >> mp->mnt_flag |= MNT_LOCAL; >> - mp->mnt_kern_flag |= MNTK_MPSAFE; >> if (subtype) { >> strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); >> strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); > > mnt_flag update should happen under the mount interlock. Yes I already have a patch for that, I'm waiting for testing by flo. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:50:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45C881C6; Fri, 9 Nov 2012 18:50:55 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4A49F8FC0A; Fri, 9 Nov 2012 18:50:53 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4063364lag.13 for ; Fri, 09 Nov 2012 10:50:52 -0800 (PST) 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=MpZx6mAmRQsXAow1YPKuugmuFPpZB8MEF+1n0PFH5SE=; b=SN2Q4Y6mWBumykoTZBuxfqa/hkM2jq6vyTWUWttQZeMYmojAwEYTxEh7kwYcKmEV3j EMAdoyORgSdVqNVwdDQvvee7wbB7kiDCZO+aTKewXxUZijX+3N7Am8pf2fuJ/J9FQIE9 EAPuJtqtDPnDd0k5qzssJ3zwZAzpuhd/Qw0X9neA8EeaaOkNbWFIgNOlwNOiGkVUr6J7 ErnuXrlFVsB49xKRjMkaBhQL1kDkZo8UxPSxjn/yztH5eYJiZT59Z1zhdKkvpbA/GOjS D4KWXRpQFCx0lGYdYsCVou1gD1FOTbJJfk9kE9VGoy6IEb1kWydFOmB32d+/2jvg7xDZ bxpw== MIME-Version: 1.0 Received: by 10.152.123.103 with SMTP id lz7mr11284996lab.21.1352487052737; Fri, 09 Nov 2012 10:50:52 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Fri, 9 Nov 2012 10:50:52 -0800 (PST) In-Reply-To: References: <201211091802.qA9I2QP6026142@svn.freebsd.org> <20121109181103.GF73505@kib.kiev.ua> Date: Fri, 9 Nov 2012 18:50:52 +0000 X-Google-Sender-Auth: JvjQyhfUI9syI2EUQQbVpDyNg2E Message-ID: Subject: Re: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:50:55 -0000 On Fri, Nov 9, 2012 at 6:47 PM, Attilio Rao wrote: > On Fri, Nov 9, 2012 at 6:11 PM, Konstantin Belousov wrote: >> On Fri, Nov 09, 2012 at 06:02:26PM +0000, Attilio Rao wrote: >>> Author: attilio >>> Date: Fri Nov 9 18:02:25 2012 >>> New Revision: 242833 >>> URL: http://svnweb.freebsd.org/changeset/base/242833 >>> >>> Log: >>> Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. >>> Porters should refer to __FreeBSD_version 1000021 for this change as >>> it may have happened at the same timeframe. >>> >>> Modified: head/sys/fs/fuse/fuse_vfsops.c >>> ============================================================================== >>> --- head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 (r242832) >>> +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 (r242833) >>> @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) >>> >>> vfs_getnewfsid(mp); >>> mp->mnt_flag |= MNT_LOCAL; >>> - mp->mnt_kern_flag |= MNTK_MPSAFE; >>> if (subtype) { >>> strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); >>> strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); >> >> mnt_flag update should happen under the mount interlock. > > Yes I already have a patch for that, I'm waiting for testing by flo. http://www.freebsd.org/~attilio/fuse_mnt_flag.patch Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 18:56:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 265E1668; Fri, 9 Nov 2012 18:56:28 +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 0CBC88FC0A; Fri, 9 Nov 2012 18:56:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9IuRqL035170; Fri, 9 Nov 2012 18:56:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9IuRxX035169; Fri, 9 Nov 2012 18:56:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211091856.qA9IuRxX035169@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Nov 2012 18:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242835 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:56:28 -0000 Author: dim Date: Fri Nov 9 18:56:27 2012 New Revision: 242835 URL: http://svnweb.freebsd.org/changeset/base/242835 Log: Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as the FreeBSD ABI requires. This is essentially a revert of upstream llvm commit r126226, and it will be reverted by upstream too. MFC after: 1 week Modified: head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Modified: head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Fri Nov 9 18:23:38 2012 (r242834) +++ head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Fri Nov 9 18:56:27 2012 (r242835) @@ -416,12 +416,12 @@ X86Subtarget::X86Subtarget(const std::st assert((!In64BitMode || HasX86_64) && "64-bit code requested on a subtarget that doesn't support it!"); - // Stack alignment is 16 bytes on Darwin, FreeBSD, Linux and Solaris (both - // 32 and 64 bit) and for all 64-bit targets. + // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both 32 and 64 + // bit) and for all 64-bit targets. if (StackAlignOverride) stackAlignment = StackAlignOverride; - else if (isTargetDarwin() || isTargetFreeBSD() || isTargetLinux() || - isTargetSolaris() || In64BitMode) + else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() || + In64BitMode) stackAlignment = 16; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:18:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0F71F27; Fri, 9 Nov 2012 19:18:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 418F88FC0A; Fri, 9 Nov 2012 19:18:36 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA9JIVY6066906; Fri, 9 Nov 2012 21:18:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-DKIM: OpenDKIM Filter v2.5.2 kib.kiev.ua qA9JIVY6066906 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA9JIVK2066905; Fri, 9 Nov 2012 21:18:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Nov 2012 21:18:31 +0200 From: Konstantin Belousov To: Dimitry Andric Subject: Re: svn commit: r242835 - head/contrib/llvm/lib/Target/X86 Message-ID: <20121109191831.GG73505@kib.kiev.ua> References: <201211091856.qA9IuRxX035169@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hSgrh6VlWhhGqruz" Content-Disposition: inline In-Reply-To: <201211091856.qA9IuRxX035169@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:18:36 -0000 --hSgrh6VlWhhGqruz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 09, 2012 at 06:56:27PM +0000, Dimitry Andric wrote: > Author: dim > Date: Fri Nov 9 18:56:27 2012 > New Revision: 242835 > URL: http://svnweb.freebsd.org/changeset/base/242835 >=20 > Log: > Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as > the FreeBSD ABI requires. This is essentially a revert of upstream llvm > commit r126226, and it will be reverted by upstream too. > =20 > MFC after: 1 week >=20 > Modified: > head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp >=20 > Modified: head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/llvm/lib/Target/X86/X86Subtarget.cpp Fri Nov 9 18:23:38= 2012 (r242834) > +++ head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp Fri Nov 9 18:56:27= 2012 (r242835) > @@ -416,12 +416,12 @@ X86Subtarget::X86Subtarget(const std::st > assert((!In64BitMode || HasX86_64) && > "64-bit code requested on a subtarget that doesn't support it!"= ); > =20 > - // Stack alignment is 16 bytes on Darwin, FreeBSD, Linux and Solaris (= both > - // 32 and 64 bit) and for all 64-bit targets. > + // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both 32 a= nd 64 > + // bit) and for all 64-bit targets. > if (StackAlignOverride) > stackAlignment =3D StackAlignOverride; > - else if (isTargetDarwin() || isTargetFreeBSD() || isTargetLinux() || > - isTargetSolaris() || In64BitMode) > + else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() || > + In64BitMode) > stackAlignment =3D 16; > } > =20 Great, thank you for taking care of this. --hSgrh6VlWhhGqruz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCdVwcACgkQC3+MBN1Mb4gnBQCgpycCgPxe9LwwdYAGDZDk600P EsgAoMs9CuQzXGo5N6vcnvFNR8Md0qH+ =IbZs -----END PGP SIGNATURE----- --hSgrh6VlWhhGqruz-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:23:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 540CE25A; Fri, 9 Nov 2012 19:23:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id E53288FC12; Fri, 9 Nov 2012 19:23:02 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA9JMsMs067422; Fri, 9 Nov 2012 21:22:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-DKIM: OpenDKIM Filter v2.5.2 kib.kiev.ua qA9JMsMs067422 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA9JMsGQ067421; Fri, 9 Nov 2012 21:22:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Nov 2012 21:22:54 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... Message-ID: <20121109192254.GH73505@kib.kiev.ua> References: <201211091802.qA9I2QP6026142@svn.freebsd.org> <20121109181103.GF73505@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/xzC8FKR3TvyAjXE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:23:03 -0000 --/xzC8FKR3TvyAjXE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 09, 2012 at 06:50:52PM +0000, Attilio Rao wrote: > On Fri, Nov 9, 2012 at 6:47 PM, Attilio Rao wrote: > > On Fri, Nov 9, 2012 at 6:11 PM, Konstantin Belousov wrote: > >> On Fri, Nov 09, 2012 at 06:02:26PM +0000, Attilio Rao wrote: > >>> Author: attilio > >>> Date: Fri Nov 9 18:02:25 2012 > >>> New Revision: 242833 > >>> URL: http://svnweb.freebsd.org/changeset/base/242833 > >>> > >>> Log: > >>> Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. > >>> Porters should refer to __FreeBSD_version 1000021 for this change as > >>> it may have happened at the same timeframe. > >>> > >>> Modified: head/sys/fs/fuse/fuse_vfsops.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/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 = (r242832) > >>> +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 = (r242833) > >>> @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) > >>> > >>> vfs_getnewfsid(mp); > >>> mp->mnt_flag |=3D MNT_LOCAL; > >>> - mp->mnt_kern_flag |=3D MNTK_MPSAFE; > >>> if (subtype) { > >>> strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); > >>> strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); > >> > >> mnt_flag update should happen under the mount interlock. > > > > Yes I already have a patch for that, I'm waiting for testing by flo. >=20 > http://www.freebsd.org/~attilio/fuse_mnt_flag.patch Why mp->mnt_data and mp->mnt_stat.f_iosize updates are synchronized ? VFS does not modify them. --/xzC8FKR3TvyAjXE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCdWA0ACgkQC3+MBN1Mb4iYxQCcDdn67LUqowhwy4Ou4Fb7SUiC 21wAoKy5OWL6i517n622hcqBh+2gnMC7 =lZHx -----END PGP SIGNATURE----- --/xzC8FKR3TvyAjXE-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:31:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6123A544; Fri, 9 Nov 2012 19:31:32 +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 455198FC08; Fri, 9 Nov 2012 19:31:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JVWiw041024; Fri, 9 Nov 2012 19:31:32 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JVWGv041023; Fri, 9 Nov 2012 19:31:32 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211091931.qA9JVWGv041023@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 9 Nov 2012 19:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242836 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:31:32 -0000 Author: mjg Date: Fri Nov 9 19:31:31 2012 New Revision: 242836 URL: http://svnweb.freebsd.org/changeset/base/242836 Log: MFC r242680: Fix possible spurious sbunlock in sctp_sorecvmsg. Approved by: trasz (mentor) Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Fri Nov 9 18:56:27 2012 (r242835) +++ stable/9/sys/netinet/sctputil.c Fri Nov 9 19:31:31 2012 (r242836) @@ -5264,10 +5264,10 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); - sockbuf_lock = 1; if (error) { goto release_unlocked; } + sockbuf_lock = 1; restart: From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:32:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53BA36B8; Fri, 9 Nov 2012 19:32:38 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 627618FC0C; Fri, 9 Nov 2012 19:32:36 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4098174lag.13 for ; Fri, 09 Nov 2012 11:32:36 -0800 (PST) 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=GtcudtqUtLkKh/Bd2hNEljaq6UTpU0EyCfqPPOudKGg=; b=pUW5hYov4UxuqFiS/uBV+KZxNcu74N25Nh+0r8jnApNeLwtRjT8y0ZPqUHrI83k1wS YRJaldlXlOqPhz+Zcmjq2HD57FYGJHyOiUqAuI17FbrKFJafaNgkgH71o1KRom6nQCSb LDs2Uil7hQrYUf3rIDuW1zSnUjJf+5LsYx6offAfVNyoUp7aEWPqKNJqaAAx+aYLT/m5 Et1MlObhDZr5LkOcIntkKtKj87stxTymIAmylrHFO8IgEcgI+hgfN5tvrsb2+FXxPgB+ Upmq4Af46+e8GiXypMKHnz+594YWnnLptwSSZBrC9e1U05Sp2TGXgsKBQ3zHXFUr46jB w+Hw== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr11736256lab.9.1352489555954; Fri, 09 Nov 2012 11:32:35 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Fri, 9 Nov 2012 11:32:35 -0800 (PST) In-Reply-To: <20121109192254.GH73505@kib.kiev.ua> References: <201211091802.qA9I2QP6026142@svn.freebsd.org> <20121109181103.GF73505@kib.kiev.ua> <20121109192254.GH73505@kib.kiev.ua> Date: Fri, 9 Nov 2012 19:32:35 +0000 X-Google-Sender-Auth: 06q56xYbX_EaOKiBoknJrIfC9x8 Message-ID: Subject: Re: svn commit: r242833 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/nfsclient fs/nullfs fs/pseudofs fs/tmpfs fs/udf... From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:32:38 -0000 On 11/9/12, Konstantin Belousov wrote: > On Fri, Nov 09, 2012 at 06:50:52PM +0000, Attilio Rao wrote: >> On Fri, Nov 9, 2012 at 6:47 PM, Attilio Rao wrote: >> > On Fri, Nov 9, 2012 at 6:11 PM, Konstantin Belousov >> > wrote: >> >> On Fri, Nov 09, 2012 at 06:02:26PM +0000, Attilio Rao wrote: >> >>> Author: attilio >> >>> Date: Fri Nov 9 18:02:25 2012 >> >>> New Revision: 242833 >> >>> URL: http://svnweb.freebsd.org/changeset/base/242833 >> >>> >> >>> Log: >> >>> Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. >> >>> Porters should refer to __FreeBSD_version 1000021 for this change >> >>> as >> >>> it may have happened at the same timeframe. >> >>> >> >>> Modified: head/sys/fs/fuse/fuse_vfsops.c >> >>> ============================================================================== >> >>> --- head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 17:56:49 2012 >> >>> (r242832) >> >>> +++ head/sys/fs/fuse/fuse_vfsops.c Fri Nov 9 18:02:25 2012 >> >>> (r242833) >> >>> @@ -339,7 +339,6 @@ fuse_vfsop_mount(struct mount *mp) >> >>> >> >>> vfs_getnewfsid(mp); >> >>> mp->mnt_flag |= MNT_LOCAL; >> >>> - mp->mnt_kern_flag |= MNTK_MPSAFE; >> >>> if (subtype) { >> >>> strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); >> >>> strlcat(mp->mnt_stat.f_fstypename, subtype, >> >>> MFSNAMELEN); >> >> >> >> mnt_flag update should happen under the mount interlock. >> > >> > Yes I already have a patch for that, I'm waiting for testing by flo. >> >> http://www.freebsd.org/~attilio/fuse_mnt_flag.patch > > Why mp->mnt_data and mp->mnt_stat.f_iosize updates are synchronized ? > VFS does not modify them. mnt_data is used within FUSE in a twisted way and MNT_ILOCK is just convenient for it. I need to recheck mnt_stat.f_iosize. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:32:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 624736B9; Fri, 9 Nov 2012 19:32:38 +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 4817B8FC14; Fri, 9 Nov 2012 19:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JWcHv041244; Fri, 9 Nov 2012 19:32:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JWc1D041242; Fri, 9 Nov 2012 19:32:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211091932.qA9JWc1D041242@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Nov 2012 19:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242837 - stable/9/lib/libpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:32:38 -0000 Author: dim Date: Fri Nov 9 19:32:37 2012 New Revision: 242837 URL: http://svnweb.freebsd.org/changeset/base/242837 Log: MFC r242622: Fix a few warnings from newer clang 3.2 in libpmc, about comparing enum pmc_event values against integer constants which fall outside the enum range. Reviewed by: fabient, sbruno Modified: stable/9/lib/libpmc/libpmc.c Directory Properties: stable/9/lib/libpmc/ (props changed) Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Fri Nov 9 19:31:31 2012 (r242836) +++ stable/9/lib/libpmc/libpmc.c Fri Nov 9 19:32:37 2012 (r242837) @@ -2261,7 +2261,7 @@ soft_allocate_pmc(enum pmc_event pe, cha (void)ctrspec; (void)pmc_config; - if (pe < PMC_EV_SOFT_FIRST || pe > PMC_EV_SOFT_LAST) + if ((int)pe < PMC_EV_SOFT_FIRST || (int)pe > PMC_EV_SOFT_LAST) return (-1); pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); @@ -3168,7 +3168,7 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe == PMC_EV_TSC_TSC) { ev = tsc_event_table; evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); - } else if (pe >= PMC_EV_SOFT_FIRST && pe <= PMC_EV_SOFT_LAST) { + } else if ((int)pe >= PMC_EV_SOFT_FIRST && (int)pe <= PMC_EV_SOFT_LAST) { ev = soft_event_table; evfence = soft_event_table + soft_event_info.pm_nevent; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:35:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEC7E9C0; Fri, 9 Nov 2012 19:35:46 +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 98EED8FC12; Fri, 9 Nov 2012 19:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JZkp1041782; Fri, 9 Nov 2012 19:35:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JZkXF041781; Fri, 9 Nov 2012 19:35:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211091935.qA9JZkXF041781@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Nov 2012 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242838 - stable/9/sys/contrib/ngatm/netnatm/msg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:35:46 -0000 Author: dim Date: Fri Nov 9 19:35:46 2012 New Revision: 242838 URL: http://svnweb.freebsd.org/changeset/base/242838 Log: MFC r242623: In sys/contrib/ngatm/netnatm/msg/uni_ie.c, fix a few warnings from newer versions of clang 3.2, about comparing enum uni_cause values against integer constants which fall outside the enum range. No functional change. Modified: stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c ============================================================================== --- stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Fri Nov 9 19:32:37 2012 (r242837) +++ stable/9/sys/contrib/ngatm/netnatm/msg/uni_ie.c Fri Nov 9 19:35:46 2012 (r242838) @@ -869,7 +869,7 @@ UNI_DECLARE_CAUSE_VALUES enum uni_diag uni_diag(enum uni_cause cause, enum uni_coding code) { - if (cause >= 128) + if ((int)cause >= 128) return (UNI_DIAG_NONE); if (code == UNI_CODING_NET) @@ -925,9 +925,9 @@ print_cause(struct unicx *cx, struct uni if (uni_print_iehdr("cause", &ie->h, cx)) return; - if (ie->cause < 128 && tab1[ie->cause].str) + if ((int)ie->cause < 128 && tab1[ie->cause].str) strcpy(buf, tab1[ie->cause].str); - else if (ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) + else if ((int)ie->cause < 128 && tab2 != NULL && tab2[ie->cause].str != NULL) strcpy(buf, tab2[ie->cause].str); else { sprintf(buf, "UNKNOWN-%u", ie->cause); @@ -1059,7 +1059,7 @@ check_cause(struct uni_ie_cause *ie, str const struct causetab *ptr; - if (ie->cause >= 128) + if ((int)ie->cause >= 128) return (-1); switch (ie->loc) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 19:45:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40F67D85; Fri, 9 Nov 2012 19:45:18 +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 269CB8FC15; Fri, 9 Nov 2012 19:45:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9JjHPD043281; Fri, 9 Nov 2012 19:45:18 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9JjH4f043280; Fri, 9 Nov 2012 19:45:17 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211091945.qA9JjH4f043280@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 9 Nov 2012 19:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242839 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 19:45:18 -0000 Author: mjg Date: Fri Nov 9 19:45:17 2012 New Revision: 242839 URL: http://svnweb.freebsd.org/changeset/base/242839 Log: MFC r242680: Fix possible spurious sbunlock in sctp_sorecvmsg. Approved by: trasz (mentor) Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Nov 9 19:35:46 2012 (r242838) +++ stable/8/sys/netinet/sctputil.c Fri Nov 9 19:45:17 2012 (r242839) @@ -5188,10 +5188,10 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); - sockbuf_lock = 1; if (error) { goto release_unlocked; } + sockbuf_lock = 1; restart: From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 20:19:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4378FCA8; Fri, 9 Nov 2012 20:19:57 +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 084D48FC08; Fri, 9 Nov 2012 20:19:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9KJuBr049276; Fri, 9 Nov 2012 20:19:56 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9KJuVb049274; Fri, 9 Nov 2012 20:19:56 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201211092019.qA9KJuVb049274@svn.freebsd.org> From: Peter Wemm Date: Fri, 9 Nov 2012 20:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242840 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 20:19:57 -0000 Author: peter Date: Fri Nov 9 20:19:56 2012 New Revision: 242840 URL: http://svnweb.freebsd.org/changeset/base/242840 Log: Undo over-aggressive conversion of spaces to tabs. ie: those within format strings, "period, space, space" in comment text, etc. Modified: head/bin/ls/ls.c head/bin/ls/print.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Fri Nov 9 19:45:17 2012 (r242839) +++ head/bin/ls/ls.c Fri Nov 9 20:19:56 2012 (r242840) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1) /* - * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width + * MAKENINES(n) turns n into (10**n)-1. This is useful for converting a width * into a number that wide in decimal. * XXX: Overflows are not considered. */ @@ -241,7 +241,7 @@ main(int argc, char *argv[]) f_timesort = 1; f_sizesort = 0; break; - /* Other flags. Please keep alphabetic. */ + /* Other flags. Please keep alphabetic. */ case ',': f_thousands = 1; break; @@ -534,7 +534,7 @@ traverse(int argc, char *argv[], int opt /* * If already output something, put out a newline as - * a separator. If multiple arguments, precede each + * a separator. If multiple arguments, precede each * directory with its name. */ if (output) { @@ -874,7 +874,7 @@ label_out: /* * Ordering for mastercmp: * If ordering the argv (fts_level = FTS_ROOTLEVEL) return non-directories - * as larger than directories. Within either group, use the sort function. + * as larger than directories. Within either group, use the sort function. * All other levels use the sort function. Error entries remain unsorted. */ static int Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Fri Nov 9 19:45:17 2012 (r242839) +++ head/bin/ls/print.c Fri Nov 9 20:19:56 2012 (r242840) @@ -160,7 +160,7 @@ printlong(const DISPLAY *dp) strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, + (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink, sp->st_nlink, dp->s_user, np->user, dp->s_group, np->group); if (f_flags) @@ -382,7 +382,7 @@ printtime(time_t ftime) format = d_first ? "%e %b %R" : "%b %e %R"; else /* mmm dd yyyy || dd mmm yyyy */ - format = d_first ? "%e %b %Y" : "%b %e %Y"; + format = d_first ? "%e %b %Y" : "%b %e %Y"; strftime(longstring, sizeof(longstring), format, localtime(&ftime)); fputs(longstring, stdout); fputc(' ', stdout); From owner-svn-src-all@FreeBSD.ORG Fri Nov 9 21:41:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C112DE84; Fri, 9 Nov 2012 21:41:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A54E68FC08; Fri, 9 Nov 2012 21:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qA9Lf7qM063209; Fri, 9 Nov 2012 21:41:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qA9Lf7eX063208; Fri, 9 Nov 2012 21:41:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211092141.qA9Lf7eX063208@svn.freebsd.org> From: Xin LI Date: Fri, 9 Nov 2012 21:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242841 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 21:41:07 -0000 Author: delphij Date: Fri Nov 9 21:41:07 2012 New Revision: 242841 URL: http://svnweb.freebsd.org/changeset/base/242841 Log: Use %s when calling make_dev with a string pointer. This makes clang happy. MFC after: 2 weeks Modified: head/sys/ofed/include/linux/cdev.h Modified: head/sys/ofed/include/linux/cdev.h ============================================================================== --- head/sys/ofed/include/linux/cdev.h Fri Nov 9 20:19:56 2012 (r242840) +++ head/sys/ofed/include/linux/cdev.h Fri Nov 9 21:41:07 2012 (r242841) @@ -107,7 +107,7 @@ cdev_add(struct linux_cdev *cdev, dev_t if (count != 1) panic("cdev_add: Unsupported count: %d", count); cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), 0, 0, 0700, - kobject_name(&cdev->kobj)); + "%s", kobject_name(&cdev->kobj)); cdev->dev = dev; cdev->cdev->si_drv1 = cdev; From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 00:32:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99548B74; Sat, 10 Nov 2012 00:32: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 7F8A38FC1A; Sat, 10 Nov 2012 00:32:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA0Wl5R090499; Sat, 10 Nov 2012 00:32:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA0Wlvw090497; Sat, 10 Nov 2012 00:32:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211100032.qAA0Wlvw090497@svn.freebsd.org> From: Xin LI Date: Sat, 10 Nov 2012 00:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242842 - in head/sys: conf modules/mthca X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 00:32:47 -0000 Author: delphij Date: Sat Nov 10 00:32:47 2012 New Revision: 242842 URL: http://svnweb.freebsd.org/changeset/base/242842 Log: Attempt toward a buildable universe by silenting a few warnings for OFED. Modified: head/sys/conf/kern.pre.mk head/sys/modules/mthca/Makefile Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Nov 9 21:41:07 2012 (r242841) +++ head/sys/conf/kern.pre.mk Sat Nov 10 00:32:47 2012 (r242842) @@ -156,7 +156,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLA # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include/ -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Modified: head/sys/modules/mthca/Makefile ============================================================================== --- head/sys/modules/mthca/Makefile Fri Nov 9 21:41:07 2012 (r242841) +++ head/sys/modules/mthca/Makefile Sat Nov 10 00:32:47 2012 (r242842) @@ -28,4 +28,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 00:36:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21A44FE1; Sat, 10 Nov 2012 00:36:54 +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 068FA8FC12; Sat, 10 Nov 2012 00:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA0areK091148; Sat, 10 Nov 2012 00:36:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA0arDU091147; Sat, 10 Nov 2012 00:36:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211100036.qAA0arDU091147@svn.freebsd.org> From: Dimitry Andric Date: Sat, 10 Nov 2012 00:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242843 - stable/9/usr.bin/clang/clang X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 00:36:54 -0000 Author: dim Date: Sat Nov 10 00:36:53 2012 New Revision: 242843 URL: http://svnweb.freebsd.org/changeset/base/242843 Log: MFC r242707: Belatedly add links from /usr/bin/clang to /usr/bin/CC, like it has been done for g++. Modified: stable/9/usr.bin/clang/clang/Makefile Directory Properties: stable/9/usr.bin/clang/ (props changed) Modified: stable/9/usr.bin/clang/clang/Makefile ============================================================================== --- stable/9/usr.bin/clang/clang/Makefile Sat Nov 10 00:32:47 2012 (r242842) +++ stable/9/usr.bin/clang/clang/Makefile Sat Nov 10 00:36:53 2012 (r242843) @@ -20,9 +20,11 @@ MLINKS= clang.1 clang++.1 \ .if ${MK_CLANG_IS_CC} != "no" LINKS+= ${BINDIR}/clang ${BINDIR}/cc \ ${BINDIR}/clang ${BINDIR}/c++ \ + ${BINDIR}/clang ${BINDIR}/CC \ ${BINDIR}/clang ${BINDIR}/cpp MLINKS+= clang.1 cc.1 \ clang.1 c++.1 \ + clang.1 CC.1 \ clang.1 cpp.1 .endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 01:46:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3139BB0; Sat, 10 Nov 2012 01:46:13 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C50CE8FC08; Sat, 10 Nov 2012 01:46:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA1kDJC001419; Sat, 10 Nov 2012 01:46:13 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA1kDsN001405; Sat, 10 Nov 2012 01:46:13 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201211100146.qAA1kDsN001405@svn.freebsd.org> From: Jason Evans Date: Sat, 10 Nov 2012 01:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242844 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 01:46:14 -0000 Author: jasone Date: Sat Nov 10 01:46:13 2012 New Revision: 242844 URL: http://svnweb.freebsd.org/changeset/base/242844 Log: Import jemalloc 3.2.0. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h head/contrib/jemalloc/include/jemalloc/internal/ctl.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/rtree.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/util.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/ChangeLog Sat Nov 10 01:46:13 2012 (r242844) @@ -6,6 +6,47 @@ found in the git revision history: http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git git://canonware.com/jemalloc.git +* 3.2.0 (November 9, 2012) + + In addition to a couple of bug fixes, this version modifies page run + allocation and dirty page purging algorithms in order to better control + page-level virtual memory fragmentation. + + Incompatible changes: + - Change the "opt.lg_dirty_mult" default from 5 to 3 (32:1 to 8:1). + + Bug fixes: + - Fix dss/mmap allocation precedence code to use recyclable mmap memory only + after primary dss allocation fails. + - Fix deadlock in the "arenas.purge" mallctl. This regression was introduced + in 3.1.0 by the addition of the "arena..purge" mallctl. + +* 3.1.0 (October 16, 2012) + + New features: + - Auto-detect whether running inside Valgrind, thus removing the need to + manually specify MALLOC_CONF=valgrind:true. + - Add the "arenas.extend" mallctl, which allows applications to create + manually managed arenas. + - Add the ALLOCM_ARENA() flag for {,r,d}allocm(). + - Add the "opt.dss", "arena..dss", and "stats.arenas..dss" mallctls, + which provide control over dss/mmap precedence. + - Add the "arena..purge" mallctl, which obsoletes "arenas.purge". + - Define LG_QUANTUM for hppa. + + Incompatible changes: + - Disable tcache by default if running inside Valgrind, in order to avoid + making unallocated objects appear reachable to Valgrind. + - Drop const from malloc_usable_size() argument on Linux. + + Bug fixes: + - Fix heap profiling crash if sampled object is freed via realloc(p, 0). + - Remove const from __*_hook variable declarations, so that glibc can modify + them during process forking. + - Fix mlockall(2)/madvise(2) interaction. + - Fix fork(2)-related deadlocks. + - Fix error return value for "thread.tcache.enabled" mallctl. + * 3.0.0 (May 11, 2012) Although this version adds some major new features, the primary focus is on Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/FREEBSD-diffs Sat Nov 10 01:46:13 2012 (r242844) @@ -1,5 +1,5 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index 877c500..7d659a7 100644 +index 54b8747..91c4a4e 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -51,12 +51,23 @@ @@ -27,7 +27,7 @@ index 877c500..7d659a7 100644 Standard API -@@ -2101,4 +2112,16 @@ malloc_conf = "lg_chunk:24";]]> +@@ -2170,4 +2181,16 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). @@ -45,7 +45,7 @@ index 877c500..7d659a7 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 268cd14..2acd2eb 100644 +index 475821a..73306ac 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1,5 +1,8 @@ @@ -97,19 +97,19 @@ index de44e14..564d604 100644 bool malloc_mutex_init(malloc_mutex_t *mutex); diff --git a/include/jemalloc/internal/private_namespace.h b/include/jemalloc/internal/private_namespace.h -index b816647..b8ce6b1 100644 +index 06241cd..7b19906 100644 --- a/include/jemalloc/internal/private_namespace.h +++ b/include/jemalloc/internal/private_namespace.h -@@ -186,7 +186,6 @@ - #define iqalloc JEMALLOC_N(iqalloc) +@@ -204,7 +204,6 @@ #define iralloc JEMALLOC_N(iralloc) + #define irallocx JEMALLOC_N(irallocx) #define isalloc JEMALLOC_N(isalloc) -#define isthreaded JEMALLOC_N(isthreaded) #define ivsalloc JEMALLOC_N(ivsalloc) #define jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child) #define jemalloc_postfork_parent JEMALLOC_N(jemalloc_postfork_parent) diff --git a/include/jemalloc/jemalloc.h.in b/include/jemalloc/jemalloc.h.in -index ad06948..505dd38 100644 +index 31b1304..c3ef2f5 100644 --- a/include/jemalloc/jemalloc.h.in +++ b/include/jemalloc/jemalloc.h.in @@ -15,6 +15,7 @@ extern "C" { @@ -122,7 +122,7 @@ index ad06948..505dd38 100644 #define ALLOCM_LG_ALIGN(la) (la) diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..9efab93 +index 0000000..9c97a13 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h @@ -0,0 +1,76 @@ @@ -203,7 +203,7 @@ index 0000000..9efab93 +#define pthread_mutex_lock _pthread_mutex_lock +#define pthread_mutex_unlock _pthread_mutex_unlock diff --git a/src/jemalloc.c b/src/jemalloc.c -index bc54cd7..fa9fcf0 100644 +index 8a667b6..aaf5012 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL) @@ -217,7 +217,7 @@ index bc54cd7..fa9fcf0 100644 /* Runtime configuration options. */ const char *je_malloc_conf; #ifdef JEMALLOC_DEBUG -@@ -429,7 +433,8 @@ malloc_conf_init(void) +@@ -448,7 +452,8 @@ malloc_conf_init(void) #endif ; @@ -228,12 +228,12 @@ index bc54cd7..fa9fcf0 100644 * Do nothing; opts is already initialized to * the value of the MALLOC_CONF environment diff --git a/src/mutex.c b/src/mutex.c -index 37a843e..4a90a05 100644 +index 55e18c2..6b6f438 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, #ifdef JEMALLOC_MUTEX_INIT_CB - int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, + JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex, void *(calloc_cb)(size_t, size_t)); + +__weak_reference(_pthread_mutex_init_calloc_cb_stub, @@ -250,7 +250,7 @@ index 37a843e..4a90a05 100644 bool diff --git a/src/util.c b/src/util.c -index 9b73c3e..f94799f 100644 +index b3a0114..df1c5d5 100644 --- a/src/util.c +++ b/src/util.c @@ -58,6 +58,22 @@ wrtmessage(void *cbopaque, const char *s) Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/VERSION Sat Nov 10 01:46:13 2012 (r242844) @@ -1 +1 @@ -3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046 +3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/doc/jemalloc.3 Sat Nov 10 01:46:13 2012 (r242844) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 05/12/2012 +.\" Date: 11/09/2012 .\" Manual: User Manual -.\" Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046 +.\" Source: jemalloc 3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9 .\" Language: English .\" -.TH "JEMALLOC" "3" "05/12/2012" "jemalloc 3.0.0-0-gfc9b1dbf69f5" "User Manual" +.TH "JEMALLOC" "3" "11/09/2012" "jemalloc 3.2.0-0-g87499f6748eb" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 3\&.0\&.0\-0\-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046\&. More information can be found at the +This manual describes jemalloc 3\&.2\&.0\-0\-g87499f6748ebe4817571e817e9f680ccb5bf54a9\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: @@ -310,6 +310,14 @@ Initialize newly allocated memory to con For reallocation, fail rather than moving the object\&. This constraint can apply to both growth and shrinkage\&. .RE .PP +\fBALLOCM_ARENA(\fR\fB\fIa\fR\fR\fB) \fR +.RS 4 +Use the arena specified by the index +\fIa\fR\&. This macro does not validate that +\fIa\fR +specifies an arena in the valid range\&. +.RE +.PP The \fBallocm\fR\fB\fR function allocates at least @@ -647,16 +655,23 @@ is specified during configuration, in wh Virtual memory chunk size (log base 2)\&. The default chunk size is 4 MiB (2^22)\&. .RE .PP +"opt\&.dss" (\fBconst char *\fR) r\- +.RS 4 +dss (\fBsbrk\fR(2)) allocation precedence as related to +\fBmmap\fR(2) +allocation\&. The following settings are supported: \(lqdisabled\(rq, \(lqprimary\(rq, and \(lqsecondary\(rq (default)\&. +.RE +.PP "opt\&.narenas" (\fBsize_t\fR) r\- .RS 4 -Maximum number of arenas to use\&. The default maximum number of arenas is four times the number of CPUs, or one if there is a single CPU\&. +Maximum number of arenas to use for automatic multiplexing of threads and arenas\&. The default is four times the number of CPUs, or one if there is a single CPU\&. .RE .PP "opt\&.lg_dirty_mult" (\fBssize_t\fR) r\- .RS 4 Per\-arena minimum ratio (log base 2) of active to dirty pages\&. Some dirty unused pages may be allowed to accumulate, within the limit set by the ratio (or one chunk worth of dirty pages, whichever is greater), before informing the kernel about some of those pages via \fBmadvise\fR(2) -or a similar system call\&. This provides the kernel with sufficient information to recycle dirty pages if physical memory becomes scarce and the pages remain unused\&. The default minimum ratio is 32:1 (2^5:1); an option value of \-1 will disable dirty page purging\&. +or a similar system call\&. This provides the kernel with sufficient information to recycle dirty pages if physical memory becomes scarce and the pages remain unused\&. The default minimum ratio is 8:1 (2^3:1); an option value of \-1 will disable dirty page purging\&. .RE .PP "opt\&.stats_print" (\fBbool\fR) r\- @@ -676,7 +691,8 @@ Junk filling enabled/disabled\&. If enab 0xa5\&. All deallocated memory will be initialized to 0x5a\&. This is intended for debugging and will impact performance negatively\&. This option is disabled by default unless \fB\-\-enable\-debug\fR -is specified during configuration, in which case it is enabled by default\&. +is specified during configuration, in which case it is enabled by default unless running inside +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2\&. .RE .PP "opt\&.quarantine" (\fBsize_t\fR) r\- [\fB\-\-enable\-fill\fR] @@ -684,7 +700,7 @@ is specified during configuration, in wh Per thread quarantine size in bytes\&. If non\-zero, each thread maintains a FIFO object quarantine that stores up to the specified number of bytes of memory\&. The quarantined memory is not freed until it is released from quarantine, though it is immediately junk\-filled if the "opt\&.junk" option is enabled\&. This feature is of particular use in combination with -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which can detect attempts to access quarantined objects\&. This is intended for debugging and will impact performance negatively\&. The default quarantine size is 0\&. +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which can detect attempts to access quarantined objects\&. This is intended for debugging and will impact performance negatively\&. The default quarantine size is 0 unless running inside Valgrind, in which case the default is 16 MiB\&. .RE .PP "opt\&.redzone" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] @@ -692,7 +708,7 @@ option is enabled\&. This feature is of Redzones enabled/disabled\&. If enabled, small allocations have redzones before and after them\&. Furthermore, if the "opt\&.junk" option is enabled, the redzones are checked for corruption during deallocation\&. However, the primary intended purpose of this feature is to be used in combination with -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which needs redzones in order to do effective buffer overflow/underflow detection\&. This option is intended for debugging and will impact performance negatively\&. This option is disabled by default\&. +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which needs redzones in order to do effective buffer overflow/underflow detection\&. This option is intended for debugging and will impact performance negatively\&. This option is disabled by default unless running inside Valgrind\&. .RE .PP "opt\&.zero" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] @@ -714,15 +730,7 @@ enabled/disabled\&. This option is disab "opt\&.valgrind" (\fBbool\fR) r\- [\fB\-\-enable\-valgrind\fR] .RS 4 \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2 -support enabled/disabled\&. If enabled, several other options are automatically modified during options processing to work well with Valgrind: -"opt\&.junk" -and -"opt\&.zero" -are set to false, -"opt\&.quarantine" -is set to 16 MiB, and -"opt\&.redzone" -is set to true\&. This option is disabled by default\&. +support enabled/disabled\&. This option is vestigal because jemalloc auto\-detects whether it is running inside Valgrind\&. This option is disabled by default, unless running inside Valgrind\&. .RE .PP "opt\&.xmalloc" (\fBbool\fR) r\- [\fB\-\-enable\-xmalloc\fR] @@ -749,7 +757,8 @@ This option is disabled by default\&. .RS 4 Thread\-specific caching enabled/disabled\&. When there are multiple threads, each thread uses a thread\-specific cache for objects up to a certain size\&. Thread\-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use\&. See the "opt\&.lg_tcache_max" -option for related tuning information\&. This option is enabled by default\&. +option for related tuning information\&. This option is enabled by default unless running inside +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2\&. .RE .PP "opt\&.lg_tcache_max" (\fBsize_t\fR) r\- [\fB\-\-enable\-tcache\fR] @@ -845,9 +854,7 @@ option for information on analyzing heap .PP "thread\&.arena" (\fBunsigned\fR) rw .RS 4 -Get or set the arena associated with the calling thread\&. The arena index must be less than the maximum number of arenas (see the -"arenas\&.narenas" -mallctl)\&. If the specified arena was not initialized beforehand (see the +Get or set the arena associated with the calling thread\&. If the specified arena was not initialized beforehand (see the "arenas\&.initialized" mallctl), it will be automatically initialized as a side effect of calling this interface\&. .RE @@ -891,9 +898,23 @@ Enable/disable calling thread\*(Aqs tcac Flush calling thread\*(Aqs tcache\&. This interface releases all cached objects and internal data structures associated with the calling thread\*(Aqs thread\-specific cache\&. Ordinarily, this interface need not be called, since automatic periodic incremental garbage collection occurs, and the thread cache is automatically discarded when a thread exits\&. However, garbage collection is triggered by allocation activity, so it is possible for a thread that stops allocating/deallocating to retain its cache indefinitely, in which case the developer may find manual flushing useful\&. .RE .PP +"arena\&.\&.purge" (\fBunsigned\fR) \-\- +.RS 4 +Purge unused dirty pages for arena , or for all arenas if equals +"arenas\&.narenas"\&. +.RE +.PP +"arena\&.\&.dss" (\fBconst char *\fR) rw +.RS 4 +Set the precedence of dss allocation as related to mmap allocation for arena , or for all arenas if equals +"arenas\&.narenas"\&. See +"opt\&.dss" +for supported settings\&. +.RE +.PP "arenas\&.narenas" (\fBunsigned\fR) r\- .RS 4 -Maximum number of arenas\&. +Current limit on number of arenas\&. .RE .PP "arenas\&.initialized" (\fBbool *\fR) r\- @@ -958,6 +979,11 @@ Maximum size supported by this large siz Purge unused dirty pages for the specified arena, or for all arenas if none is specified\&. .RE .PP +"arenas\&.extend" (\fBunsigned\fR) r\- +.RS 4 +Extend the array of arenas by appending a new arena, and returning the new arena index\&. +.RE +.PP "prof\&.active" (\fBbool\fR) rw [\fB\-\-enable\-prof\fR] .RS 4 Control whether sampling is currently active\&. See the @@ -997,7 +1023,9 @@ Total number of bytes allocated by the a "stats\&.active" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] .RS 4 Total number of bytes in active pages allocated by the application\&. This is a multiple of the page size, and greater than or equal to -"stats\&.allocated"\&. +"stats\&.allocated"\&. This does not include +"stats\&.arenas\&.\&.pdirty" +and pages entirely devoted to allocator metadata\&. .RE .PP "stats\&.mapped" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] @@ -1036,6 +1064,15 @@ Cumulative number of huge allocation req Cumulative number of huge deallocation requests\&. .RE .PP +"stats\&.arenas\&.\&.dss" (\fBconst char *\fR) r\- +.RS 4 +dss (\fBsbrk\fR(2)) allocation precedence as related to +\fBmmap\fR(2) +allocation\&. See +"opt\&.dss" +for details\&. +.RE +.PP "stats\&.arenas\&.\&.nthreads" (\fBunsigned\fR) r\- .RS 4 Number of threads currently assigned to arena\&. @@ -1197,9 +1234,7 @@ This implementation does not provide muc \m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2 tool if the \fB\-\-enable\-valgrind\fR -configuration option is enabled and the -"opt\&.valgrind" -option is enabled\&. +configuration option is enabled\&. .SH "DIAGNOSTIC MESSAGES" .PP If any of the memory allocation/deallocation functions detect an error or warning condition, a message will be printed to file descriptor Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/arena.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Sat Nov 10 01:46:13 2012 (r242844) @@ -38,10 +38,10 @@ * * (nactive >> opt_lg_dirty_mult) >= ndirty * - * So, supposing that opt_lg_dirty_mult is 5, there can be no less than 32 - * times as many active pages as dirty pages. + * So, supposing that opt_lg_dirty_mult is 3, there can be no less than 8 times + * as many active pages as dirty pages. */ -#define LG_DIRTY_MULT_DEFAULT 5 +#define LG_DIRTY_MULT_DEFAULT 3 typedef struct arena_chunk_map_s arena_chunk_map_t; typedef struct arena_chunk_s arena_chunk_t; @@ -69,7 +69,7 @@ struct arena_chunk_map_s { /* * Linkage for run trees. There are two disjoint uses: * - * 1) arena_t's runs_avail_{clean,dirty} trees. + * 1) arena_t's runs_avail tree. * 2) arena_run_t conceptually uses this linkage for in-use * non-full runs, rather than directly embedding linkage. */ @@ -162,20 +162,24 @@ typedef rb_tree(arena_chunk_map_t) arena /* Arena chunk header. */ struct arena_chunk_s { /* Arena that owns the chunk. */ - arena_t *arena; + arena_t *arena; - /* Linkage for the arena's chunks_dirty list. */ - ql_elm(arena_chunk_t) link_dirty; - - /* - * True if the chunk is currently in the chunks_dirty list, due to - * having at some point contained one or more dirty pages. Removal - * from chunks_dirty is lazy, so (dirtied && ndirty == 0) is possible. - */ - bool dirtied; + /* Linkage for tree of arena chunks that contain dirty runs. */ + rb_node(arena_chunk_t) dirty_link; /* Number of dirty pages. */ - size_t ndirty; + size_t ndirty; + + /* Number of available runs. */ + size_t nruns_avail; + + /* + * Number of available run adjacencies. Clean and dirty available runs + * are not coalesced, which causes virtual memory fragmentation. The + * ratio of (nruns_avail-nruns_adjac):nruns_adjac is used for tracking + * this fragmentation. + * */ + size_t nruns_adjac; /* * Map of pages within chunk that keeps track of free/large/small. The @@ -183,7 +187,7 @@ struct arena_chunk_s { * need to be tracked in the map. This omission saves a header page * for common chunk sizes (e.g. 4 MiB). */ - arena_chunk_map_t map[1]; /* Dynamically sized. */ + arena_chunk_map_t map[1]; /* Dynamically sized. */ }; typedef rb_tree(arena_chunk_t) arena_chunk_tree_t; @@ -331,8 +335,10 @@ struct arena_s { uint64_t prof_accumbytes; - /* List of dirty-page-containing chunks this arena manages. */ - ql_head(arena_chunk_t) chunks_dirty; + dss_prec_t dss_prec; + + /* Tree of dirty-page-containing chunks this arena manages. */ + arena_chunk_tree_t chunks_dirty; /* * In order to avoid rapid chunk allocation/deallocation when an arena @@ -367,18 +373,9 @@ struct arena_s { /* * Size/address-ordered trees of this arena's available runs. The trees - * are used for first-best-fit run allocation. The dirty tree contains - * runs with dirty pages (i.e. very likely to have been touched and - * therefore have associated physical pages), whereas the clean tree - * contains runs with pages that either have no associated physical - * pages, or have pages that the kernel may recycle at any time due to - * previous madvise(2) calls. The dirty tree is used in preference to - * the clean tree for allocations, because using dirty pages reduces - * the amount of dirty purging necessary to keep the active:dirty page - * ratio below the purge threshold. + * are used for first-best-fit run allocation. */ - arena_avail_tree_t runs_avail_clean; - arena_avail_tree_t runs_avail_dirty; + arena_avail_tree_t runs_avail; /* bins is used to store trees of free regions. */ arena_bin_t bins[NBINS]; @@ -422,13 +419,16 @@ void arena_dalloc_small(arena_t *arena, void arena_dalloc_large_locked(arena_t *arena, arena_chunk_t *chunk, void *ptr); void arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr); -void arena_stats_merge(arena_t *arena, size_t *nactive, size_t *ndirty, - arena_stats_t *astats, malloc_bin_stats_t *bstats, - malloc_large_stats_t *lstats); void *arena_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra, bool zero); -void *arena_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, - size_t alignment, bool zero, bool try_tcache); +void *arena_ralloc(arena_t *arena, void *ptr, size_t oldsize, size_t size, + size_t extra, size_t alignment, bool zero, bool try_tcache_alloc, + bool try_tcache_dalloc); +dss_prec_t arena_dss_prec_get(arena_t *arena); +void arena_dss_prec_set(arena_t *arena, dss_prec_t dss_prec); +void arena_stats_merge(arena_t *arena, const char **dss, size_t *nactive, + size_t *ndirty, arena_stats_t *astats, malloc_bin_stats_t *bstats, + malloc_large_stats_t *lstats); bool arena_new(arena_t *arena, unsigned ind); void arena_boot(void); void arena_prefork(arena_t *arena); Modified: head/contrib/jemalloc/include/jemalloc/internal/chunk.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/chunk.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/chunk.h Sat Nov 10 01:46:13 2012 (r242844) @@ -28,6 +28,7 @@ #ifdef JEMALLOC_H_EXTERNS extern size_t opt_lg_chunk; +extern const char *opt_dss; /* Protects stats_chunks; currently not used for any other purpose. */ extern malloc_mutex_t chunks_mtx; @@ -42,9 +43,14 @@ extern size_t chunk_npages; extern size_t map_bias; /* Number of arena chunk header pages. */ extern size_t arena_maxclass; /* Max size class for arenas. */ -void *chunk_alloc(size_t size, size_t alignment, bool base, bool *zero); +void *chunk_alloc(size_t size, size_t alignment, bool base, bool *zero, + dss_prec_t dss_prec); +void chunk_unmap(void *chunk, size_t size); void chunk_dealloc(void *chunk, size_t size, bool unmap); bool chunk_boot(void); +void chunk_prefork(void); +void chunk_postfork_parent(void); +void chunk_postfork_child(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ Modified: head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h Sat Nov 10 01:46:13 2012 (r242844) @@ -1,14 +1,28 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES +typedef enum { + dss_prec_disabled = 0, + dss_prec_primary = 1, + dss_prec_secondary = 2, + + dss_prec_limit = 3 +} dss_prec_t ; +#define DSS_PREC_DEFAULT dss_prec_secondary +#define DSS_DEFAULT "secondary" + #endif /* JEMALLOC_H_TYPES */ /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS +extern const char *dss_prec_names[]; + #endif /* JEMALLOC_H_STRUCTS */ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS +dss_prec_t chunk_dss_prec_get(void); +bool chunk_dss_prec_set(dss_prec_t dss_prec); void *chunk_alloc_dss(size_t size, size_t alignment, bool *zero); bool chunk_in_dss(void *chunk); bool chunk_dss_boot(void); Modified: head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h Sat Nov 10 01:46:13 2012 (r242844) @@ -9,7 +9,7 @@ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS -void pages_purge(void *addr, size_t length); +bool pages_purge(void *addr, size_t length); void *chunk_alloc_mmap(size_t size, size_t alignment, bool *zero); bool chunk_dealloc_mmap(void *chunk, size_t size); Modified: head/contrib/jemalloc/include/jemalloc/internal/ctl.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/ctl.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/ctl.h Sat Nov 10 01:46:13 2012 (r242844) @@ -33,6 +33,7 @@ struct ctl_indexed_node_s { struct ctl_arena_stats_s { bool initialized; unsigned nthreads; + const char *dss; size_t pactive; size_t pdirty; arena_stats_t astats; @@ -61,6 +62,7 @@ struct ctl_stats_s { uint64_t nmalloc; /* huge_nmalloc */ uint64_t ndalloc; /* huge_ndalloc */ } huge; + unsigned narenas; ctl_arena_stats_t *arenas; /* (narenas + 1) elements. */ }; @@ -75,6 +77,9 @@ int ctl_nametomib(const char *name, size int ctl_bymib(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); bool ctl_boot(void); +void ctl_prefork(void); +void ctl_postfork_parent(void); +void ctl_postfork_child(void); #define xmallctl(name, oldp, oldlenp, newp, newlen) do { \ if (je_mallctl(name, oldp, oldlenp, newp, newlen) \ Modified: head/contrib/jemalloc/include/jemalloc/internal/extent.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/extent.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/extent.h Sat Nov 10 01:46:13 2012 (r242844) @@ -23,6 +23,9 @@ struct extent_node_s { /* Total region size. */ size_t size; + + /* True if zero-filled; used by chunk recycling code. */ + bool zeroed; }; typedef rb_tree(extent_node_t) extent_tree_t; Modified: head/contrib/jemalloc/include/jemalloc/internal/huge.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/huge.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/huge.h Sat Nov 10 01:46:13 2012 (r242844) @@ -22,7 +22,7 @@ void *huge_palloc(size_t size, size_t al void *huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra); void *huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, - size_t alignment, bool zero); + size_t alignment, bool zero, bool try_tcache_dalloc); void huge_dalloc(void *ptr, bool unmap); size_t huge_salloc(const void *ptr); prof_ctx_t *huge_prof_ctx_get(const void *ptr); Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sat Nov 10 01:46:13 2012 (r242844) @@ -270,6 +270,9 @@ static const bool config_ivsalloc = # ifdef __arm__ # define LG_QUANTUM 3 # endif +# ifdef __hppa__ +# define LG_QUANTUM 4 +# endif # ifdef __mips__ # define LG_QUANTUM 3 # endif @@ -424,6 +427,7 @@ static const bool config_ivsalloc = VALGRIND_FREELIKE_BLOCK(ptr, rzsize); \ } while (0) #else +#define RUNNING_ON_VALGRIND ((unsigned)0) #define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) #define VALGRIND_RESIZEINPLACE_BLOCK(addr, oldSizeB, newSizeB, rzB) #define VALGRIND_FREELIKE_BLOCK(addr, rzB) @@ -510,13 +514,19 @@ extern size_t opt_narenas; /* Number of CPUs. */ extern unsigned ncpus; -extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ +/* Protects arenas initialization (arenas, arenas_total). */ +extern malloc_mutex_t arenas_lock; /* * Arenas that are used to service external requests. Not all elements of the * arenas array are necessarily used; arenas are created lazily as needed. + * + * arenas[0..narenas_auto) are used for automatic multiplexing of threads and + * arenas. arenas[narenas_auto..narenas_total) are only used if the application + * takes some action to create them and allocate from them. */ extern arena_t **arenas; -extern unsigned narenas; +extern unsigned narenas_total; +extern unsigned narenas_auto; /* Read-only after initialization. */ arena_t *arenas_extend(unsigned ind); void arenas_cleanup(void *arg); @@ -571,6 +581,7 @@ malloc_tsd_protos(JEMALLOC_ATTR(unused), size_t s2u(size_t size); size_t sa2u(size_t size, size_t alignment); +unsigned narenas_total_get(void); arena_t *choose_arena(arena_t *arena); #endif @@ -675,6 +686,18 @@ sa2u(size_t size, size_t alignment) } } +JEMALLOC_INLINE unsigned +narenas_total_get(void) +{ + unsigned narenas; + + malloc_mutex_lock(&arenas_lock); + narenas = narenas_total; + malloc_mutex_unlock(&arenas_lock); + + return (narenas); +} + /* Choose an arena based on a per-thread value. */ JEMALLOC_INLINE arena_t * choose_arena(arena_t *arena) @@ -710,15 +733,24 @@ choose_arena(arena_t *arena) #include "jemalloc/internal/quarantine.h" #ifndef JEMALLOC_ENABLE_INLINE +void *imallocx(size_t size, bool try_tcache, arena_t *arena); void *imalloc(size_t size); +void *icallocx(size_t size, bool try_tcache, arena_t *arena); void *icalloc(size_t size); +void *ipallocx(size_t usize, size_t alignment, bool zero, bool try_tcache, + arena_t *arena); void *ipalloc(size_t usize, size_t alignment, bool zero); size_t isalloc(const void *ptr, bool demote); size_t ivsalloc(const void *ptr, bool demote); size_t u2rz(size_t usize); size_t p2rz(const void *ptr); +void idallocx(void *ptr, bool try_tcache); void idalloc(void *ptr); +void iqallocx(void *ptr, bool try_tcache); void iqalloc(void *ptr); +void *irallocx(void *ptr, size_t size, size_t extra, size_t alignment, + bool zero, bool no_move, bool try_tcache_alloc, bool try_tcache_dalloc, + arena_t *arena); void *iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, bool no_move); malloc_tsd_protos(JEMALLOC_ATTR(unused), thread_allocated, thread_allocated_t) @@ -726,29 +758,44 @@ malloc_tsd_protos(JEMALLOC_ATTR(unused), #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) JEMALLOC_INLINE void * -imalloc(size_t size) +imallocx(size_t size, bool try_tcache, arena_t *arena) { assert(size != 0); if (size <= arena_maxclass) - return (arena_malloc(NULL, size, false, true)); + return (arena_malloc(arena, size, false, try_tcache)); else return (huge_malloc(size, false)); } JEMALLOC_INLINE void * -icalloc(size_t size) +imalloc(size_t size) +{ + + return (imallocx(size, true, NULL)); +} + +JEMALLOC_INLINE void * +icallocx(size_t size, bool try_tcache, arena_t *arena) { if (size <= arena_maxclass) - return (arena_malloc(NULL, size, true, true)); + return (arena_malloc(arena, size, true, try_tcache)); else return (huge_malloc(size, true)); } JEMALLOC_INLINE void * -ipalloc(size_t usize, size_t alignment, bool zero) +icalloc(size_t size) +{ + + return (icallocx(size, true, NULL)); +} + +JEMALLOC_INLINE void * +ipallocx(size_t usize, size_t alignment, bool zero, bool try_tcache, + arena_t *arena) { void *ret; @@ -756,11 +803,11 @@ ipalloc(size_t usize, size_t alignment, assert(usize == sa2u(usize, alignment)); if (usize <= arena_maxclass && alignment <= PAGE) - ret = arena_malloc(NULL, usize, zero, true); + ret = arena_malloc(arena, usize, zero, try_tcache); else { if (usize <= arena_maxclass) { - ret = arena_palloc(choose_arena(NULL), usize, alignment, - zero); + ret = arena_palloc(choose_arena(arena), usize, + alignment, zero); } else if (alignment <= chunksize) ret = huge_malloc(usize, zero); else @@ -771,6 +818,13 @@ ipalloc(size_t usize, size_t alignment, return (ret); } +JEMALLOC_INLINE void * +ipalloc(size_t usize, size_t alignment, bool zero) +{ + + return (ipallocx(usize, alignment, zero, true, NULL)); +} + /* * Typical usage: * void *ptr = [...] @@ -829,7 +883,7 @@ p2rz(const void *ptr) } JEMALLOC_INLINE void -idalloc(void *ptr) +idallocx(void *ptr, bool try_tcache) { arena_chunk_t *chunk; @@ -837,24 +891,38 @@ idalloc(void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) - arena_dalloc(chunk->arena, chunk, ptr, true); + arena_dalloc(chunk->arena, chunk, ptr, try_tcache); else huge_dalloc(ptr, true); } JEMALLOC_INLINE void -iqalloc(void *ptr) +idalloc(void *ptr) +{ + + idallocx(ptr, true); +} + +JEMALLOC_INLINE void +iqallocx(void *ptr, bool try_tcache) { if (config_fill && opt_quarantine) quarantine(ptr); else - idalloc(ptr); + idallocx(ptr, try_tcache); +} + +JEMALLOC_INLINE void +iqalloc(void *ptr) +{ + + iqallocx(ptr, true); } JEMALLOC_INLINE void * -iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, - bool no_move) +irallocx(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, + bool no_move, bool try_tcache_alloc, bool try_tcache_dalloc, arena_t *arena) { void *ret; size_t oldsize; @@ -877,7 +945,7 @@ iralloc(void *ptr, size_t size, size_t e usize = sa2u(size + extra, alignment); if (usize == 0) return (NULL); - ret = ipalloc(usize, alignment, zero); + ret = ipallocx(usize, alignment, zero, try_tcache_alloc, arena); if (ret == NULL) { if (extra == 0) return (NULL); @@ -885,7 +953,8 @@ iralloc(void *ptr, size_t size, size_t e usize = sa2u(size, alignment); if (usize == 0) return (NULL); - ret = ipalloc(usize, alignment, zero); + ret = ipallocx(usize, alignment, zero, try_tcache_alloc, + arena); if (ret == NULL) return (NULL); } @@ -896,7 +965,7 @@ iralloc(void *ptr, size_t size, size_t e */ copysize = (size < oldsize) ? size : oldsize; memcpy(ret, ptr, copysize); - iqalloc(ptr); + iqallocx(ptr, try_tcache_dalloc); return (ret); } @@ -910,15 +979,25 @@ iralloc(void *ptr, size_t size, size_t e } } else { if (size + extra <= arena_maxclass) { - return (arena_ralloc(ptr, oldsize, size, extra, - alignment, zero, true)); + return (arena_ralloc(arena, ptr, oldsize, size, extra, + alignment, zero, try_tcache_alloc, + try_tcache_dalloc)); } else { return (huge_ralloc(ptr, oldsize, size, extra, - alignment, zero)); + alignment, zero, try_tcache_dalloc)); } } } +JEMALLOC_INLINE void * +iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero, + bool no_move) +{ + + return (irallocx(ptr, size, extra, alignment, zero, no_move, true, true, + NULL)); +} + malloc_tsd_externs(thread_allocated, thread_allocated_t) malloc_tsd_funcs(JEMALLOC_INLINE, thread_allocated, thread_allocated_t, THREAD_ALLOCATED_INITIALIZER, malloc_tsd_no_cleanup) Modified: head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Sat Nov 10 00:36:53 2012 (r242843) +++ head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Sat Nov 10 01:46:13 2012 (r242844) @@ -12,6 +12,8 @@ #define arena_dalloc_large JEMALLOC_N(arena_dalloc_large) #define arena_dalloc_large_locked JEMALLOC_N(arena_dalloc_large_locked) #define arena_dalloc_small JEMALLOC_N(arena_dalloc_small) +#define arena_dss_prec_get JEMALLOC_N(arena_dss_prec_get) +#define arena_dss_prec_set JEMALLOC_N(arena_dss_prec_set) #define arena_malloc JEMALLOC_N(arena_malloc) #define arena_malloc_large JEMALLOC_N(arena_malloc_large) #define arena_malloc_small JEMALLOC_N(arena_malloc_small) @@ -51,14 +53,13 @@ #define arena_stats_merge JEMALLOC_N(arena_stats_merge) #define arena_tcache_fill_small JEMALLOC_N(arena_tcache_fill_small) #define arenas JEMALLOC_N(arenas) -#define arenas_bin_i_index JEMALLOC_N(arenas_bin_i_index) #define arenas_booted JEMALLOC_N(arenas_booted) #define arenas_cleanup JEMALLOC_N(arenas_cleanup) #define arenas_extend JEMALLOC_N(arenas_extend) #define arenas_initialized JEMALLOC_N(arenas_initialized) #define arenas_lock JEMALLOC_N(arenas_lock) -#define arenas_lrun_i_index JEMALLOC_N(arenas_lrun_i_index) #define arenas_tls JEMALLOC_N(arenas_tls) +#define arenas_tsd JEMALLOC_N(arenas_tsd) #define arenas_tsd_boot JEMALLOC_N(arenas_tsd_boot) #define arenas_tsd_cleanup_wrapper JEMALLOC_N(arenas_tsd_cleanup_wrapper) #define arenas_tsd_get JEMALLOC_N(arenas_tsd_get) @@ -101,9 +102,15 @@ #define chunk_dss_boot JEMALLOC_N(chunk_dss_boot) #define chunk_dss_postfork_child JEMALLOC_N(chunk_dss_postfork_child) #define chunk_dss_postfork_parent JEMALLOC_N(chunk_dss_postfork_parent) +#define chunk_dss_prec_get JEMALLOC_N(chunk_dss_prec_get) +#define chunk_dss_prec_set JEMALLOC_N(chunk_dss_prec_set) #define chunk_dss_prefork JEMALLOC_N(chunk_dss_prefork) #define chunk_in_dss JEMALLOC_N(chunk_in_dss) #define chunk_npages JEMALLOC_N(chunk_npages) +#define chunk_postfork_child JEMALLOC_N(chunk_postfork_child) +#define chunk_postfork_parent JEMALLOC_N(chunk_postfork_parent) +#define chunk_prefork JEMALLOC_N(chunk_prefork) +#define chunk_unmap JEMALLOC_N(chunk_unmap) #define chunks_mtx JEMALLOC_N(chunks_mtx) #define chunks_rtree JEMALLOC_N(chunks_rtree) #define chunksize JEMALLOC_N(chunksize) @@ -129,6 +136,10 @@ #define ctl_bymib JEMALLOC_N(ctl_bymib) #define ctl_byname JEMALLOC_N(ctl_byname) #define ctl_nametomib JEMALLOC_N(ctl_nametomib) +#define ctl_postfork_child JEMALLOC_N(ctl_postfork_child) +#define ctl_postfork_parent JEMALLOC_N(ctl_postfork_parent) +#define ctl_prefork JEMALLOC_N(ctl_prefork) +#define dss_prec_names JEMALLOC_N(dss_prec_names) #define extent_tree_ad_first JEMALLOC_N(extent_tree_ad_first) #define extent_tree_ad_insert JEMALLOC_N(extent_tree_ad_insert) #define extent_tree_ad_iter JEMALLOC_N(extent_tree_ad_iter) @@ -161,6 +172,7 @@ #define extent_tree_szad_reverse_iter_recurse JEMALLOC_N(extent_tree_szad_reverse_iter_recurse) #define extent_tree_szad_reverse_iter_start JEMALLOC_N(extent_tree_szad_reverse_iter_start) #define extent_tree_szad_search JEMALLOC_N(extent_tree_szad_search) +#define get_errno JEMALLOC_N(get_errno) #define hash JEMALLOC_N(hash) #define huge_allocated JEMALLOC_N(huge_allocated) #define huge_boot JEMALLOC_N(huge_boot) @@ -180,11 +192,17 @@ #define huge_salloc JEMALLOC_N(huge_salloc) #define iallocm JEMALLOC_N(iallocm) #define icalloc JEMALLOC_N(icalloc) +#define icallocx JEMALLOC_N(icallocx) #define idalloc JEMALLOC_N(idalloc) +#define idallocx JEMALLOC_N(idallocx) #define imalloc JEMALLOC_N(imalloc) +#define imallocx JEMALLOC_N(imallocx) #define ipalloc JEMALLOC_N(ipalloc) +#define ipallocx JEMALLOC_N(ipallocx) #define iqalloc JEMALLOC_N(iqalloc) +#define iqallocx JEMALLOC_N(iqallocx) #define iralloc JEMALLOC_N(iralloc) +#define irallocx JEMALLOC_N(irallocx) #define isalloc JEMALLOC_N(isalloc) #define ivsalloc JEMALLOC_N(ivsalloc) #define jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child) @@ -211,7 +229,9 @@ #define map_bias JEMALLOC_N(map_bias) #define mb_write JEMALLOC_N(mb_write) #define mutex_boot JEMALLOC_N(mutex_boot) -#define narenas JEMALLOC_N(narenas) +#define narenas_auto JEMALLOC_N(narenas_auto) +#define narenas_total JEMALLOC_N(narenas_total) +#define narenas_total_get JEMALLOC_N(narenas_total_get) #define ncpus JEMALLOC_N(ncpus) #define nhbins JEMALLOC_N(nhbins) #define opt_abort JEMALLOC_N(opt_abort) @@ -253,6 +273,9 @@ #define prof_lookup JEMALLOC_N(prof_lookup) #define prof_malloc JEMALLOC_N(prof_malloc) #define prof_mdump JEMALLOC_N(prof_mdump) +#define prof_postfork_child JEMALLOC_N(prof_postfork_child) +#define prof_postfork_parent JEMALLOC_N(prof_postfork_parent) +#define prof_prefork JEMALLOC_N(prof_prefork) #define prof_promote JEMALLOC_N(prof_promote) #define prof_realloc JEMALLOC_N(prof_realloc) #define prof_sample_accum_update JEMALLOC_N(prof_sample_accum_update) @@ -263,6 +286,7 @@ #define prof_tdata_init JEMALLOC_N(prof_tdata_init) #define prof_tdata_initialized JEMALLOC_N(prof_tdata_initialized) #define prof_tdata_tls JEMALLOC_N(prof_tdata_tls) +#define prof_tdata_tsd JEMALLOC_N(prof_tdata_tsd) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 01:52:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B535D68; Sat, 10 Nov 2012 01:52:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F07BE8FC0A; Sat, 10 Nov 2012 01:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA1qqEA002361; Sat, 10 Nov 2012 01:52:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA1qqS2002354; Sat, 10 Nov 2012 01:52:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211100152.qAA1qqS2002354@svn.freebsd.org> From: Xin LI Date: Sat, 10 Nov 2012 01:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242845 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 01:52:53 -0000 Author: delphij Date: Sat Nov 10 01:52:52 2012 New Revision: 242845 URL: http://svnweb.freebsd.org/changeset/base/242845 Log: MFV r242729 (mm): Illumos r13840:97fd5cdf328a: 3145 single-copy arc 3212 ztest: race condition between vdev_online() and spa_vdev_remove() Illumos r13849:3468a95b27cd: 3258 ztest's use of file descriptors is unstable Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Nov 10 01:46:13 2012 (r242844) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sat Nov 10 01:52:52 2012 (r242845) @@ -121,8 +121,8 @@ #include #include -#define ZTEST_FD_DATA 3 -#define ZTEST_FD_RAND 4 +static int ztest_fd_data = -1; +static int ztest_fd_rand = -1; typedef struct ztest_shared_hdr { uint64_t zh_hdr_size; @@ -710,14 +710,17 @@ process_options(int argc, char **argv) UINT64_MAX >> 2); if (strlen(altdir) > 0) { - char cmd[MAXNAMELEN]; - char realaltdir[MAXNAMELEN]; + char *cmd; + char *realaltdir; char *bin; char *ztest; char *isa; int isalen; - (void) realpath(getexecname(), cmd); + cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + + VERIFY(NULL != realpath(getexecname(), cmd)); if (0 != access(altdir, F_OK)) { ztest_dump_core = B_FALSE; fatal(B_TRUE, "invalid alternate ztest path: %s", @@ -748,6 +751,9 @@ process_options(int argc, char **argv) fatal(B_TRUE, "invalid alternate lib directory %s", zo->zo_alt_libpath); } + + umem_free(cmd, MAXPATHLEN); + umem_free(realaltdir, MAXPATHLEN); } } @@ -764,10 +770,12 @@ ztest_random(uint64_t range) { uint64_t r; + ASSERT3S(ztest_fd_rand, >=, 0); + if (range == 0) return (0); - if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r)) + if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r)) fatal(1, "short read from /dev/urandom"); return (r % range); @@ -4703,7 +4711,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 if (islog) (void) rw_unlock(&ztest_name_lock); } else { + /* + * Ideally we would like to be able to randomly + * call vdev_[on|off]line without holding locks + * to force unpredictable failures but the side + * effects of vdev_[on|off]line prevent us from + * doing so. We grab the ztest_vdev_lock here to + * prevent a race between injection testing and + * aux_vdev removal. + */ + VERIFY(mutex_lock(&ztest_vdev_lock) == 0); (void) vdev_online(spa, guid0, 0, NULL); + VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); } } @@ -5660,29 +5679,16 @@ ztest_init(ztest_shared_t *zs) } static void -setup_fds(void) +setup_data_fd(void) { - int fd; -#ifdef illumos - - char *tmp = tempnam(NULL, NULL); - fd = open(tmp, O_RDWR | O_CREAT, 0700); - ASSERT3U(fd, ==, ZTEST_FD_DATA); - (void) unlink(tmp); - free(tmp); -#else - char tmp[MAXPATHLEN]; - - strlcpy(tmp, ztest_opts.zo_dir, MAXPATHLEN); - strlcat(tmp, "/ztest.XXXXXX", MAXPATHLEN); - fd = mkstemp(tmp); - ASSERT3U(fd, ==, ZTEST_FD_DATA); -#endif + static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX"; - fd = open("/dev/urandom", O_RDONLY); - ASSERT3U(fd, ==, ZTEST_FD_RAND); + ztest_fd_data = mkstemp(ztest_name_data); + ASSERT3S(ztest_fd_data, >=, 0); + (void) unlink(ztest_name_data); } + static int shared_data_size(ztest_shared_hdr_t *hdr) { @@ -5703,15 +5709,11 @@ setup_hdr(void) int size; ztest_shared_hdr_t *hdr; -#ifndef illumos - pwrite(ZTEST_FD_DATA, "", 1, 0); -#endif - hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t))); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t))); hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t); hdr->zh_opts_size = sizeof (ztest_shared_opts_t); @@ -5722,7 +5724,7 @@ setup_hdr(void) hdr->zh_ds_count = ztest_opts.zo_datasets; size = shared_data_size(hdr); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size)); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, size)); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); } @@ -5735,14 +5737,14 @@ setup_data(void) uint8_t *buf; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); size = shared_data_size(hdr); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); buf = (uint8_t *)hdr; @@ -5761,12 +5763,13 @@ exec_child(char *cmd, char *libpath, boo { pid_t pid; int status; - char cmdbuf[MAXPATHLEN]; + char *cmdbuf = NULL; pid = fork(); if (cmd == NULL) { - (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf)); + cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN); cmd = cmdbuf; } @@ -5775,9 +5778,16 @@ exec_child(char *cmd, char *libpath, boo if (pid == 0) { /* child */ char *emptyargv[2] = { cmd, NULL }; + char fd_data_str[12]; struct rlimit rl = { 1024, 1024 }; (void) setrlimit(RLIMIT_NOFILE, &rl); + + (void) close(ztest_fd_rand); + VERIFY3U(11, >=, + snprintf(fd_data_str, 12, "%d", ztest_fd_data)); + VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1)); + (void) enable_extended_FILE_stdio(-1, -1); if (libpath != NULL) VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1)); @@ -5790,6 +5800,11 @@ exec_child(char *cmd, char *libpath, boo fatal(B_TRUE, "exec failed: %s", cmd); } + if (cmdbuf != NULL) { + umem_free(cmdbuf, MAXPATHLEN); + cmd = NULL; + } + while (waitpid(pid, &status, 0) != pid) continue; if (statusp != NULL) @@ -5854,39 +5869,41 @@ main(int argc, char **argv) char timebuf[100]; char numbuf[6]; spa_t *spa; - char cmd[MAXNAMELEN]; + char *cmd; boolean_t hasalt; - - boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR)); - ASSERT(ischild || errno == EBADF); + char *fd_data_str = getenv("ZTEST_FD_DATA"); (void) setvbuf(stdout, NULL, _IOLBF, 0); dprintf_setup(&argc, argv); - if (!ischild) { + ztest_fd_rand = open("/dev/urandom", O_RDONLY); + ASSERT3S(ztest_fd_rand, >=, 0); + + if (!fd_data_str) { process_options(argc, argv); - setup_fds(); + setup_data_fd(); setup_hdr(); setup_data(); bcopy(&ztest_opts, ztest_shared_opts, sizeof (*ztest_shared_opts)); } else { + ztest_fd_data = atoi(fd_data_str); setup_data(); bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts)); } ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count); /* Override location of zpool.cache */ - (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", - ztest_opts.zo_dir); + VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache", + ztest_opts.zo_dir), !=, -1); ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t), UMEM_NOFAIL); zs = ztest_shared; - if (ischild) { + if (fd_data_str) { metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang; metaslab_df_alloc_threshold = zs->zs_metaslab_df_alloc_threshold; @@ -5909,7 +5926,8 @@ main(int argc, char **argv) (u_longlong_t)ztest_opts.zo_time); } - (void) strlcpy(cmd, getexecname(), sizeof (cmd)); + cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL); + (void) strlcpy(cmd, getexecname(), MAXNAMELEN); zs->zs_do_init = B_TRUE; if (strlen(ztest_opts.zo_alt_ztest) != 0) { @@ -6050,5 +6068,7 @@ main(int argc, char **argv) kills, iters - kills, (100.0 * kills) / MAX(1, iters)); } + umem_free(cmd, MAXNAMELEN); + return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 01:46:13 2012 (r242844) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 01:52:52 2012 (r242845) @@ -191,6 +191,7 @@ uint64_t zfs_arc_meta_limit = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; +int zfs_disable_dup_eviction = 0; TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max); TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); @@ -321,7 +322,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_io_error; kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_memory_throttle_count; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -334,6 +334,10 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_write_buffer_bytes_scanned; kstat_named_t arcstat_l2_write_buffer_list_iter; kstat_named_t arcstat_l2_write_buffer_list_null_iter; + kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_duplicate_buffers; + kstat_named_t arcstat_duplicate_buffers_size; + kstat_named_t arcstat_duplicate_reads; } arc_stats_t; static arc_stats_t arc_stats = { @@ -391,7 +395,6 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, @@ -403,7 +406,11 @@ static arc_stats_t arc_stats = { { "l2_write_pios", KSTAT_DATA_UINT64 }, { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } + { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 }, + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "duplicate_buffers", KSTAT_DATA_UINT64 }, + { "duplicate_buffers_size", KSTAT_DATA_UINT64 }, + { "duplicate_reads", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -1518,6 +1525,17 @@ arc_buf_clone(arc_buf_t *from) hdr->b_buf = buf; arc_get_data_buf(buf); bcopy(from->b_data, buf->b_data, size); + + /* + * This buffer already exists in the arc so create a duplicate + * copy for the caller. If the buffer is associated with user data + * then track the size and number of duplicates. These stats will be + * updated as duplicate buffers are created and destroyed. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMP(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, size); + } hdr->b_datacnt += 1; return (buf); } @@ -1618,6 +1636,16 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ ASSERT3U(state->arcs_size, >=, size); atomic_add_64(&state->arcs_size, -size); buf->b_data = NULL; + + /* + * If we're destroying a duplicate buffer make sure + * that the appropriate statistics are updated. + */ + if (buf->b_hdr->b_datacnt > 1 && + buf->b_hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, -size); + } ASSERT(buf->b_hdr->b_datacnt > 0); buf->b_hdr->b_datacnt -= 1; } @@ -1802,6 +1830,48 @@ arc_buf_size(arc_buf_t *buf) } /* + * Called from the DMU to determine if the current buffer should be + * evicted. In order to ensure proper locking, the eviction must be initiated + * from the DMU. Return true if the buffer is associated with user data and + * duplicate buffers still exist. + */ +boolean_t +arc_buf_eviction_needed(arc_buf_t *buf) +{ + arc_buf_hdr_t *hdr; + boolean_t evict_needed = B_FALSE; + + if (zfs_disable_dup_eviction) + return (B_FALSE); + + mutex_enter(&buf->b_evict_lock); + hdr = buf->b_hdr; + if (hdr == NULL) { + /* + * We are in arc_do_user_evicts(); let that function + * perform the eviction. + */ + ASSERT(buf->b_data == NULL); + mutex_exit(&buf->b_evict_lock); + return (B_FALSE); + } else if (buf->b_data == NULL) { + /* + * We have already been added to the arc eviction list; + * recommend eviction. + */ + ASSERT3P(hdr, ==, &arc_eviction_hdr); + mutex_exit(&buf->b_evict_lock); + return (B_TRUE); + } + + if (hdr->b_datacnt > 1 && hdr->b_type == ARC_BUFC_DATA) + evict_needed = B_TRUE; + + mutex_exit(&buf->b_evict_lock); + return (evict_needed); +} + +/* * Evict buffers from list until we've removed the specified number of * bytes. Move the removed buffers to the appropriate evict state. * If the recycle flag is set, then attempt to "recycle" a buffer: @@ -2887,8 +2957,10 @@ arc_read_done(zio_t *zio) abuf = buf; for (acb = callback_list; acb; acb = acb->acb_next) { if (acb->acb_done) { - if (abuf == NULL) + if (abuf == NULL) { + ARCSTAT_BUMP(arcstat_duplicate_reads); abuf = arc_buf_clone(buf); + } acb->acb_buf = abuf; abuf = NULL; } @@ -3434,6 +3506,16 @@ arc_release(arc_buf_t *buf, void *tag) ASSERT3U(*size, >=, hdr->b_size); atomic_add_64(size, -hdr->b_size); } + + /* + * We're releasing a duplicate user data buffer, update + * our statistics accordingly. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, + -hdr->b_size); + } hdr->b_datacnt -= 1; arc_cksum_verify(buf); #ifdef illumos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 10 01:46:13 2012 (r242844) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 10 01:52:52 2012 (r242845) @@ -2089,7 +2089,24 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, dbuf_evict(db); } else { VERIFY(arc_buf_remove_ref(db->db_buf, db) == 0); - if (!DBUF_IS_CACHEABLE(db)) + + /* + * A dbuf will be eligible for eviction if either the + * 'primarycache' property is set or a duplicate + * copy of this buffer is already cached in the arc. + * + * In the case of the 'primarycache' a buffer + * is considered for eviction if it matches the + * criteria set in the property. + * + * To decide if our buffer is considered a + * duplicate, we must call into the arc to determine + * if multiple buffers are referencing the same + * block on-disk. If so, then we simply evict + * ourselves. + */ + if (!DBUF_IS_CACHEABLE(db) || + arc_buf_eviction_needed(db->db_buf)) dbuf_clear(db); else mutex_exit(&db->db_mtx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Nov 10 01:46:13 2012 (r242844) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Nov 10 01:52:52 2012 (r242845) @@ -99,6 +99,7 @@ int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); +boolean_t arc_buf_eviction_needed(arc_buf_t *buf); #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf); #endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 02:08:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF160202; Sat, 10 Nov 2012 02:08:40 +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 9B2168FC0A; Sat, 10 Nov 2012 02:08:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA28epF004845; Sat, 10 Nov 2012 02:08:40 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA28e0v004842; Sat, 10 Nov 2012 02:08:40 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211100208.qAA28e0v004842@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 10 Nov 2012 02:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242847 - in head/sys: i386/include kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 02:08:40 -0000 Author: alfred Date: Sat Nov 10 02:08:40 2012 New Revision: 242847 URL: http://svnweb.freebsd.org/changeset/base/242847 Log: Allow maxusers to scale on machines with large address space. Some hooks are added to clamp down maxusers and nmbclusters for small address space systems. VM_MAX_AUTOTUNE_MAXUSERS - the max maxusers that will be autotuned based on physical memory. VM_MAX_AUTOTUNE_NMBCLUSTERS - max nmbclusters based on physical memory. These are set to the old values on i386 to preserve the clamping that was being done to all arches. Another macro VM_AUTOTUNE_NMBCLUSTERS is provided to allow an override for the calculation on a MD basis. Currently no arch defines this. Reviewed by: peter MFC after: 2 weeks Modified: head/sys/i386/include/vmparam.h head/sys/kern/kern_mbuf.c head/sys/kern/subr_param.c Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Sat Nov 10 02:08:19 2012 (r242846) +++ head/sys/i386/include/vmparam.h Sat Nov 10 02:08:40 2012 (r242847) @@ -202,4 +202,13 @@ #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ +#ifndef VM_MAX_AUTOTUNE_MAXUSERS +#define VM_MAX_AUTOTUNE_MAXUSERS 384 +#endif + +#ifndef VM_MAX_AUTOTUNE_NMBCLUSTERS +/* old maxusers max value. */ +#define VM_MAX_AUTOTUNE_NMBCLUSTERS (1024 + VM_MAX_AUTOTUNE_MAXUSERS * 64) +#endif + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Nov 10 02:08:19 2012 (r242846) +++ head/sys/kern/kern_mbuf.c Sat Nov 10 02:08:40 2012 (r242847) @@ -113,8 +113,17 @@ tunable_mbinit(void *dummy) /* This has to be done before VM init. */ TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); - if (nmbclusters == 0) + if (nmbclusters == 0) { +#ifdef VM_AUTOTUNE_NMBCLUSTERS + nmbclusters = VM_AUTOTUNE_NMBCLUSTERS; +#else nmbclusters = 1024 + maxusers * 64; +#endif +#ifdef VM_MAX_AUTOTUNE_NMBCLUSTERS + if (nmbclusters > VM_MAX_AUTOTUNE_NMBCLUSTERS) + nmbclusters = VM_MAX_AUTOTUNE_NMBCLUSTERS; +#endif + } TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); if (nmbjumbop == 0) Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sat Nov 10 02:08:19 2012 (r242846) +++ head/sys/kern/subr_param.c Sat Nov 10 02:08:40 2012 (r242847) @@ -278,17 +278,17 @@ init_param2(long physpages) maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; - /* - * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. - * Scales it down 6x for large memory machines. - */ - if (maxusers > 384) { - if (sizeof(void *) <= 4) - maxusers = 384; - else - maxusers = 384 + ((maxusers - 384) / 6); - } - } +#ifdef VM_MAX_AUTOTUNE_MAXUSERS + if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS) + maxusers = VM_MAX_AUTOTUNE_MAXUSERS; +#endif + /* + * Scales down the function in which maxusers grows once + * we hit 384. + */ + if (maxusers > 384) + maxusers = 384 + ((maxusers - 384) / 8); + } /* * The following can be overridden after boot via sysctl. Note: From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 02:34:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B428672 for ; Sat, 10 Nov 2012 02:34:59 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C98FF8FC12 for ; Sat, 10 Nov 2012 02:34:58 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4340797lag.13 for ; Fri, 09 Nov 2012 18:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=VZJi+Xp8tceXO/3FBuuDwK0j8qQXaZNScwtRQUX0Ewo=; b=UOl4YjiM/i66nundNf1jVq1zX5r6f9PdLTOe1qALKql15swDesyGTvKM9aAjk4nvsO EP4dPj/d3pSmkm8Rou3KFsG3V0vCDiveFbKo7UEaDEB03yOsQdyjV04nYUwi0gf9I0bu 2BDuvh0fPXOgvDE32H4DOfG79PLiOvf6iTV9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=VZJi+Xp8tceXO/3FBuuDwK0j8qQXaZNScwtRQUX0Ewo=; b=DwSx8rxT8KPnBHIj4gRHZIVXFGR/oB3kYEM7NtCnyxilWD7WLWg9gQLhy7dfDQEhVH uzl+jsLldAe+0/wXQxLTlGtdz8511u/YG6fwMKyzuryzrF0jHyy0pRIyKc8J3DhAjOAf Y18dAgLBLrvBXk4sOupFsRqdLQeTpdAjNBKU/LiLnkSt1JFr0jYgbWueAiPzDcHsZe3T HSxk/049cGScJqFCL3LjZg7OXN9bOZ3C4xHaOsZ9KzQ5Zn4ATihUaWOe2WnrJ9yW0SLx /kSEDQp2IxmlCjq4n2g2uHEBVI1MyEz/fnKrB014fcIyCHoouVN9RsP8+40Cy5BskG6f dfuA== Received: by 10.112.103.136 with SMTP id fw8mr3326025lbb.18.1352514897485; Fri, 09 Nov 2012 18:34:57 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Fri, 9 Nov 2012 18:34:26 -0800 (PST) In-Reply-To: <201211100208.qAA28e0v004842@svn.freebsd.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Nov 2012 21:34:26 -0500 X-Google-Sender-Auth: d6TzAJaOCOwqM9gr-d5andsoLhQ Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmbxJI2K+tspHWYNapZnElX1FPcDQhqSjNjhRpC5kopTIzWh1W+WxyXTX7emN/HSxGSt67j Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 02:34:59 -0000 On 9 November 2012 21:08, Alfred Perlstein wrote: > Modified: head/sys/kern/subr_param.c > +#ifdef VM_MAX_AUTOTUNE_MAXUSERS > + if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS) > + maxusers = VM_MAX_AUTOTUNE_MAXUSERS; > +#endif > + /* > + * Scales down the function in which maxusers grows once > + * we hit 384. > + */ > + if (maxusers > 384) > + maxusers = 384 + ((maxusers - 384) / 8); > + } Hey, I know you didn't introduce this magic number 384. But can you (or someone else) explain where it came from? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 02:56:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEB7B8FE; Sat, 10 Nov 2012 02:56:37 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 32A378FC0A; Sat, 10 Nov 2012 02:56:37 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id EC4BE1A3C22; Fri, 9 Nov 2012 18:56:30 -0800 (PST) Message-ID: <509DC25E.5030306@mu.org> Date: Fri, 09 Nov 2012 18:56:30 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 02:56:37 -0000 On 11/9/12 6:34 PM, Eitan Adler wrote: > On 9 November 2012 21:08, Alfred Perlstein wrote: >> Modified: head/sys/kern/subr_param.c >> +#ifdef VM_MAX_AUTOTUNE_MAXUSERS >> + if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS) >> + maxusers = VM_MAX_AUTOTUNE_MAXUSERS; >> +#endif >> + /* >> + * Scales down the function in which maxusers grows once >> + * we hit 384. >> + */ >> + if (maxusers > 384) >> + maxusers = 384 + ((maxusers - 384) / 8); >> + } > Hey, > > I know you didn't introduce this magic number 384. But can you (or > someone else) explain where it came from? > Sure, this is magic for i386 PAE machines. 384 maxusers was pretty much the highest you wanted auto-tuned SAFELY for 32bit KVA on i386. Now with 64 bit machines doing away with this hard ceiling, I wanted to change the slope so that it doesn't grow too much as a conservative measure to test the waters. Take for example my amd64 machine with 16GB of ram. Without the scaling factor of "maxusers = 384 + ((maxusers - 384) / 8)" then I get 8173 maxusers. 8173 maxusers translates to 524096 nmbclusters (1024 + 8173 * 64). That is 2GB RAM for just nmbclusters, nevermind jumbo9 and jumbo16. With the scaling adjustment I get 1357 maxusers which is 87872 nmbclusters. That is 343MB. Somewhat more reasonable. I'm open to other suggestions and people coming in here to open the value up higher... however I wanted a conservative value for now to avoid too much concern. We'll see where this takes us. -Alfred With this patch I get 75104 nmbclusters, which is 75104 pages which is 293 MB of ram! From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 03:44:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 499B5CF; Sat, 10 Nov 2012 03:44:09 +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 140FF8FC08; Sat, 10 Nov 2012 03:44:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA3i8tk019659; Sat, 10 Nov 2012 03:44:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA3i8dk019658; Sat, 10 Nov 2012 03:44:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211100344.qAA3i8dk019658@svn.freebsd.org> From: Eitan Adler Date: Sat, 10 Nov 2012 03:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242848 - head/usr.bin/ssh-copy-id X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 03:44:09 -0000 Author: eadler Date: Sat Nov 10 03:44:08 2012 New Revision: 242848 URL: http://svnweb.freebsd.org/changeset/base/242848 Log: Be a bit more paranoid. Use more portable constructs in order to allow upstream adoption Add per-file error messages Reviewed by: jilles Approved by: cperciva MFC after: 1 week Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Nov 10 02:08:40 2012 (r242847) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Nov 10 03:44:08 2012 (r242848) @@ -34,19 +34,18 @@ usage() { sendkey() { local h="$1" - shift 1 - local k="$@" - echo "$k" | ssh $port -S none $options "$user$h" /bin/sh -c \'' - set -e; - umask 077; - keyfile=$HOME/.ssh/authorized_keys ; - mkdir -p $HOME/.ssh/ ; - while read alg key comment ; do - if ! grep -sqwF "$key" "$keyfile"; then - echo "$alg $key $comment" | - tee -a "$keyfile" >/dev/null ; - fi ; - done + local k="$2" + printf "%s\n" "$k" | ssh $port -S none $options "$user$h" /bin/sh -c \'' \ + set -e; \ + umask 077; \ + keyfile=$HOME/.ssh/authorized_keys ; \ + mkdir -p -- "$HOME/.ssh/" ; \ + while read alg key comment ; do \ + [ -n "$key" ] || continue; \ + if ! grep -sqwF "$key" "$keyfile"; then \ + printf "$alg $key $comment\n" >> "$keyfile" ; \ + fi ; \ + done \ '\' } @@ -63,12 +62,17 @@ nl=" " options="" +IFS=$nl + while getopts 'i:lo:p:' arg; do case $arg in i) hasarg="x" - if [ -f "$OPTARG" ]; then - keys="$(cat $OPTARG)$nl$keys" + if [ -r "$OPTARG" ]; then + keys="$(cat -- "$OPTARG")$nl$keys" + else + echo "File $OPTARG not found" >&2 + exit 1 fi ;; l) @@ -76,10 +80,10 @@ while getopts 'i:lo:p:' arg; do agentKeys ;; p) - port="-p $OPTARG" + port=-p$nl$OPTARG ;; o) - options="$options -o '$OPTARG'" + options=$options$nl-o$nl$OPTARG ;; *) usage @@ -92,11 +96,11 @@ shift $((OPTIND-1)) if [ -z "$hasarg" ]; then agentKeys fi -if [ -z "$keys" -o "$keys" = "$nl" ]; then +if [ -z "$keys" ] || [ "$keys" = "$nl" ]; then echo "no keys found" >&2 exit 1 fi -if [ -z "$@" ]; then +if [ "$#" -eq 0 ]; then usage fi From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 04:49:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2CA27CB; Sat, 10 Nov 2012 04:49:09 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A76208FC08; Sat, 10 Nov 2012 04:49:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA4n97F029416; Sat, 10 Nov 2012 04:49:09 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA4n98l029415; Sat, 10 Nov 2012 04:49:09 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211100449.qAA4n98l029415@svn.freebsd.org> From: Greg Lehey Date: Sat, 10 Nov 2012 04:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242849 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 04:49:09 -0000 Author: grog Date: Sat Nov 10 04:49:09 2012 New Revision: 242849 URL: http://svnweb.freebsd.org/changeset/base/242849 Log: Correct date and spelling of encounter between Stanley and Livingstone. MFC after: 2 weeks Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Sat Nov 10 03:44:08 2012 (r242848) +++ head/usr.bin/calendar/calendars/calendar.history Sat Nov 10 04:49:09 2012 (r242849) @@ -383,6 +383,7 @@ 10/23 Swallows leave Capistrano 10/25 The UN removes Taiwan and admits the People's Republic of China, 1971 10/26 UN's World Health Organization declares smallpox eradicated, 1978 +10/27 Henry Stanley asks David Livingstone, "Dr. Livingstone, I presume?", 1871 10/27 New York's Boss Tweed is arrested on fraud charges, 1871 10/27 The first New York Subway is opened, 1904 10/28 Columbus discovers Cuba, 1492 @@ -411,7 +412,6 @@ 11/09 Roosevelt establishes the Civil Works Administration, 1933 11/10 41 Women arrested in suffragette demonstrations near White House, 1917 11/10 Cpt. Wirz, commandant of Andersonville Prison hanged, 1865 -11/10 Henry Stanley asks David Livingston, "Dr. Livingston, I presume?", 1871 11/11 Washington becomes the 42nd state, 1889 11/12 Dr. Sun Yat-sen's Birthday in Taiwan 11/12 USA first exports oil to Europe, 1861 From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 06:05:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09E5ED90; Sat, 10 Nov 2012 06:05:05 +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 E25CE8FC0C; Sat, 10 Nov 2012 06:05:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA654aL041334; Sat, 10 Nov 2012 06:05:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA654Tk041332; Sat, 10 Nov 2012 06:05:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211100605.qAA654Tk041332@svn.freebsd.org> From: Eitan Adler Date: Sat, 10 Nov 2012 06:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r242850 - in releng/9.1: etc/root share/skel X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 06:05:05 -0000 Author: eadler Date: Sat Nov 10 06:05:04 2012 New Revision: 242850 URL: http://svnweb.freebsd.org/changeset/base/242850 Log: MFC r242514: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Approved by: cperciva (implicit) Approved by: re (kib) Modified: releng/9.1/etc/root/dot.cshrc releng/9.1/share/skel/dot.cshrc Directory Properties: releng/9.1/etc/ (props changed) releng/9.1/share/skel/ (props changed) Modified: releng/9.1/etc/root/dot.cshrc ============================================================================== --- releng/9.1/etc/root/dot.cshrc Sat Nov 10 04:49:09 2012 (r242849) +++ releng/9.1/etc/root/dot.cshrc Sat Nov 10 06:05:04 2012 (r242850) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then Modified: releng/9.1/share/skel/dot.cshrc ============================================================================== --- releng/9.1/share/skel/dot.cshrc Sat Nov 10 04:49:09 2012 (r242849) +++ releng/9.1/share/skel/dot.cshrc Sat Nov 10 06:05:04 2012 (r242850) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 06:10:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C743F14; Sat, 10 Nov 2012 06:10:08 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 627C08FC08; Sat, 10 Nov 2012 06:10:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA6A8WS042137; Sat, 10 Nov 2012 06:10:08 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA6A8Wr042136; Sat, 10 Nov 2012 06:10:08 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201211100610.qAA6A8Wr042136@svn.freebsd.org> From: Greg Lehey Date: Sat, 10 Nov 2012 06:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242851 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 06:10:08 -0000 Author: grog Date: Sat Nov 10 06:10:07 2012 New Revision: 242851 URL: http://svnweb.freebsd.org/changeset/base/242851 Log: More style(9) tabs vs. spaces: - tabs after #define - Not in comments. MFC after: 2 weeks Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Sat Nov 10 06:05:04 2012 (r242850) +++ head/usr.bin/locale/locale.c Sat Nov 10 06:10:07 2012 (r242851) @@ -79,32 +79,32 @@ struct _lcinfo { { "LC_MONETARY", LC_MONETARY }, { "LC_MESSAGES", LC_MESSAGES } }; -#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0])) +#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0])) /* ids for values not referenced by nl_langinfo() */ #define KW_ZERO 10000 #define KW_GROUPING (KW_ZERO+1) -#define KW_INT_CURR_SYMBOL (KW_ZERO+2) -#define KW_CURRENCY_SYMBOL (KW_ZERO+3) -#define KW_MON_DECIMAL_POINT (KW_ZERO+4) -#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) -#define KW_MON_GROUPING (KW_ZERO+6) -#define KW_POSITIVE_SIGN (KW_ZERO+7) -#define KW_NEGATIVE_SIGN (KW_ZERO+8) -#define KW_INT_FRAC_DIGITS (KW_ZERO+9) -#define KW_FRAC_DIGITS (KW_ZERO+10) -#define KW_P_CS_PRECEDES (KW_ZERO+11) -#define KW_P_SEP_BY_SPACE (KW_ZERO+12) -#define KW_N_CS_PRECEDES (KW_ZERO+13) -#define KW_N_SEP_BY_SPACE (KW_ZERO+14) -#define KW_P_SIGN_POSN (KW_ZERO+15) -#define KW_N_SIGN_POSN (KW_ZERO+16) -#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) -#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) -#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) -#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) -#define KW_INT_P_SIGN_POSN (KW_ZERO+21) -#define KW_INT_N_SIGN_POSN (KW_ZERO+22) +#define KW_INT_CURR_SYMBOL (KW_ZERO+2) +#define KW_CURRENCY_SYMBOL (KW_ZERO+3) +#define KW_MON_DECIMAL_POINT (KW_ZERO+4) +#define KW_MON_THOUSANDS_SEP (KW_ZERO+5) +#define KW_MON_GROUPING (KW_ZERO+6) +#define KW_POSITIVE_SIGN (KW_ZERO+7) +#define KW_NEGATIVE_SIGN (KW_ZERO+8) +#define KW_INT_FRAC_DIGITS (KW_ZERO+9) +#define KW_FRAC_DIGITS (KW_ZERO+10) +#define KW_P_CS_PRECEDES (KW_ZERO+11) +#define KW_P_SEP_BY_SPACE (KW_ZERO+12) +#define KW_N_CS_PRECEDES (KW_ZERO+13) +#define KW_N_SEP_BY_SPACE (KW_ZERO+14) +#define KW_P_SIGN_POSN (KW_ZERO+15) +#define KW_N_SIGN_POSN (KW_ZERO+16) +#define KW_INT_P_CS_PRECEDES (KW_ZERO+17) +#define KW_INT_P_SEP_BY_SPACE (KW_ZERO+18) +#define KW_INT_N_CS_PRECEDES (KW_ZERO+19) +#define KW_INT_N_SEP_BY_SPACE (KW_ZERO+20) +#define KW_INT_P_SIGN_POSN (KW_ZERO+21) +#define KW_INT_N_SIGN_POSN (KW_ZERO+22) struct _kwinfo { const char *name; @@ -218,7 +218,7 @@ struct _kwinfo { "(POSIX legacy)" } /* compat */ }; -#define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) +#define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) const char *boguslocales[] = { "UTF-8" }; #define NBOGUS (sizeof(boguslocales)/sizeof(boguslocales[0])) @@ -316,7 +316,7 @@ usage(void) * * XXX actually output of this function does not guarantee that locale * is really available to application, since it can be broken or - * inconsistent thus setlocale() will fail. Maybe add '-V' function to + * inconsistent thus setlocale() will fail. Maybe add '-V' function to * also validate these locales? */ void @@ -664,7 +664,7 @@ showkeywordslist(char *substring) { size_t i; -#define FMT "%-20s %-12s %-7s %-20s\n" +#define FMT "%-20s %-12s %-7s %-20s\n" if (substring == NULL) printf("List of available keywords\n\n"); From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 07:02:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12BD0720; Sat, 10 Nov 2012 07:02:58 +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 EB6478FC08; Sat, 10 Nov 2012 07:02:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA72vIr050158; Sat, 10 Nov 2012 07:02:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA72vYx050157; Sat, 10 Nov 2012 07:02:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211100702.qAA72vYx050157@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Nov 2012 07:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242852 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 07:02:58 -0000 Author: mav Date: Sat Nov 10 07:02:57 2012 New Revision: 242852 URL: http://svnweb.freebsd.org/changeset/base/242852 Log: Several optimizations to sched_idletd(): - Do not try to steal load from other CPUs if there was no contest switches on this CPU (i.e. it was idle all the time and woke up just for bus mastering or TLB shutdown). If current CPU was idle, then it is quite unlikely that some other CPU has load to steal. Under high I/O rate, when TLB shutdowns cause numerous CPU wakeups, on 24-CPU system load stealing code may consume up to 25% of all CPU time without giving any benefits. - Change code that implements spinning for load to restart spin in case of context switch. Previous code periodically called cpu_idle() even under high interrupt/context switch rate. - Rise spinning threshold to 10KHz, where it gives at least some effect that may worth consumed power. Reviewed by: jeff@ Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Nov 10 06:10:07 2012 (r242851) +++ head/sys/kern/sched_ule.c Sat Nov 10 07:02:57 2012 (r242852) @@ -1441,7 +1441,7 @@ sched_initticks(void *dummy) affinity = SCHED_AFFINITY_DEFAULT; #endif if (sched_idlespinthresh < 0) - sched_idlespinthresh = imax(16, 2 * hz / realstathz); + sched_idlespinthresh = 2 * max(10000, 6 * hz) / realstathz; } @@ -1883,7 +1883,8 @@ sched_switch(struct thread *td, struct t preempted = !(td->td_flags & TDF_SLICEEND); td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); td->td_owepreempt = 0; - tdq->tdq_switchcnt++; + if (!TD_IS_IDLETHREAD(td)) + tdq->tdq_switchcnt++; /* * The lock pointer in an idle thread should never change. Reset it * to CAN_RUN as well. @@ -2614,17 +2615,27 @@ sched_idletd(void *dummy) { struct thread *td; struct tdq *tdq; - int switchcnt; + int oldswitchcnt, switchcnt; int i; mtx_assert(&Giant, MA_NOTOWNED); td = curthread; tdq = TDQ_SELF(); THREAD_NO_SLEEPING(); + oldswitchcnt = -1; for (;;) { + if (tdq->tdq_load) { + thread_lock(td); + mi_switch(SW_VOL | SWT_IDLE, NULL); + thread_unlock(td); + } + switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; #ifdef SMP - if (tdq_idled(tdq) == 0) - continue; + if (switchcnt != oldswitchcnt) { + oldswitchcnt = switchcnt; + if (tdq_idled(tdq) == 0) + continue; + } #endif switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; /* @@ -2641,20 +2652,26 @@ sched_idletd(void *dummy) cpu_spinwait(); } } + + /* If there was context switch during spin, restart it. */ switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; - if (tdq->tdq_load == 0) { - tdq->tdq_cpu_idle = 1; - if (tdq->tdq_load == 0) { - cpu_idle(switchcnt > sched_idlespinthresh * 4); - tdq->tdq_switchcnt++; - } - tdq->tdq_cpu_idle = 0; - } - if (tdq->tdq_load) { - thread_lock(td); - mi_switch(SW_VOL | SWT_IDLE, NULL); - thread_unlock(td); - } + if (tdq->tdq_load != 0 || switchcnt != oldswitchcnt) + continue; + + /* Run main MD idle handler. */ + tdq->tdq_cpu_idle = 1; + cpu_idle(switchcnt * 4 > sched_idlespinthresh); + tdq->tdq_cpu_idle = 0; + + /* + * Account thread-less hardware interrupts and + * other wakeup reasons equal to context switches. + */ + switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; + if (switchcnt != oldswitchcnt) + continue; + tdq->tdq_switchcnt++; + oldswitchcnt++; } } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 08:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43B8E124; Sat, 10 Nov 2012 08:34:41 +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 28DB68FC13; Sat, 10 Nov 2012 08:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAA8Yf70064267; Sat, 10 Nov 2012 08:34:41 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAA8YfGS064265; Sat, 10 Nov 2012 08:34:41 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211100834.qAA8YfGS064265@svn.freebsd.org> From: Kevin Lo Date: Sat, 10 Nov 2012 08:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242853 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 08:34:41 -0000 Author: kevlo Date: Sat Nov 10 08:34:40 2012 New Revision: 242853 URL: http://svnweb.freebsd.org/changeset/base/242853 Log: Fix the build. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Nov 10 07:02:57 2012 (r242852) +++ head/sys/dev/ath/if_athvar.h Sat Nov 10 08:34:40 2012 (r242853) @@ -774,7 +774,7 @@ struct ath_softc { struct task sc_dfstask; /* DFS processing task */ /* ALQ */ -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ struct if_ath_alq sc_alq; #endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 08:36:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A36E72AD; Sat, 10 Nov 2012 08:36:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 3235D8FC08; Sat, 10 Nov 2012 08:36:02 +0000 (UTC) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAA8SCtD027977; Sat, 10 Nov 2012 19:28:12 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAA8S20Y025378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Nov 2012 19:28:04 +1100 Date: Sat, 10 Nov 2012 19:28:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r242842 - in head/sys: conf modules/mthca In-Reply-To: <201211100032.qAA0Wlvw090497@svn.freebsd.org> Message-ID: <20121110191905.H915@besplex.bde.org> References: <201211100032.qAA0Wlvw090497@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=fbv1UDsF c=1 sm=1 a=5sdN5XwoAGkA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=L_8HYZ1iqUoA:10 a=SCQOxAknV-SESF-HZBkA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 08:36:03 -0000 On Sat, 10 Nov 2012, Xin LI wrote: > Log: > Attempt toward a buildable universe by silenting a few warnings for OFED. > > Modified: > head/sys/conf/kern.pre.mk > head/sys/modules/mthca/Makefile Any chance of not adding style bugs in 1-line changes? > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Fri Nov 9 21:41:07 2012 (r242841) > +++ head/sys/conf/kern.pre.mk Sat Nov 10 00:32:47 2012 (r242842) > @@ -156,7 +156,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLA > # Infiniband C flags. Correct include paths and omit errors that linux > # does not honor. > OFEDINCLUDES= -I$S/ofed/include/ > -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions > +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides > OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} > OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} > OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Please don't format source files or output for 150-column terminals, especially when 'fixing' code formatted for 80 columns. > Modified: head/sys/modules/mthca/Makefile > ============================================================================== > --- head/sys/modules/mthca/Makefile Fri Nov 9 21:41:07 2012 (r242841) > +++ head/sys/modules/mthca/Makefile Sat Nov 10 00:32:47 2012 (r242842) > @@ -28,4 +28,4 @@ opt_inet6.h: > > .include > > -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions > +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides This one also misformats the whitespace before the new set of options. Also, silencing warnings breaks them (unless they are bugs in clang). In normal development, it is just as easy to fix the bugs as to break the warnings, but there is a major compiler change lots of warnings are broken and then the bugs that they report tend to remain unfixed. The compiler should not be changed if it causes a single new warning. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 10:41:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E1F96B4; Sat, 10 Nov 2012 10:41:01 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E71DB8FC0A; Sat, 10 Nov 2012 10:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAAf0aT086082; Sat, 10 Nov 2012 10:41:00 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAAf0VV086081; Sat, 10 Nov 2012 10:41:00 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201211101041.qAAAf0VV086081@svn.freebsd.org> From: Roman Divacky Date: Sat, 10 Nov 2012 10:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242854 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 10:41:01 -0000 Author: rdivacky Date: Sat Nov 10 10:41:00 2012 New Revision: 242854 URL: http://svnweb.freebsd.org/changeset/base/242854 Log: Initialize hdrlen to 0 to avoid clang warning in NOINET case. Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sat Nov 10 08:34:40 2012 (r242853) +++ head/sys/netinet/tcp_timewait.c Sat Nov 10 10:41:00 2012 (r242854) @@ -519,6 +519,7 @@ tcp_twrespond(struct tcptw *tw, int flag struct ip6_hdr *ip6 = NULL; int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif + hdrlen = 0; /* Keep compiler happy */ INP_WLOCK_ASSERT(inp); From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 10:50:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93B7D8A3; Sat, 10 Nov 2012 10:50:16 +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 138D88FC08; Sat, 10 Nov 2012 10:50:14 +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 MAA04438; Sat, 10 Nov 2012 12:50:10 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TX8de-0004nJ-Kp; Sat, 10 Nov 2012 12:50:10 +0200 Message-ID: <509E3162.5020702@FreeBSD.org> Date: Sat, 10 Nov 2012 12:50:10 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121030 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> In-Reply-To: <509DC25E.5030306@mu.org> X-Enigmail-Version: 1.4.5 Mail-Followup-To: Alfred Perlstein , Eitan Adler , Alfred Perlstein , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , Eitan Adler , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 10:50:16 -0000 on 10/11/2012 04:56 Alfred Perlstein said the following: > Sure, this is magic for i386 PAE machines. 384 maxusers was pretty much the > highest you wanted auto-tuned SAFELY for 32bit KVA on i386. So 384 is i386 sans 'i' and minus two? :-) Sorry, I still couldn't find an explanation of 384 in your reply... E.g. why not 320 or 400. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 11:55:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7129D2E6; Sat, 10 Nov 2012 11:55:53 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5589F8FC0C; Sat, 10 Nov 2012 11:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAABtrUH000173; Sat, 10 Nov 2012 11:55:53 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAABtrLl000172; Sat, 10 Nov 2012 11:55:53 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101155.qAABtrLl000172@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 11:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242855 - head/sys/boot/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 11:55:53 -0000 Author: nyan Date: Sat Nov 10 11:55:52 2012 New Revision: 242855 URL: http://svnweb.freebsd.org/changeset/base/242855 Log: MFi386: r241785 boot: use -march=i386 for both i386 and amd64 builds Modified: head/sys/boot/pc98/Makefile.inc Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Sat Nov 10 10:41:00 2012 (r242854) +++ head/sys/boot/pc98/Makefile.inc Sat Nov 10 11:55:52 2012 (r242855) @@ -5,7 +5,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float \ -Os -DPC98 LDFLAGS+= -nostdlib From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:04:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DB2C86A; Sat, 10 Nov 2012 12:04:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 591918FC12; Sat, 10 Nov 2012 12:04:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC43gZ001975; Sat, 10 Nov 2012 12:04:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC43Xe001973; Sat, 10 Nov 2012 12:04:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101204.qAAC43Xe001973@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242856 - in stable/9/sys: amd64/pci i386/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:04:03 -0000 Author: avg Date: Sat Nov 10 12:04:02 2012 New Revision: 242856 URL: http://svnweb.freebsd.org/changeset/base/242856 Log: MFC r241540: pciereg_cfg*: use assembly to access the mem-mapped cfg space Modified: stable/9/sys/amd64/pci/pci_cfgreg.c stable/9/sys/i386/pci/pci_cfgreg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- stable/9/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 11:55:52 2012 (r242855) +++ stable/9/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ #define PCIE_VADDR(base, reg, bus, slot, func) \ ((base) + \ ((((bus) & 0xff) << 20) | \ @@ -317,13 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -344,13 +354,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } } Modified: stable/9/sys/i386/pci/pci_cfgreg.c ============================================================================== --- stable/9/sys/i386/pci/pci_cfgreg.c Sat Nov 10 11:55:52 2012 (r242855) +++ stable/9/sys/i386/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) @@ -652,6 +652,14 @@ pciereg_findelem(vm_paddr_t papage) return (elem); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ + static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) @@ -673,13 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -707,13 +718,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:04:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A4059DF; Sat, 10 Nov 2012 12:04:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA9CD8FC08; Sat, 10 Nov 2012 12:04:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC4MuT002077; Sat, 10 Nov 2012 12:04:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC4Mj3002075; Sat, 10 Nov 2012 12:04:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101204.qAAC4Mj3002075@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242857 - in stable/8/sys: amd64/pci i386/pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:04:23 -0000 Author: avg Date: Sat Nov 10 12:04:22 2012 New Revision: 242857 URL: http://svnweb.freebsd.org/changeset/base/242857 Log: MFC r241540: pciereg_cfg*: use assembly to access the mem-mapped cfg space Modified: stable/8/sys/amd64/pci/pci_cfgreg.c stable/8/sys/i386/pci/pci_cfgreg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- stable/8/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) +++ stable/8/sys/amd64/pci/pci_cfgreg.c Sat Nov 10 12:04:22 2012 (r242857) @@ -295,6 +295,13 @@ pcie_cfgregopen(uint64_t base, uint8_t m return (1); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ #define PCIE_VADDR(base, reg, bus, slot, func) \ ((base) + \ ((((bus) & 0xff) << 20) | \ @@ -317,13 +324,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -344,13 +354,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } } Modified: stable/8/sys/i386/pci/pci_cfgreg.c ============================================================================== --- stable/8/sys/i386/pci/pci_cfgreg.c Sat Nov 10 12:04:02 2012 (r242856) +++ stable/8/sys/i386/pci/pci_cfgreg.c Sat Nov 10 12:04:22 2012 (r242857) @@ -652,6 +652,14 @@ pciereg_findelem(vm_paddr_t papage) return (elem); } +/* + * AMD BIOS And Kernel Developer's Guides for CPU families starting with 10h + * have a requirement that all accesses to the memory mapped PCI configuration + * space are done using AX class of registers. + * Since other vendors do not currently have any contradicting requirements + * the AMD access pattern is applied universally. + */ + static int pciereg_cfgread(int bus, unsigned slot, unsigned func, unsigned reg, unsigned bytes) @@ -673,13 +681,16 @@ pciereg_cfgread(int bus, unsigned slot, switch (bytes) { case 4: - data = *(volatile uint32_t *)(va); + __asm __volatile("mov %1, %%eax" : "=a" (data) + : "m" (*(uint32_t *)va)); break; case 2: - data = *(volatile uint16_t *)(va); + __asm __volatile("movzwl %1, %%eax" : "=a" (data) + : "m" (*(uint16_t *)va)); break; case 1: - data = *(volatile uint8_t *)(va); + __asm __volatile("movzbl %1, %%eax" : "=a" (data) + : "m" (*(uint8_t *)va)); break; } @@ -707,13 +718,16 @@ pciereg_cfgwrite(int bus, unsigned slot, switch (bytes) { case 4: - *(volatile uint32_t *)(va) = data; + __asm __volatile("mov %%eax, %0" : "=m" (*(uint32_t *)va) + : "a" (data)); break; case 2: - *(volatile uint16_t *)(va) = data; + __asm __volatile("mov %%ax, %0" : "=m" (*(uint16_t *)va) + : "a" (data)); break; case 1: - *(volatile uint8_t *)(va) = data; + __asm __volatile("mov %%al, %0" : "=m" (*(uint8_t *)va) + : "a" (data)); break; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:06:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05BFAB5C; Sat, 10 Nov 2012 12:06:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE8088FC13; Sat, 10 Nov 2012 12:06:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC6OwQ002538; Sat, 10 Nov 2012 12:06:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC6O8I002537; Sat, 10 Nov 2012 12:06:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101206.qAAC6O8I002537@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242858 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:06:25 -0000 Author: avg Date: Sat Nov 10 12:06:24 2012 New Revision: 242858 URL: http://svnweb.freebsd.org/changeset/base/242858 Log: MFC r241773: zfs: wait in arc_lowmem only if curproc == pageproc Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:04:22 2012 (r242857) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:24 2012 (r242858) @@ -3718,8 +3718,16 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_reclaim_thr_lock); needfree = 1; cv_signal(&arc_reclaim_thr_cv); - while (needfree) - msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + + /* + * It is unsafe to block here in arbitrary threads, because we can come + * here from ARC itself and may hold ARC locks and thus risk a deadlock + * with ARC reclaim thread. + */ + if (curproc == pageproc) { + while (needfree) + msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + } mutex_exit(&arc_reclaim_thr_lock); mutex_exit(&arc_lowmem_lock); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:06:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD85DCAF; Sat, 10 Nov 2012 12:06:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C28268FC08; Sat, 10 Nov 2012 12:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC6a1l002619; Sat, 10 Nov 2012 12:06:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC6aB1002617; Sat, 10 Nov 2012 12:06:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101206.qAAC6aB1002617@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242859 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:06:36 -0000 Author: avg Date: Sat Nov 10 12:06:36 2012 New Revision: 242859 URL: http://svnweb.freebsd.org/changeset/base/242859 Log: MFC r241773: zfs: wait in arc_lowmem only if curproc == pageproc Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:24 2012 (r242858) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:36 2012 (r242859) @@ -3718,8 +3718,16 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_reclaim_thr_lock); needfree = 1; cv_signal(&arc_reclaim_thr_cv); - while (needfree) - msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + + /* + * It is unsafe to block here in arbitrary threads, because we can come + * here from ARC itself and may hold ARC locks and thus risk a deadlock + * with ARC reclaim thread. + */ + if (curproc == pageproc) { + while (needfree) + msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + } mutex_exit(&arc_reclaim_thr_lock); mutex_exit(&arc_lowmem_lock); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:08:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A12A1E2F; Sat, 10 Nov 2012 12:08:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 871058FC08; Sat, 10 Nov 2012 12:08:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC86pK003094; Sat, 10 Nov 2012 12:08:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC86HQ003093; Sat, 10 Nov 2012 12:08:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101208.qAAC86HQ003093@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242860 - stable/9/sys/dev/cpuctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:08:06 -0000 Author: avg Date: Sat Nov 10 12:08:06 2012 New Revision: 242860 URL: http://svnweb.freebsd.org/changeset/base/242860 Log: MFC r242565: cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call Modified: stable/9/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/9/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:06:36 2012 (r242859) +++ stable/9/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:08:06 2012 (r242860) @@ -204,7 +204,7 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - do_cpuid(data->level, data->data); + cpuid_count(data->level, 0, data->data); restore_cpu(oldcpu, is_bound, td); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:08:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D7E26E; Sat, 10 Nov 2012 12:08:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 233538FC13; Sat, 10 Nov 2012 12:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAC8Jct003170; Sat, 10 Nov 2012 12:08:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAC8IqE003169; Sat, 10 Nov 2012 12:08:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101208.qAAC8IqE003169@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242861 - stable/8/sys/dev/cpuctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:08:19 -0000 Author: avg Date: Sat Nov 10 12:08:18 2012 New Revision: 242861 URL: http://svnweb.freebsd.org/changeset/base/242861 Log: MFC r242565: cpuctl_do_cpuid: explicitly use ecx=0 for cpuid call Modified: stable/8/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cpuctl/ (props changed) Modified: stable/8/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/8/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:08:06 2012 (r242860) +++ stable/8/sys/dev/cpuctl/cpuctl.c Sat Nov 10 12:08:18 2012 (r242861) @@ -204,7 +204,7 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - do_cpuid(data->level, data->data); + cpuid_count(data->level, 0, data->data); restore_cpu(oldcpu, is_bound, td); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:22:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BB5B3CF; Sat, 10 Nov 2012 12:22:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7985B8FC13; Sat, 10 Nov 2012 12:22:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAACMQGS006194; Sat, 10 Nov 2012 12:22:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAACMQ1Y006193; Sat, 10 Nov 2012 12:22:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211101222.qAACMQ1Y006193@svn.freebsd.org> From: Andriy Gapon Date: Sat, 10 Nov 2012 12:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242862 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:22:26 -0000 Author: avg Date: Sat Nov 10 12:22:26 2012 New Revision: 242862 URL: http://svnweb.freebsd.org/changeset/base/242862 Log: zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots ... before trying to destroy the zvol snapshots themselves. PR: kern/173442 Reported by: Petri Helenius , mm Obtained from: Brian Behlendorf , Illumos Bug #3170 Tested by: Petri Helenius MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 10 12:08:18 2012 (r242861) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 10 12:22:26 2012 (r242862) @@ -3245,6 +3245,7 @@ zfs_ioc_destroy_snaps_nvl(zfs_cmd_t *zc) } (void) zfs_unmount_snap(name, NULL); + (void) zvol_remove_minor(name); } err = dmu_snapshots_destroy_nvl(nvl, zc->zc_defer_destroy, From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:25:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A965656D; Sat, 10 Nov 2012 12:25:27 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 75D268FC0A; Sat, 10 Nov 2012 12:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAACPRKX006847; Sat, 10 Nov 2012 12:25:27 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAACPRYP006845; Sat, 10 Nov 2012 12:25:27 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101225.qAACPRYP006845@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 12:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242863 - in head/sys/boot/pc98: boot2 btx/btx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:25:27 -0000 Author: nyan Date: Sat Nov 10 12:25:27 2012 New Revision: 242863 URL: http://svnweb.freebsd.org/changeset/base/242863 Log: MFi386: r241301 add detection of serial console presence to btx and boot2-like blocks Modified: head/sys/boot/pc98/boot2/boot2.c head/sys/boot/pc98/btx/btx/btx.S Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Sat Nov 10 12:22:26 2012 (r242862) +++ head/sys/boot/pc98/boot2/boot2.c Sat Nov 10 12:25:27 2012 (r242863) @@ -554,8 +554,10 @@ parse() } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: head/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- head/sys/boot/pc98/btx/btx/btx.S Sat Nov 10 12:22:26 2012 (r242862) +++ head/sys/boot/pc98/btx/btx/btx.S Sat Nov 10 12:25:27 2012 (r242863) @@ -840,7 +840,7 @@ putstr: lodsb # Load char .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD /* - * void sio_init(void) + * int sio_init(void) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format @@ -856,14 +856,19 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_getc.1 # Get character /* - * void sio_flush(void) + * int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* * void sio_putc(int c) From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:38:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40880BE2; Sat, 10 Nov 2012 12:38:07 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26F2C8FC12; Sat, 10 Nov 2012 12:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAACc7Jo009487; Sat, 10 Nov 2012 12:38:07 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAACc7ho009486; Sat, 10 Nov 2012 12:38:07 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101238.qAACc7ho009486@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 12:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242864 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:38:07 -0000 Author: nyan Date: Sat Nov 10 12:38:06 2012 New Revision: 242864 URL: http://svnweb.freebsd.org/changeset/base/242864 Log: MFi386: r241300 i386 comconsole: don't loop forever if hardware doesn't respond - clear capability flags when hw timeouts - retire comc_started status variable and directly use c_flags to see if comconsole is selected for use Modified: head/sys/boot/pc98/libpc98/comconsole.c Modified: head/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- head/sys/boot/pc98/libpc98/comconsole.c Sat Nov 10 12:25:27 2012 (r242863) +++ head/sys/boot/pc98/libpc98/comconsole.c Sat Nov 10 12:38:06 2012 (r242864) @@ -63,7 +63,6 @@ static void comc_setup(int speed, int po static int comc_speed_set(struct env_var *ev, int flags, const void *value); -static int comc_started; static int comc_curspeed; static int comc_port = COMPORT; static uint32_t comc_locator; @@ -87,9 +86,6 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* @@ -137,18 +133,19 @@ comc_probe(struct console *cp) env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - if (comc_started && arg == 0) - return 0; - comc_started = 1; comc_setup(comc_curspeed, comc_port); - return(0); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void @@ -166,13 +163,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -185,7 +182,8 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if (comc_started && comc_curspeed != speed) + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -203,7 +201,8 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if (comc_started && comc_port != port) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_port != port) { comc_setup(comc_curspeed, port); set_hw_console_hint(); } @@ -305,7 +304,8 @@ comc_pcidev_set(struct env_var *ev, int printf("Invalid pcidev\n"); return (CMD_ERROR); } - if (comc_started && comc_locator != locator) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_locator != locator) { error = comc_pcidev_handle(locator); if (error != CMD_OK) return (error); @@ -317,6 +317,8 @@ comc_pcidev_set(struct env_var *ev, int static void comc_setup(int speed, int port) { + static int TRY_COUNT = 1000000; + int tries; comc_curspeed = speed; comc_port = port; @@ -327,9 +329,15 @@ comc_setup(int speed, int port) outb(comc_port + com_cfcr, COMC_FMT); outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + tries = 0; do inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + + if (tries < TRY_COUNT) + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 12:42:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D73E0D81; Sat, 10 Nov 2012 12:42:28 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9EDB8FC08; Sat, 10 Nov 2012 12:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAACgS5r010396; Sat, 10 Nov 2012 12:42:28 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAACgSL0010395; Sat, 10 Nov 2012 12:42:28 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101242.qAACgSL0010395@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 12:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242865 - head/sys/boot/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 12:42:29 -0000 Author: nyan Date: Sat Nov 10 12:42:28 2012 New Revision: 242865 URL: http://svnweb.freebsd.org/changeset/base/242865 Log: cosmetic changes to reduce diffs against i386. Modified: head/sys/boot/pc98/Makefile.inc Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Sat Nov 10 12:38:06 2012 (r242864) +++ head/sys/boot/pc98/Makefile.inc Sat Nov 10 12:42:28 2012 (r242865) @@ -6,8 +6,8 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float \ - -Os -DPC98 + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 13:24:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59A5E688; Sat, 10 Nov 2012 13:24:34 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34B348FC0A; Sat, 10 Nov 2012 13:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAADOYHW018143; Sat, 10 Nov 2012 13:24:34 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAADOYw0018142; Sat, 10 Nov 2012 13:24:34 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101324.qAADOYw0018142@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 13:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242866 - head/sys/pc98/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 13:24:34 -0000 Author: nyan Date: Sat Nov 10 13:24:33 2012 New Revision: 242866 URL: http://svnweb.freebsd.org/changeset/base/242866 Log: Use ANSI prototype to fix build with clang. MFC after: 1 week Modified: head/sys/pc98/include/bus.h Modified: head/sys/pc98/include/bus.h ============================================================================== --- head/sys/pc98/include/bus.h Sat Nov 10 12:42:28 2012 (r242865) +++ head/sys/pc98/include/bus.h Sat Nov 10 13:24:33 2012 (r242866) @@ -317,24 +317,22 @@ _BUS_ACCESS_METHODS_PROTO(u_int32_t,4) /* * read methods */ -#define _BUS_SPACE_READ(TYPE,BWN) \ -static __inline TYPE \ -bus_space_read_##BWN (tag, bsh, offset) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ -{ \ - register TYPE result; \ - \ - __asm __volatile("call *%2" \ - :"=a" (result), \ - "=d" (offset) \ - :"o" (bsh->bsh_bam.bs_read_##BWN), \ - "b" (bsh), \ - "1" (offset) \ - ); \ - \ - return result; \ +#define _BUS_SPACE_READ(TYPE,BWN) \ +static __inline TYPE \ +bus_space_read_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset) \ +{ \ + register TYPE result; \ + \ + __asm __volatile("call *%2" \ + :"=a" (result), \ + "=d" (offset) \ + :"o" (bsh->bsh_bam.bs_read_##BWN), \ + "b" (bsh), \ + "1" (offset) \ + ); \ + \ + return result; \ } _BUS_SPACE_READ(u_int8_t,1) @@ -344,22 +342,19 @@ _BUS_SPACE_READ(u_int32_t,4) /* * write methods */ -#define _BUS_SPACE_WRITE(TYPE,BWN) \ -static __inline void \ -bus_space_write_##BWN (tag, bsh, offset, val) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - TYPE val; \ -{ \ - \ - __asm __volatile("call *%1" \ - :"=d" (offset) \ - :"o" (bsh->bsh_bam.bs_write_##BWN), \ - "a" (val), \ - "b" (bsh), \ - "0" (offset) \ - ); \ +#define _BUS_SPACE_WRITE(TYPE,BWN) \ +static __inline void \ +bus_space_write_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, TYPE val) \ +{ \ + \ + __asm __volatile("call *%1" \ + :"=d" (offset) \ + :"o" (bsh->bsh_bam.bs_write_##BWN), \ + "a" (val), \ + "b" (bsh), \ + "0" (offset) \ + ); \ } _BUS_SPACE_WRITE(u_int8_t,1) @@ -371,12 +366,8 @@ _BUS_SPACE_WRITE(u_int32_t,4) */ #define _BUS_SPACE_READ_MULTI(TYPE,BWN) \ static __inline void \ -bus_space_read_multi_##BWN (tag, bsh, offset, buf, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - TYPE *buf; \ - size_t cnt; \ +bus_space_read_multi_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, TYPE *buf, size_t cnt) \ { \ \ __asm __volatile("call *%3" \ @@ -400,12 +391,8 @@ _BUS_SPACE_READ_MULTI(u_int32_t,4) */ #define _BUS_SPACE_WRITE_MULTI(TYPE,BWN) \ static __inline void \ -bus_space_write_multi_##BWN (tag, bsh, offset, buf, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - const TYPE *buf; \ - size_t cnt; \ +bus_space_write_multi_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, const TYPE *buf, size_t cnt) \ { \ \ __asm __volatile("call *%3" \ @@ -429,12 +416,8 @@ _BUS_SPACE_WRITE_MULTI(u_int32_t,4) */ #define _BUS_SPACE_READ_REGION(TYPE,BWN) \ static __inline void \ -bus_space_read_region_##BWN (tag, bsh, offset, buf, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - TYPE *buf; \ - size_t cnt; \ +bus_space_read_region_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, TYPE *buf, size_t cnt) \ { \ \ __asm __volatile("call *%3" \ @@ -458,12 +441,8 @@ _BUS_SPACE_READ_REGION(u_int32_t,4) */ #define _BUS_SPACE_WRITE_REGION(TYPE,BWN) \ static __inline void \ -bus_space_write_region_##BWN (tag, bsh, offset, buf, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - const TYPE *buf; \ - size_t cnt; \ +bus_space_write_region_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, const TYPE *buf, size_t cnt) \ { \ \ __asm __volatile("call *%3" \ @@ -487,12 +466,8 @@ _BUS_SPACE_WRITE_REGION(u_int32_t,4) */ #define _BUS_SPACE_SET_MULTI(TYPE,BWN) \ static __inline void \ -bus_space_set_multi_##BWN (tag, bsh, offset, val, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - TYPE val; \ - size_t cnt; \ +bus_space_set_multi_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, TYPE val, size_t cnt) \ { \ \ __asm __volatile("call *%2" \ @@ -515,12 +490,8 @@ _BUS_SPACE_SET_MULTI(u_int32_t,4) */ #define _BUS_SPACE_SET_REGION(TYPE,BWN) \ static __inline void \ -bus_space_set_region_##BWN (tag, bsh, offset, val, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t bsh; \ - bus_size_t offset; \ - TYPE val; \ - size_t cnt; \ +bus_space_set_region_##BWN (bus_space_tag_t tag, bus_space_handle_t bsh, \ + bus_size_t offset, TYPE val, size_t cnt) \ { \ \ __asm __volatile("call *%2" \ @@ -543,13 +514,8 @@ _BUS_SPACE_SET_REGION(u_int32_t,4) */ #define _BUS_SPACE_COPY_REGION(BWN) \ static __inline void \ -bus_space_copy_region_##BWN (tag, sbsh, src, dbsh, dst, cnt) \ - bus_space_tag_t tag; \ - bus_space_handle_t sbsh; \ - bus_size_t src; \ - bus_space_handle_t dbsh; \ - bus_size_t dst; \ - size_t cnt; \ +bus_space_copy_region_##BWN (bus_space_tag_t tag, bus_space_handle_t sbsh, \ + bus_size_t src, bus_space_handle_t dbsh, bus_size_t dst, size_t cnt) \ { \ \ if (dbsh->bsh_bam.bs_copy_region_1 != sbsh->bsh_bam.bs_copy_region_1) \ From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 13:25:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 418557FE; Sat, 10 Nov 2012 13:25:47 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 258F08FC0A; Sat, 10 Nov 2012 13:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAADPlR0018356; Sat, 10 Nov 2012 13:25:47 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAADPkIr018355; Sat, 10 Nov 2012 13:25:46 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101325.qAADPkIr018355@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 13:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242867 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 13:25:47 -0000 Author: nyan Date: Sat Nov 10 13:25:46 2012 New Revision: 242867 URL: http://svnweb.freebsd.org/changeset/base/242867 Log: MFi386: r211924 Register an interrupt vector for DTrace return probes. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Nov 10 13:24:33 2012 (r242866) +++ head/sys/pc98/pc98/machdep.c Sat Nov 10 13:25:46 2012 (r242867) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mp_watchdog.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_kdtrace.h" #include #include @@ -1772,7 +1773,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2291,6 +2296,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 13:41:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40956F8B; Sat, 10 Nov 2012 13:41:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25BC28FC08; Sat, 10 Nov 2012 13:41:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAADfQ2W021424; Sat, 10 Nov 2012 13:41:26 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAADfQEw021423; Sat, 10 Nov 2012 13:41:26 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101341.qAADfQEw021423@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 13:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242868 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 13:41:26 -0000 Author: nyan Date: Sat Nov 10 13:41:25 2012 New Revision: 242868 URL: http://svnweb.freebsd.org/changeset/base/242868 Log: Fix some KASSERTs. They are missing changes from r208833, r227394 and r227442. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Nov 10 13:25:46 2012 (r242867) +++ head/sys/pc98/pc98/machdep.c Sat Nov 10 13:41:25 2012 (r242868) @@ -2652,7 +2652,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); @@ -2821,6 +2822,7 @@ static void fpstate_drop(struct thread *td) { + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 13:48:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 733802CD; Sat, 10 Nov 2012 13:48:42 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57AC08FC15; Sat, 10 Nov 2012 13:48:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAADmgGT022874; Sat, 10 Nov 2012 13:48:42 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAADmgrc022872; Sat, 10 Nov 2012 13:48:42 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101348.qAADmgrc022872@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 13:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242869 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 13:48:42 -0000 Author: nyan Date: Sat Nov 10 13:48:41 2012 New Revision: 242869 URL: http://svnweb.freebsd.org/changeset/base/242869 Log: Reduce diffs against i386. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Nov 10 13:41:25 2012 (r242868) +++ head/sys/pc98/pc98/machdep.c Sat Nov 10 13:48:41 2012 (r242869) @@ -1237,7 +1237,7 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); -#ifdef MP_WATCHDOG +#if defined(MP_WATCHDOG) ap_watchdog(PCPU_GET(cpuid)); #endif /* If we are busy - try to use fast methods. */ @@ -2157,6 +2157,8 @@ do_next: for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); } void From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 14:56:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B61328B2; Sat, 10 Nov 2012 14:56:35 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9BAE58FC0C; Sat, 10 Nov 2012 14:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAEuZJb037545; Sat, 10 Nov 2012 14:56:35 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAEuZZY037544; Sat, 10 Nov 2012 14:56:35 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101456.qAAEuZZY037544@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 14:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242870 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 14:56:35 -0000 Author: nyan Date: Sat Nov 10 14:56:35 2012 New Revision: 242870 URL: http://svnweb.freebsd.org/changeset/base/242870 Log: MFi386: r232263 Fix build mpboot.s with clang. Modified: head/sys/conf/Makefile.pc98 Modified: head/sys/conf/Makefile.pc98 ============================================================================== --- head/sys/conf/Makefile.pc98 Sat Nov 10 13:48:41 2012 (r242869) +++ head/sys/conf/Makefile.pc98 Sat Nov 10 14:56:35 2012 (r242870) @@ -34,6 +34,10 @@ MACHINE=pc98 MKMODULESENV+= MACHINE=${MACHINE} +# XXX: clang integrated-as doesn't grok .codeNN directives yet +ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} + %BEFORE_DEPEND %OBJS From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 14:58:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9295BA38; Sat, 10 Nov 2012 14:58:06 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 781B88FC0A; Sat, 10 Nov 2012 14:58:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAEw6FV037890; Sat, 10 Nov 2012 14:58:06 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAEw6XK037882; Sat, 10 Nov 2012 14:58:06 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211101458.qAAEw6XK037882@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Nov 2012 14:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242871 - in head/sys/dev: ct snc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 14:58:06 -0000 Author: nyan Date: Sat Nov 10 14:58:06 2012 New Revision: 242871 URL: http://svnweb.freebsd.org/changeset/base/242871 Log: Use ANSI prototype to fix build with clang. MFC after: 1 week Modified: head/sys/dev/ct/bshw_machdep.c head/sys/dev/ct/ct.c head/sys/dev/ct/ct_isa.c head/sys/dev/ct/ct_machdep.h head/sys/dev/snc/dp83932.c head/sys/dev/snc/dp83932subr.c head/sys/dev/snc/if_snc.c head/sys/dev/snc/if_snc_cbus.c Modified: head/sys/dev/ct/bshw_machdep.c ============================================================================== --- head/sys/dev/ct/bshw_machdep.c Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/ct/bshw_machdep.c Sat Nov 10 14:58:06 2012 (r242871) @@ -78,9 +78,7 @@ typedef unsigned long vaddr_t; * GENERIC MACHDEP FUNCTIONS *********************************************************/ void -bshw_synch_setup(ct, ti) - struct ct_softc *ct; - struct targ_info *ti; +bshw_synch_setup(struct ct_softc *ct, struct targ_info *ti) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -99,8 +97,7 @@ bshw_synch_setup(ct, ti) } void -bshw_bus_reset(ct) - struct ct_softc *ct; +bshw_bus_reset(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -149,9 +146,7 @@ bshw_bus_reset(ct) /* probe */ int -bshw_read_settings(chp, bs) - struct ct_bus_access_handle *chp; - struct bshw_softc *bs; +bshw_read_settings(struct ct_bus_access_handle *chp, struct bshw_softc *bs) { static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 }; @@ -183,8 +178,7 @@ static __inline void bshw_lc_smit_stop(s static int bshw_lc_smit_fstat(struct ct_softc *, int, int); static __inline void -bshw_lc_smit_stop(ct) - struct ct_softc *ct; +bshw_lc_smit_stop(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -193,10 +187,7 @@ bshw_lc_smit_stop(ct) } static __inline void -bshw_lc_smit_start(ct, count, direction) - struct ct_softc *ct; - int count; - u_int direction; +bshw_lc_smit_start(struct ct_softc *ct, int count, u_int direction) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t pval, val; @@ -212,9 +203,7 @@ bshw_lc_smit_start(ct, count, direction) } static int -bshw_lc_smit_fstat(ct, wc, read) - struct ct_softc *ct; - int wc, read; +bshw_lc_smit_fstat(struct ct_softc *ct, int wc, int read) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t stat; @@ -244,8 +233,7 @@ bshw_lc_smit_fstat(ct, wc, read) } void -bshw_smit_xfer_stop(ct) - struct ct_softc *ct; +bshw_smit_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -292,8 +280,7 @@ bad: } int -bshw_smit_xfer_start(ct) - struct ct_softc *ct; +bshw_smit_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -396,8 +383,7 @@ static void bshw_dmastart(struct ct_soft static void bshw_dmadone(struct ct_softc *); int -bshw_dma_xfer_start(ct) - struct ct_softc *ct; +bshw_dma_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -458,8 +444,7 @@ bshw_dma_xfer_start(ct) } void -bshw_dma_xfer_stop(ct) - struct ct_softc *ct; +bshw_dma_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -523,10 +508,8 @@ bshw_dma_xfer_stop(ct) static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; static __inline void -bshw_dma_write_1(chp, port, val) - struct ct_bus_access_handle *chp; - bus_addr_t port; - u_int8_t val; +bshw_dma_write_1(struct ct_bus_access_handle *chp, bus_addr_t port, + u_int8_t val) { CT_BUS_WEIGHT(chp); @@ -534,8 +517,7 @@ bshw_dma_write_1(chp, port, val) } static void -bshw_dmastart(ct) - struct ct_softc *ct; +bshw_dmastart(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -581,8 +563,7 @@ bshw_dmastart(ct) } static void -bshw_dmadone(ct) - struct ct_softc *ct; +bshw_dmadone(struct ct_softc *ct) { struct bshw_softc *bs = ct->ct_hw; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -609,8 +590,7 @@ static void bshw_dma_start_elecom(struct static void bshw_dma_stop_elecom(struct ct_softc *); static int -bshw_dma_init_texa(ct) - struct ct_softc *ct; +bshw_dma_init_texa(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t regval; @@ -625,8 +605,7 @@ bshw_dma_init_texa(ct) } static int -bshw_dma_init_sc98(ct) - struct ct_softc *ct; +bshw_dma_init_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -652,8 +631,7 @@ bshw_dma_init_sc98(ct) } static void -bshw_dma_start_sc98(ct) - struct ct_softc *ct; +bshw_dma_start_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -662,8 +640,7 @@ bshw_dma_start_sc98(ct) } static void -bshw_dma_stop_sc98(ct) - struct ct_softc *ct; +bshw_dma_stop_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -672,8 +649,7 @@ bshw_dma_stop_sc98(ct) } static void -bshw_dma_start_elecom(ct) - struct ct_softc *ct; +bshw_dma_start_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); @@ -682,8 +658,7 @@ bshw_dma_start_elecom(ct) } static void -bshw_dma_stop_elecom(ct) - struct ct_softc *ct; +bshw_dma_stop_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); Modified: head/sys/dev/ct/ct.c ============================================================================== --- head/sys/dev/ct/ct.c Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/ct/ct.c Sat Nov 10 14:58:06 2012 (r242871) @@ -164,9 +164,7 @@ struct scsi_low_funcs ct_funcs = { * HW functions **************************************************/ static __inline void -cthw_phase_bypass(ct, ph) - struct ct_softc *ct; - u_int8_t ph; +cthw_phase_bypass(struct ct_softc *ct, u_int8_t ph) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -175,8 +173,7 @@ cthw_phase_bypass(ct, ph) } static void -cthw_bus_reset(ct) - struct ct_softc *ct; +cthw_bus_reset(struct ct_softc *ct) { /* @@ -187,10 +184,8 @@ cthw_bus_reset(ct) } static int -cthw_chip_reset(chp, chiprevp, chipclk, hostid) - struct ct_bus_access_handle *chp; - int *chiprevp; - int chipclk, hostid; +cthw_chip_reset(struct ct_bus_access_handle *chp, int *chiprevp, int chipclk, + int hostid) { #define CT_SELTIMEOUT_20MHz_REGV (0x80) u_int8_t aux, regv; @@ -285,8 +280,7 @@ out: } static struct ct_synch_data * -ct_make_synch_table(ct) - struct ct_softc *ct; +ct_make_synch_table(struct ct_softc *ct) { struct ct_synch_data *sdtp, *sdp; u_int base, i, period; @@ -329,11 +323,8 @@ ct_make_synch_table(ct) * Attach & Probe **************************************************/ int -ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp) - struct ct_bus_access_handle *chp; - u_int dvcfg, chipclk; - int hsid; - int *chiprevp; +ctprobesubr(struct ct_bus_access_handle *chp, u_int dvcfg, int hsid, + u_int chipclk, int *chiprevp) { #if 0 @@ -346,8 +337,7 @@ ctprobesubr(chp, dvcfg, hsid, chipclk, c } void -ctattachsubr(ct) - struct ct_softc *ct; +ctattachsubr(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -362,8 +352,7 @@ ctattachsubr(ct) * SCSI LOW interface functions **************************************************/ static void -cthw_attention(ct) - struct ct_softc *ct; +cthw_attention(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -380,8 +369,7 @@ cthw_attention(ct) } static void -ct_attention(ct) - struct ct_softc *ct; +ct_attention(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -398,10 +386,7 @@ ct_attention(ct) } static int -ct_targ_init(ct, ti, action) - struct ct_softc *ct; - struct targ_info *ti; - int action; +ct_targ_init(struct ct_softc *ct, struct targ_info *ti, int action) { struct ct_targ_info *cti = (void *) ti; @@ -438,9 +423,7 @@ ct_targ_init(ct, ti, action) } static int -ct_world_start(ct, fdone) - struct ct_softc *ct; - int fdone; +ct_world_start(struct ct_softc *ct, int fdone) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -470,9 +453,7 @@ ct_world_start(ct, fdone) } static int -ct_start_selection(ct, cb) - struct ct_softc *ct; - struct slccb *cb; +ct_start_selection(struct ct_softc *ct, struct slccb *cb) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -544,10 +525,7 @@ ct_start_selection(ct, cb) } static int -ct_msg(ct, ti, msg) - struct ct_softc *ct; - struct targ_info *ti; - u_int msg; +ct_msg(struct ct_softc *ct, struct targ_info *ti, u_int msg) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -599,11 +577,8 @@ ct_msg(ct, ti, msg) * *************************************************/ static int -ct_xfer(ct, data, len, direction, statp) - struct ct_softc *ct; - u_int8_t *data; - int len, direction; - u_int *statp; +ct_xfer(struct ct_softc *ct, u_int8_t *data, int len, int direction, + u_int *statp) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -663,8 +638,7 @@ ct_xfer(ct, data, len, direction, statp) #define CT_PADDING_BUF_SIZE 32 static void -ct_io_xfer(ct) - struct ct_softc *ct; +ct_io_xfer(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -716,9 +690,7 @@ struct ct_err ct_cmderr[] = { }; static void -ct_phase_error(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_phase_error(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct targ_info *ti = slp->sl_Tnexus; @@ -764,9 +736,7 @@ ct_phase_error(ct, scsi_status) * ### SCSI PHASE SEQUENCER ### **************************************************/ static int -ct_reselected(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_reselected(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -809,9 +779,7 @@ ct_reselected(ct, scsi_status) } static int -ct_target_nexus_establish(ct, lun, dir) - struct ct_softc *ct; - int lun, dir; +ct_target_nexus_establish(struct ct_softc *ct, int lun, int dir) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -831,8 +799,7 @@ ct_target_nexus_establish(ct, lun, dir) } static int -ct_lun_nexus_establish(ct) - struct ct_softc *ct; +ct_lun_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -843,8 +810,7 @@ ct_lun_nexus_establish(ct) } static int -ct_ccb_nexus_establish(ct) - struct ct_softc *ct; +ct_ccb_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -870,8 +836,7 @@ ct_ccb_nexus_establish(ct) } static int -ct_unbusy(ct) - struct ct_softc *ct; +ct_unbusy(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -894,8 +859,7 @@ ct_unbusy(ct) } static int -ct_catch_intr(ct) - struct ct_softc *ct; +ct_catch_intr(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -913,8 +877,7 @@ ct_catch_intr(ct) } int -ctintr(arg) - void *arg; +ctintr(void *arg) { struct ct_softc *ct = arg; struct scsi_low_softc *slp = &ct->sc_sclow; Modified: head/sys/dev/ct/ct_isa.c ============================================================================== --- head/sys/dev/ct/ct_isa.c Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/ct/ct_isa.c Sat Nov 10 14:58:06 2012 (r242871) @@ -367,16 +367,14 @@ ct_dmamap(void *arg, bus_dma_segment_t * } static void -ct_isa_bus_access_weight(chp) - struct ct_bus_access_handle *chp; +ct_isa_bus_access_weight(struct ct_bus_access_handle *chp) { outb(0x5f, 0); } static void -ct_isa_dmasync_before(ct) - struct ct_softc *ct; +ct_isa_dmasync_before(struct ct_softc *ct) { if (need_pre_dma_flush) @@ -384,8 +382,7 @@ ct_isa_dmasync_before(ct) } static void -ct_isa_dmasync_after(ct) - struct ct_softc *ct; +ct_isa_dmasync_after(struct ct_softc *ct) { if (need_post_dma_flush) Modified: head/sys/dev/ct/ct_machdep.h ============================================================================== --- head/sys/dev/ct/ct_machdep.h Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/ct/ct_machdep.h Sat Nov 10 14:58:06 2012 (r242871) @@ -90,8 +90,7 @@ static __inline void cthw_set_count (struct ct_bus_access_handle *, u_int); static __inline u_int8_t -ct_stat_read_1(chp) - struct ct_bus_access_handle *chp; +ct_stat_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -101,9 +100,7 @@ ct_stat_read_1(chp) } static __inline void -cthw_set_count(chp, count) - struct ct_bus_access_handle *chp; - u_int count; +cthw_set_count(struct ct_bus_access_handle *chp, u_int count) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -119,8 +116,7 @@ cthw_set_count(chp, count) } static __inline u_int -cthw_get_count(chp) - struct ct_bus_access_handle *chp; +cthw_get_count(struct ct_bus_access_handle *chp) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -138,10 +134,7 @@ cthw_get_count(chp) } static __inline void -ct_write_cmds(chp, cmd, len) - struct ct_bus_access_handle *chp; - u_int8_t *cmd; - int len; +ct_write_cmds(struct ct_bus_access_handle *chp, u_int8_t *cmd, int len) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -157,9 +150,7 @@ ct_write_cmds(chp, cmd, len) } static __inline u_int8_t -ct_cr_read_1(chp, offs) - struct ct_bus_access_handle *chp; - bus_addr_t offs; +ct_cr_read_1(struct ct_bus_access_handle *chp, bus_addr_t offs) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -173,10 +164,7 @@ ct_cr_read_1(chp, offs) } static __inline void -ct_cr_write_1(chp, offs, val) - struct ct_bus_access_handle *chp; - bus_addr_t offs; - u_int8_t val; +ct_cr_write_1(struct ct_bus_access_handle *chp, bus_addr_t offs, u_int8_t val) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -188,8 +176,7 @@ ct_cr_write_1(chp, offs, val) } static __inline u_int8_t -ct_cmdp_read_1(chp) - struct ct_bus_access_handle *chp; +ct_cmdp_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -199,9 +186,7 @@ ct_cmdp_read_1(chp) } static __inline void -ct_cmdp_write_1(chp, val) - struct ct_bus_access_handle *chp; - u_int8_t val; +ct_cmdp_write_1(struct ct_bus_access_handle *chp, u_int8_t val) { bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val); Modified: head/sys/dev/snc/dp83932.c ============================================================================== --- head/sys/dev/snc/dp83932.c Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/snc/dp83932.c Sat Nov 10 14:58:06 2012 (r242871) @@ -142,10 +142,8 @@ int sncdebug = 0; int -sncconfig(sc, media, nmedia, defmedia, myea) - struct snc_softc *sc; - int *media, nmedia, defmedia; - u_int8_t *myea; +sncconfig(struct snc_softc *sc, int *media, int nmedia, int defmedia, + u_int8_t *myea) { struct ifnet *ifp; int i; @@ -195,8 +193,7 @@ sncconfig(sc, media, nmedia, defmedia, m } void -sncshutdown(arg) - void *arg; +sncshutdown(void *arg) { struct snc_softc *sc = arg; @@ -208,8 +205,7 @@ sncshutdown(arg) * Media change callback. */ int -snc_mediachange(ifp) - struct ifnet *ifp; +snc_mediachange(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; int error; @@ -227,9 +223,7 @@ snc_mediachange(ifp) * Media status callback. */ void -snc_mediastatus(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +snc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) { struct snc_softc *sc = ifp->if_softc; @@ -248,10 +242,7 @@ snc_mediastatus(ifp, ifmr) static int -sncioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; +sncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr; struct snc_softc *sc = ifp->if_softc; @@ -317,8 +308,7 @@ sncioctl(ifp, cmd, data) * Encapsulate a packet of type family for the local net. */ static void -sncstart(ifp) - struct ifnet *ifp; +sncstart(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; @@ -328,8 +318,7 @@ sncstart(ifp) } static void -sncstart_locked(ifp) - struct ifnet *ifp; +sncstart_locked(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; struct mbuf *m; @@ -390,16 +379,14 @@ outloop: * hardware/software errors. */ static void -sncreset(sc) - struct snc_softc *sc; +sncreset(struct snc_softc *sc) { sncstop(sc); sncinit_locked(sc); } static void -sncinit(xsc) - void *xsc; +sncinit(void *xsc) { struct snc_softc *sc = xsc; @@ -476,8 +463,7 @@ sncinit_locked(struct snc_softc *sc) * part way through. */ static int -sncstop(sc) - struct snc_softc *sc; +sncstop(struct snc_softc *sc) { struct mtd *mtd; @@ -536,10 +522,7 @@ sncwatchdog(void *arg) * stuff packet into sonic */ static u_int -sonicput(sc, m0, mtd_next) - struct snc_softc *sc; - struct mbuf *m0; - int mtd_next; +sonicput(struct snc_softc *sc, struct mbuf *m0, int mtd_next) { struct mtd *mtdp; struct mbuf *m; @@ -629,8 +612,7 @@ sonicput(sc, m0, mtd_next) * CAM support */ static void -caminitialise(sc) - struct snc_softc *sc; +caminitialise(struct snc_softc *sc) { u_int32_t v_cda = sc->v_cda; int i; @@ -653,10 +635,7 @@ caminitialise(sc) } static void -camentry(sc, entry, ea) - int entry; - u_char *ea; - struct snc_softc *sc; +camentry(struct snc_softc *sc, int entry, u_char *ea) { u_int32_t v_cda = sc->v_cda; int camoffset = entry * CDA_CAMDESC; @@ -670,8 +649,7 @@ camentry(sc, entry, ea) } static void -camprogram(sc) - struct snc_softc *sc; +camprogram(struct snc_softc *sc) { struct ifmultiaddr *ifma; struct ifnet *ifp; @@ -732,8 +710,7 @@ camprogram(sc) #ifdef SNCDEBUG static void -camdump(sc) - struct snc_softc *sc; +camdump(struct snc_softc *sc) { int i; @@ -758,8 +735,7 @@ camdump(sc) #endif static void -initialise_tda(sc) - struct snc_softc *sc; +initialise_tda(struct snc_softc *sc) { struct mtd *mtd; int i; @@ -780,8 +756,7 @@ initialise_tda(sc) } static void -initialise_rda(sc) - struct snc_softc *sc; +initialise_rda(struct snc_softc *sc) { int i; u_int32_t vv_rda = 0; @@ -809,8 +784,7 @@ initialise_rda(sc) } static void -initialise_rra(sc) - struct snc_softc *sc; +initialise_rra(struct snc_softc *sc) { int i; u_int v; @@ -842,8 +816,7 @@ initialise_rra(sc) } void -sncintr(arg) - void *arg; +sncintr(void *arg) { struct snc_softc *sc = (struct snc_softc *)arg; int isr; @@ -912,8 +885,7 @@ sncintr(arg) * Transmit interrupt routine */ static void -sonictxint(sc) - struct snc_softc *sc; +sonictxint(struct snc_softc *sc) { struct mtd *mtd; u_int32_t txp; @@ -990,8 +962,7 @@ sonictxint(sc) * Receive interrupt routine */ static void -sonicrxint(sc) - struct snc_softc *sc; +sonicrxint(struct snc_softc *sc) { u_int32_t rda; int orra; @@ -1084,10 +1055,7 @@ sonicrxint(sc) * appropriate protocol handler */ static int -sonic_read(sc, pkt, len) - struct snc_softc *sc; - u_int32_t pkt; - int len; +sonic_read(struct snc_softc *sc, u_int32_t pkt, int len) { struct ifnet *ifp = sc->sc_ifp; struct ether_header *et; @@ -1131,10 +1099,7 @@ sonic_read(sc, pkt, len) * munge the received packet into an mbuf chain */ static struct mbuf * -sonic_get(sc, pkt, datalen) - struct snc_softc *sc; - u_int32_t pkt; - int datalen; +sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) { struct mbuf *m, *top, **mp; int len; @@ -1194,8 +1159,7 @@ sonic_get(sc, pkt, datalen) * Enable power on the interface. */ int -snc_enable(sc) - struct snc_softc *sc; +snc_enable(struct snc_softc *sc) { #ifdef SNCDEBUG @@ -1217,8 +1181,7 @@ snc_enable(sc) * Disable power on the interface. */ void -snc_disable(sc) - struct snc_softc *sc; +snc_disable(struct snc_softc *sc) { #ifdef SNCDEBUG Modified: head/sys/dev/snc/dp83932subr.c ============================================================================== --- head/sys/dev/snc/dp83932subr.c Sat Nov 10 14:56:35 2012 (r242870) +++ head/sys/dev/snc/dp83932subr.c Sat Nov 10 14:58:06 2012 (r242871) @@ -73,9 +73,7 @@ static __inline u_int16_t snc_nec16_sele * to accept packets. */ int -sncsetup(sc, lladdr) - struct snc_softc *sc; - u_int8_t *lladdr; +sncsetup(struct snc_softc *sc, u_int8_t *lladdr) { u_int32_t p, pp; int i; @@ -172,8 +170,7 @@ sncsetup(sc, lladdr) * check if a specified irq is acceptable. */ u_int8_t -snc_nec16_validate_irq(irq) - int irq; +snc_nec16_validate_irq(int irq) { const u_int8_t encoded_irq[16] = { -1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1 @@ -186,9 +183,7 @@ snc_nec16_validate_irq(irq) * specify irq to board. */ int -snc_nec16_register_irq(sc, irq) - struct snc_softc *sc; - int irq; +snc_nec16_register_irq(struct snc_softc *sc, int irq) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -212,8 +207,7 @@ snc_nec16_register_irq(sc, irq) * check if a specified memory base address is acceptable. */ int -snc_nec16_validate_mem(maddr) - int maddr; +snc_nec16_validate_mem(int maddr) { /* Check on Normal mode with max range, only */ @@ -230,9 +224,7 @@ snc_nec16_validate_mem(maddr) * specify memory base address to board and map to first bank. */ int -snc_nec16_register_mem(sc, maddr) - struct snc_softc *sc; - int maddr; +snc_nec16_register_mem(struct snc_softc *sc, int maddr) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -260,11 +252,8 @@ snc_nec16_register_mem(sc, maddr) } int -snc_nec16_check_memory(iot, ioh, memt, memh) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; +snc_nec16_check_memory(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh) { u_int16_t val; int i, j; @@ -341,14 +330,9 @@ snc_nec16_check_memory(iot, ioh, memt, m } int -snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; - int irq; - int maddr; - u_int8_t type; +snc_nec16_detectsubr(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh, int irq, int maddr, + u_int8_t type) { u_int16_t cr; u_int8_t ident; @@ -413,8 +397,7 @@ snc_nec16_detectsubr(iot, ioh, memt, mem #define SNC_NEC_SERIES_PNP_CBUS2 0x3d u_int8_t * -snc_nec16_detect_type(myea) - u_int8_t *myea; +snc_nec16_detect_type(u_int8_t *myea) { u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2]; u_int8_t series = myea[3]; @@ -459,10 +442,8 @@ snc_nec16_detect_type(myea) } int -snc_nec16_get_enaddr(iot, ioh, myea) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t *myea; +snc_nec16_get_enaddr(bus_space_tag_t iot, bus_space_handle_t ioh, + u_int8_t *myea) { u_int8_t eeprom[SNEC_EEPROM_SIZE]; u_int8_t rom_sum, sum = 0x00; @@ -493,9 +474,7 @@ snc_nec16_get_enaddr(iot, ioh, myea) * read from NEC/SONIC NIC register. */ u_int16_t -snc_nec16_nic_get(sc, reg) - struct snc_softc *sc; - u_int8_t reg; +snc_nec16_nic_get(struct snc_softc *sc, u_int8_t reg) { u_int16_t val; @@ -510,10 +489,7 @@ snc_nec16_nic_get(sc, reg) * write to NEC/SONIC NIC register. */ void -snc_nec16_nic_put(sc, reg, val) - struct snc_softc *sc; - u_int8_t reg; - u_int16_t val; +snc_nec16_nic_put(struct snc_softc *sc, u_int8_t reg, u_int16_t val) { /* select SONIC register */ @@ -527,10 +503,7 @@ snc_nec16_nic_put(sc, reg, val) * where exists specified (internal buffer memory) offset. */ static __inline u_int16_t -snc_nec16_select_bank(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_select_bank(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -565,11 +538,8 @@ snc_nec16_select_bank(sc, base, offset) * write to SONIC descriptors. */ void -snc_nec16_writetodesc(sc, base, offset, val) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; - u_int16_t val; +snc_nec16_writetodesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset, + u_int16_t val) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -584,10 +554,7 @@ snc_nec16_writetodesc(sc, base, offset, * read from SONIC descriptors. */ u_int16_t -snc_nec16_readfromdesc(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_readfromdesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -602,11 +569,8 @@ snc_nec16_readfromdesc(sc, base, offset) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 15:21:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E65594A9; Sat, 10 Nov 2012 15:21:39 +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 CC93A8FC12; Sat, 10 Nov 2012 15:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAFLdtF042838; Sat, 10 Nov 2012 15:21:39 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAFLd07042837; Sat, 10 Nov 2012 15:21:39 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211101521.qAAFLd07042837@svn.freebsd.org> From: Kevin Lo Date: Sat, 10 Nov 2012 15:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242872 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 15:21:40 -0000 Author: kevlo Date: Sat Nov 10 15:21:39 2012 New Revision: 242872 URL: http://svnweb.freebsd.org/changeset/base/242872 Log: s/ATH_DEBUG/ATH_DEBUG_ALQ Modified: head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sat Nov 10 14:58:06 2012 (r242871) +++ head/sys/dev/ath/if_ath_sysctl.c Sat Nov 10 15:21:39 2012 (r242872) @@ -711,7 +711,7 @@ ath_sysctlattach(struct ath_softc *sc) } #endif -#ifdef ATH_DEBUG +#ifdef ATH_DEBUG_ALQ ath_sysctl_alq_attach(sc); #endif } From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:02:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5DD39F; Sat, 10 Nov 2012 16:02:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBA688FC08; Sat, 10 Nov 2012 16:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAG2CmU051371; Sat, 10 Nov 2012 16:02:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAG2CmV051370; Sat, 10 Nov 2012 16:02:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211101602.qAAG2CmV051370@svn.freebsd.org> From: Dimitry Andric Date: Sat, 10 Nov 2012 16:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242873 - head/sys/dev/nve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:02:13 -0000 Author: dim Date: Sat Nov 10 16:02:12 2012 New Revision: 242873 URL: http://svnweb.freebsd.org/changeset/base/242873 Log: Fix all the inconsistent nve_os* function declarations and definitions in nve(4). The OS_API structure defined in os.h expects NV_API_CALL attributes, effectively regparm(0), on its function pointers, but all the functions were declared and defined without this attribute. MFC after: 1 week Modified: head/sys/dev/nve/if_nve.c Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Sat Nov 10 15:21:39 2012 (r242872) +++ head/sys/dev/nve/if_nve.c Sat Nov 10 16:02:12 2012 (r242873) @@ -152,30 +152,30 @@ static int nve_miibus_writereg(devi static void nve_dmamap_cb(void *, bus_dma_segment_t *, int, int); static void nve_dmamap_tx_cb(void *, bus_dma_segment_t *, int, bus_size_t, int); -static NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); -static NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); -static NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); -static NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); -static NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); -static NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); -static NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); -static NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); -static NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); -static NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); -static NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); -static NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); -static NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); - -static NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); -static PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); -static NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); -static NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); -static NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); -static NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); -static PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID, PMEMORY_BLOCK); +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID, PMEMORY_BLOCKEX); +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID, PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID, PMEMORY_BLOCK, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID, PNV_VOID, NV_UINT32, NV_UINT8 *, NV_UINT8); +static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID, NV_SINT32); +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID, PNV_VOID, PTIMER_FUNC, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID, PNV_VOID, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID, PNV_VOID); + +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID, PNV_VOID, PNV_VOID *, NV_UINT8 *, NV_UINT8); +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID, PNV_VOID *, NV_UINT32); +static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID, NV_SINT32, PNV_VOID *); +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID, NV_SINT32, PNV_VOID); +static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID, PNV_VOID); static device_method_t nve_methods[] = { /* Device interface */ @@ -1342,7 +1342,7 @@ nve_watchdog(struct nve_softc *sc) /* --- Start of NVOSAPI interface --- */ /* Allocate DMA enabled general use memory for API */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK mem) { struct nve_softc *sc; @@ -1370,7 +1370,7 @@ nve_osalloc(PNV_VOID ctx, PMEMORY_BLOCK } /* Free allocated memory */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK mem) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osfree - 0x%x - %d\n", @@ -1381,7 +1381,7 @@ nve_osfree(PNV_VOID ctx, PMEMORY_BLOCK m } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osallocex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1427,7 +1427,7 @@ nve_osallocex(PNV_VOID ctx, PMEMORY_BLOC } /* Copied directly from nvnet.c */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCKEX mem_block_ex) { MEMORY_BLOCK mem_block; @@ -1442,7 +1442,7 @@ nve_osfreeex(PNV_VOID ctx, PMEMORY_BLOCK } /* Clear memory region */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osclear(PNV_VOID ctx, PNV_VOID mem, NV_SINT32 length) { DEBUGOUT(NVE_DEBUG_API, "nve: nve_osclear\n"); @@ -1451,7 +1451,7 @@ nve_osclear(PNV_VOID ctx, PNV_VOID mem, } /* Sleep for a tick */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osdelay(PNV_VOID ctx, NV_UINT32 usec) { DELAY(usec); @@ -1459,7 +1459,7 @@ nve_osdelay(PNV_VOID ctx, NV_UINT32 usec } /* Allocate memory for rx buffer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osallocrxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID *id) { struct nve_softc *sc = ctx; @@ -1515,7 +1515,7 @@ fail: } /* Free the rx buffer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID id) { struct nve_softc *sc = ctx; @@ -1539,7 +1539,7 @@ nve_osfreerxbuf(PNV_VOID ctx, PMEMORY_BL } /* This gets called by the Nvidia API after our TX packet has been sent */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospackettx(PNV_VOID ctx, PNV_VOID id, NV_UINT32 success) { struct nve_softc *sc = ctx; @@ -1578,7 +1578,7 @@ fail: /* This gets called by the Nvidia API when a new packet has been received */ /* XXX What is newbuf used for? XXX */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospacketrx(PNV_VOID ctx, PNV_VOID data, NV_UINT32 success, NV_UINT8 *newbuf, NV_UINT8 priority) { @@ -1636,7 +1636,7 @@ nve_ospacketrx(PNV_VOID ctx, PNV_VOID da } /* This gets called by NVIDIA API when the PHY link state changes */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled) { @@ -1646,7 +1646,7 @@ nve_oslinkchg(PNV_VOID ctx, NV_SINT32 en } /* Setup a watchdog timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osalloctimer(PNV_VOID ctx, PNV_VOID *timer) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1660,7 +1660,7 @@ nve_osalloctimer(PNV_VOID ctx, PNV_VOID } /* Free the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osfreetimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1672,7 +1672,7 @@ nve_osfreetimer(PNV_VOID ctx, PNV_VOID t } /* Setup timer parameters */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osinittimer(PNV_VOID ctx, PNV_VOID timer, PTIMER_FUNC func, PNV_VOID parameters) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1686,7 +1686,7 @@ nve_osinittimer(PNV_VOID ctx, PNV_VOID t } /* Set the timer to go off */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ossettimer(PNV_VOID ctx, PNV_VOID timer, NV_UINT32 delay) { struct nve_softc *sc = ctx; @@ -1700,7 +1700,7 @@ nve_ossettimer(PNV_VOID ctx, PNV_VOID ti } /* Cancel the timer */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oscanceltimer(PNV_VOID ctx, PNV_VOID timer) { @@ -1711,7 +1711,7 @@ nve_oscanceltimer(PNV_VOID ctx, PNV_VOID return (1); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID readdata, PNV_VOID *id, NV_UINT8 *newbuffer, NV_UINT8 priority) { @@ -1722,7 +1722,7 @@ nve_ospreprocpkt(PNV_VOID ctx, PNV_VOID return (1); } -static PNV_VOID +static NV_API_CALL PNV_VOID nve_ospreprocpktnopq(PNV_VOID ctx, PNV_VOID readdata) { @@ -1732,7 +1732,7 @@ nve_ospreprocpktnopq(PNV_VOID ctx, PNV_V return (NULL); } -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_osindicatepkt(PNV_VOID ctx, PNV_VOID *id, NV_UINT32 pktno) { @@ -1743,7 +1743,7 @@ nve_osindicatepkt(PNV_VOID ctx, PNV_VOID } /* Allocate mutex context (already done in nve_attach) */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockalloc(PNV_VOID ctx, NV_SINT32 type, PNV_VOID *pLock) { struct nve_softc *sc = (struct nve_softc *)ctx; @@ -1756,7 +1756,7 @@ nve_oslockalloc(PNV_VOID ctx, NV_SINT32 } /* Obtain a spin lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1766,7 +1766,7 @@ nve_oslockacquire(PNV_VOID ctx, NV_SINT3 } /* Release lock */ -static NV_SINT32 +static NV_API_CALL NV_SINT32 nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock) { @@ -1776,7 +1776,7 @@ nve_oslockrelease(PNV_VOID ctx, NV_SINT3 } /* I have no idea what this is for */ -static PNV_VOID +static NV_API_CALL PNV_VOID nve_osreturnbufvirt(PNV_VOID ctx, PNV_VOID readdata) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74238376; Sat, 10 Nov 2012 16:08:22 +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 5A22F8FC08; Sat, 10 Nov 2012 16:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAG8MUH052451; Sat, 10 Nov 2012 16:08:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAG8Me7052450; Sat, 10 Nov 2012 16:08:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211101608.qAAG8Me7052450@svn.freebsd.org> From: Dimitry Andric Date: Sat, 10 Nov 2012 16:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242874 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:08:22 -0000 Author: dim Date: Sat Nov 10 16:08:21 2012 New Revision: 242874 URL: http://svnweb.freebsd.org/changeset/base/242874 Log: Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a cross gcc gets built during the cross-tools stage. MFC after: 1 week X-MFC-With: 242706 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 10 16:02:12 2012 (r242873) +++ head/Makefile.inc1 Sat Nov 10 16:08:21 2012 (r242874) @@ -1138,7 +1138,7 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif -.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") _gcc_tools= gnu/usr.bin/cc/cc_tools .endif @@ -1200,7 +1200,7 @@ _clang= usr.bin/clang _clang_libs= lib/clang .endif -.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") _cc= gnu/usr.bin/cc .endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:19:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C3325DF; Sat, 10 Nov 2012 16:19:10 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id DE1E98FC08; Sat, 10 Nov 2012 16:19:09 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id C56A61A3C1C; Sat, 10 Nov 2012 08:19:08 -0800 (PST) Message-ID: <509E7E7C.9000104@mu.org> Date: Sat, 10 Nov 2012 08:19:08 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Eitan Adler , Alfred Perlstein , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> In-Reply-To: <509E3162.5020702@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:19:10 -0000 On 11/10/12 2:50 AM, Andriy Gapon wrote: > on 10/11/2012 04:56 Alfred Perlstein said the following: >> Sure, this is magic for i386 PAE machines. 384 maxusers was pretty much the >> highest you wanted auto-tuned SAFELY for 32bit KVA on i386. > So 384 is i386 sans 'i' and minus two? :-) > Sorry, I still couldn't find an explanation of 384 in your reply... > E.g. why not 320 or 400. > Please consult the svn log for this file, it's relatively clear just in the commit logs/comments. Grep for 384/512 and look around. -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:26:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7847A95 for ; Sat, 10 Nov 2012 16:26:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 15A7E8FC0A for ; Sat, 10 Nov 2012 16:26:15 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so49331lbb.13 for ; Sat, 10 Nov 2012 08:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Al2Q3NWlfZ61N6gevcsRPP4rET/r00SQg30iRK8dwo8=; b=e9kxVF+KwFJU/upNV3UzdoiLkRJqcL9++Dl+6t8hdpNbFjQmmchpg8PUA8lAZ0C4gZ u+UkFqubgR+TjKWZyWyPJZzJlYqKWmWMrEcV27mzP2GpJTjiEVvrJ4IvPfnNjNcinyZT MdQFU8Mban/RrTlOpSizNyQsw+EZ/oDYirEFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Al2Q3NWlfZ61N6gevcsRPP4rET/r00SQg30iRK8dwo8=; b=Clgp3bQVB1kamAlAkU/mL5ySU/jr0abwE6esSfy5VPD4zuoWL1P09G2v35TTLHlKyx 2JvB9axQk4sXAZQZnDFKMjxpXCilJ+gBcozg2h/TOelwDtatk4zcUwNoTuxrKjcj5npA KeRkHXOB+MaayZMigy8S7I/AnHR58vqLzx7hffFbRY3oT0ejbd2nCz6I5WeoD/J8FKp+ FtUpZLk8g7vOJDmbv89yiS2htpCwhjIWAnU8EQ8nS2/4c+JY3a6YQBaIutwJEs8oY2Q5 CmhaZHi+6D06jA04387f91gtoDckh9mXvFZggxJUr8wiAVPtTVjJbMdfD9qUxfTodkKj Fwpw== Received: by 10.112.103.136 with SMTP id fw8mr3928461lbb.18.1352564774791; Sat, 10 Nov 2012 08:26:14 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sat, 10 Nov 2012 08:25:44 -0800 (PST) In-Reply-To: <509E7E7C.9000104@mu.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> From: Eitan Adler Date: Sat, 10 Nov 2012 11:25:44 -0500 X-Google-Sender-Auth: 0rmC9KryeqOo92A8wHOI7SGWyNc Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlzrktJyuPaRMcjWlqrL02gX9l2cVWZTk/YCMxgPb6dnksOgO9C9ZErL4sOfFtA/JXFp8E4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:26:16 -0000 On 10 November 2012 11:19, Alfred Perlstein wrote: > Please consult the svn log for this file, it's relatively clear just in the > commit logs/comments. Grep for 384/512 and look around. Can this reasoning be added as a comment? I did grep for 384 in the log, but a) I didn't find the answer b) one shouldn't have to. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:38:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00DE3F5F; Sat, 10 Nov 2012 16:38:37 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id CC15C8FC12; Sat, 10 Nov 2012 16:38:37 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 8DDF61A3C1B; Sat, 10 Nov 2012 08:38:37 -0800 (PST) Message-ID: <509E830D.5080006@mu.org> Date: Sat, 10 Nov 2012 08:38:37 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:38:38 -0000 On 11/10/12 8:25 AM, Eitan Adler wrote: > On 10 November 2012 11:19, Alfred Perlstein wrote: >> Please consult the svn log for this file, it's relatively clear just in the >> commit logs/comments. Grep for 384/512 and look around. > Can this reasoning be added as a comment? I did grep for 384 in the log, but > a) I didn't find the answer > b) one shouldn't have to. > > It probably could be added, but then a bunch of other people would complain about the comment being too wordy or "not in English". I will paste the relevant log messages which do explain it. If you would like to add a comment or work on a comment that won't be criticized for being "too wordy" then we can do that together. r89769 | dillon | 2002-01-24 17:54:16 -0800 (Thu, 24 Jan 2002) | 9 lines Make the 'maxusers 0' auto-sizing code slightly more conservative. Change from 1 megabyte of ram per user to 2 megabytes of ram per user, and reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM available while 384 leaves 270 MB of KVM available. Available KVM is important in order to deal with zalloc and kernel malloc area growth. Reviewed by: mckusick MFC: either before 4.5 if re's agree, or after 4.5 r87546 | dillon | 2001-12-08 17:57:09 -0800 (Sat, 08 Dec 2001) | 6 lines Allow maxusers to be specified as 0 in the kernel config, which will cause the system to auto-size to between 32 and 512 depending on the amount of memory. MFC after: 1 week From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:44:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D491F1F6; Sat, 10 Nov 2012 16:44:46 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 822C68FC0C; Sat, 10 Nov 2012 16:44:46 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 48AA51A3C26; Sat, 10 Nov 2012 08:44:46 -0800 (PST) Message-ID: <509E847E.30509@mu.org> Date: Sat, 10 Nov 2012 08:44:46 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> In-Reply-To: <509E830D.5080006@mu.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, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:44:47 -0000 On 11/10/12 8:38 AM, Alfred Perlstein wrote: > On 11/10/12 8:25 AM, Eitan Adler wrote: >> On 10 November 2012 11:19, Alfred Perlstein wrote: >>> Please consult the svn log for this file, it's relatively clear just >>> in the >>> commit logs/comments. Grep for 384/512 and look around. >> Can this reasoning be added as a comment? I did grep for 384 in the >> log, but >> a) I didn't find the answer >> b) one shouldn't have to. >> >> > It probably could be added, but then a bunch of other people would > complain about the comment being too wordy or "not in English". > > I will paste the relevant log messages which do explain it. If you > would like to add a comment or work on a comment that won't be > criticized for being "too wordy" then we can do that together. > > r89769 | dillon | 2002-01-24 17:54:16 -0800 (Thu, 24 Jan 2002) | 9 lines > > Make the 'maxusers 0' auto-sizing code slightly more conservative. Change > from 1 megabyte of ram per user to 2 megabytes of ram per user, and > reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM > available > while 384 leaves 270 MB of KVM available. Available KVM is important > in order to deal with zalloc and kernel malloc area growth. > > Reviewed by: mckusick > MFC: either before 4.5 if re's agree, or after 4.5 > > > r87546 | dillon | 2001-12-08 17:57:09 -0800 (Sat, 08 Dec 2001) | 6 lines > > Allow maxusers to be specified as 0 in the kernel config, which will > cause the system to auto-size to between 32 and 512 depending on the > amount of memory. > > MFC after: 1 week > Let me add a bit of commentary on these logs... Effectively what happens is that as "maxusers" goes up, the amount of kernel memory needed for the structures grows. Unfortunately at a certain point the slope of this function is too steep and makes it too easy to exhaust kernel address space (which kills the crab (and the kernel)) what was decided at the time was just to cap it hard. What was really needed was for the slope to be relaxed and for architectures to be allowed to override/cap it if needed. This is now done. Hopefully it's done correctly and will last us some time. -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 16:48:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6236C39D for ; Sat, 10 Nov 2012 16:48:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B48AE8FC15 for ; Sat, 10 Nov 2012 16:48:32 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4674030lag.13 for ; Sat, 10 Nov 2012 08:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/2hxDk033V3n1KMXmWHcI0DSbWCX+ZJ0TJ+/fK1rsOs=; b=qOBblqn16SnG72PCaeMU0zn1dautX0nQHck5LtsgTF8OUKtgMo1bdxfSnS/xC48SCa ZsqMA+UH+lGct2Dqjwedui7qZ1YXxcgcb7w7wjSgDr7zK8FiiRK0jP3uucPz4VCRXqBE REHrcc385qcjEl0huK2WOO9mQnx7uZsEi+Dhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=/2hxDk033V3n1KMXmWHcI0DSbWCX+ZJ0TJ+/fK1rsOs=; b=Yvy4h3PUHz566qeHxZasLIYRt6njcni3+PHoEX8MussCD9cAb72GPOG6B0JQ/OCjii c55VjSfRekWw47f39KifqRkHtlPsbEz8FfT38XfysVxKbNDkRoP/rVqVIYRK/sS6tagW 1KGLB3AWCmkuoNWOTvUBf1ebu+xYyyDD0F4HKISTjmu8gKMsKAtMYxo1nEelIO+6oW3E ioYFx2lI+W9No4hFKZRodGS/8osR9I0s34qjqFa8Y6bS3zBd+PpnKFAAn61aDyb5a6dH saPbKouNf17aqK8wDtbGPwZYV0py44h1FFMV4rElNBwLdnlEejDVAeFHLZC70S3h1+QM fR+Q== Received: by 10.152.104.148 with SMTP id ge20mr13403233lab.51.1352566111431; Sat, 10 Nov 2012 08:48:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sat, 10 Nov 2012 08:48:01 -0800 (PST) In-Reply-To: <509E847E.30509@mu.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> From: Eitan Adler Date: Sat, 10 Nov 2012 11:48:01 -0500 X-Google-Sender-Auth: ZxHcub2LoFZKv0HeuZcAPipNfCI Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmjKyXgH69l2v6nq4930RjqDaFUrZcr+bvTR2xMlz1IIdTNmY1Nkv0CE1/0NOULgTpAKcI7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 16:48:33 -0000 On 10 November 2012 11:44, Alfred Perlstein wrote: > On 11/10/12 8:38 AM, Alfred Perlstein wrote: >> >> On 11/10/12 8:25 AM, Eitan Adler wrote: >>> >>> On 10 November 2012 11:19, Alfred Perlstein wrote: >>>> >>>> Please consult the svn log for this file, it's relatively clear just in >>>> the >>>> commit logs/comments. Grep for 384/512 and look around. >>> >>> Can this reasoning be added as a comment? I did grep for 384 in the log, >>> but >>> a) I didn't find the answer >>> b) one shouldn't have to. >>> >>> >> It probably could be added, but then a bunch of other people would >> complain about the comment being too wordy or "not in English". >> >> I will paste the relevant log messages which do explain it. If you would >> like to add a comment or work on a comment that won't be criticized for >> being "too wordy" then we can do that together. >> >> r89769 | dillon | 2002-01-24 17:54:16 -0800 (Thu, 24 Jan 2002) | 9 lines >> >> Make the 'maxusers 0' auto-sizing code slightly more conservative. Change >> from 1 megabyte of ram per user to 2 megabytes of ram per user, and >> reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM available >> while 384 leaves 270 MB of KVM available. Available KVM is important >> in order to deal with zalloc and kernel malloc area growth. >> >> Reviewed by: mckusick >> MFC: either before 4.5 if re's agree, or after 4.5 >> >> >> r87546 | dillon | 2001-12-08 17:57:09 -0800 (Sat, 08 Dec 2001) | 6 lines >> >> Allow maxusers to be specified as 0 in the kernel config, which will >> cause the system to auto-size to between 32 and 512 depending on the >> amount of memory. >> >> MFC after: 1 week >> > Let me add a bit of commentary on these logs... > > Effectively what happens is that as "maxusers" goes up, the amount of kernel > memory needed for the structures grows. Unfortunately at a certain point > the slope of this function is too steep and makes it too easy to exhaust > kernel address space (which kills the crab (and the kernel)) what was > decided at the time was just to cap it hard. I understand this. What I was confused by is where the number "384" comes from? Was this empirically tested? Mathematically deduced? Arbitrarily chosen? I think the log messages you pasted mostly answered this. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:04:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C97DC8A1; Sat, 10 Nov 2012 17:04:48 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A55088FC0A; Sat, 10 Nov 2012 17:04:48 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 5ED2F1A3C1C; Sat, 10 Nov 2012 09:04:48 -0800 (PST) Message-ID: <509E8930.50800@mu.org> Date: Sat, 10 Nov 2012 09:04:48 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:04:48 -0000 On 11/10/12 8:48 AM, Eitan Adler wrote: > On 10 November 2012 11:44, Alfred Perlstein wrote: >> On 11/10/12 8:38 AM, Alfred Perlstein wrote: >>> On 11/10/12 8:25 AM, Eitan Adler wrote: >>>> On 10 November 2012 11:19, Alfred Perlstein wrote: >>>>> Please consult the svn log for this file, it's relatively clear just in >>>>> the >>>>> commit logs/comments. Grep for 384/512 and look around. >>>> Can this reasoning be added as a comment? I did grep for 384 in the log, >>>> but >>>> a) I didn't find the answer >>>> b) one shouldn't have to. >>>> >>>> >>> It probably could be added, but then a bunch of other people would >>> complain about the comment being too wordy or "not in English". >>> >>> I will paste the relevant log messages which do explain it. If you would >>> like to add a comment or work on a comment that won't be criticized for >>> being "too wordy" then we can do that together. >>> >>> r89769 | dillon | 2002-01-24 17:54:16 -0800 (Thu, 24 Jan 2002) | 9 lines >>> >>> Make the 'maxusers 0' auto-sizing code slightly more conservative. Change >>> from 1 megabyte of ram per user to 2 megabytes of ram per user, and >>> reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM available >>> while 384 leaves 270 MB of KVM available. Available KVM is important >>> in order to deal with zalloc and kernel malloc area growth. >>> >>> Reviewed by: mckusick >>> MFC: either before 4.5 if re's agree, or after 4.5 >>> >>> >>> r87546 | dillon | 2001-12-08 17:57:09 -0800 (Sat, 08 Dec 2001) | 6 lines >>> >>> Allow maxusers to be specified as 0 in the kernel config, which will >>> cause the system to auto-size to between 32 and 512 depending on the >>> amount of memory. >>> >>> MFC after: 1 week >>> >> Let me add a bit of commentary on these logs... >> >> Effectively what happens is that as "maxusers" goes up, the amount of kernel >> memory needed for the structures grows. Unfortunately at a certain point >> the slope of this function is too steep and makes it too easy to exhaust >> kernel address space (which kills the crab (and the kernel)) what was >> decided at the time was just to cap it hard. > I understand this. What I was confused by is where the number "384" > comes from? Was this empirically tested? Mathematically deduced? > Arbitrarily chosen? > > I think the log messages you pasted mostly answered this. > > Sure, if you'd like you can help me craft that comment now? -alfred From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:27:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F421C9D; Sat, 10 Nov 2012 17:27:09 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id DB9258FC0C; Sat, 10 Nov 2012 17:27:08 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qAAHOcN3033457; Sat, 10 Nov 2012 10:24:39 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qAAHOZU2019106; Sat, 10 Nov 2012 10:24:35 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Ian Lepore To: Alfred Perlstein In-Reply-To: <509E830D.5080006@mu.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 10 Nov 2012 10:24:35 -0700 Message-ID: <1352568275.17290.85.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Eitan Adler , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:27:09 -0000 On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote: > On 11/10/12 8:25 AM, Eitan Adler wrote: > > On 10 November 2012 11:19, Alfred Perlstein wrote: > >> Please consult the svn log for this file, it's relatively clear > just in the > >> commit logs/comments. Grep for 384/512 and look around. > > Can this reasoning be added as a comment? I did grep for 384 in the > log, but > > a) I didn't find the answer > > b) one shouldn't have to. > > > > > It probably could be added, but then a bunch of other people would > complain about the comment being too wordy or "not in English". The fact that such a thing could happen explains much about the current state of the code. An outsider could easily come to the conclusion that the FreeBSD motto is something along the lines of "It should be as hard to read as it was to write." -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:34:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD5DAF2B for ; Sat, 10 Nov 2012 17:34:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF598FC14 for ; Sat, 10 Nov 2012 17:34:16 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so79000lbb.13 for ; Sat, 10 Nov 2012 09:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=3dDcSlaMuplY/RYfifGOsUlP8McmGO+90ViVEvbwoVw=; b=nf/X2qwPn6BkFx0QKFzwDflrhGtqNOSBKPQ4u2LGgcjK4v0vXy1daO5FD4jx/I64Cf bxj93PjIZ4uTxv+9bt7PvL6LYyRH9XkKNWxFt0vn2nHp37SbD0zqqCI29J3cB8XQf8ES iNsXVGe0EVIwwpVw7xP8h4KpuYVGVVonaw90E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=3dDcSlaMuplY/RYfifGOsUlP8McmGO+90ViVEvbwoVw=; b=mlVmCsXkOs/i5lQwiMzhbaD2xgLcXDuVg3rEPPt6bTWJOunUpx44keicFU+CULnzSO mbDLGOAiC/1s7lIsay0esZkVDp36pjBB+rw3BVi4Cmlyc2d4yYQeePWzacRGyuJbyI87 mIkNpvdsgyPvw+cFX56dU2BHu4v57LWd6LdTEKwmY83yQVrzQLf82Yst5aN8BP4JFu2R z4YzDVrmgIccbWmVPzkUZko5f9myfmYQa+KctiNYk3mfrORcGUIFQqxKQ6KcL+Dpu8GQ sLb830w9NjkY0ScZ7G1/1qROzaGcojOZEdq7Ee9LzY1F8rj9uNJ+O1Wo/xnObgh0AN32 Z0jA== Received: by 10.152.131.200 with SMTP id oo8mr13651867lab.34.1352568854971; Sat, 10 Nov 2012 09:34:14 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sat, 10 Nov 2012 09:33:44 -0800 (PST) In-Reply-To: <509E8930.50800@mu.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> From: Eitan Adler Date: Sat, 10 Nov 2012 12:33:44 -0500 X-Google-Sender-Auth: U_52WXABGsVx7w9BBrzMfgTVbWk Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQm1wPPOBgzpd7Ai1ksDERj9U+mAzGv8CYpCvxY2h2g10X2M1mGHrN/nnCuXWa6GI837Hk+J Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:34:17 -0000 On 10 November 2012 12:04, Alfred Perlstein wrote: > Sure, if you'd like you can help me craft that comment now? I think this is short and clear: === Limit the amount of kernel address space used to a fixed cap. 384 is an arbitrarily chosen value that leaves 270 MB of KVA available of the 2 MB total. On systems with large amount of memory reduce the the slope of the function in order to avoiding exhausting KVA. === -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:43:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27BDE2F7 for ; Sat, 10 Nov 2012 17:43:50 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 81E8A8FC15 for ; Sat, 10 Nov 2012 17:43:49 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so82569lbb.13 for ; Sat, 10 Nov 2012 09:43:48 -0800 (PST) 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 :cc:content-type; bh=Dctgs3GWgHpAp1ocqtYNBRtq7CQr6jeJhgoUkJvE/Gk=; b=kchStCbFVHcqva+Z4+GAuKVLIuuEQd9edZcCpqU0eCu5pL5X4kk/4RakZxjUIyFP2K YyCWJjChCc1pTseFyHPRBjemyYCLC3hnwRxGzT6tqkLPXSISWQ+fB1hkNOvk9waBS/RF 4exELuBHtpJ7XkNgwHGduIH5uwsashD/p2y2c= 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 :cc:content-type:x-gm-message-state; bh=Dctgs3GWgHpAp1ocqtYNBRtq7CQr6jeJhgoUkJvE/Gk=; b=K/FUvhbEcft4ZL9ACFffFqMs+Vp5Jzp74vPOX/Eo0EdT9V0ee8PXPoVH9EhAQQyaRE 9fsONfVaMBabPGbWd8brdfag8U8n0Xiq79+dLBE47udvgnwE7Vn4o/sKZBPYXWXHmuSK xt8lfbzltCpyMo14D5tmMCHfY61mIItaxe50/VRhDv8EOZJa9Rw8levdolRoVQu4vNE+ H1OSV2tO5L1DkUZHDxc2REpWiX6sJ+XKFlcIYA+Kb4lD6f8dCEnUhm2dPWW208QPNjIz 1lcdP5zASHIshEKOJCh6YFU7bhX18TBtXsq9KKmHPmgQaGDlyYFK6NJpU6xx/ohJf8Le pxaw== MIME-Version: 1.0 Received: by 10.152.106.4 with SMTP id gq4mr13486842lab.44.1352569428210; Sat, 10 Nov 2012 09:43:48 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 09:43:48 -0800 (PST) In-Reply-To: <1352568275.17290.85.camel@revolution.hippie.lan> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <1352568275.17290.85.camel@revolution.hippie.lan> Date: Sat, 10 Nov 2012 09:43:48 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkEvEHGehqv9D6fW10mD7opZtn3FuNImwgK/8k7KNQQNwY9FiResbZ1T6iUuBUajgJTcruX Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:43:50 -0000 On Sat, Nov 10, 2012 at 9:24 AM, Ian Lepore wrote: > On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote: >> On 11/10/12 8:25 AM, Eitan Adler wrote: >> > On 10 November 2012 11:19, Alfred Perlstein wrote: >> >> Please consult the svn log for this file, it's relatively clear >> just in the >> >> commit logs/comments. Grep for 384/512 and look around. >> > Can this reasoning be added as a comment? I did grep for 384 in the >> log, but >> > a) I didn't find the answer >> > b) one shouldn't have to. >> > >> > >> It probably could be added, but then a bunch of other people would >> complain about the comment being too wordy or "not in English". > > The fact that such a thing could happen explains much about the current > state of the code. An outsider could easily come to the conclusion that > the FreeBSD motto is something along the lines of "It should be as hard > to read as it was to write." Don't forget to explain that you get 1 maxusers per 2MB of physical memory which turns into 64 x 2k clusters and a whole series of side effects. Wouldn't it be nice if we could write "By default, mbuf clusters are capped at 6% of physical ram or 6% of kernel address space, whichever is smaller" ? That's a little easier than trying to explain maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE) if (maxusers > 384) maxusers = 384 + ((maxusers - 384) / 8); nmbclusters = 1024 + maxusers * 64; I'd sure prefer to explain: /* pick smaller of kva pages or physical pages */ if ((physpages / 16) < (kvapages / 16)) nmbclusters = physpages / 16; else nmbclusters = kvapages / 16; Leave maxusers for calculating maxproc. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:45:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 277CF48F for ; Sat, 10 Nov 2012 17:45:59 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5528FC15 for ; Sat, 10 Nov 2012 17:45:58 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so83462lbb.13 for ; Sat, 10 Nov 2012 09:45:57 -0800 (PST) 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 :cc:content-type; bh=6qmi/yyJqvaZOXljwsab57jaEGeaQu8vG9BKssmprNo=; b=vEaeRAwoPcYhKRgfPFE1cne6L1uPbTvq9uotg+hI7u90Agv2zUMuR6RE1npowSvAqK 5xP9x3605Ms2tLYjUe/BwU2fsYWJcsmVv6lDwpLZ5xJXtL9z+LLqJhIYioFh4lqr9muY 3mIxNsXnAczqoWFlDxbf+lFVRNowCCpeCwjCU= 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 :cc:content-type:x-gm-message-state; bh=6qmi/yyJqvaZOXljwsab57jaEGeaQu8vG9BKssmprNo=; b=j8/uUV+oUmuP6kWtYM1H+yHyen9S2zYJyHnnEz6o0UIcgcgSOy+og/CBGAfwxHibZ7 4rfqJENDmUYGCbH5afBWp0gZ+UNgF3+NR4fLYlja5hCEwo+E3JG0T12Sq5sA+rsgrtaO S8yzLEZ2wwEmmbWkDsINCDjDspwRx9YT+O2laZrw8rTL8qwgki3dANM+YUwbvM7ZYuPM +PFQ7F37T1iCoJr1lLpuC56j14Nlba7Ct3b1Jau0gDN1ENcAllO5fpyc64nvQm+kqPgY 3PsYgnkF2xpOYPEDkL2sNROAf9zrjjQ8BTXp+dtBuXhANsYGtI9gitYyygRCSKo/CBVc mNKQ== MIME-Version: 1.0 Received: by 10.112.49.133 with SMTP id u5mr1595803lbn.105.1352569557272; Sat, 10 Nov 2012 09:45:57 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 09:45:57 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> Date: Sat, 10 Nov 2012 09:45:57 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmLW3ruh57jZAN36Hde2y6M8um7xhSg9Mgzt2KgZMXSvWCMf1WkqYjSL88YEnSU8md0jDCm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:45:59 -0000 On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: > On 10 November 2012 12:04, Alfred Perlstein wrote: >> Sure, if you'd like you can help me craft that comment now? > > I think this is short and clear: > === > Limit the amount of kernel address space used to a fixed cap. > 384 is an arbitrarily chosen value that leaves 270 MB of KVA available > of the 2 MB total. On systems with large amount of memory reduce the > the slope of the function in order to avoiding exhausting KVA. > === That's actually completely 100% incorrect... -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:48:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F41E0617 for ; Sat, 10 Nov 2012 17:48:41 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 619F48FC12 for ; Sat, 10 Nov 2012 17:48:40 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so84583lbb.13 for ; Sat, 10 Nov 2012 09:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=7crDERkcdPYht6rcWPmwb4ifkcgpF1Kd9LwjFVDa8MQ=; b=t75wH1kNZ0PEuDyTj7iaDPkzkaDQDiGDQbLiu+YAG88BkQF48atT06T4cTBaRdN2Oo ws+hP2ExLLI9In/jD4ge7pegQPfQdsjesHzd9Qy9oC20g5DyTuJ34FK61iSuiRdHYA8F wpQAj/grMlWDM/bSP95fq0I5V6FCTjVcQxwG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=7crDERkcdPYht6rcWPmwb4ifkcgpF1Kd9LwjFVDa8MQ=; b=UoUOjuVpXT+nh5ycYrSZUASInxjt1Hg5lh7Nod2cA26WVkQMgifpWcAS+cio2vXGvz lS5XH+9HDS5BbZBD+6jrN6Q/S+msF4NMjzbkgeb9jVffldsVByfqr3j+jQeJCroXTDO+ 2VKQ1Kqo143qKdySmu27EALPIUSiqSP8ubKVXBb3nJKzffiVvlBcpB5N1HWfqDQuQVNS EskPH+roabLh7vQSeOMSihS50YCUXbZlbKcm0fSFdyvCaZrbDrZk3GYoZs55Q7YlrDyz IHjTDeqfmcthlzcKIVeV/2QEgDPmd19St9D/E/0VGHl4XJu/Z2bBF5gW+elabLOmZ1Ny VkAA== Received: by 10.152.104.115 with SMTP id gd19mr13925355lab.13.1352569720012; Sat, 10 Nov 2012 09:48:40 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Sat, 10 Nov 2012 09:48:09 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> From: Eitan Adler Date: Sat, 10 Nov 2012 12:48:09 -0500 X-Google-Sender-Auth: 2teh-GJeDxVv-0Gkdq-uGnh30Vk Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern To: Peter Wemm Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl1NFun2glnnfNnvhuxVEcYrzII15Q+oEgrXO5jDPCQ7JTZXKb70Etr4m1hNC+b8ArXE5eS Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:48:42 -0000 On 10 November 2012 12:45, Peter Wemm wrote: > On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: >> On 10 November 2012 12:04, Alfred Perlstein wrote: >>> Sure, if you'd like you can help me craft that comment now? >> >> I think this is short and clear: >> === >> Limit the amount of kernel address space used to a fixed cap. >> 384 is an arbitrarily chosen value that leaves 270 MB of KVA available >> of the 2 MB total. On systems with large amount of memory reduce the >> the slope of the function in order to avoiding exhausting KVA. >> === > > That's actually completely 100% incorrect... okay. I'm going by the log messages posted so far. I have no idea how this works. Can you explain it better? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:49:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C75AD78F for ; Sat, 10 Nov 2012 17:49:32 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 325618FC08 for ; Sat, 10 Nov 2012 17:49:32 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so84898lbb.13 for ; Sat, 10 Nov 2012 09:49:31 -0800 (PST) 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 :cc:content-type; bh=2eIS91y7OP7ePdhLqEgRAKKQHJPxQnNcZfQz1tJ1MB4=; b=LJM1goP1B2HENw9cTgOBKFErb3EeVBKZoaSMIudacmSlM81Lffq5fFnDNmR9o5Ln/i iqvz4pbggRHy48TmuSrcGd9Snp4gyCyH1Id7jSE6m4MQNsIuXSTPbTV3beP47rZjloVb lIzU6gM59DiW2Y5j7DhqlnpYic+bVbfxHBthA= 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 :cc:content-type:x-gm-message-state; bh=2eIS91y7OP7ePdhLqEgRAKKQHJPxQnNcZfQz1tJ1MB4=; b=OmCQlCHmVGo9eeDmQv+ALZ0hkltkWVVBJ6eRSfB4IByzmY5Gsyg8TUVtLqGFvrPkUW hcW8U9moo70LpwVcziIKotxOr2MUe7j7ZpakIqZvq4tsOtqjR83eHp0V3wKnySazxoow r18d9+GS0hG9OHx8bnYVbeWDdVYZwgOzGQldkqoo0lty3oyO7uzmHrF68d58bm6IFG8A Z1LVYo9wt+QOlLltj/gaC2gvCKJd4KyqBlpMmSDtMjohc06hxwjqxYBydpChlpTxnR28 pTOv5WobDCWR9p+i2Vno3bZdaLjOyV0SDONtmJpudnN63KXoaMnTHjl4t+UdGRUVn5u0 9E1Q== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr14063337lab.9.1352569771002; Sat, 10 Nov 2012 09:49:31 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 09:49:30 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <1352568275.17290.85.camel@revolution.hippie.lan> Date: Sat, 10 Nov 2012 09:49:30 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkeQB8fjaarE4SLudcuzm7HslQrE1nqq5uczW0xT7mGRbZ3o2CYHgq4ccBmy3OF5tHnsE+g Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:49:32 -0000 On Sat, Nov 10, 2012 at 9:43 AM, Peter Wemm wrote: > /* pick smaller of kva pages or physical pages */ > if ((physpages / 16) < (kvapages / 16)) > nmbclusters = physpages / 16; > else > nmbclusters = kvapages / 16; (note: not actual numbers.. kva pages doesn't exist and there's a pages vs cluster size factor missing. The example was for the discussion) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:51:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7423A6B; Sat, 10 Nov 2012 17:51:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 41DEF8FC08; Sat, 10 Nov 2012 17:51:28 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id wc20so6346520obb.13 for ; Sat, 10 Nov 2012 09:51:27 -0800 (PST) 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=/lX/NOc4fy+RbDR2pijksz7wX+upOE0Zm/gETwZ3FcM=; b=LtQs/NsyJ5sdmgLTcH7eTaU3BTYeIKqQ1zbu9AwSYtJ2WavfIstPwItNQymUMc+Uxn 75NvC3514bh1yDXExo7Am1B7S1WR9/f6CVdAAk5o7XCKZ1mlhJLV6TQSLRtv7+POtiKX svFNfzYxgxlQ+yGdwN+CfDmmoQzcf/JNrGJGGjMCbqoj60OakO6JtbqgAqwpQGHLeuaM ojwhPZXBXtujYsEOWkuICa6wKXTZ0KJS4ZyF4u+5h7UBAHseJJRzUdFaLeEnCt2TSBXU uz5fmBB28bM3ulYd6Vgwm6qSHsKmWblsI8RALlGwAKpiquKr+6/wRyLBaeL/Uz9rakqW sHdg== MIME-Version: 1.0 Received: by 10.60.32.137 with SMTP id j9mr11134060oei.133.1352569887827; Sat, 10 Nov 2012 09:51:27 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 10 Nov 2012 09:51:27 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> Date: Sat, 10 Nov 2012 09:51:27 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Garrett Cooper To: Peter Wemm Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:51:29 -0000 On Sat, Nov 10, 2012 at 9:45 AM, Peter Wemm wrote: > On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: > > On 10 November 2012 12:04, Alfred Perlstein wrote: > >> Sure, if you'd like you can help me craft that comment now? > > > > I think this is short and clear: > > === > > Limit the amount of kernel address space used to a fixed cap. > > 384 is an arbitrarily chosen value that leaves 270 MB of KVA available > > of the 2 MB total. On systems with large amount of memory reduce the > > the slope of the function in order to avoiding exhausting KVA. > > === > > That's actually completely 100% incorrect... > Would it be a good idea to reference the other commit ref. numbers done by dillon@ in the commit message, or would this be redundant? Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 17:57:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62F0EC5F; Sat, 10 Nov 2012 17:57:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id E27C78FC08; Sat, 10 Nov 2012 17:57:53 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id wc20so6350388obb.13 for ; Sat, 10 Nov 2012 09:57:53 -0800 (PST) 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=HbLo5/tbgEIQbX2s5XdEfPAvJF6z1UebL+173Dzc6fM=; b=dYeZWwrmNgBhGtMaCVRRY+3AFTkB0XBl+wwactLusWaZdR++oYn8FX9JccITOip8U7 WcsG/tzkZHQiDJQuKdTqv7BdFY/da8KVzOtOiFGZyPh55ild7H/XRyayfcx53nY2Ayl+ 4ewbiv82VO7VVTSAhWoN0QvUlUpy+DcH5iFc7T0pzSBGtoxGh6kIZaGiy3fSbLtamCuQ 8bmZQuaxIgRubYuaqo9c9YGtXRKF2PW9WRF5ZC2ZC5Z5P577U/gdPr2LZlp4JVjvwejR h4GCV6h2uevCpOcrNHdywdM/Ujl8J7HKJOtHWUiRBAQWKKACl++dKj4uTxZcztoKds/X HzsQ== MIME-Version: 1.0 Received: by 10.60.28.42 with SMTP id y10mr10469871oeg.24.1352570273066; Sat, 10 Nov 2012 09:57:53 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 10 Nov 2012 09:57:52 -0800 (PST) In-Reply-To: <20121110191905.H915@besplex.bde.org> References: <201211100032.qAA0Wlvw090497@svn.freebsd.org> <20121110191905.H915@besplex.bde.org> Date: Sat, 10 Nov 2012 09:57:52 -0800 Message-ID: Subject: Re: svn commit: r242842 - in head/sys: conf modules/mthca From: Garrett Cooper To: Bruce Evans 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, Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 17:57:54 -0000 On Sat, Nov 10, 2012 at 12:28 AM, Bruce Evans wrote: > On Sat, 10 Nov 2012, Xin LI wrote: > > Log: >> Attempt toward a buildable universe by silenting a few warnings for OFED. >> >> Modified: >> head/sys/conf/kern.pre.mk >> head/sys/modules/mthca/**Makefile >> > > Any chance of not adding style bugs in 1-line changes? > > > Modified: head/sys/conf/kern.pre.mk >> ==============================**==============================** >> ================== >> --- head/sys/conf/kern.pre.mk Fri Nov 9 21:41:07 2012 (r242841) >> +++ head/sys/conf/kern.pre.mk Sat Nov 10 00:32:47 2012 (r242842) >> @@ -156,7 +156,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLA >> # Infiniband C flags. Correct include paths and omit errors that linux >> # does not honor. >> OFEDINCLUDES= -I$S/ofed/include/ >> -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions >> +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions >> -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion >> -Wno-initializer-overrides >> OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} >> OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} >> OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} >> > > Please don't format source files or output for 150-column terminals, > especially when 'fixing' code formatted for 80 columns. > > > Modified: head/sys/modules/mthca/**Makefile >> ==============================**==============================** >> ================== >> --- head/sys/modules/mthca/**Makefile Fri Nov 9 21:41:07 2012 >> (r242841) >> +++ head/sys/modules/mthca/**Makefile Sat Nov 10 00:32:47 2012 >> (r242842) >> @@ -28,4 +28,4 @@ opt_inet6.h: >> >> .include >> >> -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions >> +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch >> -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides >> > > This one also misformats the whitespace before the new set of options. > > Also, silencing warnings breaks them (unless they are bugs in clang). > In normal development, it is just as easy to fix the bugs as to break the > warnings, but there is a major compiler change lots of warnings are broken > and then the bugs that they report tend to remain unfixed. The compiler > should not be changed if it causes a single new warning. > I agree if this commit was atomic and development was going to iterate on from this point, but in reality cleaning up these items is going to require a joint effort between the maintainers (currently listed as rwatson, but in all actuality Isilon) and the upstream maintainters (the OFED group), etc as this is (in part) contributed code. We're running 2 year old sources that are going to be refreshed to a slightly newer version of the stack soon, so Xin's silencing of the warnings is an ok approach (ultimately those lines need to be clipped of the warnings anyhow, so this commit should be reverted in the future). I'll add this to a list of items that should be looked into internally and resolved when moving to later versions of the stack (1.5.x latest/3.x). Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 18:04:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E65EE76 for ; Sat, 10 Nov 2012 18:04:11 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 832E48FC18 for ; Sat, 10 Nov 2012 18:04:10 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4705729lag.13 for ; Sat, 10 Nov 2012 10:04:09 -0800 (PST) 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 :cc:content-type; bh=PQNNQfekIRiuNks9cYOzvOShghbPgLArbHLW3cpTqsM=; b=OJGMoP73kDJNpHGH1ZmrYv04wcmjpIlzcJrBKyFU+bSJD3ao5WJsfcD7ebeN3qni7n WStjuJVBm9wDgoH2OxWFePgBeVqUId6OtMmI2r0D+cUMJFd5/CLArV/1xlNT39xh1p5h BtsdaJ7t+B/qwCx2ErLpiFUBcAkB6/jhuPisI= 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 :cc:content-type:x-gm-message-state; bh=PQNNQfekIRiuNks9cYOzvOShghbPgLArbHLW3cpTqsM=; b=dz2fPgz7dSYtTz7m7xTYklf7S1whWF376nJr/yMIZWa7v399QuU3mgWkStH8fNScrw 0XK8PIQ44GSBvoyO/Gyk1rTxDQI/2+4NTmndhKrYXcOmISUzB+5uWyo6CbkJWRyK1msK sNjO1vgMZrdpTu4xrkD8orONWGrnDB/ICD6jztu6hnaNJsEV/DyRZvPTWfavyLXd0mLr 9t9CFf3kOAjZ6iis5yzuLn9S1nnTthRgieaE714UXnmNQcH46bNqJFRM4RJMi5Kr9hhm KeL/9KmZoW2+cVgs9NRrTQsb1seDViCViJFkhv8cCO1WZkUTWvqznW7lVkZHKgSfBzlW qYZw== MIME-Version: 1.0 Received: by 10.152.148.8 with SMTP id to8mr13991719lab.2.1352570649277; Sat, 10 Nov 2012 10:04:09 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 10:04:09 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> Date: Sat, 10 Nov 2012 10:04:09 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQn9qpaxhdyay5Ty2dyAgvn/PZSgwJtDb7JITErUUMN30NP6linrLIPN3XyD4/tknWM6DONO Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 18:04:11 -0000 On Sat, Nov 10, 2012 at 9:48 AM, Eitan Adler wrote: > On 10 November 2012 12:45, Peter Wemm wrote: >> On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: >>> On 10 November 2012 12:04, Alfred Perlstein wrote: >>>> Sure, if you'd like you can help me craft that comment now? >>> >>> I think this is short and clear: >>> === >>> Limit the amount of kernel address space used to a fixed cap. >>> 384 is an arbitrarily chosen value that leaves 270 MB of KVA available >>> of the 2 MB total. On systems with large amount of memory reduce the >>> the slope of the function in order to avoiding exhausting KVA. >>> === >> >> That's actually completely 100% incorrect... > > okay. I'm going by the log messages posted so far. I have no idea how > this works. Can you explain it better? That's exactly my point.. You get 1 maxuser per 2MB of physical ram. If you get more than 384 maxusers (ie: 192GB of ram) we scale it differently for the part past 192GB. I have no idea how the hell to calculate that. You get an unlimited number of regular mbufs. You get 64 clusters per maxuser (128k) Unless I fubared the numbers, this currently works out to be 6%, or 1/16. Each MD backend gets to provide a cap for maxusers, which is in units of 2MB. For an i386 PAE machine you have a finite amount of KVA space (1GB, but this is adjustable.. you can easily configure it for 3GB kva with one compile option for the kernel). The backends where the nmbclusters comes out of KVA should calculate the number of 2MB units to avoid running out of KVA. amd64 does a mixture of direct map and kva allocations. eg: mbufs and clusters come from direct map, the jumbo clusters come from kva. So side effects of nmbclusters for amd64 are more complicated. 1/2 of the nmbclusters (which are in physcal ram) are allocated as jumbo frames (kva) 1/4 of nmbclusters (physical) are 9k jumbo frames (kva) 1/8 of nmbclusters (physical) are used to set the 16k kva backed jumbo frame pool. amd64 kva is "large enough" now, but my recollection is that sparc64 has a small kva plus a large direct map. Tuning for amd64 isn't relevant for sparc64. mips has direct map, but doesn't have a "large" direct map, nor a "large" kva. This is complicated but we need a simple user visible view of it. It really needs to be something like "nmbclusters defaults to 6% of physical ram, with machine dependent limits". The MD limits are bad enough, and using bogo-units like "maxusers" just makes it worse. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 18:08:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 673DC6B for ; Sat, 10 Nov 2012 18:08:14 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id B218A8FC14 for ; Sat, 10 Nov 2012 18:08:13 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so92553lbb.13 for ; Sat, 10 Nov 2012 10:08:12 -0800 (PST) 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 :cc:content-type; bh=2puI8SlI+lrVi8HY4HvpG69Bg7b1mmAuJP7B8anFWOo=; b=w3XhOlso6f5y664dhHAZS9T3PalohgrqQGCmff5e+H6xkz36NyPEq6dyrJszV7AujY h/ChscLC3znEOsk3+TocZaPw98aupq9YPQgC3tlMgkD2zVStegndJDyHY+6u9uYazxaB d2u91h/4k9Kafk4eZnDTVdkoq0KxRJO1MU5xg= 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 :cc:content-type:x-gm-message-state; bh=2puI8SlI+lrVi8HY4HvpG69Bg7b1mmAuJP7B8anFWOo=; b=SvRHt6zUSvx6w5aYkIPUcI9cYnzcywPJKjs9N4VpjTV+EYePzN7QUG6S6s2hLm/KHv 6NhYgs9XPCb/NxumeKJgtD3sbqk63GfmoS6wKNsZ5I2RHOI4by16bUdGWwPEvO0YX1pk TVA6CFo1EWoAr8ydH1wc2CbTLVfbtn/zDISpYNsbukWeUDg0PUIn18skD434CqUfTkbh w51vFB5hG0Cfzwn6A9WyfdG0YgZBxRV4ad0N6r0HqB/Ib2i7vfPCNhTTACKT1kDTfPlL CGh5R5G54nWbg7aThTZ1rPaxdkLMvGESdRIpWh6osTOpX5rfgrgSEYM0M/CKvdH5ZwkG tmtg== MIME-Version: 1.0 Received: by 10.152.106.4 with SMTP id gq4mr13529914lab.44.1352570892606; Sat, 10 Nov 2012 10:08:12 -0800 (PST) Received: by 10.112.100.230 with HTTP; Sat, 10 Nov 2012 10:08:12 -0800 (PST) In-Reply-To: References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> Date: Sat, 10 Nov 2012 10:08:12 -0800 Message-ID: Subject: Re: svn commit: r242847 - in head/sys: i386/include kern From: Peter Wemm To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkAZiRVDYS2yxhMfGJ8HdT24O6VQ5PqifWN/tcDk9maKwgzQDWCGt1Lx7By4ccQnS892P9d Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 18:08:14 -0000 On Sat, Nov 10, 2012 at 9:51 AM, Garrett Cooper wrote: > On Sat, Nov 10, 2012 at 9:45 AM, Peter Wemm wrote: >> >> On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: >> > On 10 November 2012 12:04, Alfred Perlstein wrote: >> >> Sure, if you'd like you can help me craft that comment now? >> > >> > I think this is short and clear: >> > === >> > Limit the amount of kernel address space used to a fixed cap. >> > 384 is an arbitrarily chosen value that leaves 270 MB of KVA available >> > of the 2 MB total. On systems with large amount of memory reduce the >> > the slope of the function in order to avoiding exhausting KVA. >> > === >> >> That's actually completely 100% incorrect... > > > Would it be a good idea to reference the other commit ref. numbers done > by dillon@ in the commit message, or would this be redundant? Sadly not. There's so many layers of indirection and obfuscation of units that there isn't a commit message that explains the current state. You have to read the code and reverse the math. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 19:11:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC1C9A6C; Sat, 10 Nov 2012 19:11:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id ECD038FC12; Sat, 10 Nov 2012 19:11:07 +0000 (UTC) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAAJB0pW006039; Sun, 11 Nov 2012 06:11:00 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAAJAdt9010322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Nov 2012 06:10:50 +1100 Date: Sun, 11 Nov 2012 06:10:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r242847 - in head/sys: i386/include kern In-Reply-To: Message-ID: <20121111044336.M891@besplex.bde.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=fbv1UDsF c=1 sm=1 a=yyKEtvhfh8wA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=aSzTme4LXwMA:10 a=ZmIiC_jQAAAA:8 a=U6GZwgxexPRxzELaP_QA:9 a=CjuIK1q_8ugA:10 a=PXSvYFfLtboA:10 a=8oIPWY89C-lIo7lo:21 a=wgKTgG8_0Eo8r15q:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, Alfred Perlstein X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 19:11:09 -0000 On Sat, 10 Nov 2012, Eitan Adler wrote: > On 10 November 2012 12:04, Alfred Perlstein wrote: >> Sure, if you'd like you can help me craft that comment now? > > I think this is short and clear: > === > Limit the amount of kernel address space used to a fixed cap. > 384 is an arbitrarily chosen value that leaves 270 MB of KVA available > of the 2 MB total. On systems with large amount of memory reduce the > the slope of the function in order to avoiding exhausting KVA. > === The code and the original log message are much clearer. Saying "2MB total" in the above significantly obfuscates the 2MB in the code. As documented in the log message, it is a heuristic scale factor for scaling from the _physical_ memory size to the maxusers parameter. It is also clear in the code that it doesn't scale from a virtual memory size, but less clear that it scales to something related to a virtual memory size (it scales to maxusers which is used to tune parametrize many things including kva, and the 384 is mainly to limit it for the kva things. This is bogus of course). The 2MB is certainly not for kva, and even more certainly, the total kva is not 2MB. "slope of the function" is an unclear way of describing the scaling steps. Originally, there was only the scaling step involving scaling physical memory by 2MB. Scaling was stopped when maxusers hit 384: maxusers was clamped at 384. This corresponds to changing the "slope of the function" to 0. Now we change it to 1/8 of the 1/2MB scale, i.e., to incrementing maxusers by 1 for every 16MB of _physical_ memory. This is still bogus, but probably better than clamping. Describing this is complicated by the new VM_MAX_AUTOTUNE_MAX_USERS parameter. This gives a clamp on maxusers corresponding to the old one of 384 when VM_MAX_AUTOTUNE_MAX_USERS is defined to be that value. This is needed mainly for PAE. I don't like this value being ifdefed. For PAE, the value just can't be increased (except as described below), and decreasing it is not useful. Other unclarities in the above: - its first sentence says that the limit is to a fixed cap, but the whole point of recent changes is to change the limit from a fixed cap to a variable one. The second sentence describes the old behviour with the fixed cap. The third sentence modifies the first 2. > Limit the amount of kernel address space used to a fixed cap. > 384 is an arbitrarily chosen value that leaves 270 MB of KVA available > of the 2 MB total. On systems with large amount of memory reduce the > the slope of the function in order to avoiding exhausting KVA. Original log message: % ---------------------------- % revision 1.51 % date: 2002/01/25 01:54:16; author: dillon; state: Exp; lines: +3 -3 % Make the 'maxusers 0' auto-sizing code slightly more conservative. Change % from 1 megabyte of ram per user to 2 megabytes of ram per user, and % reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM available % while 384 leaves 270 MB of KVM available. Available KVM is important % in order to deal with zalloc and kernel malloc area growth. % % Reviewed by: mckusick % MFC: either before 4.5 if re's agree, or after 4.5 All these magic numbers are completely wrong if someone changes VM_MIN_KERNEL_ADDRESS, as is very reasonable if they run out of of kva. There is a normal if not working option for this (KVA_PAGES), unlike for VM_MAX_AUTOTUNE_MAX_USERS or the old hard-coded 384. Doubling of the i386 KVA_PAGES from 256 to 512 should approximately double many of the above numbers and more than double others (when the kva consumed by say the buffer cache is not doubled to match, we can have more than double the kva for mbufs. There are other bogus limits and tuning of the buffer cache based on a fixed limit and physical memory, and doubling KVA_PAGES doesn't double all of these). PAE already doubles KVA_SIZE, so all of the above numbers must be off by a factor of about 2 for either PAE or !PAE. The magic numbers are also made significantly wrong by any significant use of the buffer cache limit to increase the amount of kva for the buffer cache. Anyone who does this must know what they are doing, but isn't helped by hard-coded magic number in comments. The above numbers are probably slightly made slightly wrong by general bloat. If 384 gave 270 MB free in 201, it must give < 270 MB in 2012. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 19:18:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED252C26 for ; Sat, 10 Nov 2012 19:18:18 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 519398FC16 for ; Sat, 10 Nov 2012 19:18:17 +0000 (UTC) Received: (qmail 79430 invoked from network); 10 Nov 2012 20:52:52 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 10 Nov 2012 20:52:52 -0000 Message-ID: <509EA869.6030407@freebsd.org> Date: Sat, 10 Nov 2012 20:18:01 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Peter Wemm Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Eitan Adler , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 19:18:19 -0000 On 10.11.2012 19:04, Peter Wemm wrote: > On Sat, Nov 10, 2012 at 9:48 AM, Eitan Adler wrote: >> On 10 November 2012 12:45, Peter Wemm wrote: >>> On Sat, Nov 10, 2012 at 9:33 AM, Eitan Adler wrote: >>>> On 10 November 2012 12:04, Alfred Perlstein wrote: >>>>> Sure, if you'd like you can help me craft that comment now? >>>> >>>> I think this is short and clear: >>>> === >>>> Limit the amount of kernel address space used to a fixed cap. >>>> 384 is an arbitrarily chosen value that leaves 270 MB of KVA available >>>> of the 2 MB total. On systems with large amount of memory reduce the >>>> the slope of the function in order to avoiding exhausting KVA. >>>> === >>> >>> That's actually completely 100% incorrect... >> >> okay. I'm going by the log messages posted so far. I have no idea how >> this works. Can you explain it better? > > That's exactly my point.. > > You get 1 maxuser per 2MB of physical ram. > If you get more than 384 maxusers (ie: 192GB of ram) we scale it > differently for the part past 192GB. I have no idea how the hell to Rather past 768MB of RAM. > calculate that. > You get an unlimited number of regular mbufs. > You get 64 clusters per maxuser (128k) > Unless I fubared the numbers, this currently works out to be 6%, or 1/16. > > Each MD backend gets to provide a cap for maxusers, which is in units > of 2MB. For an i386 PAE machine you have a finite amount of KVA space > (1GB, but this is adjustable.. you can easily configure it for 3GB kva > with one compile option for the kernel). The backends where the > nmbclusters comes out of KVA should calculate the number of 2MB units > to avoid running out of KVA. > > amd64 does a mixture of direct map and kva allocations. eg: mbufs and > clusters come from direct map, the jumbo clusters come from kva. > > So side effects of nmbclusters for amd64 are more complicated. > > 1/2 of the nmbclusters (which are in physcal ram) are allocated as > jumbo frames (kva) > 1/4 of nmbclusters (physical) are 9k jumbo frames (kva) > 1/8 of nmbclusters (physical) are used to set the 16k kva backed jumbo > frame pool. The mbufs and clusters of different types are not allocated at startup time, but rather their total allocation at runtime is *limited* to that maximal value in UMA. > amd64 kva is "large enough" now, but my recollection is that sparc64 > has a small kva plus a large direct map. Tuning for amd64 isn't > relevant for sparc64. mips has direct map, but doesn't have a "large" > direct map, nor a "large" kva. > > This is complicated but we need a simple user visible view of it. It > really needs to be something like "nmbclusters defaults to 6% of > physical ram, with machine dependent limits". The MD limits are bad > enough, and using bogo-units like "maxusers" just makes it worse. Yes, that would be optimal. -- Andre From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 19:32:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66D31116; Sat, 10 Nov 2012 19:32:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32DF18FC08; Sat, 10 Nov 2012 19:32:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAJWHO2092963; Sat, 10 Nov 2012 19:32:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAJWHeY092962; Sat, 10 Nov 2012 19:32:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211101932.qAAJWHeY092962@svn.freebsd.org> From: Attilio Rao Date: Sat, 10 Nov 2012 19:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242875 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 19:32:17 -0000 Author: attilio Date: Sat Nov 10 19:32:16 2012 New Revision: 242875 URL: http://svnweb.freebsd.org/changeset/base/242875 Log: - Protect mnt_data and mnt_flags under the mount interlock - Move mp->mnt_stat manipulation where all of them happens Reported by: davide Discussed with: kib Tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616, 242727 Modified: head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Sat Nov 10 16:08:21 2012 (r242874) +++ head/sys/fs/fuse/fuse_vfsops.c Sat Nov 10 19:32:16 2012 (r242875) @@ -234,8 +234,10 @@ fuse_vfsop_mount(struct mount *mp) if (mp->mnt_flag & MNT_UPDATE) return EOPNOTSUPP; + MNT_ILOCK(mp); mp->mnt_flag |= MNT_SYNCHRONOUS; mp->mnt_data = NULL; + MNT_IUNLOCK(mp); /* Get the new options passed to mount */ opts = mp->mnt_optnew; @@ -323,22 +325,20 @@ fuse_vfsop_mount(struct mount *mp) FUSE_UNLOCK(); goto out; } - /* We need this here as this slot is used by getnewvnode() */ - mp->mnt_stat.f_iosize = PAGE_SIZE; - mp->mnt_data = data; data->ref++; data->mp = mp; data->dataflags |= mntopts; data->max_read = max_read; data->daemon_timeout = daemon_timeout; -#ifdef XXXIP - if (!priv_check(td, PRIV_VFS_FUSE_SYNC_UNMOUNT)) - data->dataflags |= FSESS_CAN_SYNC_UNMOUNT; -#endif FUSE_UNLOCK(); vfs_getnewfsid(mp); + MNT_ILOCK(mp); + mp->mnt_data = data; mp->mnt_flag |= MNT_LOCAL; + MNT_IUNLOCK(mp); + /* We need this here as this slot is used by getnewvnode() */ + mp->mnt_stat.f_iosize = PAGE_SIZE; if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 19:32:27 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05864262; Sat, 10 Nov 2012 19:32:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 861A78FC08; Sat, 10 Nov 2012 19:32:25 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAAJWCc8020875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Nov 2012 06:32:13 +1100 Date: Sun, 11 Nov 2012 06:32:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Wemm Subject: Re: svn commit: r242847 - in head/sys: i386/include kern In-Reply-To: Message-ID: <20121111061517.H1208@besplex.bde.org> References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <1352568275.17290.85.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=JdTkNj2V c=1 sm=1 a=yyKEtvhfh8wA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=aSzTme4LXwMA:10 a=vGqK-bROAAAA:8 a=2lI9rghLtlvfURV_4KEA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Ian Lepore , Alfred Perlstein , Eitan Adler , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 19:32:27 -0000 On Sat, 10 Nov 2012, Peter Wemm wrote: > On Sat, Nov 10, 2012 at 9:24 AM, Ian Lepore > wrote: >> On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote: >>> It probably could be added, but then a bunch of other people would >>> complain about the comment being too wordy or "not in English". >> >> The fact that such a thing could happen explains much about the current >> state of the code. An outsider could easily come to the conclusion that >> the FreeBSD motto is something along the lines of "It should be as hard >> to read as it was to write." > > Don't forget to explain that you get 1 maxusers per 2MB of physical > memory which turns into 64 x 2k clusters and a whole series of side > effects. > > Wouldn't it be nice if we could write "By default, mbuf clusters are > capped at 6% of physical ram or 6% of kernel address space, whichever > is smaller" ? > > That's a little easier than trying to explain > maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE) > if (maxusers > 384) > maxusers = 384 + ((maxusers - 384) / 8); > nmbclusters = 1024 + maxusers * 64; > > I'd sure prefer to explain: > > /* pick smaller of kva pages or physical pages */ > if ((physpages / 16) < (kvapages / 16)) > nmbclusters = physpages / 16; > else > nmbclusters = kvapages / 16; > > Leave maxusers for calculating maxproc. I prefer to write clear code and not echo it in comments: nmbclusters = min(physpages, kvapages) / 16; The most interesting point (the reason why 6% was chosen) is not documented by either. Unfortunately, this is too simple to work - probably min() has a wrong type. - probably physical == virtual limit is too simple - varies scaling errors for the magic 16. It assumes that the cluster size is the page size. Your comment avoids this problem by saying "mbuf clusters" and not giving their units, so that is correct if the units are the same as for the memory sizes. But don't ask alfred to fix all the old mistakes. To change to the above, you at least have to subtract the contribution of nmbclusters to maxusers and change related magic and check that everything fits again. Lots of separate limits risks unduly restricting each while not actually preventing over-commit unless all the limits are unduly restrictive. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 21:02:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE4011AE; Sat, 10 Nov 2012 21:02:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2E8FD8FC0C; Sat, 10 Nov 2012 21:02:24 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C2A065C59; Sat, 10 Nov 2012 22:02:23 +0100 (CET) Message-ID: <509EC0E5.6040109@FreeBSD.org> Date: Sat, 10 Nov 2012 22:02:29 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Xin LI Subject: Re: svn commit: r242842 - in head/sys: conf modules/mthca References: <201211100032.qAA0Wlvw090497@svn.freebsd.org> In-Reply-To: <201211100032.qAA0Wlvw090497@svn.freebsd.org> Content-Type: multipart/mixed; boundary="------------030108040104080601000702" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 21:02:25 -0000 This is a multi-part message in MIME format. --------------030108040104080601000702 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2012-11-10 01:32, Xin LI wrote: > Author: delphij > Date: Sat Nov 10 00:32:47 2012 > New Revision: 242842 > URL: http://svnweb.freebsd.org/changeset/base/242842 > > Log: > Attempt toward a buildable universe by silenting a few warnings for OFED. ... > -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions > +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides A few of these warnings point to real bugs, e.g. the uninitialized packet_length variable in ib_ud_header_init(), and the incorrect value passed to rdma_notify() in sdp_rx_comp_work(). The others are not that severe, but very easy to fix, as you can see from the attached diff. If anything, I hope the maintainer(s) will check with upstream whether these bugs are already fixed? Meanwhile, I see no reason why we could not do a local fix. --------------030108040104080601000702 Content-Type: text/x-diff; name="fix-ofed-warn-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-ofed-warn-1.diff" Index: sys/conf/kern.pre.mk =================================================================== --- sys/conf/kern.pre.mk (revision 242861) +++ sys/conf/kern.pre.mk (working copy) @@ -156,7 +156,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU] # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include/ -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Index: sys/modules/mthca/Makefile =================================================================== --- sys/modules/mthca/Makefile (revision 242861) +++ sys/modules/mthca/Makefile (working copy) @@ -28,4 +28,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions Index: sys/ofed/drivers/infiniband/core/cma.c =================================================================== --- sys/ofed/drivers/infiniband/core/cma.c (revision 242861) +++ sys/ofed/drivers/infiniband/core/cma.c (working copy) @@ -1312,7 +1312,7 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, *sin = iw_event->local_addr; sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; *sin = iw_event->remote_addr; - switch (iw_event->status) { + switch ((int)iw_event->status) { case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; Index: sys/ofed/drivers/infiniband/core/ud_header.c =================================================================== --- sys/ofed/drivers/infiniband/core/ud_header.c (revision 242861) +++ sys/ofed/drivers/infiniband/core/ud_header.c (working copy) @@ -230,7 +230,7 @@ void ib_ud_header_init(int payload_bytes int immediate_present, struct ib_ud_header *header) { - u16 packet_length; + u16 packet_length = 0; memset(header, 0, sizeof *header); Index: sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c =================================================================== --- sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c (revision 242861) +++ sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c (working copy) @@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *work) if (unlikely(!ssk->poll_cq)) { struct rdma_cm_id *id = ssk->id; if (id && id->qp) - rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED); + rdma_notify(id, IB_EVENT_COMM_EST); goto out; } Index: sys/ofed/include/linux/pci.h =================================================================== --- sys/ofed/include/linux/pci.h (revision 242861) +++ sys/ofed/include/linux/pci.h (working copy) @@ -73,10 +73,12 @@ struct pci_device_id { #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 -#define PCI_VDEVICE(vendor, device) \ - PCI_VENDOR_ID_##vendor, (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 -#define PCI_DEVICE(vendor, device) \ - (vendor), (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 +#define PCI_VDEVICE(_vendor, _device) \ + .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#define PCI_DEVICE(_vendor, _device) \ + .vendor = (_vendor), .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID #define to_pci_dev(n) container_of(n, struct pci_dev, dev) --------------030108040104080601000702-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 21:22:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AA645A2; Sat, 10 Nov 2012 21:22: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 E3D798FC08; Sat, 10 Nov 2012 21:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAALMAqk014248; Sat, 10 Nov 2012 21:22:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAALMAnO014246; Sat, 10 Nov 2012 21:22:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211102122.qAALMAnO014246@svn.freebsd.org> From: Dimitry Andric Date: Sat, 10 Nov 2012 21:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242879 - in head/lib: libc/gen msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 21:22:11 -0000 Author: dim Date: Sat Nov 10 21:22:10 2012 New Revision: 242879 URL: http://svnweb.freebsd.org/changeset/base/242879 Log: Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC after: 1 week Modified: head/lib/libc/gen/isnan.c head/lib/msun/src/s_isnan.c Modified: head/lib/libc/gen/isnan.c ============================================================================== --- head/lib/libc/gen/isnan.c Sat Nov 10 21:09:17 2012 (r242878) +++ head/lib/libc/gen/isnan.c Sat Nov 10 21:22:10 2012 (r242879) @@ -35,6 +35,7 @@ * binary compat until we can bump libm's major version number. */ +#ifdef PIC __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); @@ -55,3 +56,4 @@ __isnanf(float f) u.f = f; return (u.bits.exp == 255 && u.bits.man != 0); } +#endif /* PIC */ Modified: head/lib/msun/src/s_isnan.c ============================================================================== --- head/lib/msun/src/s_isnan.c Sat Nov 10 21:09:17 2012 (r242878) +++ head/lib/msun/src/s_isnan.c Sat Nov 10 21:22:10 2012 (r242879) @@ -30,8 +30,9 @@ #include "fpmath.h" -/* Provided by libc */ -#if 0 +/* Provided by libc.so */ +#ifndef PIC +#undef isnan int isnan(double d) { @@ -40,7 +41,7 @@ isnan(double d) u.d = d; return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); } -#endif +#endif /* !PIC */ int __isnanf(float f) From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 21:43:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF0059C7; Sat, 10 Nov 2012 21:43:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 79A068FC0A; Sat, 10 Nov 2012 21:43:49 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAALhjw9076925; Sat, 10 Nov 2012 23:43:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-DKIM: OpenDKIM Filter v2.5.2 kib.kiev.ua qAALhjw9076925 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAALhjSl076924; Sat, 10 Nov 2012 23:43:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Nov 2012 23:43:45 +0200 From: Konstantin Belousov To: Dimitry Andric Subject: Re: svn commit: r242879 - in head/lib: libc/gen msun/src Message-ID: <20121110214345.GT73505@kib.kiev.ua> References: <201211102122.qAALMAnO014246@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="99MdDuYC93zIKUQv" Content-Disposition: inline In-Reply-To: <201211102122.qAALMAnO014246@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 21:43:50 -0000 --99MdDuYC93zIKUQv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 10, 2012 at 09:22:10PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Nov 10 21:22:10 2012 > New Revision: 242879 > URL: http://svnweb.freebsd.org/changeset/base/242879 >=20 > Log: > Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in > libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, > but not in libm.so. > =20 > This makes it possible to statically link executables using both isnan > and isnanf with libc and libm. > =20 > Tested by: kargl > MFC after: 1 week >=20 > Modified: > head/lib/libc/gen/isnan.c > head/lib/msun/src/s_isnan.c >=20 > Modified: head/lib/libc/gen/isnan.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/lib/libc/gen/isnan.c Sat Nov 10 21:09:17 2012 (r242878) > +++ head/lib/libc/gen/isnan.c Sat Nov 10 21:22:10 2012 (r242879) > @@ -35,6 +35,7 @@ > * binary compat until we can bump libm's major version number. > */ > =20 > +#ifdef PIC > __weak_reference(__isnan, isnan); > __weak_reference(__isnanf, isnanf); > =20 > @@ -55,3 +56,4 @@ __isnanf(float f) > u.f =3D f; > return (u.bits.exp =3D=3D 255 && u.bits.man !=3D 0); > } > +#endif /* PIC */ >=20 > Modified: head/lib/msun/src/s_isnan.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/lib/msun/src/s_isnan.c Sat Nov 10 21:09:17 2012 (r242878) > +++ head/lib/msun/src/s_isnan.c Sat Nov 10 21:22:10 2012 (r242879) > @@ -30,8 +30,9 @@ > =20 > #include "fpmath.h" > =20 > -/* Provided by libc */ > -#if 0 > +/* Provided by libc.so */ > +#ifndef PIC > +#undef isnan > int > isnan(double d) > { > @@ -40,7 +41,7 @@ isnan(double d) > u.d =3D d; > return (u.bits.exp =3D=3D 2047 && (u.bits.manl !=3D 0 || u.bits.manh != =3D 0)); > } > -#endif > +#endif /* !PIC */ > =20 > int > __isnanf(float f) So you broke ABI for libm ? --99MdDuYC93zIKUQv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCeypAACgkQC3+MBN1Mb4gQBACfX3Lbm8p1JdV2Sn8achQSsHEO dxwAn1K1VSurCuOH3Y8Z4yxwxPh/QaaZ =o0Bs -----END PGP SIGNATURE----- --99MdDuYC93zIKUQv-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 22:16:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2E95AC; Sat, 10 Nov 2012 22:16:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 663928FC08; Sat, 10 Nov 2012 22:16:59 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 19ADD5C59; Sat, 10 Nov 2012 23:16:58 +0100 (CET) Message-ID: <509ED25E.3070302@FreeBSD.org> Date: Sat, 10 Nov 2012 23:17:02 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r242879 - in head/lib: libc/gen msun/src References: <201211102122.qAALMAnO014246@svn.freebsd.org> <20121110214345.GT73505@kib.kiev.ua> In-Reply-To: <20121110214345.GT73505@kib.kiev.ua> 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 22:16:59 -0000 On 2012-11-10 22:43, Konstantin Belousov wrote: > On Sat, Nov 10, 2012 at 09:22:10PM +0000, Dimitry Andric wrote: ... >> Author: dim >> Date: Sat Nov 10 21:22:10 2012 >> New Revision: 242879 >> URL: http://svnweb.freebsd.org/changeset/base/242879 >> >> Log: >> Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in >> libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, >> but not in libm.so. >> >> This makes it possible to statically link executables using both isnan >> and isnanf with libc and libm. ... > So you broke ABI for libm ? No, both libc.so and libm.so are the same as before. Only the .a files are changed. I should probably have made the commit message more clear, sorry about that. From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 22:24:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92AF524D; Sat, 10 Nov 2012 22:24:58 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 61EB18FC08; Sat, 10 Nov 2012 22:24:58 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id DC1B51A3C27; Sat, 10 Nov 2012 14:24:57 -0800 (PST) Message-ID: <509ED439.8090607@mu.org> Date: Sat, 10 Nov 2012 14:24:57 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> In-Reply-To: <509EA869.6030407@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Eitan Adler , Peter Wemm , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 22:24:58 -0000 On 11/10/12 11:18 AM, Andre Oppermann wrote: > On 10.11.2012 19:04, Peter Wemm wrote: >> This is complicated but we need a simple user visible view of it. It >> really needs to be something like "nmbclusters defaults to 6% of >> physical ram, with machine dependent limits". The MD limits are bad >> enough, and using bogo-units like "maxusers" just makes it worse. > > Yes, that would be optimal. > No it would not. I used to be able to tell people "hey just try increasing maxusers" and they would and suddenly the box would be OK. Now I'll have to remember 3,4,5,10,20x tunable to increase? The concept of a single knob to do ***basic*** tuning is a good one. Please leave it alone. There is nothing about "maxusers" that stops someone from tuning individual subsystems. You just wind up making FreeBSD an "experts only" playground by gratuitously changing this. Again, please leave it alone, we need basic tuning to be simple and easy. What we have now works. Do not pull it apart and make it convoluted and "expert only". thank you, -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 22:29:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CE753E4; Sat, 10 Nov 2012 22:29:03 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D706B8FC12; Sat, 10 Nov 2012 22:29:01 +0000 (UTC) Received: from Alfreds-MacBook-Pro-5.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 923DD1A3C49; Sat, 10 Nov 2012 14:29:01 -0800 (PST) Message-ID: <509ED52C.3030308@mu.org> Date: Sat, 10 Nov 2012 14:29:00 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <1352568275.17290.85.camel@revolution.hippie.lan> In-Reply-To: <1352568275.17290.85.camel@revolution.hippie.lan> 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, Alfred Perlstein , Eitan Adler , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 22:29:03 -0000 On 11/10/12 9:24 AM, Ian Lepore wrote: > On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote: >> On 11/10/12 8:25 AM, Eitan Adler wrote: >>> On 10 November 2012 11:19, Alfred Perlstein wrote: >>>> Please consult the svn log for this file, it's relatively clear >> just in the >>>> commit logs/comments. Grep for 384/512 and look around. >>> Can this reasoning be added as a comment? I did grep for 384 in the >> log, but >>> a) I didn't find the answer >>> b) one shouldn't have to. >>> >>> >> It probably could be added, but then a bunch of other people would >> complain about the comment being too wordy or "not in English". > The fact that such a thing could happen explains much about the current > state of the code. An outsider could easily come to the conclusion that > the FreeBSD motto is something along the lines of "It should be as hard > to read as it was to write." > > -- Ian > > Ian, I am very much in favor of commenting code. In fact I would like to have more "story like" comments that explain things in the code. Unfortunately, EVERY TIME I DO THIS I get a bikeshed on it and it soaks up a whole day if not more. FreeBSD community needs to rally behind people, not block them for making changes like these. Why do you think no one had the balls to touch maxusers in the first place? ... If you guessed "not worth the bikeshed" you'd be right. -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 22:37:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A13AF5ED; Sat, 10 Nov 2012 22:37:07 +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 6A9898FC0A; Sat, 10 Nov 2012 22:37:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAAMb7Qj029482; Sat, 10 Nov 2012 22:37:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAAMb78T029481; Sat, 10 Nov 2012 22:37:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211102237.qAAMb78T029481@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 Nov 2012 22:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242880 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 22:37:07 -0000 Author: adrian Date: Sat Nov 10 22:37:06 2012 New Revision: 242880 URL: http://svnweb.freebsd.org/changeset/base/242880 Log: Correct some rather weird and broken behaviour observed when doing actual traffic with an AR9380/AR9382/AR9485. The sample rate control stats would show impossibly large numbers for "successful packets transmitted." The number was a tad under 2^^64-1. So after a bit of digging, I found that the sample rate control code was making 'tries' turn into a negative number.. and this was because ts_longretry was too small. The hardware returns "ts_longretry" at the current rate selection, not overall for that TX descriptor. So if you setup four TX rate scenarios and the second one works, ts_longretry is only set for the number of attempts at that second rate scenario. The FreeBSD HAL code does the correction in ath_hal_proctxdesc() - however, this isn't possible with EDMA. EDMA TX completion is done separate from the original TX descriptor. So the real solution is to split out "find ts_rate and ts_longretry" from "complete TX descriptor". Until that's done, put a hack in the EDMA TX path that uses the rate scenario information in the ath_buf. Tested: AR9380, AR9382, AR9485 STA mode Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 10 21:22:10 2012 (r242879) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 10 22:37:06 2012 (r242880) @@ -594,13 +594,26 @@ ath_edma_tx_processq(struct ath_softc *s * in the TX descriptor. However the TX completion * FIFO doesn't have this information. So here we * do a separate HAL call to populate that information. + * + * The same problem exists with ts_longretry. + * The FreeBSD HAL corrects ts_longretry in the HAL layer; + * the AR9380 HAL currently doesn't. So until the HAL + * is imported and this can be added, we correct for it + * here. */ - /* XXX TODO */ /* XXX faked for now. Ew. */ if (ts.ts_finaltsi < 4) { ts.ts_rate = bf->bf_state.bfs_rc[ts.ts_finaltsi].ratecode; + switch (ts.ts_finaltsi) { + case 3: ts.ts_longretry += + bf->bf_state.bfs_rc[2].tries; + case 2: ts.ts_longretry += + bf->bf_state.bfs_rc[1].tries; + case 1: ts.ts_longretry += + bf->bf_state.bfs_rc[0].tries; + } } else { device_printf(sc->sc_dev, "%s: finaltsi=%d\n", __func__, From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 23:05:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB3538EA for ; Sat, 10 Nov 2012 23:05:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0AE478FC12 for ; Sat, 10 Nov 2012 23:05:00 +0000 (UTC) Received: (qmail 80643 invoked from network); 11 Nov 2012 00:39:40 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 11 Nov 2012 00:39:40 -0000 Message-ID: <509EDD93.3020001@freebsd.org> Date: Sun, 11 Nov 2012 00:04:51 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> <509ED439.8090607@mu.org> In-Reply-To: <509ED439.8090607@mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Eitan Adler , Peter Wemm , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 23:05:01 -0000 On 10.11.2012 23:24, Alfred Perlstein wrote: > On 11/10/12 11:18 AM, Andre Oppermann wrote: >> On 10.11.2012 19:04, Peter Wemm wrote: >>> This is complicated but we need a simple user visible view of it. It >>> really needs to be something like "nmbclusters defaults to 6% of >>> physical ram, with machine dependent limits". The MD limits are bad >>> enough, and using bogo-units like "maxusers" just makes it worse. >> >> Yes, that would be optimal. >> > No it would not. > > I used to be able to tell people "hey just try increasing maxusers" and they would and suddenly the > box would be OK. > > Now I'll have to remember 3,4,5,10,20x tunable to increase? No. The whole mbuf and cluster stuff isn't allocated or reserved at boot time. We simply need a limit to prevent it from exhausting all available kvm / physical memory whichever is less. Other than that there is no relation to maxusers except historic behavior. So the ideal mbuf limit is just short of keeling the kernel over no matter what maxusers says. There also isn't much to tune then as the only fix would be to add more physical ram. -- Andre > The concept of a single knob to do ***basic*** tuning is a good one. > > Please leave it alone. > > There is nothing about "maxusers" that stops someone from tuning individual subsystems. > > You just wind up making FreeBSD an "experts only" playground by gratuitously changing this. > > Again, please leave it alone, we need basic tuning to be simple and easy. > > What we have now works. Do not pull it apart and make it convoluted and "expert only". > > thank you, > > -Alfred > > From owner-svn-src-all@FreeBSD.ORG Sat Nov 10 23:21:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4506BEA; Sat, 10 Nov 2012 23:21:18 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 6AD708FC08; Sat, 10 Nov 2012 23:21:18 +0000 (UTC) Received: from [10.0.1.17] (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 1F0D11A3C1F; Sat, 10 Nov 2012 15:21:18 -0800 (PST) References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> <509ED439.8090607@mu.org> <509EDD93.3020001@freebsd.org> In-Reply-To: <509EDD93.3020001@freebsd.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <17959D7E-4F3C-4513-91F2-3CDDE3A0D41A@mu.org> X-Mailer: iPhone Mail (9B206) From: Alfred Perlstein Subject: Re: svn commit: r242847 - in head/sys: i386/include kern Date: Sat, 10 Nov 2012 15:21:14 -0800 To: Andre Oppermann Cc: "src-committers@freebsd.org" , Eitan Adler , Peter Wemm , "svn-src-all@freebsd.org" , Alfred Perlstein , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2012 23:21:19 -0000 On Nov 10, 2012, at 3:04 PM, Andre Oppermann wrote: > On 10.11.2012 23:24, Alfred Perlstein wrote: >> On 11/10/12 11:18 AM, Andre Oppermann wrote: >>> On 10.11.2012 19:04, Peter Wemm wrote: >>>> This is complicated but we need a simple user visible view of it. It >>>> really needs to be something like "nmbclusters defaults to 6% of >>>> physical ram, with machine dependent limits". The MD limits are bad >>>> enough, and using bogo-units like "maxusers" just makes it worse. >>>=20 >>> Yes, that would be optimal. >>>=20 >> No it would not. >>=20 >> I used to be able to tell people "hey just try increasing maxusers" and t= hey would and suddenly the >> box would be OK. >>=20 >> Now I'll have to remember 3,4,5,10,20x tunable to increase? >=20 > No. The whole mbuf and cluster stuff isn't allocated or reserved > at boot time. We simply need a limit to prevent it from exhausting > all available kvm / physical memory whichever is less. >=20 > Other than that there is no relation to maxusers except historic > behavior. >=20 > So the ideal mbuf limit is just short of keeling the kernel over > no matter what maxusers says. There also isn't much to tune then > as the only fix would be to add more physical ram. I think that makes sense. If you have ideas please look into it.=20 -Alfred