From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 10 19:48:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7A81065672; Mon, 10 Jan 2011 19:48:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 314D68FC23; Mon, 10 Jan 2011 19:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0AJmPpC091176; Mon, 10 Jan 2011 19:48:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0AJmP9e091174; Mon, 10 Jan 2011 19:48:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101101948.p0AJmP9e091174@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 Jan 2011 19:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217231 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2011 19:48:25 -0000 Author: yongari Date: Mon Jan 10 19:48:24 2011 New Revision: 217231 URL: http://svn.freebsd.org/changeset/base/217231 Log: MFC r217226: Apply DMA address space restriction to controllers that have 4GB DMA boundary bug and runs with PCI-X mode. watchdog timeout was observed on BCM5704 which lives behind certain PCI-X bridge(e.g. AMD 8131 PCI-X bridge). It's still not clear whether the root cause came from that PCI-X bridge or not. The watchdog timeout indicates the issue is in TX path. If the bridge reorders TX mailbox write accesses it would generate all kinds of problems but I'm not sure. This should be revisited. Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2. Tested by: Michael L. Squires (mikes <> siralan dot org) Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Jan 10 19:43:16 2011 (r217230) +++ stable/7/sys/dev/bge/if_bge.c Mon Jan 10 19:48:24 2011 (r217231) @@ -2473,8 +2473,18 @@ bge_dma_alloc(struct bge_softc *sc) /* Create parent tag for buffers. */ boundary = 0; - if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) { boundary = BGE_DMA_BNDRY; + /* + * XXX + * watchdog timeout issue was observed on BCM5704 which + * lives behind PCI-X bridge(e.g AMD 8131 PCI-X bridge). + * Limiting DMA address space to 32bits seems to address + * it. + */ + if (sc->bge_flags & BGE_FLAG_PCIX) + lowaddr = BUS_SPACE_MAXADDR_32BIT; + } error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 11 20:05:53 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842F31065673; Tue, 11 Jan 2011 20:05:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587028FC13; Tue, 11 Jan 2011 20:05:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0BK5rlB033726; Tue, 11 Jan 2011 20:05:53 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0BK5rxo033723; Tue, 11 Jan 2011 20:05:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101112005.p0BK5rxo033723@svn.freebsd.org> From: Doug Barton Date: Tue, 11 Jan 2011 20:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217282 - stable/7/usr.bin/stat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 20:05:53 -0000 Author: dougb Date: Tue Jan 11 20:05:53 2011 New Revision: 217282 URL: http://svn.freebsd.org/changeset/base/217282 Log: MFC r203971: The NetBSD Foundation has granted permission to remove clause 3 and 4 from their software. Obtained from: NetBSD Modified: stable/7/usr.bin/stat/stat.1 stable/7/usr.bin/stat/stat.c Directory Properties: stable/7/usr.bin/stat/ (props changed) Modified: stable/7/usr.bin/stat/stat.1 ============================================================================== --- stable/7/usr.bin/stat/stat.1 Tue Jan 11 20:04:37 2011 (r217281) +++ stable/7/usr.bin/stat/stat.1 Tue Jan 11 20:05:53 2011 (r217282) @@ -14,13 +14,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/7/usr.bin/stat/stat.c ============================================================================== --- stable/7/usr.bin/stat/stat.c Tue Jan 11 20:04:37 2011 (r217281) +++ stable/7/usr.bin/stat/stat.c Tue Jan 11 20:05:53 2011 (r217282) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 12 05:37:13 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D5E6106566C; Wed, 12 Jan 2011 05:37:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF2C8FC28; Wed, 12 Jan 2011 05:37:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0C5bDSG053443; Wed, 12 Jan 2011 05:37:13 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0C5bD7p053441; Wed, 12 Jan 2011 05:37:13 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101120537.p0C5bD7p053441@svn.freebsd.org> From: Doug Barton Date: Wed, 12 Jan 2011 05:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217298 - stable/7/usr.bin/stat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 05:37:13 -0000 Author: dougb Date: Wed Jan 12 05:37:13 2011 New Revision: 217298 URL: http://svn.freebsd.org/changeset/base/217298 Log: MFC 178651: The referenced section name is 'Formats', not 'FORMATS'. Modified: stable/7/usr.bin/stat/stat.1 Directory Properties: stable/7/usr.bin/stat/ (props changed) Modified: stable/7/usr.bin/stat/stat.1 ============================================================================== --- stable/7/usr.bin/stat/stat.1 Wed Jan 12 04:59:29 2011 (r217297) +++ stable/7/usr.bin/stat/stat.1 Wed Jan 12 05:37:13 2011 (r217298) @@ -121,7 +121,7 @@ error messages are automatically suppres .It Fl f Ar format Display information using the specified format. See the -.Sx FORMATS +.Sx Formats section for a description of valid formats. .It Fl l Display output in From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 12 07:27:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BF34106564A; Wed, 12 Jan 2011 07:27:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA0E8FC0A; Wed, 12 Jan 2011 07:27:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0C7RUsq058195; Wed, 12 Jan 2011 07:27:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0C7RUVT058193; Wed, 12 Jan 2011 07:27:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101120727.p0C7RUVT058193@svn.freebsd.org> From: Doug Barton Date: Wed, 12 Jan 2011 07:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217299 - stable/7/usr.bin/stat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 07:27:30 -0000 Author: dougb Date: Wed Jan 12 07:27:30 2011 New Revision: 217299 URL: http://svn.freebsd.org/changeset/base/217299 Log: MFC r188498 (partial): "I've changed main() to set file properly, so output() is never called with file set to NULL." Obtained from: ed The other bits of that revision are related to using fdevname(3). This was never merged back to RELENG_7, however the cleanup of the code in this MFC is good both for general purposes, and diff reduction to HEAD (which in turn will make the following MFCs easier). Modified: stable/7/usr.bin/stat/stat.c Directory Properties: stable/7/usr.bin/stat/ (props changed) Modified: stable/7/usr.bin/stat/stat.c ============================================================================== --- stable/7/usr.bin/stat/stat.c Wed Jan 12 05:37:13 2011 (r217298) +++ stable/7/usr.bin/stat/stat.c Wed Jan 12 07:27:30 2011 (r217299) @@ -200,6 +200,7 @@ main(int argc, char *argv[]) int ch, rc, errs, am_readlink; int lsF, fmtchar, usestat, fn, nonl, quiet; char *statfmt, *options, *synopsis; + const char *file; am_readlink = 0; lsF = 0; @@ -300,22 +301,25 @@ main(int argc, char *argv[]) errs = 0; do { - if (argc == 0) + if (argc == 0) { + file = "(stdin)"; rc = fstat(STDIN_FILENO, &st); - else if (usestat) - rc = stat(argv[0], &st); - else - rc = lstat(argv[0], &st); + } else { + file = argv[0]; + if (usestat) + rc = stat(file, &st); + else + rc = lstat(file, &st); + } if (rc == -1) { errs = 1; linkfail = 1; if (!quiet) - warn("%s: stat", - argc == 0 ? "(stdin)" : argv[0]); + warn("%s: stat", file); } else - output(&st, argv[0], statfmt, fn, nonl, quiet); + output(&st, file, statfmt, fn, nonl, quiet); argv++; argc--; @@ -828,10 +832,7 @@ format1(const struct stat *st, case SHOW_filename: small = 0; data = 0; - if (file == NULL) - (void)strncpy(path, "(stdin)", sizeof(path)); - else - (void)strncpy(path, file, sizeof(path)); + (void)strncpy(path, file, sizeof(path)); sdata = path; formats = FMTF_STRING; if (ofmt == 0) From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 12 07:38:49 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BCD51065672; Wed, 12 Jan 2011 07:38:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAD788FC17; Wed, 12 Jan 2011 07:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0C7cmWZ059596; Wed, 12 Jan 2011 07:38:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0C7cmlH059592; Wed, 12 Jan 2011 07:38:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101120738.p0C7cmlH059592@svn.freebsd.org> From: Doug Barton Date: Wed, 12 Jan 2011 07:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217300 - stable/7/usr.bin/stat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 07:38:49 -0000 Author: dougb Date: Wed Jan 12 07:38:48 2011 New Revision: 217300 URL: http://svn.freebsd.org/changeset/base/217300 Log: For stat.c ========== MFC r216196: Bring in the change from NetBSD 1.18: "If using stat (the -L flag) and it fails, fall back to lstat(). It may be the case that we're examining a broken symlink, and anything is better than nothing." The changes in 1.14 through 1.17 were not relevant to us. Obtained from: atatat@NetBSD.org MFC r216202: Bring in the change from NetBSD 1.22: "Fix a trivial truncation case, and eliminate a corner case that might print a nul character." I am purposely bypassing the following versions: 1.19 A build infrastructure change that does not apply to us 1.20 A feature I am not interested in, but don't object if someone else wants to pick it up 1.21 A build infrastructure change that does not apply to us Obtained from: atatat@NetBSD.org MFC r216203: Bring in a new feature, adding a -f option to readlink to print the path of the target, similar to realpath(1). See the discussion at: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662 This brings in the following changes: 1.24 "PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't grok -f, and there's no alternative (+fix) Patch applied with minor tweak (%y -> %R, as it was already taken) plus some nits from myself. Thanks!" Obtained from: elad@NetBSD.org 1.25 "Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead fake the filename '(stdin)' like the %N format." Obtained from: mlelstv@NetBSD.org 1.27 "The ofmt variable is actually a bit mask (not the character that was in the format string) so that we can "or" it with the bits in the formats variable. This fixes the missing " -> " in front of the real path (when you use %SR). Also, the ?: needs another space." Obtained from: atatat@NetBSD.org I am purposely omitting the following changes: 1.23 A humanize_number(3) clone that should better be implemented by actually using humanize_number(3) 1.26 This is the removal of license clause 3 and 4, already handled by imp in r203971 MFC 216205: Bring in the update from NetBSD 1.28: "Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)" Because of code differences I had to hand-apply parts of the patch, so responsibility for errors goes to me. Obtained from: lukem@NetBSD.org MFC 216206: [ Also applies to Makefile ] Fix an "unused variable" error that gets us all the way to WARNS=6 MFC 216207: Bring in the following changes from NetBSD. See the discussion at: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128 1.29 "Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it successfully prints mtimes after 2038." 1.30 "Improve previous with comments." Obtained from: dholland@NetBSD.org (both) MFC 216343: Bring in the change from OpenBSD's 1.14: "synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually exclusive; while here, slightly improve spacing in the source code so it fits on a 80-column display again. diff greatly improved by martynas@" Obtained from: sobrado@OpenBSD.org MFC 216512: Bring in the relevant changes from NetBSD's 1.31: "Use strlcpy, not strncpy, when the desired semantics are strlcpy's rather than strncpy's." Note: NetBSD's 1.32 is their adoption of our r216206 Obtained from: dholland@NetBSD.org For stat.1 ========== MFC 216197: Add my own documentation for the change in our r216196, aka NetBSD's 1.18 For -L if stat(2) fails, fall back to lstat(2). .Dd purposely not bumped because more changes are coming. MFC 216204: Bring in the update from NetBSD 1.19, the documentation of readlink -f "PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't grok -f, and there's no alternative (+fix) Patch applied with minor tweak (%y -> %R, as it was already taken) plus some nits from myself. Thanks!" Obtained from: elad@NetBSD.org MFC 216209: Bring in the change from NetBSD 1.12: "document default format." Obtained from: yamt@NetBSD.org MFC 216213: Bring in the changes from NetBSD 1.13 that we did not already have, with some differences. "Sort options. Use more mdoc macros. Some nit fixes. Bump date." Obtained from: wiz@NetBSD.org MFC 216215: Bring in the changes from NetBSD 1.16 that we did not already have. "Some fixes from jmc@openbsd." Obtained from: wiz@NetBSD.org MFC 216216: Bring in the change from NetBSD 1.20: "Make sentence easier to parse. From jsing@openbsd via jmc@openbsd." Obtained from: wiz@NetBSD.org MFC 216218: Bring in the following changes from NetBSD: 1.21 "Document the flags displayed by the default format, and mention their short names. From espie@openbsd via jmc@openbsd." 1.24 "Fix three variable names. From Todd T. Fries via Jason McIntyre." Obtained from: wiz@NetBSD.org (previous 2) 1.25 "Be consistent: document the birthtime field of struct stat for the "B" field specifier." Obtained from: reed@NetBSD.org 1.26 "Drop trailing space." Obtained from: wiz@NetBSD.org 1.27 "Since we have st_birthtime in struct stat, it is in default display." Obtained from: enami@NetBSD.org Purposely skipping the following revisions: 1.22 NetBSD-specific change 1.23 Removal of license clauses 3 and 4, already handled by imp in our r203971 MFC 216219: Bring in the change from NetBSD 1.28: "\\ -> \e" Obtained from: joerg@NetBSD.org Bump .Dd because we're now up to date with the latest NetBSD version Modified: stable/7/usr.bin/stat/Makefile stable/7/usr.bin/stat/stat.1 stable/7/usr.bin/stat/stat.c Directory Properties: stable/7/usr.bin/stat/ (props changed) Modified: stable/7/usr.bin/stat/Makefile ============================================================================== --- stable/7/usr.bin/stat/Makefile Wed Jan 12 07:27:30 2011 (r217299) +++ stable/7/usr.bin/stat/Makefile Wed Jan 12 07:38:48 2011 (r217300) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= stat -WARNS?= 2 +WARNS?= 6 LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 Modified: stable/7/usr.bin/stat/stat.1 ============================================================================== --- stable/7/usr.bin/stat/stat.1 Wed Jan 12 07:27:30 2011 (r217299) +++ stable/7/usr.bin/stat/stat.1 Wed Jan 12 07:38:48 2011 (r217300) @@ -1,4 +1,4 @@ -.\" $NetBSD: stat.1,v 1.11 2003/05/08 13:07:10 wiz Exp $ +.\" $NetBSD: stat.1,v 1.28 2010/04/05 21:25:01 joerg Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2010 +.Dd December 5, 2010 .Dt STAT 1 .Os .Sh NAME @@ -43,15 +43,15 @@ .Op Fl t Ar timefmt .Op Ar .Nm readlink -.Op Fl n +.Op Fl fn .Op Ar .Sh DESCRIPTION The .Nm utility displays information about the file pointed to by .Ar file . -Read, write or execute permissions of the named file are not required, but -all directories listed in the path name leading to the file must be +Read, write, or execute permissions of the named file are not required, but +all directories listed in the pathname leading to the file must be searchable. If no argument is given, .Nm @@ -60,13 +60,42 @@ displays information about the file desc When invoked as .Nm readlink , only the target of the symbolic link is printed. -If the given argument is not a symbolic link, +If the given argument is not a symbolic link and the +.Fl f +option is not specified, .Nm readlink will print nothing and exit with an error. +If the +.Fl f +option is specified, the output is canonicalized by following every symlink +in every component of the given path recursively. +.Nm readlink +will resolve both absolute and relative paths, and return the absolute pathname +corresponding to +.Ar file . +In this case, the argument does not need to be a symbolic link. .Pp The information displayed is obtained by calling .Xr lstat 2 with the given argument and evaluating the returned structure. +The default format displays the +.Fa st_dev , +.Fa st_ino , +.Fa st_mode , +.Fa st_nlink , +.Fa st_uid , +.Fa st_gid , +.Fa st_rdev , +.Fa st_size , +.Fa st_atime , +.Fa st_mtime , +.Fa st_ctime , +.Fa st_birthtime , +.Fa st_blksize , +.Fa st_blocks , +and +.Fa st_flags +fields, in that order. .Pp The options are as follows: .Bl -tag -width indent @@ -107,6 +136,14 @@ will refer to the target of if file is a symbolic link, and not to .Ar file itself. +If the link is broken or the target does not exist, +fall back on +.Xr lstat 2 +and report information about the link. +.It Fl l +Display output in +.Ic ls Fl lT +format. .It Fl n Do not force a newline to appear at the end of each piece of output. .It Fl q @@ -136,7 +173,8 @@ display the raw, numerical value (for ex epoch, etc.). .It Fl s Display information in -.Dq "shell output" , +.Dq shell output +format, suitable for initializing variables. .It Fl x Display information in a more verbose way as known from some @@ -334,49 +372,62 @@ A required field specifier, being one of .It Cm d Device upon which .Ar file -resides. +resides +.Pq Fa st_dev . .It Cm i .Ar file Ns 's -inode number. +inode number +.Pq Fa st_ino . .It Cm p -File type and permissions. +File type and permissions +.Pq Fa st_mode . .It Cm l Number of hard links to -.Ar file . +.Ar file +.Pq Fa st_nlink . .It Cm u , g User ID and group ID of .Ar file Ns 's -owner. +owner +.Pq Fa st_uid , st_gid . .It Cm r -Device number for character and block device special files. +Device number for character and block device special files +.Pq Fa st_rdev . .It Cm a , m , c , B The time .Ar file -was last accessed or modified, of when the inode was last changed, or -the birth time of the inode. +was last accessed or modified, or when the inode was last changed, or +the birth time of the inode +.Pq Fa st_atime , st_mtime , st_ctime , st_birthtime . .It Cm z The size of .Ar file -in bytes. +in bytes +.Pq Fa st_size . .It Cm b Number of blocks allocated for -.Ar file . +.Ar file +.Pq Fa st_blocks . .It Cm k -Optimal file system I/O operation block size. +Optimal file system I/O operation block size +.Pq Fa st_blksize . .It Cm f User defined flags for .Ar file . .It Cm v -Inode generation number. +Inode generation number +.Pq Fa st_gen . .El .Pp -The following four field specifiers are not drawn directly from the +The following five field specifiers are not drawn directly from the data in .Vt "struct stat" , but are: .Bl -tag -width indent .It Cm N The name of the file. +.It Cm R +The absolute pathname corresponding to the file. .It Cm T The file type, either as in .Nm ls Fl F @@ -406,12 +457,12 @@ as an output form, with the exception of .Cm p which defaults to -.Cm O , +.Cm O ; .Cm a , m , and .Cm c which default to -.Cm D , +.Cm D ; and .Cm Y , T , and @@ -421,8 +472,15 @@ which default to .Sh EXIT STATUS .Ex -std stat readlink .Sh EXAMPLES +If no options are specified, the default format is +"%d %i %Sp %l %Su %Sg %r %z \e"%Sa\e" \e"%Sm\e" \e"%Sc\e" \e"%SB\e" %k %b %#Xf %N". +.Bd -literal -offset indent +\*[Gt] stat /tmp/bar +0 78852 -rw-r--r-- 1 root wheel 0 0 "Jul 8 10:26:03 2004" "Jul 8 10:26:03 2004" "Jul 8 10:28:13 2004" "Jan 1 09:00:00 1970" 16384 0 0 /tmp/bar +.Ed +.Pp Given a symbolic link -.Pa foo +.Dq foo that points from .Pa /tmp/foo to Modified: stable/7/usr.bin/stat/stat.c ============================================================================== --- stable/7/usr.bin/stat/stat.c Wed Jan 12 07:27:30 2011 (r217299) +++ stable/7/usr.bin/stat/stat.c Wed Jan 12 07:38:48 2011 (r217300) @@ -30,7 +30,8 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.13 2003/07/25 03:21:17 atatat Exp $"); +__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $" +"$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $"); #endif #endif @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -150,6 +152,7 @@ __FBSDID("$FreeBSD$"); #define MIDDLE_PIECE 'M' #define LOW_PIECE 'L' +#define SHOW_realpath 'R' #define SHOW_st_dev 'd' #define SHOW_st_ino 'i' #define SHOW_st_mode 'p' @@ -173,7 +176,7 @@ __FBSDID("$FreeBSD$"); void usage(const char *); void output(const struct stat *, const char *, - const char *, int, int, int); + const char *, int, int); int format1(const struct stat *, /* stat info */ const char *, /* the file name */ const char *, int, /* the format string itself */ @@ -184,7 +187,7 @@ int format1(const struct stat *, /* stat char *xfflagstostr(unsigned long); #endif -char *timefmt; +const char *timefmt; int linkfail; #define addchar(s, c, nl) \ @@ -199,7 +202,7 @@ main(int argc, char *argv[]) struct stat st; int ch, rc, errs, am_readlink; int lsF, fmtchar, usestat, fn, nonl, quiet; - char *statfmt, *options, *synopsis; + const char *statfmt, *options, *synopsis; const char *file; am_readlink = 0; @@ -214,14 +217,15 @@ main(int argc, char *argv[]) if (strcmp(getprogname(), "readlink") == 0) { am_readlink = 1; - options = "n"; - synopsis = "[-n] [file ...]"; + options = "fn"; + synopsis = "[-fn] [file ...]"; statfmt = "%Y"; fmtchar = 'f'; quiet = 1; } else { options = "f:FlLnqrst:x"; - synopsis = "[-FlLnqrsx] [-f format] [-t timefmt] [file ...]"; + synopsis = "[-FLnq] [-f format | -l | -r | -s | -x] " + "[-t timefmt] [file ...]"; } while ((ch = getopt(argc, argv, options)) != -1) @@ -239,6 +243,10 @@ main(int argc, char *argv[]) quiet = 1; break; case 'f': + if (am_readlink) { + statfmt = "%R"; + break; + } statfmt = optarg; /* FALLTHROUGH */ case 'l': @@ -306,8 +314,17 @@ main(int argc, char *argv[]) rc = fstat(STDIN_FILENO, &st); } else { file = argv[0]; - if (usestat) - rc = stat(file, &st); + if (usestat) { + /* + * Try stat() and if it fails, fall back to + * lstat() just in case we're examining a + * broken symlink. + */ + if ((rc = stat(file, &st)) == -1 && + errno == ENOENT && + (rc = lstat(file, &st)) == -1) + errno = ENOENT; + } else rc = lstat(file, &st); } @@ -319,7 +336,7 @@ main(int argc, char *argv[]) warn("%s: stat", file); } else - output(&st, file, statfmt, fn, nonl, quiet); + output(&st, file, statfmt, fn, nonl); argv++; argc--; @@ -361,10 +378,10 @@ usage(const char *synopsis) */ void output(const struct stat *st, const char *file, - const char *statfmt, int fn, int nonl, int quiet) + const char *statfmt, int fn, int nonl) { int flags, size, prec, ofmt, hilo, what; - char buf[PATH_MAX]; + char buf[PATH_MAX + 4 + 1]; const char *subfmt; int nl, t, i; @@ -501,6 +518,7 @@ output(const struct stat *st, const char } switch (*statfmt) { + fmtcase(what, SHOW_realpath); fmtcase(what, SHOW_st_dev); fmtcase(what, SHOW_st_ino); fmtcase(what, SHOW_st_mode); @@ -533,7 +551,7 @@ output(const struct stat *st, const char buf, sizeof(buf), flags, size, prec, ofmt, hilo, what); - for (i = 0; i < t && i < sizeof(buf); i++) + for (i = 0; i < t && i < (int)(sizeof(buf) - 1); i++) addchar(stdout, buf[i], &nl); continue; @@ -560,7 +578,8 @@ format1(const struct stat *st, int hilo, int what) { u_int64_t data; - char *sdata, lfmt[24], tmp[20]; + char *stmp, lfmt[24], tmp[20]; + const char *sdata; char smode[12], sid[12], path[PATH_MAX + 4]; struct passwd *pw; struct group *gr; @@ -621,28 +640,29 @@ format1(const struct stat *st, small = (sizeof(st->st_mode) == 4); data = st->st_mode; strmode(st->st_mode, smode); - sdata = smode; - l = strlen(sdata); - if (sdata[l - 1] == ' ') - sdata[--l] = '\0'; + stmp = smode; + l = strlen(stmp); + if (stmp[l - 1] == ' ') + stmp[--l] = '\0'; if (hilo == HIGH_PIECE) { data >>= 12; - sdata += 1; - sdata[3] = '\0'; + stmp += 1; + stmp[3] = '\0'; hilo = 0; } else if (hilo == MIDDLE_PIECE) { data = (data >> 9) & 07; - sdata += 4; - sdata[3] = '\0'; + stmp += 4; + stmp[3] = '\0'; hilo = 0; } else if (hilo == LOW_PIECE) { data &= 0777; - sdata += 7; - sdata[3] = '\0'; + stmp += 7; + stmp[3] = '\0'; hilo = 0; } + sdata = stmp; formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX | FMTF_STRING; if (ofmt == 0) @@ -703,7 +723,6 @@ format1(const struct stat *st, ts = *tsp; /* copy so we can muck with it */ small = (sizeof(ts.tv_sec) == 4); data = ts.tv_sec; - small = 1; tm = localtime(&ts.tv_sec); (void)strftime(path, sizeof(path), timefmt, tm); sdata = path; @@ -759,6 +778,26 @@ format1(const struct stat *st, ofmt = FMTF_UNSIGNED; break; #endif /* HAVE_STRUCT_STAT_ST_GEN */ + case SHOW_realpath: + small = 0; + data = 0; + if (file == NULL) { + (void)strlcpy(path, "(stdin)", sizeof(path)); + sdata = path; + } else { + snprintf(path, sizeof(path), " -> "); + if (realpath(file, path + 4) == NULL) { + linkfail = 1; + l = 0; + path[0] = '\0'; + } + sdata = path + (ofmt == FMTF_STRING ? 0 : 4); + } + + formats = FMTF_STRING; + if (ofmt == 0) + ofmt = FMTF_STRING; + break; case SHOW_symlink: small = 0; data = 0; @@ -784,24 +823,23 @@ format1(const struct stat *st, case SHOW_filetype: small = 0; data = 0; - sdata = smode; - sdata[0] = '\0'; + sdata = ""; if (hilo == 0 || hilo == LOW_PIECE) { switch (st->st_mode & S_IFMT) { - case S_IFIFO: (void)strcat(sdata, "|"); break; - case S_IFDIR: (void)strcat(sdata, "/"); break; + case S_IFIFO: sdata = "|"; break; + case S_IFDIR: sdata = "/"; break; case S_IFREG: if (st->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) - (void)strcat(sdata, "*"); + sdata = "*"; break; - case S_IFLNK: (void)strcat(sdata, "@"); break; - case S_IFSOCK: (void)strcat(sdata, "="); break; + case S_IFLNK: sdata = "@"; break; + case S_IFSOCK: sdata = "="; break; #ifdef S_IFWHT - case S_IFWHT: (void)strcat(sdata, "%"); break; + case S_IFWHT: sdata = "%"; break; #endif /* S_IFWHT */ #ifdef S_IFDOOR - case S_IFDOOR: (void)strcat(sdata, ">"); break; + case S_IFDOOR: sdata = ">"; break; #endif /* S_IFDOOR */ } hilo = 0; @@ -832,7 +870,7 @@ format1(const struct stat *st, case SHOW_filename: small = 0; data = 0; - (void)strncpy(path, file, sizeof(path)); + (void)strlcpy(path, file, sizeof(path)); sdata = path; formats = FMTF_STRING; if (ofmt == 0) @@ -907,8 +945,9 @@ format1(const struct stat *st, (void)snprintf(tmp, sizeof(tmp), "%d", size); (void)strcat(lfmt, tmp); } - (void)strcat(lfmt, "d"); - return (snprintf(buf, blen, lfmt, ts.tv_sec)); + (void)strcat(lfmt, "lld"); + return (snprintf(buf, blen, lfmt, + (long long)ts.tv_sec)); } /* @@ -931,7 +970,8 @@ format1(const struct stat *st, (void)snprintf(tmp, sizeof(tmp), "%d", size); (void)strcat(lfmt, tmp); } - (void)strcat(lfmt, "d"); + /* Seconds: time_t cast to long long. */ + (void)strcat(lfmt, "lld"); /* * The stuff after the decimal point always needs zero @@ -942,8 +982,10 @@ format1(const struct stat *st, /* * We can "print" at most nine digits of precision. The * rest we will pad on at the end. + * + * Nanoseconds: long. */ - (void)snprintf(tmp, sizeof(tmp), "%dd", prec > 9 ? 9 : prec); + (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 : prec); (void)strcat(lfmt, tmp); /* @@ -957,8 +999,8 @@ format1(const struct stat *st, * Use the format, and then tack on any zeroes that * might be required to make up the requested precision. */ - l = snprintf(buf, blen, lfmt, ts.tv_sec, ts.tv_nsec); - for (; prec > 9 && l < blen; prec--, l++) + l = snprintf(buf, blen, lfmt, (long long)ts.tv_sec, ts.tv_nsec); + for (; prec > 9 && l < (int)blen; prec--, l++) (void)strcat(buf, "0"); return (l); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 13 12:26:39 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1E9106566B; Thu, 13 Jan 2011 12:26:39 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB83B8FC12; Thu, 13 Jan 2011 12:26:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0DCQdvj050280; Thu, 13 Jan 2011 12:26:39 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0DCQd9M050278; Thu, 13 Jan 2011 12:26:39 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101131226.p0DCQd9M050278@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 13 Jan 2011 12:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217348 - stable/7/tools/regression/bin/date X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 12:26:39 -0000 Author: keramida (doc committer) Date: Thu Jan 13 12:26:39 2011 New Revision: 217348 URL: http://svn.freebsd.org/changeset/base/217348 Log: MFC r217208 - regression/date: unset all LC_xxx vars and set LANG/LC_ALL When running with a custom locale setup, it's easy to confuse the date regression tests and cause them to fail, e.g. when LANG='C' but LC_ALL='el_GR.UTF-8'. Set LC_ALL to 'C', which overrides all other LC_xxx options, to avoid this sort of problem. Modified: stable/7/tools/regression/bin/date/regress.sh Directory Properties: stable/7/tools/regression/bin/date/ (props changed) Modified: stable/7/tools/regression/bin/date/regress.sh ============================================================================== --- stable/7/tools/regression/bin/date/regress.sh Thu Jan 13 11:23:42 2011 (r217347) +++ stable/7/tools/regression/bin/date/regress.sh Thu Jan 13 12:26:39 2011 (r217348) @@ -19,7 +19,7 @@ TEST1=3222243 # 1970-02-07 07:04:03 TEST2=1005600000 # 2001-11-12 21:11:12 -export LANG=C +export LC_ALL=C export TZ=UTC count=0 From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 01:07:40 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536F0106566C; Fri, 14 Jan 2011 01:07:40 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2704B8FC19; Fri, 14 Jan 2011 01:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0E17e1F069820; Fri, 14 Jan 2011 01:07:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0E17eNq069817; Fri, 14 Jan 2011 01:07:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101140107.p0E17eNq069817@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 14 Jan 2011 01:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217387 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 01:07:40 -0000 Author: lstewart Date: Fri Jan 14 01:07:39 2011 New Revision: 217387 URL: http://svn.freebsd.org/changeset/base/217387 Log: MFC r216995,217043: Add a man page for the Object Specific Data (OSD) KPI. Although not directly related the FreeBSD Foundation funded "Five New TCP Congestion Control Algorithms for FreeBSD" project, the understanding and inspiration required to write this documentation was significantly bolstered by the Foundation's support. Reviewed by: pjd Added: stable/7/share/man/man9/osd.9 - copied, changed from r216995, head/share/man/man9/osd.9 Modified: stable/7/share/man/man9/Makefile Directory Properties: stable/7/share/man/ (props changed) stable/7/share/man/man1/ (props changed) stable/7/share/man/man3/ (props changed) stable/7/share/man/man4/ (props changed) stable/7/share/man/man5/ (props changed) stable/7/share/man/man7/ (props changed) stable/7/share/man/man8/ (props changed) stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Fri Jan 14 00:57:13 2011 (r217386) +++ stable/7/share/man/man9/Makefile Fri Jan 14 01:07:39 2011 (r217387) @@ -157,6 +157,7 @@ MAN= accept_filter.9 \ mtx_pool.9 \ mutex.9 \ namei.9 \ + osd.9 \ panic.9 \ pbuf.9 \ p_candebug.9 \ Copied and modified: stable/7/share/man/man9/osd.9 (from r216995, head/share/man/man9/osd.9) ============================================================================== --- head/share/man/man9/osd.9 Wed Jan 5 11:49:23 2011 (r216995, copy source) +++ stable/7/share/man/man9/osd.9 Fri Jan 14 01:07:39 2011 (r217387) @@ -34,7 +34,7 @@ .Nm osd_deregister , .Nm osd_set , .Nm osd_get , -.Nm osd_del, +.Nm osd_del , .Nm osd_call , .Nm osd_exit .Nd Object Specific Data @@ -378,7 +378,7 @@ terminates prematurely and returns the m .Sh HISTORY The Object Specific Data (OSD) facility first appeared in -.Fx 8.0 . +.Fx 7.3 . .Sh AUTHORS .An -nosplit The From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 13:35:55 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE4E1065697; Fri, 14 Jan 2011 13:35:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59D4D8FC0C; Fri, 14 Jan 2011 13:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EDZtXK089540; Fri, 14 Jan 2011 13:35:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EDZtJ6089538; Fri, 14 Jan 2011 13:35:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101141335.p0EDZtJ6089538@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 14 Jan 2011 13: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 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217402 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 13:35:55 -0000 Author: bz Date: Fri Jan 14 13:35:55 2011 New Revision: 217402 URL: http://svn.freebsd.org/changeset/base/217402 Log: MFC r217135: Clarify when we switch from keepidle to keepinvtl intervals if sending TCP keepalive probes is enabled. Modified: stable/7/share/man/man4/tcp.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/tcp.4 ============================================================================== --- stable/7/share/man/man4/tcp.4 Fri Jan 14 13:34:56 2011 (r217401) +++ stable/7/share/man/man4/tcp.4 Fri Jan 14 13:35:55 2011 (r217402) @@ -32,7 +32,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 28, 2007 +.Dd January 8, 2011 .Dt TCP 4 .Os .Sh NAME @@ -289,7 +289,9 @@ Amount of time, in milliseconds, that th before keepalive probes (if enabled) are sent. .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote -machines. +machines, when no response is received on a +.Va keepidle +probe. After .Dv TCPTV_KEEPCNT (default 8) probes are sent, with no response, the connection is dropped. From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 20:28:12 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ABA4106566C; Fri, 14 Jan 2011 20:28:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517978FC0C; Fri, 14 Jan 2011 20:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EKSCeG099789; Fri, 14 Jan 2011 20:28:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EKSCN2099787; Fri, 14 Jan 2011 20:28:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101142028.p0EKSCN2099787@svn.freebsd.org> From: Marius Strobl Date: Fri, 14 Jan 2011 20:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217419 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 20:28:12 -0000 Author: marius Date: Fri Jan 14 20:28:12 2011 New Revision: 217419 URL: http://svn.freebsd.org/changeset/base/217419 Log: MFC: r217009 Remove a redundant variable assignment found with the clang static analyzer. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Fri Jan 14 20:28:11 2011 (r217418) +++ stable/7/sys/dev/mpt/mpt_cam.c Fri Jan 14 20:28:12 2011 (r217419) @@ -2965,7 +2965,7 @@ mpt_fc_els_reply_handler(struct mpt_soft } if (tgt_req) { mpt_tgt_state_t *tgt = MPT_TGT_STATE(mpt, tgt_req); - union ccb *ccb = tgt->ccb; + union ccb *ccb; uint32_t ct_id; /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 20:30:18 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFC7106566C; Fri, 14 Jan 2011 20:30:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39CBE8FC19; Fri, 14 Jan 2011 20:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EKUIq3099948; Fri, 14 Jan 2011 20:30:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EKUIOe099946; Fri, 14 Jan 2011 20:30:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101142030.p0EKUIOe099946@svn.freebsd.org> From: Marius Strobl Date: Fri, 14 Jan 2011 20:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217420 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 20:30:18 -0000 Author: marius Date: Fri Jan 14 20:30:17 2011 New Revision: 217420 URL: http://svn.freebsd.org/changeset/base/217420 Log: MFC: r217010 Fix whitespace. Modified: stable/7/sys/net/if_media.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_media.h ============================================================================== --- stable/7/sys/net/if_media.h Fri Jan 14 20:28:12 2011 (r217419) +++ stable/7/sys/net/if_media.h Fri Jan 14 20:30:17 2011 (r217420) @@ -36,7 +36,7 @@ */ #ifndef _NET_IF_MEDIA_H_ -#define _NET_IF_MEDIA_H_ +#define _NET_IF_MEDIA_H_ /* * Prototypes and definitions for BSD/OS-compatible network interface @@ -144,13 +144,12 @@ uint64_t ifmedia_baudrate(int); #define IFM_10G_LR 18 /* 10GBase-LR 1310nm Single-mode */ #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ -#define IFM_2500_SX 21 /* 2500BaseSX - multi-mode fiber */ -#define IFM_10G_TWINAX 22 /* 10GBase Twinax copper */ -#define IFM_10G_TWINAX_LONG 23 /* 10GBase Twinax Long copper */ -#define IFM_10G_LRM 24 /* 10GBase-LRM 850nm Multi-mode */ -#define IFM_UNKNOWN 25 /* media types not defined yet */ -#define IFM_10G_T 26 /* 10GBase-T - RJ45 */ - +#define IFM_2500_SX 21 /* 2500BaseSX - multi-mode fiber */ +#define IFM_10G_TWINAX 22 /* 10GBase Twinax copper */ +#define IFM_10G_TWINAX_LONG 23 /* 10GBase Twinax Long copper */ +#define IFM_10G_LRM 24 /* 10GBase-LRM 850nm Multi-mode */ +#define IFM_UNKNOWN 25 /* media types not defined yet */ +#define IFM_10G_T 26 /* 10GBase-T - RJ45 */ /* note 31 is the max! */ @@ -231,20 +230,20 @@ uint64_t ifmedia_baudrate(int); /* * ATM */ -#define IFM_ATM 0x000000a0 -#define IFM_ATM_UNKNOWN 3 -#define IFM_ATM_UTP_25 4 -#define IFM_ATM_TAXI_100 5 -#define IFM_ATM_TAXI_140 6 -#define IFM_ATM_MM_155 7 -#define IFM_ATM_SM_155 8 -#define IFM_ATM_UTP_155 9 -#define IFM_ATM_MM_622 10 -#define IFM_ATM_SM_622 11 +#define IFM_ATM 0x000000a0 +#define IFM_ATM_UNKNOWN 3 +#define IFM_ATM_UTP_25 4 +#define IFM_ATM_TAXI_100 5 +#define IFM_ATM_TAXI_140 6 +#define IFM_ATM_MM_155 7 +#define IFM_ATM_SM_155 8 +#define IFM_ATM_UTP_155 9 +#define IFM_ATM_MM_622 10 +#define IFM_ATM_SM_622 11 #define IFM_ATM_VIRTUAL 12 -#define IFM_ATM_SDH 0x00000100 /* SDH instead of SONET */ -#define IFM_ATM_NOSCRAMB 0x00000200 /* no scrambling */ -#define IFM_ATM_UNASSIGNED 0x00000400 /* unassigned cells */ +#define IFM_ATM_SDH 0x00000100 /* SDH instead of SONET */ +#define IFM_ATM_NOSCRAMB 0x00000200 /* no scrambling */ +#define IFM_ATM_UNASSIGNED 0x00000400 /* unassigned cells */ /* * CARP Common Address Redundancy Protocol @@ -294,22 +293,22 @@ uint64_t ifmedia_baudrate(int); #define IFM_STATUS_VALID IFM_AVALID /* List of "status valid" bits, for ifconfig(8). */ -#define IFM_STATUS_VALID_LIST { \ - IFM_AVALID, \ - 0 \ +#define IFM_STATUS_VALID_LIST { \ + IFM_AVALID, \ + 0 \ } /* * Macros to extract various bits of information from the media word. */ -#define IFM_TYPE(x) ((x) & IFM_NMASK) -#define IFM_SUBTYPE(x) ((x) & IFM_TMASK) -#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) -#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) -#define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK)) -#define IFM_MODE(x) ((x) & IFM_MMASK) +#define IFM_TYPE(x) ((x) & IFM_NMASK) +#define IFM_SUBTYPE(x) ((x) & IFM_TMASK) +#define IFM_TYPE_OPTIONS(x) ((x) & IFM_OMASK) +#define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) +#define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) +#define IFM_MODE(x) ((x) & IFM_MMASK) -#define IFM_INST_MAX IFM_INST(IFM_IMASK) +#define IFM_INST_MAX IFM_INST(IFM_IMASK) /* * Macro to create a media word. @@ -537,7 +536,7 @@ struct ifmedia_description { { 0, NULL }, \ } -# define IFM_SUBTYPE_ATM_DESCRIPTIONS { \ +#define IFM_SUBTYPE_ATM_DESCRIPTIONS { \ { IFM_ATM_UNKNOWN, "Unknown" }, \ { IFM_ATM_UTP_25, "UTP/25.6MBit" }, \ { IFM_ATM_TAXI_100, "Taxi/100MBit" }, \ @@ -551,7 +550,7 @@ struct ifmedia_description { { 0, NULL }, \ } -# define IFM_SUBTYPE_ATM_ALIASES { \ +#define IFM_SUBTYPE_ATM_ALIASES { \ { IFM_ATM_UNKNOWN, "UNKNOWN" }, \ { IFM_ATM_UTP_25, "UTP-25" }, \ { IFM_ATM_TAXI_100, "TAXI-100" }, \ @@ -572,7 +571,6 @@ struct ifmedia_description { { 0, NULL }, \ } - #define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_MANUAL, "manual" }, \ @@ -604,7 +602,7 @@ struct ifmedia_baudrate { uint64_t ifmb_baudrate; /* corresponding baudrate */ }; -#define IFM_BAUDRATE_DESCRIPTIONS { \ +#define IFM_BAUDRATE_DESCRIPTIONS { \ { IFM_ETHER | IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_5, IF_Mbps(10) }, \ @@ -668,10 +666,10 @@ struct ifmedia_status_description { const char *ifms_string[2]; }; -#define IFM_STATUS_DESC(ifms, bit) \ +#define IFM_STATUS_DESC(ifms, bit) \ (ifms)->ifms_string[((ifms)->ifms_bit & (bit)) ? 1 : 0] -#define IFM_STATUS_DESCRIPTIONS { \ +#define IFM_STATUS_DESCRIPTIONS { \ { IFM_ETHER, IFM_AVALID, IFM_ACTIVE, \ { "no carrier", "active" } }, \ { IFM_FDDI, IFM_AVALID, IFM_ACTIVE, \ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 20:43:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E32C41065694; Fri, 14 Jan 2011 20:43:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C66AD8FC08; Fri, 14 Jan 2011 20:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EKhONZ000452; Fri, 14 Jan 2011 20:43:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EKhOQb000449; Fri, 14 Jan 2011 20:43:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101142043.p0EKhOQb000449@svn.freebsd.org> From: Marius Strobl Date: Fri, 14 Jan 2011 20:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217423 - in stable/7: sbin/ifconfig sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 20:43:25 -0000 Author: marius Date: Fri Jan 14 20:43:24 2011 New Revision: 217423 URL: http://svn.freebsd.org/changeset/base/217423 Log: MFC: r217013 Teach ifconfig(8) the handy shared option shortcut aliases the NetBSD counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for "flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback" for "hw-loopback". Modified: stable/7/sbin/ifconfig/ifmedia.c stable/7/sys/net/if_media.h Directory Properties: stable/7/sbin/ifconfig/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/7/sbin/ifconfig/ifmedia.c Fri Jan 14 20:43:21 2011 (r217422) +++ stable/7/sbin/ifconfig/ifmedia.c Fri Jan 14 20:43:24 2011 (r217423) @@ -416,6 +416,9 @@ static struct ifmedia_description ifm_su static struct ifmedia_description ifm_shared_option_descriptions[] = IFM_SHARED_OPTION_DESCRIPTIONS; +static struct ifmedia_description ifm_shared_option_aliases[] = + IFM_SHARED_OPTION_ALIASES; + struct ifmedia_type_to_subtype { struct { struct ifmedia_description *desc; @@ -424,7 +427,7 @@ struct ifmedia_type_to_subtype { struct { struct ifmedia_description *desc; int alias; - } options[3]; + } options[4]; struct { struct ifmedia_description *desc; int alias; @@ -443,6 +446,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ethernet_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -460,6 +464,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -477,6 +482,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -494,6 +500,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ieee80211_option_descriptions[0], 0 }, { NULL, 0 }, }, @@ -513,6 +520,7 @@ static struct ifmedia_type_to_subtype if }, { { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_atm_option_descriptions[0], 0 }, { NULL, 0 }, }, Modified: stable/7/sys/net/if_media.h ============================================================================== --- stable/7/sys/net/if_media.h Fri Jan 14 20:43:21 2011 (r217422) +++ stable/7/sys/net/if_media.h Fri Jan 14 20:43:24 2011 (r217423) @@ -594,6 +594,15 @@ struct ifmedia_description { { 0, NULL }, \ } +#define IFM_SHARED_OPTION_ALIASES { \ + { IFM_FDX, "fdx" }, \ + { IFM_HDX, "hdx" }, \ + { IFM_FLOW, "flow" }, \ + { IFM_LOOP, "loop" }, \ + { IFM_LOOP, "loopback" }, \ + { 0, NULL }, \ +} + /* * Baudrate descriptions for the various media types. */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 14 22:58:41 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7572F1065675; Fri, 14 Jan 2011 22:58:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 646CD8FC14; Fri, 14 Jan 2011 22:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0EMwf1v005014; Fri, 14 Jan 2011 22:58:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0EMwfBm005012; Fri, 14 Jan 2011 22:58:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101142258.p0EMwfBm005012@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 14 Jan 2011 22:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217431 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 22:58:41 -0000 Author: yongari Date: Fri Jan 14 22:58:41 2011 New Revision: 217431 URL: http://svn.freebsd.org/changeset/base/217431 Log: MFC r216131: Document loader tunable hw.re.prefer_iomap. Modified: stable/7/share/man/man4/re.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Fri Jan 14 22:58:08 2011 (r217430) +++ stable/7/share/man/man4/re.4 Fri Jan 14 22:58:41 2011 (r217431) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2010 +.Dd December 2, 2010 .Dt RE 4 .Os .Sh NAME @@ -178,6 +178,11 @@ prompt before booting the kernel or stor .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.prefer_iomap +This tunable controls which register mapping should be used on the +specified device. +A non-zero value enables I/O space register mapping. +The default value is 0 to use memory space register mapping. .El .Sh DIAGNOSTICS .Bl -diag From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 15 00:34:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219021065693; Sat, 15 Jan 2011 00:34:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1C0A8FC18; Sat, 15 Jan 2011 00:34:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0F0Yoxx007468; Sat, 15 Jan 2011 00:34:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0F0YoxC007466; Sat, 15 Jan 2011 00:34:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101150034.p0F0YoxC007466@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 15 Jan 2011 00:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217436 - stable/7/sys/dev/re X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 00:34:51 -0000 Author: yongari Date: Sat Jan 15 00:34:50 2011 New Revision: 217436 URL: http://svn.freebsd.org/changeset/base/217436 Log: MFC r217296: For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E), limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of blindly configuring it to 16KB. Due to lack of documentation, re(4) didn't allow jumbo frame on these controllers. However it seems controller is confused with jumbo frame such that it can DMA the received frame to wrong address instead of splitting it into multiple RX buffers. Of course, this caused panic. Since re(4) does not support jumbo frames on these controllers, make controller drop frame that is longer than RE_RX_DESC_BUFLEN sized frame. Fortunately RTL810x controllers, which do not support jumbo frame, have no such issues but this change also limited maximum RX buffer size allowed to RTL810x controllers. Allowing 16KB RX buffer for controllers that have no such capability is meaningless. Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sat Jan 15 00:32:15 2011 (r217435) +++ stable/7/sys/dev/re/if_re.c Sat Jan 15 00:34:50 2011 (r217436) @@ -2773,8 +2773,13 @@ re_init_locked(struct rl_softc *sc) * For 8169 gigE NICs, set the max allowed RX packet * size so we can receive jumbo frames. */ - if (sc->rl_type == RL_8169) - CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + if (sc->rl_type == RL_8169) { + if ((sc->rl_flags & (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) == + (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN); + else + CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383); + } if (sc->rl_testmode) return; From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 15 09:36:31 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA679106564A; Sat, 15 Jan 2011 09:36:31 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9D648FC08; Sat, 15 Jan 2011 09:36:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0F9aVnx019843; Sat, 15 Jan 2011 09:36:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0F9aVGt019841; Sat, 15 Jan 2011 09:36:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101150936.p0F9aVGt019841@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 15 Jan 2011 09:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217443 - stable/7/sys/geom X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 09:36:32 -0000 Author: jh Date: Sat Jan 15 09:36:31 2011 New Revision: 217443 URL: http://svn.freebsd.org/changeset/base/217443 Log: MFC r214748: Extend the g_eventlock mutex coverage in one_event() to include setting of the EV_DONE flag and use the mutex to protect against losing wakeups in g_waitfor_event(). Modified: stable/7/sys/geom/geom_event.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/geom_event.c ============================================================================== --- stable/7/sys/geom/geom_event.c Sat Jan 15 09:25:19 2011 (r217442) +++ stable/7/sys/geom/geom_event.c Sat Jan 15 09:36:31 2011 (r217443) @@ -212,11 +212,12 @@ one_event(void) g_topology_assert(); mtx_lock(&g_eventlock); TAILQ_REMOVE(&g_events, ep, events); - mtx_unlock(&g_eventlock); if (ep->flag & EV_WAKEUP) { ep->flag |= EV_DONE; + mtx_unlock(&g_eventlock); wakeup(ep); } else { + mtx_unlock(&g_eventlock); g_free(ep); } g_topology_unlock(); @@ -355,11 +356,14 @@ g_waitfor_event(g_event_t *func, void *a va_end(ap); if (error) return (error); - do - tsleep(ep, PRIBIO, "g_waitfor_event", hz); - while (!(ep->flag & EV_DONE)); + + mtx_lock(&g_eventlock); + while (!(ep->flag & EV_DONE)) + msleep(ep, &g_eventlock, PRIBIO, "g_waitfor_event", hz); if (ep->flag & EV_CANCELED) error = EAGAIN; + mtx_unlock(&g_eventlock); + g_free(ep); return (error); }