From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 25 08:14:08 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F7BDEDA; Mon, 25 Feb 2013 08:14:08 +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 90B95377; Mon, 25 Feb 2013 08:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P8E8jd088812; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P8E8T1088811; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302250814.r1P8E8T1088811@svn.freebsd.org> From: Xin LI Date: Mon, 25 Feb 2013 08:14:08 +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: r247254 - in stable: 8/sbin/recoverdisk 9/sbin/recoverdisk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:14:08 -0000 Author: delphij Date: Mon Feb 25 08:14:07 2013 New Revision: 247254 URL: http://svnweb.freebsd.org/changeset/base/247254 Log: MFC r246329: Use stripesize as smallest block size if it's available. Modified: stable/8/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/8/sbin/recoverdisk/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/9/sbin/recoverdisk/ (props changed) Modified: stable/8/sbin/recoverdisk/recoverdisk.c ============================================================================== --- stable/8/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:08:13 2013 (r247253) +++ stable/8/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:14:07 2013 (r247254) @@ -156,6 +156,7 @@ main(int argc, char * const argv[]) int error, flags, state; u_char *buf; u_int sectorsize; + u_int stripesize; time_t t1, t2; struct stat sb; u_int n, snapshot = 60; @@ -202,6 +203,10 @@ main(int argc, char * const argv[]) if (error < 0) err(1, "DIOCGSECTORSIZE failed"); + error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize); + if (error == 0 && stripesize > sectorsize) + sectorsize = stripesize; + minsize = sectorsize; bigsize = (bigsize / sectorsize) * sectorsize; From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 25 19:09:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3455F6F5; Mon, 25 Feb 2013 19:09:14 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B30BFC5; Mon, 25 Feb 2013 19:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJ9DvI085855; Mon, 25 Feb 2013 19:09:13 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJ9D27085854; Mon, 25 Feb 2013 19:09:13 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302251909.r1PJ9D27085854@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 25 Feb 2013 19:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247276 - stable/8/lib/libc/stdlib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:09:14 -0000 Author: keramida (doc committer) Date: Mon Feb 25 19:09:13 2013 New Revision: 247276 URL: http://svnweb.freebsd.org/changeset/base/247276 Log: MFH r247014, r247050 and r247051. Add a sample program that shows how a custom comparison function and qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor), remko (mentor) Modified: stable/8/lib/libc/stdlib/qsort.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdlib/qsort.3 ============================================================================== --- stable/8/lib/libc/stdlib/qsort.3 Mon Feb 25 19:08:46 2013 (r247275) +++ stable/8/lib/libc/stdlib/qsort.3 Mon Feb 25 19:09:13 2013 (r247276) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 30, 2003 +.Dd February 20, 2013 .Dt QSORT 3 .Os .Sh NAME @@ -205,6 +205,46 @@ functions return no value. .Pp .Rv -std heapsort mergesort +.Sh EXAMPLES +A sample program that sorts an array of +.Vt int +values in place using +.Fn qsort , +and then prints the sorted array to standard output is: +.Bd -literal +#include +#include + +/* + * Custom comparison function that can compare 'int' values through pointers + * passed by qsort(3). + */ +static int +int_compare(const void *p1, const void *p2) +{ + int left = *(const int *)p1; + int right = *(const int *)p2; + + return ((left > right) - (left < right)); +} + +/* + * Sort an array of 'int' values and print it to standard output. + */ +int +main(void) +{ + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; + + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + puts(""); + return (EXIT_SUCCESS); +} +.Ed .Sh COMPATIBILITY Previous versions of .Fn qsort From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 26 06:01:59 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC0634A0; Tue, 26 Feb 2013 06:01:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB717EBB; Tue, 26 Feb 2013 06:01:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q61xsI087654; Tue, 26 Feb 2013 06:01:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q61xPP087646; Tue, 26 Feb 2013 06:01:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302260601.r1Q61xPP087646@svn.freebsd.org> From: Xin LI Date: Tue, 26 Feb 2013 06:01:59 +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: r247310 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/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-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 06:01:59 -0000 Author: delphij Date: Tue Feb 26 06:01:58 2013 New Revision: 247310 URL: http://svnweb.freebsd.org/changeset/base/247310 Log: MF9 r247309: MFC r246586,246587,246619,246624,246768,246808: LZ4 compression support in ZFS. (Note: sys/conf/files change omitted from this changeset). Added: stable/8/sys/cddl/boot/zfs/lz4.c - copied unchanged from r247309, stable/9/sys/cddl/boot/zfs/lz4.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4 stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/sys/cddl/boot/zfs/README stable/8/sys/cddl/boot/zfs/zfsimpl.h stable/8/sys/cddl/boot/zfs/zfssubr.c stable/8/sys/cddl/compat/opensolaris/sys/byteorder.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Feb 26 05:58:05 2013 (r247309) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Feb 26 06:01:58 2013 (r247310) @@ -1,5 +1,5 @@ '\" te -.\" Copyright (c) 2012, Martin Matuska . +.\" Copyright (c) 2013, Martin Matuska . .\" All Rights Reserved. .\" .\" The contents of this file are subject to the terms of the @@ -19,14 +19,15 @@ .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. +.\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2012 +.Dd February 10, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -38,14 +39,12 @@ .Nm .Cm create .Op Fl p -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... filesystem +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... Ar filesystem .Nm .Cm create .Op Fl ps .Op Fl b Ar blocksize -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Fl V .Ar size volume .Nm @@ -58,13 +57,13 @@ .Sm off .Ar snapshot .Op % Ns Ar snapname -.Op , Ns Ar ... +.Op , Ns ... .Sm on .Nm .Cm snapshot .Op Fl r -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... filesystem@snapname Ns | Ns Ar volume@snapname +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar filesystem@snapname Ns | Ns Ar volume@snapname .Nm .Cm rollback .Op Fl rRf @@ -72,8 +71,8 @@ .Nm .Cm clone .Op Fl p -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... snapshot filesystem Ns | Ns Ar volume +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar snapshot filesystem Ns | Ns Ar volume .Nm .Cm promote .Ar clone-filesystem @@ -101,31 +100,29 @@ .Cm list .Op Fl r Ns | Ns Fl d Ar depth .Op Fl H -.Op Fl o Ar property Ns Op , Ns Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... -.Op Fl s Ar property -.Ar ... -.Op Fl S Ar property -.Ar ... +.Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ... +.Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ... +.Oo Fl s Ar property Oc Ns ... +.Oo Fl S Ar property Oc Ns ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm set .Ar property Ns = Ns Ar value -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Nm .Cm get .Op Fl r Ns | Ns Fl d Ar depth .Op Fl Hp -.Op Fl o Ar all | field Ns Op , Ns Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... -.Op Fl s Ar source Ns Op , Ns Ar ... -.Ar all | property Ns Op , Ns Ar ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo Ns , Ar type Oc Ns ... +.Op Fl s Ar source Ns Oo Ns , Ns Ar source Oc Ns ... +.Ar all | property Ns Oo Ns , Ns Ar property Oc Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Nm .Cm inherit .Op Fl rS .Ar property -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Nm .Cm upgrade .Op Fl v @@ -137,29 +134,25 @@ .Nm .Cm userspace .Op Fl Hinp -.Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl s Ar field -.Ar ... -.Op Fl S Ar field -.Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ... .Ar filesystem Ns | Ns Ar snapshot .Nm .Cm groupspace .Op Fl Hinp -.Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl s Ar field -.Ar ... -.Op Fl S Ar field -.Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... +.Op Fl o Ar field Ns Oo , Ns field Oc Ns ... +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ... .Ar filesystem Ns | Ns Ar snapshot .Nm .Cm mount .Nm .Cm mount .Op Fl vO -.Op Fl o Ar property Ns Op , Ns Ar ... +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Fl a | Ar filesystem .Nm .Cm unmount @@ -191,63 +184,71 @@ .Nm .Cm allow .Op Fl ldug -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ... -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Ar perm Ns | Ns Ar @setname Ns +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ... .Ar filesystem Ns | Ns Ar volume .Nm .Cm allow .Op Fl ld -.Fl e -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Fl e Ns | Ns Cm everyone +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Nm .Cm allow .Fl c -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Nm .Cm allow .Fl s .Ar @setname -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Nm .Cm unallow .Op Fl rldug -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ... -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Nm .Cm unallow .Op Fl rld -.Fl e -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Fl e Ns | Ns Cm everyone +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Nm .Cm unallow .Op Fl r .Fl c -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Nm .Cm unallow .Op Fl r .Fl s .Ar @setname -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Nm .Cm hold .Op Fl r -.Ar tag snapshot ... +.Ar tag snapshot Ns ... .Nm .Cm holds .Op Fl r -.Ar snapshot ... +.Ar snapshot Ns ... .Nm .Cm release .Op Fl r -.Ar tag snapshot ... +.Ar tag snapshot Ns ... .Nm .Cm diff .Op Fl FHt @@ -859,7 +860,7 @@ but this may change in future releases). disables integrity checking on user data. Disabling checksums is .Em NOT a recommended practice. -.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle +.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Controls the compression algorithm used for this dataset. The .CM lzjb compression algorithm is optimized for performance while providing decent data @@ -887,6 +888,26 @@ The .Cm zle compression algorithm compresses runs of zeros. .Pp +The +.Sy lz4 +compression algorithm is a high-performance replacement +for the +.Sy lzjb +algorithm. It features significantly faster +compression and decompression, as well as a moderately higher +compression ratio than +.Sy lzjb , +but can only be used on pools with +the +.Sy lz4_compress +feature set to +.Sy enabled . +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy lz4_compress +feature. +.Pp This property can also be referred to by its shortened column name .Cm compress . Changing this property affects only newly-written data. @@ -1383,8 +1404,8 @@ Displays a help message. .Nm .Cm create .Op Fl p -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... filesystem +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar filesystem .Xc .Pp Creates a new @@ -1419,8 +1440,7 @@ options. .Cm create .Op Fl ps .Op Fl b Ar blocksize -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Fl V .Ar size volume .Xc @@ -1520,7 +1540,7 @@ behavior for mounted file systems in use .Sm off .Ar snapshot .Op % Ns Ar snapname -.Op , Ns Ar ... +.Op , Ns ... .Sm on .Xc .Pp @@ -1581,8 +1601,7 @@ behavior for mounted file systems in use .Nm .Cm snapshot .Op Fl r -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname .Xc .Pp @@ -1629,8 +1648,8 @@ option to force an unmount of any clone .Nm .Cm clone .Op Fl p -.Op Fl o Ar property Ns = Ns Ar value -.Ar ... snapshot filesystem Ns | Ns Ar volume +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... +.Ar snapshot filesystem Ns | Ns Ar volume .Xc .Pp Creates a clone of the given snapshot. See the @@ -1733,13 +1752,11 @@ only dataset that can be renamed recursi .Cm list .Op Fl r Ns | Ns Fl d Ar depth .Op Fl H -.Op Fl o Ar property Ns Op , Ns Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... -.Op Fl s Ar property -.Ar ... -.Op Fl S Ar property -.Ar ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... +.Oo Fl s Ar property Oc Ns ... +.Oo Fl S Ar property Oc Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Xc .Pp Lists the property information for the given datasets in tabular form. If @@ -1765,7 +1782,7 @@ will display only the dataset and its di .It Fl H Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space. -.It Fl o Ar property Ns Op , Ns Ar ... +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... A comma-separated list of properties to display. The property must be: .Bl -bullet -offset 2n .It @@ -1789,7 +1806,7 @@ shortcut for specifying .Sy filesystem,volume syntax. .El -.It Fl t Ar type Ns Op , Ns Ar ... +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... A comma-separated list of types to display, where .Ar type is one of @@ -1852,11 +1869,11 @@ section. .Cm get .Op Fl r Ns | Ns Fl d Ar depth .Op Fl Hp -.Op Fl o Ar all | field Ns Op , Ns Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... -.Op Fl s Ar source Ns Op , Ns Ar ... -.Ar all | property Ns Op , Ns Ar ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... +.Op Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... +.Ar all | property Ns Oo , Ns Ar property Oc Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Xc .Pp Displays properties for the given datasets. If no datasets are specified, then @@ -1906,7 +1923,7 @@ omitted, and fields are explicitly separ arbitrary amount of space. .It Fl p Display numbers in parseable (exact) values. -.It Fl o Cm all | Ar field Ns Op , Ns Ar ... +.It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ... A comma-separated list of columns to display. Supported values are .Sy name,property,value,received,source . Default values are @@ -1914,7 +1931,7 @@ Default values are The keyword .Cm all specifies all columns. -.It Fl t Ar type Ns Op , Ns Ar ... +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... A comma-separated list of types to display, where .Ar type is one of @@ -1922,7 +1939,7 @@ is one of For example, specifying .Fl t Cm snapshot displays only snapshots. -.It Fl s Ar source Ns Op , Ns Ar ... +.It Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following: @@ -1934,7 +1951,7 @@ The default value is all sources. .Cm inherit .Op Fl rS .Ar property -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Xc .Pp Clears the specified property, causing it to be inherited from an ancestor. If @@ -2009,12 +2026,10 @@ Upgrade the specified file system. .Nm .Cm userspace .Op Fl Hinp -.Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl s Ar field -.Ar ... -.Op Fl S Ar field -.Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... .Ar filesystem Ns | Ns Ar snapshot .Xc .Pp @@ -2031,7 +2046,7 @@ Print numeric ID instead of user/group n Do not print headers, use tab-delimited output. .It Fl p Use exact (parsable) numeric output. -.It Fl o Ar field Ns Op , Ns Ar ... +.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Display only the specified fields from the following set: .Sy type,name,used,quota . The default is to display all fields. @@ -2046,7 +2061,7 @@ another. The default is .It Fl S Ar field Sort by this field in reverse order. See .Fl s . -.It Fl t Ar type Ns Op , Ns Ar ... +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Print only the specified types from the following set: .Sy all,posixuser,smbuser,posixgroup,smbgroup . .Pp @@ -2062,12 +2077,10 @@ Translate SID to POSIX ID. This flag cur .Nm .Cm groupspace .Op Fl Hinp -.Op Fl o Ar field Ns Op , Ns Ar ... -.Op Fl s Ar field -.Ar ... -.Op Fl S Ar field -.Ar ... -.Op Fl t Ar type Ns Op , Ns Ar ... +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... +.Oo Fl s Ar field Oc Ns ... +.Oo Fl S Ar field Oc Ns ... +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... .Ar filesystem Ns | Ns Ar snapshot .Xc .Pp @@ -2091,7 +2104,7 @@ file systems currently mounted. .Nm .Cm mount .Op Fl vO -.Op Fl o Ar property Ns Op , Ns Ar ... +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Fl a | Ar filesystem .Xc .Pp @@ -2104,7 +2117,7 @@ Report mount progress. .It Fl O Perform an overlay mount. Overlay mounts are not supported on .Fx . -.It Fl o Ar property Ns Op , Ns Ar ... +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... An optional, comma-separated list of mount options to use temporarily for the duration of the mount. See the .Qq Sx Temporary Mount Point Properties @@ -2423,16 +2436,18 @@ for more information. .Nm .Cm allow .Op Fl ldug -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ... -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Ar perm Ns | Ns Ar @setname Ns +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ... .Ar filesystem Ns | Ns Ar volume .Xc .It Xo .Nm .Cm allow .Op Fl ld -.Fl e -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Fl e Ns | Ns Cm everyone +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Xc .Pp @@ -2442,26 +2457,31 @@ administration permission for the file s .Bl -tag -width indent .It Xo .Op Fl ug -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ... +.Ar user Ns | Ns Ar group Ns Oo , Ar user Ns | Ns Ar group Oc Ns ... .Xc Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the .Fl ug options are specified, then the argument is interpreted preferentially as the -keyword "everyone", then as a user name, and lastly as a group name. To specify -a user or group named "everyone", use the +keyword +.Cm everyone , +then as a user name, and lastly as a group name. To specify +a user or group named +.Qq everyone , +use the .Fl u or .Fl g options. To specify a group with the same name as a user, use the .Fl g option. +.It Op Fl e Ns | Ns Cm everyone +Specifies that the permissions be delegated to +.Qq everyone . .It Xo -.Op Fl e -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar perm Ns | Ns Ar @setname Ns Oo , Ns Ar perm Ns | Ns Ar @setname Oc Ns ... .Xc -Specifies that the permissions be delegated to "everyone". -Multiple permissions +The permissions to delegate. Multiple permissions may be specified as a comma-separated list. Permission names are the same as .Tn ZFS subcommand and property names. See the property list below. Property set names, @@ -2568,7 +2588,8 @@ protocol .Nm .Cm allow .Fl c -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Xc .Pp @@ -2579,7 +2600,8 @@ creator of any newly-created descendent .Cm allow .Fl s .Ar @setname -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... .Ar filesystem Ns | Ns Ar volume .Xc .Pp @@ -2595,16 +2617,18 @@ and can be no more than 64 characters lo .Nm .Cm unallow .Op Fl rldug -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ... -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Xc .It Xo .Nm .Cm unallow .Op Fl rld -.Fl e -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Fl e Ns | Ns Cm everyone +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Xc .It Xo @@ -2612,7 +2636,8 @@ and can be no more than 64 characters lo .Cm unallow .Op Fl r .Fl c -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Xc .Pp @@ -2621,10 +2646,12 @@ Removes permissions that were granted wi command. No permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified -.Ar user , group , No or Ar everyone -are removed. Specifying "everyone" (or using the -.Fl e -option) only removes the permissions that were granted to "everyone", +.Ar user , group , No or everyone +are removed. Specifying +.Cm everyone +.Po or using the Fl e +option +.Pc only removes the permissions that were granted to everyone , not all permissions for every user and group. See the .Qq Nm Cm allow command for a description of the @@ -2640,7 +2667,8 @@ Recursively remove the permissions from .Op Fl r .Fl s .Ar @setname -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ... +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns +.Ns ... Oc .Ar filesystem Ns | Ns Ar volume .Xc .Pp @@ -2650,7 +2678,7 @@ then all permissions are removed, thus r .Nm .Cm hold .Op Fl r -.Ar tag snapshot ... +.Ar tag snapshot Ns ... .Xc .Pp Adds a single reference, named with the @@ -2671,7 +2699,7 @@ snapshots of all descendent file systems .Nm .Cm holds .Op Fl r -.Ar snapshot ... +.Ar snapshot Ns ... .Xc .Pp Lists all existing user references for the given snapshot or snapshots. @@ -2684,7 +2712,7 @@ listing the holds on the named snapshot. .Nm .Cm release .Op Fl r -.Ar tag snapshot ... +.Ar tag snapshot Ns ... .Xc .Pp Removes a single reference, named with the Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Feb 26 05:58:05 2013 (r247309) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Feb 26 06:01:58 2013 (r247310) @@ -18,10 +18,11 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd Aug 28, 2012 +.Dd February 8, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -185,6 +186,49 @@ This feature is .Sy active while there are any filesystems, volumes, or snapshots which were created after enabling this feature. +.It Sy lz4_compress +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress" +.It GUID Ta org.illumos:lz4_compress +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +.Sy lz4 +is a high-performance real-time compression algorithm that +features significantly faster compression and decompression as well as a +higher compression ratio than the older +.Sy lzjb +compression. +Typically, +.Sy lz4 +compression is approximately 50% faster on +compressible data and 200% faster on incompressible data than +.Sy lzjb . +It is also approximately 80% faster on decompression, while +giving approximately 10% better compression ratio. +.Pp +When the +.Sy lz4_compress +feature is set to +.Sy enabled , +the +administrator can turn on +.Sy lz4 +compression on any dataset on the +pool using the +.Xr zfs 8 +command. Please note that doing so will +immediately activate the +.Sy lz4_compress +feature on the underlying +pool (even before any data is written). Since this feature is not +read-only compatible, this operation will render the pool unimportable +on systems without support for the +.Sy lz4_compress +feature. At the +moment, this operation cannot be reversed. Booting off of +.Sy lz4 +-compressed root pools is supported. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/8/sys/cddl/boot/zfs/README ============================================================================== --- stable/8/sys/cddl/boot/zfs/README Tue Feb 26 05:58:05 2013 (r247309) +++ stable/8/sys/cddl/boot/zfs/README Tue Feb 26 06:01:58 2013 (r247310) @@ -5,6 +5,7 @@ are used by the ZFS bootstrap: fletcher.c checksum support sha256.c checksum support + lz4.c compression support lzjb.c compression support zfssubr.c checksum, compression and raidz support zfsimpl.h mostly describing the physical layout Copied: stable/8/sys/cddl/boot/zfs/lz4.c (from r247309, stable/9/sys/cddl/boot/zfs/lz4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/boot/zfs/lz4.c Tue Feb 26 06:01:58 2013 (r247310, copy of r247309, stable/9/sys/cddl/boot/zfs/lz4.c) @@ -0,0 +1,308 @@ +/* + * LZ4 - Fast LZ compression algorithm + * Header File + * Copyright (C) 2011-2013, Yann Collet. + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You can contact the author at : + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html + * - LZ4 source repository : http://code.google.com/p/lz4/ + * + * $FreeBSD$ + */ + +static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, + int isize, int maxOutputSize); + +/* ARGSUSED */ +static int +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dummy __unused) +{ + const uint8_t *src = s_start; + uint32_t bufsiz = htonl(*(uint32_t *)src); + + /* invalid compressed buffer size encoded at start */ + if (bufsiz + 4 > s_len) + return (1); + + /* + * Returns 0 on success (decompression function returned non-negative) + * and non-zero on failure (decompression function returned negative). + */ + return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz, + d_len) < 0); +} + +/* + * CPU Feature Detection + */ + +/* 32 or 64 bits ? */ +#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || \ + defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \ + defined(__LP64__) || defined(_LP64)) +#define LZ4_ARCH64 1 +#else +#define LZ4_ARCH64 0 +#endif + +/* + * Little Endian or Big Endian? + * Note: overwrite the below #define if you know your architecture endianess. + */ +#if BYTE_ORDER == BIG_ENDIAN +#define LZ4_BIG_ENDIAN 1 +#else + /* + * Little Endian assumed. PDP Endian and other very rare endian format + * are unsupported. + */ +#endif + +/* + * Compiler Options + */ +#if __STDC_VERSION__ >= 199901L /* C99 */ +/* "restrict" is a known keyword */ +#else +/* Disable restrict */ +#define restrict +#endif + +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +#define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) \ + | (((x) & 0xffu) << 8))) + +#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) +#define expect(expr, value) (__builtin_expect((expr), (value))) +#else +#define expect(expr, value) (expr) +#endif + +#define likely(expr) expect((expr) != 0, 1) +#define unlikely(expr) expect((expr) != 0, 0) + +/* Basic types */ +#define BYTE uint8_t +#define U16 uint16_t +#define U32 uint32_t +#define S32 int32_t +#define U64 uint64_t + +typedef struct _U16_S { + U16 v; +} U16_S; +typedef struct _U32_S { + U32 v; +} U32_S; +typedef struct _U64_S { + U64 v; +} U64_S; + +#define A64(x) (((U64_S *)(x))->v) +#define A32(x) (((U32_S *)(x))->v) +#define A16(x) (((U16_S *)(x))->v) + +/* + * Constants + */ +#define MINMATCH 4 + +#define COPYLENGTH 8 +#define LASTLITERALS 5 + +#define ML_BITS 4 +#define ML_MASK ((1U<> ML_BITS)) == RUN_MASK) { + int s = 255; + while ((ip < iend) && (s == 255)) { + s = *ip++; + length += s; + } + } + /* copy literals */ + cpy = op + length; + if ((cpy > oend - COPYLENGTH) || + (ip + length > iend - COPYLENGTH)) { + if (cpy > oend) + /* + * Error: request to write beyond destination + * buffer. + */ + goto _output_error; + if (ip + length > iend) + /* + * Error : request to read beyond source + * buffer. + */ + goto _output_error; + memcpy(op, ip, length); + op += length; + ip += length; + if (ip < iend) + /* Error : LZ4 format violation */ + goto _output_error; + /* Necessarily EOF, due to parsing restrictions. */ + break; + } + LZ4_WILDCOPY(ip, op, cpy); + ip -= (op - cpy); + op = cpy; + + /* get offset */ + LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip); + ip += 2; + if (ref < (BYTE * const) dest) + /* + * Error: offset creates reference outside of + * destination buffer. + */ + goto _output_error; + + /* get matchlength */ + if ((length = (token & ML_MASK)) == ML_MASK) { + while (ip < iend) { + int s = *ip++; + length += s; + if (s == 255) + continue; + break; + } + } + /* copy repeated sequence */ + if unlikely(op - ref < STEPSIZE) { +#if LZ4_ARCH64 + size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 }; + size_t dec2 = dec2table[op - ref]; +#else + const int dec2 = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 26 16:56:00 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A0D8CD9; Tue, 26 Feb 2013 16:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C17EFAA; Tue, 26 Feb 2013 16:56:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QGu0n3086068; Tue, 26 Feb 2013 16:56:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QGtxdv086058; Tue, 26 Feb 2013 16:55:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302261655.r1QGtxdv086058@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Feb 2013 16:55:59 +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: r247322 - in stable/8: etc/rc.d sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 16:56:00 -0000 Author: jhb Date: Tue Feb 26 16:55:59 2013 New Revision: 247322 URL: http://svnweb.freebsd.org/changeset/base/247322 Log: MFC 234927: - Don't log messages saying that accounting is being disabled and enabled if the accounting log file is atomically replaced with a new file (such as during log rotation). - Simplify accounting log rotation a bit. There is no need to re-run accton(8) after renaming the new log file to it's real name. PR: kern/167321 Modified: stable/8/etc/rc.d/accounting stable/8/sys/kern/kern_acct.c Directory Properties: stable/8/etc/ (props changed) stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/etc/rc.d/accounting ============================================================================== --- stable/8/etc/rc.d/accounting Tue Feb 26 16:55:44 2013 (r247321) +++ stable/8/etc/rc.d/accounting Tue Feb 26 16:55:59 2013 (r247322) @@ -65,9 +65,7 @@ accounting_rotate_log() mv ${accounting_file} ${accounting_file}.0 if checkyesno accounting_enable; then - ln $_file ${accounting_file##*/} - ${accounting_command} ${accounting_file} - unlink $_file + mv $_file ${accounting_file} fi } Modified: stable/8/sys/kern/kern_acct.c ============================================================================== --- stable/8/sys/kern/kern_acct.c Tue Feb 26 16:55:44 2013 (r247321) +++ stable/8/sys/kern/kern_acct.c Tue Feb 26 16:55:59 2013 (r247322) @@ -122,7 +122,7 @@ static uint32_t encode_timeval(struct ti static uint32_t encode_long(long); static void acctwatch(void); static void acct_thread(void *); -static int acct_disable(struct thread *); +static int acct_disable(struct thread *, int); /* * Accounting vnode pointer, saved vnode pointer, and flags for each. @@ -196,7 +196,7 @@ int acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, vfslocked; + int error, flags, vfslocked, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -246,6 +246,13 @@ acct(struct thread *td, struct acct_args sx_xlock(&acct_sx); /* + * Don't log spurious disable/enable messages if we are + * switching from one accounting file to another due to log + * rotation. + */ + replacing = (acct_vp != NULL && uap->path != NULL); + + /* * If accounting was previously enabled, kill the old space-watcher, * close the file, and (if no new file was specified, leave). Reset * the suspended state regardless of whether accounting remains @@ -254,7 +261,7 @@ acct(struct thread *td, struct acct_args acct_suspended = 0; if (acct_vp != NULL) { vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); - error = acct_disable(td); + error = acct_disable(td, !replacing); VFS_UNLOCK_GIANT(vfslocked); } if (uap->path == NULL) { @@ -299,7 +306,8 @@ acct(struct thread *td, struct acct_args } acct_configured = 1; sx_xunlock(&acct_sx); - log(LOG_NOTICE, "Accounting enabled\n"); + if (!replacing) + log(LOG_NOTICE, "Accounting enabled\n"); return (error); } @@ -308,7 +316,7 @@ acct(struct thread *td, struct acct_args * our reference to the credential, and clearing the vnode's flags. */ static int -acct_disable(struct thread *td) +acct_disable(struct thread *td, int logging) { int error; @@ -319,7 +327,8 @@ acct_disable(struct thread *td) acct_vp = NULL; acct_cred = NULL; acct_flags = 0; - log(LOG_NOTICE, "Accounting disabled\n"); + if (logging) + log(LOG_NOTICE, "Accounting disabled\n"); return (error); } @@ -574,7 +583,7 @@ acctwatch(void) */ vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); if (acct_vp->v_type == VBAD) { - (void) acct_disable(NULL); + (void) acct_disable(NULL, 1); VFS_UNLOCK_GIANT(vfslocked); acct_state |= ACCT_EXITREQ; return; From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 26 19:14:30 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E21BC28B; Tue, 26 Feb 2013 19:14:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC42119F0; Tue, 26 Feb 2013 19:14:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJEUNI029260; Tue, 26 Feb 2013 19:14:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJEUmp029257; Tue, 26 Feb 2013 19:14:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302261914.r1QJEUmp029257@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Feb 2013 19:14:30 +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: r247336 - stable/8/sbin/dhclient X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 19:14:31 -0000 Author: jhb Date: Tue Feb 26 19:14:29 2013 New Revision: 247336 URL: http://svnweb.freebsd.org/changeset/base/247336 Log: MFC 239356,239564: Teach dhclient to track changes in link state and to enter the reboot state when the link on an interface goes up causing dhclient to attempt to renew its existing lease. PR: bin/166656 Modified: stable/8/sbin/dhclient/dhclient.c stable/8/sbin/dhclient/dhcpd.h Directory Properties: stable/8/sbin/dhclient/ (props changed) Modified: stable/8/sbin/dhclient/dhclient.c ============================================================================== --- stable/8/sbin/dhclient/dhclient.c Tue Feb 26 19:14:05 2013 (r247335) +++ stable/8/sbin/dhclient/dhclient.c Tue Feb 26 19:14:29 2013 (r247336) @@ -218,6 +218,7 @@ routehandler(struct protocol *p) struct sockaddr *sa; struct iaddr a; ssize_t n; + int linkstat; n = read(routefd, &msg, sizeof(msg)); rtm = (struct rt_msghdr *)msg; @@ -278,6 +279,15 @@ routehandler(struct protocol *p) ifi->name); goto die; } + linkstat = interface_link_status(ifi->name); + if (linkstat != ifi->linkstat) { + debug("%s link state %s -> %s", ifi->name, + ifi->linkstat ? "up" : "down", + linkstat ? "up" : "down"); + ifi->linkstat = linkstat; + if (linkstat) + state_reboot(ifi); + } break; case RTM_IFANNOUNCE: ifan = (struct if_announcemsghdr *)rtm; @@ -430,6 +440,7 @@ main(int argc, char *argv[]) } fprintf(stderr, " got link\n"); } + ifi->linkstat = 1; if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); Modified: stable/8/sbin/dhclient/dhcpd.h ============================================================================== --- stable/8/sbin/dhclient/dhcpd.h Tue Feb 26 19:14:05 2013 (r247335) +++ stable/8/sbin/dhclient/dhcpd.h Tue Feb 26 19:14:29 2013 (r247336) @@ -208,6 +208,7 @@ struct interface_info { int errors; int dead; u_int16_t index; + int linkstat; }; struct timeout { From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 26 21:05:07 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD24A2DE; Tue, 26 Feb 2013 21:05:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B718567; Tue, 26 Feb 2013 21:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QL57vI062863; Tue, 26 Feb 2013 21:05:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QL57aS062861; Tue, 26 Feb 2013 21:05:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302262105.r1QL57aS062861@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Feb 2013 21:05: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: r247350 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 21:05:08 -0000 Author: jhb Date: Tue Feb 26 21:05:06 2013 New Revision: 247350 URL: http://svnweb.freebsd.org/changeset/base/247350 Log: MFC 240467: Ignore stop and continue signals sent to an exiting process. Stop signals set p_xstat to the signal that triggered the stop, but p_xstat is also used to hold the exit status of an exiting process. Without this change, a stop signal that arrived after a process was marked P_WEXIT but before it was marked a zombie would overwrite the exit status with the stop signal number. Modified: stable/8/sys/kern/kern_exit.c stable/8/sys/kern/kern_sig.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_exit.c ============================================================================== --- stable/8/sys/kern/kern_exit.c Tue Feb 26 21:04:58 2013 (r247349) +++ stable/8/sys/kern/kern_exit.c Tue Feb 26 21:05:06 2013 (r247350) @@ -183,6 +183,14 @@ exit1(struct thread *td, int rv) _STOPEVENT(p, S_EXIT, rv); /* + * Ignore any pending request to stop due to a stop signal. + * Once P_WEXIT is set, future requests will be ignored as + * well. + */ + p->p_flag &= ~P_STOPPED_SIG; + KASSERT(!P_SHOULDSTOP(p), ("exiting process is stopped")); + + /* * Note that we are exiting and do another wakeup of anyone in * PIOCWAIT in case they aren't listening for S_EXIT stops or * decided to wait again after we told them we are exiting. Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Tue Feb 26 21:04:58 2013 (r247349) +++ stable/8/sys/kern/kern_sig.c Tue Feb 26 21:05:06 2013 (r247350) @@ -2142,6 +2142,8 @@ tdsignal(struct proc *p, struct thread * * We try do the per-process part here. */ if (P_SHOULDSTOP(p)) { + KASSERT(!(p->p_flag & P_WEXIT), + ("signal to stopped but exiting process")); if (sig == SIGKILL) { /* * If traced process is already stopped, @@ -2256,7 +2258,7 @@ tdsignal(struct proc *p, struct thread * MPASS(action == SIG_DFL); if (prop & SA_STOP) { - if (p->p_flag & P_PPWAIT) + if (p->p_flag & (P_PPWAIT|P_WEXIT)) goto out; p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; @@ -2418,6 +2420,7 @@ ptracestop(struct thread *td, int sig) struct proc *p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + KASSERT(!(p->p_flag & P_WEXIT), ("Stopping exiting process")); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Stopping for traced signal"); @@ -2658,7 +2661,7 @@ issignal(struct thread *td, int stop_all * process group, ignore tty stop signals. */ if (prop & SA_STOP) { - if (p->p_flag & P_TRACED || + if (p->p_flag & (P_TRACED|P_WEXIT) || (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 26 22:08:11 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5ED38E26; Tue, 26 Feb 2013 22:08:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5207D331; Tue, 26 Feb 2013 22:08:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QM8BRZ082180; Tue, 26 Feb 2013 22:08:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QM8BDi082179; Tue, 26 Feb 2013 22:08:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302262208.r1QM8BDi082179@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Feb 2013 22:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247358 - stable/8/sys/dev/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-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 22:08:11 -0000 Author: jhb Date: Tue Feb 26 22:08:10 2013 New Revision: 247358 URL: http://svnweb.freebsd.org/changeset/base/247358 Log: MFC 240473: Add some registers defined in PCI 3.0 including new AER bits. Modified: stable/8/sys/dev/pci/pcireg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Tue Feb 26 22:07:59 2013 (r247357) +++ stable/8/sys/dev/pci/pcireg.h Tue Feb 26 22:08:10 2013 (r247358) @@ -64,6 +64,7 @@ #define PCIM_CMD_BACKTOBACK 0x0200 #define PCIM_CMD_INTxDIS 0x0400 #define PCIR_STATUS 0x06 +#define PCIM_STATUS_INTxSTATE 0x0008 #define PCIM_STATUS_CAPPRESENT 0x0010 #define PCIM_STATUS_66CAPABLE 0x0020 #define PCIM_STATUS_BACKTOBACK 0x0080 @@ -135,11 +136,22 @@ #define PCIZ_VC 0x0002 /* Virtual Channel */ #define PCIZ_SERNUM 0x0003 /* Device Serial Number */ #define PCIZ_PWRBDGT 0x0004 /* Power Budgeting */ +#define PCIZ_RCLINK_DCL 0x0005 /* Root Complex Link Declaration */ +#define PCIZ_RCLINK_CTL 0x0006 /* Root Complex Internal Link Control */ +#define PCIZ_RCEC_ASSOC 0x0007 /* Root Complex Event Collector Association */ +#define PCIZ_MFVC 0x0008 /* Multi-Function Virtual Channel */ +#define PCIZ_RCRB 0x000a /* RCRB Header */ #define PCIZ_VENDOR 0x000b /* Vendor Unique */ #define PCIZ_ACS 0x000d /* Access Control Services */ #define PCIZ_ARI 0x000e /* Alternative Routing-ID Interpretation */ #define PCIZ_ATS 0x000f /* Address Translation Services */ #define PCIZ_SRIOV 0x0010 /* Single Root IO Virtualization */ +#define PCIZ_MULTICAST 0x0012 /* Multicast */ +#define PCIZ_RESIZE_BAR 0x0015 /* Resizable BAR */ +#define PCIZ_DPA 0x0016 /* Dynamic Power Allocation */ +#define PCIZ_TPH_REQ 0x0017 /* TPH Requester */ +#define PCIZ_LTR 0x0018 /* Latency Tolerance Reporting */ +#define PCIZ_SEC_PCIE 0x0019 /* Secondary PCI Express */ /* config registers for header type 0 devices */ @@ -910,6 +922,10 @@ #define PCIM_AER_UC_ECRC_ERROR 0x00080000 #define PCIM_AER_UC_UNSUPPORTED_REQUEST 0x00100000 #define PCIM_AER_UC_ACS_VIOLATION 0x00200000 +#define PCIM_AER_UC_INTERNAL_ERROR 0x00400000 +#define PCIM_AER_UC_MC_BLOCKED_TLP 0x00800000 +#define PCIM_AER_UC_ATOMIC_EGRESS_BLK 0x01000000 +#define PCIM_AER_UC_TLP_PREFIX_BLOCKED 0x02000000 #define PCIR_AER_UC_MASK 0x08 /* Shares bits with UC_STATUS */ #define PCIR_AER_UC_SEVERITY 0x0c /* Shares bits with UC_STATUS */ #define PCIR_AER_COR_STATUS 0x10 @@ -919,6 +935,8 @@ #define PCIM_AER_COR_REPLAY_ROLLOVER 0x00000100 #define PCIM_AER_COR_REPLAY_TIMEOUT 0x00001000 #define PCIM_AER_COR_ADVISORY_NF_ERROR 0x00002000 +#define PCIM_AER_COR_INTERNAL_ERROR 0x00004000 +#define PCIM_AER_COR_HEADER_LOG_OVFLOW 0x00008000 #define PCIR_AER_COR_MASK 0x14 /* Shares bits with COR_STATUS */ #define PCIR_AER_CAP_CONTROL 0x18 #define PCIM_AER_FIRST_ERROR_PTR 0x0000001f @@ -926,6 +944,9 @@ #define PCIM_AER_ECRC_GEN_ENABLE 0x00000040 #define PCIM_AER_ECRC_CHECK_CAPABLE 0x00000080 #define PCIM_AER_ECRC_CHECK_ENABLE 0x00000100 +#define PCIM_AER_MULT_HDR_CAPABLE 0x00000200 +#define PCIM_AER_MULT_HDR_ENABLE 0x00000400 +#define PCIM_AER_TLP_PREFIX_LOG_PRESENT 0x00000800 #define PCIR_AER_HEADER_LOG 0x1c #define PCIR_AER_ROOTERR_CMD 0x2c /* Only for root complex ports */ #define PCIM_AER_ROOTERR_COR_ENABLE 0x00000001 @@ -942,6 +963,7 @@ #define PCIM_AER_ROOTERR_INT_MESSAGE 0xf8000000 #define PCIR_AER_COR_SOURCE_ID 0x34 /* Only for root complex ports */ #define PCIR_AER_ERR_SOURCE_ID 0x36 /* Only for root complex ports */ +#define PCIR_AER_TLP_PREFIX_LOG 0x38 /* Only for TLP prefix functions */ /* Virtual Channel definitions */ #define PCIR_VC_CAP1 0x04 From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 27 08:56:57 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E01EDDA6; Wed, 27 Feb 2013 08:56:57 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CD6311FD; Wed, 27 Feb 2013 08:56:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R8uvJW081756; Wed, 27 Feb 2013 08:56:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R8uvrQ081755; Wed, 27 Feb 2013 08:56:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302270856.r1R8uvrQ081755@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 27 Feb 2013 08:56: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: r247395 - stable/8/usr.sbin/mountd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 08:56:58 -0000 Author: pluknet Date: Wed Feb 27 08:56:57 2013 New Revision: 247395 URL: http://svnweb.freebsd.org/changeset/base/247395 Log: MFC r247034: Check if the -sec option is given without an argument. PR: bin/170413 Submitted by: Andrey Simonenko Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Wed Feb 27 08:55:26 2013 (r247394) +++ stable/8/usr.sbin/mountd/mountd.c Wed Feb 27 08:56:57 2013 (r247395) @@ -2229,7 +2229,7 @@ do_opt(char **cpp, char **endcpp, struct ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { opt_flags |= OP_QUIET; - } else if (!strcmp(cpopt, "sec")) { + } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) return (1); opt_flags |= OP_SEC; From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 27 19:22:31 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EACE0B4F; Wed, 27 Feb 2013 19:22: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 C283B93D; Wed, 27 Feb 2013 19:22:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJMVTc073041; Wed, 27 Feb 2013 19:22:31 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJMRap073016; Wed, 27 Feb 2013 19:22:27 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302271922.r1RJMRap073016@svn.freebsd.org> From: Martin Matuska Date: Wed, 27 Feb 2013 19:22: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: r247407 - in stable/8: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/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-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 19:22:32 -0000 Author: mm Date: Wed Feb 27 19:22:27 2013 New Revision: 247407 URL: http://svnweb.freebsd.org/changeset/base/247407 Log: MFC r246631,246651,246666,246675,246678,246688: Merge various ZFS bugfixes MFC r246631: Import vendor bugfixes Illumos ZFS issues: 3422 zpool create/syseventd race yield non-importable pool 3425 first write to a new zvol can fail with EFBIG MFC r246651: Import minor type change in refcount.h header from vendor (illumos). MFC r246666: Import vendor ZFS bugfix fixing a problem in arc_read(). Illumos ZFS issues: 3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt) MFC r246675: Add tunable to allow block allocation on degraded vdevs. Illumos ZFS issues: 3507 Tunable to allow block allocation even on degraded vdevs MFC r246678: Import vendor bugfixes regarding SA rounding, header size and layout. This was already partially fixed by avg. Illumos ZFS issues: 3512 rounding discrepancy in sa_find_sizes() 3513 mismatch between SA header size and layout MFC r246688 [1]: Merge zfs_ioctl.c code that should have been merged together with ZFS v28. Fixes several problems if working with read-only pools. Changed code originaly introduced in onnv-gate 13061:bda0decf867b Contains changes up to illumos-gate 13700:4bc0783f6064 PR: kern/175897 [1] Suggested by: avg [1] Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:22:27 2013 (r247407) @@ -983,7 +983,7 @@ visit_indirect(spa_t *spa, const dnode_p arc_buf_t *buf; uint64_t fill = 0; - err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf, + err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); @@ -2001,9 +2001,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0); } -/* ARGSUSED */ static int -zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; @@ -2410,7 +2409,7 @@ typedef struct zdb_ddt_entry { /* ARGSUSED */ static int zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { avl_tree_t *t = arg; avl_index_t where; Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Feb 27 19:22:27 2013 (r247407) @@ -526,13 +526,12 @@ get_configs(libzfs_handle_t *hdl, pool_l * version * pool guid * name - * pool txg (if available) * comment (if available) * pool state * hostid (if available) * hostname (if available) */ - uint64_t state, version, pool_txg; + uint64_t state, version; char *comment = NULL; version = fnvlist_lookup_uint64(tmp, @@ -548,11 +547,6 @@ get_configs(libzfs_handle_t *hdl, pool_l fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, name); - if (nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0) - fnvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_TXG, pool_txg); - if (nvlist_lookup_string(tmp, ZPOOL_CONFIG_COMMENT, &comment) == 0) fnvlist_add_string(config, 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 Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Feb 27 19:22:27 2013 (r247407) @@ -940,7 +940,6 @@ buf_cons(void *vbuf, void *unused, int k bzero(buf, sizeof (arc_buf_t)); mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL); - rw_init(&buf->b_data_lock, NULL, RW_DEFAULT, NULL); arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS); return (0); @@ -970,7 +969,6 @@ buf_dest(void *vbuf, void *unused) arc_buf_t *buf = vbuf; mutex_destroy(&buf->b_evict_lock); - rw_destroy(&buf->b_data_lock); arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS); } @@ -2968,42 +2966,11 @@ arc_read_done(zio_t *zio) * * arc_read_done() will invoke all the requested "done" functions * for readers of this block. - * - * Normal callers should use arc_read and pass the arc buffer and offset - * for the bp. But if you know you don't need locking, you can use - * arc_read_nolock. */ int -arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - int err; - - if (pbuf == NULL) { - /* - * XXX This happens from traverse callback funcs, for - * the objset_phys_t block. - */ - return (arc_read_nolock(pio, spa, bp, done, private, priority, - zio_flags, arc_flags, zb)); - } - - ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt)); - ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size); - rw_enter(&pbuf->b_data_lock, RW_READER); - - err = arc_read_nolock(pio, spa, bp, done, private, priority, - zio_flags, arc_flags, zb); - rw_exit(&pbuf->b_data_lock); - - return (err); -} - -int -arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) +arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, + void *private, int priority, int zio_flags, uint32_t *arc_flags, + const zbookmark_t *zb) { arc_buf_hdr_t *hdr; arc_buf_t *buf; @@ -3482,19 +3449,6 @@ arc_release(arc_buf_t *buf, void *tag) } } -/* - * Release this buffer. If it does not match the provided BP, fill it - * with that block's contents. - */ -/* ARGSUSED */ -int -arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa, - zbookmark_t *zb) -{ - arc_release(buf, tag); - return (0); -} - int arc_released(arc_buf_t *buf) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Feb 27 19:22:27 2013 (r247407) @@ -135,7 +135,7 @@ bptree_add(objset_t *os, uint64_t obj, b /* ARGSUSED */ static int -bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { int err; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed Feb 27 19:22:27 2013 (r247407) @@ -513,7 +513,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t spa_t *spa; zbookmark_t zb; uint32_t aflags = ARC_NOWAIT; - arc_buf_t *pbuf; DB_DNODE_ENTER(db); dn = DB_DNODE(db); @@ -575,14 +574,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t db->db.db_object, db->db_level, db->db_blkid); dbuf_add_ref(db, NULL); - /* ZIO_FLAG_CANFAIL callers have to check the parent zio's error */ - if (db->db_parent) - pbuf = db->db_parent->db_buf; - else - pbuf = db->db_objset->os_phys_buf; - - (void) dsl_read(zio, spa, db->db_blkptr, pbuf, + (void) arc_read(zio, spa, db->db_blkptr, dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ, (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED, &aflags, &zb); @@ -982,7 +975,6 @@ void dbuf_release_bp(dmu_buf_impl_t *db) { objset_t *os; - zbookmark_t zb; DB_GET_OBJSET(&os, db); ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); @@ -990,13 +982,7 @@ dbuf_release_bp(dmu_buf_impl_t *db) list_link_active(&os->os_dsl_dataset->ds_synced_link)); ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf)); - zb.zb_objset = os->os_dsl_dataset ? - os->os_dsl_dataset->ds_object : 0; - zb.zb_object = db->db.db_object; - zb.zb_level = db->db_level; - zb.zb_blkid = db->db_blkid; - (void) arc_release_bp(db->db_buf, db, - db->db_blkptr, os->os_spa, &zb); + (void) arc_release(db->db_buf, db); } dbuf_dirty_record_t * @@ -1831,7 +1817,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki if (bp && !BP_IS_HOLE(bp)) { int priority = dn->dn_type == DMU_OT_DDT_ZAP ? ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ; - arc_buf_t *pbuf; dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; zbookmark_t zb; @@ -1839,13 +1824,8 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET, dn->dn_object, 0, blkid); - if (db) - pbuf = db->db_buf; - else - pbuf = dn->dn_objset->os_phys_buf; - - (void) dsl_read(NULL, dn->dn_objset->os_spa, - bp, pbuf, NULL, NULL, priority, + (void) arc_read(NULL, dn->dn_objset->os_spa, + bp, NULL, NULL, priority, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, &zb); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Wed Feb 27 19:22:27 2013 (r247407) @@ -128,7 +128,7 @@ report_dnode(struct diffarg *da, uint64_ /* ARGSUSED */ static int -diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { struct diffarg *da = arg; @@ -155,9 +155,9 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons int blksz = BP_GET_LSIZE(bp); int i; - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); blk = abuf->b_data; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Wed Feb 27 19:22:27 2013 (r247407) @@ -276,12 +276,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat aflags |= ARC_L2CACHE; dprintf_bp(os->os_rootbp, "reading %s", ""); - /* - * XXX when bprewrite scrub can change the bp, - * and this is called from dmu_objset_open_ds_os, the bp - * could change, and we'll need a lock. - */ - err = dsl_read_nolock(NULL, spa, os->os_rootbp, + err = arc_read(NULL, spa, os->os_rootbp, arc_getbuf_func, &os->os_phys_buf, ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb); if (err) { @@ -1124,8 +1119,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio SET_BOOKMARK(&zb, os->os_dsl_dataset ? os->os_dsl_dataset->ds_object : DMU_META_OBJSET, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf, - os->os_rootbp, os->os_spa, &zb)); + arc_release(os->os_phys_buf, &os->os_phys_buf); dmu_write_policy(os, NULL, 0, 0, &zp); @@ -1764,7 +1758,7 @@ dmu_objset_prefetch(const char *name, vo SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - (void) dsl_read_nolock(NULL, dsl_dataset_get_spa(ds), + (void) arc_read(NULL, dsl_dataset_get_spa(ds), &ds->ds_phys->ds_bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Feb 27 19:22:27 2013 (r247407) @@ -317,7 +317,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t /* ARGSUSED */ static int -backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { dmu_sendarg_t *dsp = arg; @@ -346,9 +346,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co uint32_t aflags = ARC_WAIT; arc_buf_t *abuf; - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); blk = abuf->b_data; @@ -365,9 +365,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); - if (arc_read_nolock(NULL, spa, bp, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) return (EIO); err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data); @@ -377,9 +377,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); - if (dsl_read(NULL, spa, bp, pbuf, - arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &aflags, zb) != 0) { + if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, + &aflags, zb) != 0) { if (zfs_send_corrupt_data) { /* Send a block filled with 0x"zfs badd bloc" */ abuf = arc_buf_alloc(spa, blksz, &abuf, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Feb 27 19:22:27 2013 (r247407) @@ -62,9 +62,9 @@ typedef struct traverse_data { } traverse_data_t; static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object); + uint64_t objset, uint64_t object); static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, - arc_buf_t *buf, uint64_t objset, uint64_t object); + uint64_t objset, uint64_t object); static int traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) @@ -81,7 +81,7 @@ traverse_zil_block(zilog_t *zilog, blkpt SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, bp->blk_cksum.zc_word[ZIL_ZC_SEQ]); - (void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, td->td_arg); + (void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg); return (0); } @@ -105,7 +105,7 @@ traverse_zil_record(zilog_t *zilog, lr_t SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid, ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp)); - (void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, + (void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg); } return (0); @@ -182,7 +182,7 @@ traverse_pause(traverse_data_t *td, cons static void traverse_prefetch_metadata(traverse_data_t *td, - arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_t *zb) { uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; @@ -200,14 +200,13 @@ traverse_prefetch_metadata(traverse_data if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE) return; - (void) arc_read(NULL, td->td_spa, bp, - pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL, &flags, zb); + (void) arc_read(NULL, td->td_spa, bp, NULL, NULL, + ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); } static int traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_t *zb) { zbookmark_t czb; int err = 0, lasterr = 0; @@ -228,8 +227,7 @@ traverse_visitbp(traverse_data_t *td, co } if (BP_IS_HOLE(bp)) { - err = td->td_func(td->td_spa, NULL, NULL, pbuf, zb, dnp, - td->td_arg); + err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg); return (err); } @@ -249,7 +247,7 @@ traverse_visitbp(traverse_data_t *td, co } if (td->td_flags & TRAVERSE_PRE) { - err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp, + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == TRAVERSE_VISIT_NO_CHILDREN) return (0); @@ -265,8 +263,7 @@ traverse_visitbp(traverse_data_t *td, co blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; - err = dsl_read(NULL, td->td_spa, bp, pbuf, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); @@ -276,7 +273,7 @@ traverse_visitbp(traverse_data_t *td, co SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, zb->zb_blkid * epb + i); - traverse_prefetch_metadata(td, buf, &cbp[i], &czb); + traverse_prefetch_metadata(td, &cbp[i], &czb); } /* recursively visitbp() blocks below this */ @@ -284,7 +281,7 @@ traverse_visitbp(traverse_data_t *td, co SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, zb->zb_blkid * epb + i); - err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb); + err = traverse_visitbp(td, dnp, &cbp[i], &czb); if (err) { if (!hard) break; @@ -296,21 +293,20 @@ traverse_visitbp(traverse_data_t *td, co int i; int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; - err = dsl_read(NULL, td->td_spa, bp, pbuf, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); dnp = buf->b_data; for (i = 0; i < epb; i++) { - prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset, + prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset, zb->zb_blkid * epb + i); } /* recursively visitbp() blocks below this */ for (i = 0; i < epb; i++) { - err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset, + err = traverse_dnode(td, &dnp[i], zb->zb_objset, zb->zb_blkid * epb + i); if (err) { if (!hard) @@ -323,24 +319,23 @@ traverse_visitbp(traverse_data_t *td, co objset_phys_t *osp; dnode_phys_t *dnp; - err = dsl_read_nolock(NULL, td->td_spa, bp, - arc_getbuf_func, &buf, + err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); osp = buf->b_data; dnp = &osp->os_meta_dnode; - prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset, + prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { prefetch_dnode_metadata(td, &osp->os_userused_dnode, - buf, zb->zb_objset, DMU_USERUSED_OBJECT); + zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, - buf, zb->zb_objset, DMU_USERUSED_OBJECT); + zb->zb_objset, DMU_USERUSED_OBJECT); } - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (err && hard) { lasterr = err; @@ -348,7 +343,7 @@ traverse_visitbp(traverse_data_t *td, co } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_userused_dnode; - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_USERUSED_OBJECT); } if (err && hard) { @@ -357,7 +352,7 @@ traverse_visitbp(traverse_data_t *td, co } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_groupused_dnode; - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + err = traverse_dnode(td, dnp, zb->zb_objset, DMU_GROUPUSED_OBJECT); } } @@ -367,8 +362,7 @@ traverse_visitbp(traverse_data_t *td, co post: if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { - err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp, - td->td_arg); + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; } @@ -384,25 +378,25 @@ post: static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object) + uint64_t objset, uint64_t object) { int j; zbookmark_t czb; for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); - traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb); + traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb); } if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); - traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb); + traverse_prefetch_metadata(td, &dnp->dn_spill, &czb); } } static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *buf, uint64_t objset, uint64_t object) + uint64_t objset, uint64_t object) { int j, err = 0, lasterr = 0; zbookmark_t czb; @@ -410,7 +404,7 @@ traverse_dnode(traverse_data_t *td, cons for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); - err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb); + err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb); if (err) { if (!hard) break; @@ -420,7 +414,7 @@ traverse_dnode(traverse_data_t *td, cons if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); - err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb); + err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb); if (err) { if (!hard) return (err); @@ -433,8 +427,7 @@ traverse_dnode(traverse_data_t *td, cons /* ARGSUSED */ static int traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, - void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { prefetch_data_t *pfd = arg; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; @@ -455,10 +448,8 @@ traverse_prefetcher(spa_t *spa, zilog_t cv_broadcast(&pfd->pd_cv); mutex_exit(&pfd->pd_mtx); - (void) dsl_read(NULL, spa, bp, pbuf, NULL, NULL, - ZIO_PRIORITY_ASYNC_READ, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, - &aflags, zb); + (void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb); return (0); } @@ -476,7 +467,7 @@ traverse_prefetch_thread(void *arg) SET_BOOKMARK(&czb, td.td_objset, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - (void) traverse_visitbp(&td, NULL, NULL, td.td_rootbp, &czb); + (void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb); mutex_enter(&td_main->td_pfd->pd_mtx); td_main->td_pfd->pd_exited = B_TRUE; @@ -540,7 +531,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t SET_BOOKMARK(&czb, td.td_objset, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); - err = traverse_visitbp(&td, NULL, NULL, rootbp, &czb); + err = traverse_visitbp(&td, NULL, rootbp, &czb); mutex_enter(&pd.pd_mtx); pd.pd_cancel = B_TRUE; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Feb 27 19:22:27 2013 (r247407) @@ -21,7 +21,7 @@ /* * 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. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -284,6 +284,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u delta = P2NPHASE(off, dn->dn_datablksz); } + min_ibs = max_ibs = dn->dn_indblkshift; if (dn->dn_maxblkid > 0) { /* * The blocksize can't change, @@ -291,13 +292,6 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u */ ASSERT(dn->dn_datablkshift != 0); min_bs = max_bs = dn->dn_datablkshift; - min_ibs = max_ibs = dn->dn_indblkshift; - } else if (dn->dn_indblkshift > max_ibs) { - /* - * This ensures that if we reduce DN_MAX_INDBLKSHIFT, - * the code will still work correctly on older pools. - */ - min_ibs = max_ibs = dn->dn_indblkshift; } /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Feb 27 19:22:27 2013 (r247407) @@ -1308,7 +1308,7 @@ struct killarg { /* ARGSUSED */ static int -kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, +kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { struct killarg *ka = arg; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Feb 27 19:22:27 2013 (r247407) @@ -396,24 +396,6 @@ dsl_free_sync(zio_t *pio, dsl_pool_t *dp zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags)); } -int -dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - return (arc_read(pio, spa, bpp, pbuf, done, private, - priority, zio_flags, arc_flags, zb)); -} - -int -dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *private, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb) -{ - return (arc_read_nolock(pio, spa, bpp, done, private, - priority, zio_flags, arc_flags, zb)); -} - static uint64_t dsl_scan_ds_maxtxg(dsl_dataset_t *ds) { @@ -584,12 +566,8 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid); - /* - * XXX need to make sure all of these arc_read() prefetches are - * done before setting xlateall (similar to dsl_read()) - */ (void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp, - buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, + NULL, NULL, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb); } @@ -647,8 +625,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -670,8 +647,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da } else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) { uint32_t flags = ARC_WAIT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -683,8 +659,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da int i, j; int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; @@ -706,8 +681,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da uint32_t flags = ARC_WAIT; objset_phys_t *osp; - err = arc_read_nolock(NULL, dp->dp_spa, bp, - arc_getbuf_func, bufp, + err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); if (err) { scn->scn_phys.scn_errors++; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Feb 27 19:22:27 2013 (r247407) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ #include @@ -97,6 +98,15 @@ int metaslab_prefetch_limit = SPA_DVAS_P int metaslab_smo_bonus_pct = 150; /* + * Should we be willing to write data to degraded vdevs? + */ +boolean_t zfs_write_to_degraded = B_FALSE; +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW, + &zfs_write_to_degraded, 0, + "Allow writing data to degraded vdevs"); +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); + +/* * ========================================================================== * Metaslab classes * ========================================================================== @@ -1383,10 +1393,13 @@ top: /* * Avoid writing single-copy data to a failing vdev + * unless the user instructs us that it is okay. */ if ((vd->vdev_stat.vs_write_errors > 0 || vd->vdev_state < VDEV_STATE_HEALTHY) && - d == 0 && dshift == 3) { + d == 0 && dshift == 3 && + !(zfs_write_to_degraded && vd->vdev_state == + VDEV_STATE_DEGRADED)) { all_zero = B_FALSE; goto next; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Wed Feb 27 19:22:27 2013 (r247407) @@ -553,6 +553,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ { int var_size = 0; int i; + int j = -1; int full_space; int hdrsize; boolean_t done = B_FALSE; @@ -574,11 +575,13 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ sizeof (sa_hdr_phys_t); full_space = (buftype == SA_BONUS) ? DN_MAX_BONUSLEN : db->db_size; + ASSERT(IS_P2ALIGNED(full_space, 8)); for (i = 0; i != attr_count; i++) { boolean_t is_var_sz; - *total += P2ROUNDUP(attr_desc[i].sa_length, 8); + *total = P2ROUNDUP(*total, 8); + *total += attr_desc[i].sa_length; if (done) goto next; @@ -590,7 +593,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ if (is_var_sz && var_size > 1) { if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) + *total < full_space) { + /* + * Account for header space used by array of + * optional sizes of variable-length attributes. + * Record the index in case this increase needs + * to be reversed due to spill-over. + */ hdrsize += sizeof (uint16_t); + j = i; } else { done = B_TRUE; *index = i; @@ -619,6 +629,14 @@ next: *will_spill = B_TRUE; } + /* + * j holds the index of the last variable-sized attribute for + * which hdrsize was increased. Reverse the increase if that + * attribute will be relocated to the spill block. + */ + if (*will_spill && j == *index) + hdrsize -= sizeof (uint16_t); + hdrsize = P2ROUNDUP(hdrsize, 8); return (hdrsize); } @@ -709,6 +727,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu for (i = 0, len_idx = 0, hash = -1ULL; i != attr_count; i++) { uint16_t length; + ASSERT(IS_P2ALIGNED(data_start, 8)); + ASSERT(IS_P2ALIGNED(buf_space, 8)); attrs[i] = attr_desc[i].sa_attr; length = SA_REGISTERED_LEN(sa, attrs[i]); if (length == 0) @@ -717,6 +737,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu VERIFY(length == attr_desc[i].sa_length); if (buf_space < length) { /* switch to spill buffer */ + VERIFY(spilling); VERIFY(bonustype == DMU_OT_SA); if (buftype == SA_BONUS && !sa->sa_force_spill) { sa_find_layout(hdl->sa_os, hash, attrs_start, 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 Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Feb 27 19:22:27 2013 (r247407) @@ -1764,7 +1764,7 @@ spa_load_verify_done(zio_t *zio) /*ARGSUSED*/ static int spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { if (bp != NULL) { zio_t *rio = arg; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Wed Feb 27 19:22:27 2013 (r247407) @@ -49,7 +49,6 @@ struct arc_buf { arc_buf_hdr_t *b_hdr; arc_buf_t *b_next; kmutex_t b_evict_lock; - krwlock_t b_data_lock; void *b_data; arc_evict_func_t *b_efunc; void *b_private; @@ -93,8 +92,6 @@ void arc_buf_add_ref(arc_buf_t *buf, voi int arc_buf_remove_ref(arc_buf_t *buf, void *tag); int arc_buf_size(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); -int arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa, - zbookmark_t *zb); int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); @@ -103,10 +100,7 @@ void arc_buf_thaw(arc_buf_t *buf); int arc_referenced(arc_buf_t *buf); #endif -int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *priv, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); -int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, +int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, void *priv, int priority, int flags, uint32_t *arc_flags, const zbookmark_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h Wed Feb 27 19:22:27 2013 (r247407) @@ -40,8 +40,7 @@ struct zilog; struct arc_buf; typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp, - void *arg); + const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg); #define TRAVERSE_PRE (1<<0) #define TRAVERSE_POST (1<<1) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Feb 27 19:22:27 2013 (r247407) @@ -134,12 +134,6 @@ void dsl_pool_willuse_space(dsl_pool_t * void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); -int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *priv, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); -int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *priv, int priority, int zio_flags, - uint32_t *arc_flags, const zbookmark_t *zb); void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h Wed Feb 27 19:22:27 2013 (r247407) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_REFCOUNT_H @@ -54,8 +55,8 @@ typedef struct refcount { kmutex_t rc_mtx; list_t rc_list; list_t rc_removed; - int64_t rc_count; - int64_t rc_removed_count; + uint64_t rc_count; + uint64_t rc_removed_count; } refcount_t; /* Note: refcount_t must be initialized with refcount_create() */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Feb 27 19:22:27 2013 (r247407) @@ -1328,7 +1328,8 @@ vdev_validate(vdev_t *vd, boolean_t stri if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { uint64_t aux_guid = 0; nvlist_t *nvl; - uint64_t txg = strict ? spa->spa_config_txg : -1ULL; + uint64_t txg = spa_last_synced_txg(spa) != 0 ? + spa_last_synced_txg(spa) : -1ULL; if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, @@ -1512,7 +1513,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd, spa_last_synced_txg(spa)); + (void) vdev_validate(vd, B_TRUE); } /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Feb 27 19:20:50 2013 (r247406) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Feb 27 19:22:27 2013 (r247407) @@ -106,12 +106,18 @@ typedef enum { DATASET_NAME } zfs_ioc_namecheck_t; +typedef enum { + POOL_CHECK_NONE = 1 << 0, + POOL_CHECK_SUSPENDED = 1 << 1, + POOL_CHECK_READONLY = 1 << 2 +} zfs_ioc_poolcheck_t; + typedef struct zfs_ioc_vec { zfs_ioc_func_t *zvec_func; zfs_secpolicy_func_t *zvec_secpolicy; zfs_ioc_namecheck_t zvec_namecheck; boolean_t zvec_his_log; - boolean_t zvec_pool_check; + zfs_ioc_poolcheck_t zvec_pool_check; } zfs_ioc_vec_t; /* This array is indexed by zfs_userquota_prop_t */ @@ -5033,138 +5039,155 @@ zfs_ioc_unjail(zfs_cmd_t *zc) static zfs_ioc_vec_t zfs_ioc_vec[] = { { zfs_ioc_pool_create, zfs_secpolicy_config, POOL_NAME, B_FALSE, - B_FALSE }, + POOL_CHECK_NONE }, { zfs_ioc_pool_destroy, zfs_secpolicy_config, POOL_NAME, B_FALSE, - B_FALSE }, + POOL_CHECK_NONE }, { zfs_ioc_pool_import, zfs_secpolicy_config, POOL_NAME, B_TRUE, - B_FALSE }, + POOL_CHECK_NONE }, { zfs_ioc_pool_export, zfs_secpolicy_config, POOL_NAME, B_FALSE, - B_FALSE }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 27 19:38:34 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A308293; Wed, 27 Feb 2013 19:38:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1449FC; Wed, 27 Feb 2013 19:38:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJcYS0076823; Wed, 27 Feb 2013 19:38:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJcYCC076821; Wed, 27 Feb 2013 19:38:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302271938.r1RJcYCC076821@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Feb 2013 19:38: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: r247409 - stable/8/usr.sbin/pciconf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 19:38:34 -0000 Author: jhb Date: Wed Feb 27 19:38:33 2013 New Revision: 247409 URL: http://svnweb.freebsd.org/changeset/base/247409 Log: MFC 240474: - Denote PCI-e endpoints that support FLR. - Make parsing of PCI-e extended capabilities assume that future version numbers are backwards compatible. - Add new AER error descriptions. - Add descriptions for more PCI-e extended capabilities. Modified: stable/8/usr.sbin/pciconf/cap.c stable/8/usr.sbin/pciconf/err.c Directory Properties: stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/8/usr.sbin/pciconf/cap.c ============================================================================== --- stable/8/usr.sbin/pciconf/cap.c Wed Feb 27 19:38:25 2013 (r247408) +++ stable/8/usr.sbin/pciconf/cap.c Wed Feb 27 19:38:33 2013 (r247409) @@ -428,6 +428,8 @@ cap_express(int fd, struct pci_conf *p, printf(" max data %d(%d)", MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5), MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD)); + if (val & PCIEM_CAP_FLR) + printf(" FLR"); val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4, @@ -587,7 +589,7 @@ ecap_aer(int fd, struct pci_conf *p, uin uint32_t sta, mask; printf("AER %d", ver); - if (ver != 1) + if (ver < 1) return; sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); @@ -603,7 +605,7 @@ ecap_vc(int fd, struct pci_conf *p, uint uint32_t cap1; printf("VC %d", ver); - if (ver != 1) + if (ver < 1) return; cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); @@ -618,7 +620,7 @@ ecap_sernum(int fd, struct pci_conf *p, uint32_t high, low; printf("Serial %d", ver); - if (ver != 1) + if (ver < 1) return; low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); @@ -626,10 +628,58 @@ ecap_sernum(int fd, struct pci_conf *p, } static void +ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) +{ + uint32_t val; + + printf("Vendor %d", ver); + if (ver < 1) + return; + val = read_config(fd, &p->pc_sel, ptr + 4, 4); + printf(" ID %d", val & 0xffff); +} + +static void +ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) +{ + uint32_t val; + + printf("PCIe Sec %d", ver); + if (ver < 1) + return; + val = read_config(fd, &p->pc_sel, ptr + 8, 4); + printf(" lane errors %#x", val); +} + +struct { + uint16_t id; + const char *name; +} ecap_names[] = { + { PCIZ_PWRBDGT, "Power Budgeting" }, + { PCIZ_RCLINK_DCL, "Root Complex Link Declaration" }, + { PCIZ_RCLINK_CTL, "Root Complex Internal Link Control" }, + { PCIZ_RCEC_ASSOC, "Root Complex Event Collector ASsociation" }, + { PCIZ_MFVC, "MFVC" }, + { PCIZ_RCRB, "RCRB" }, + { PCIZ_ACS, "ACS" }, + { PCIZ_ARI, "ARI" }, + { PCIZ_ATS, "ATS" }, + { PCIZ_SRIOV, "SRIOV" }, + { PCIZ_MULTICAST, "Multicast" }, + { PCIZ_RESIZE_BAR, "Resizable BAR" }, + { PCIZ_DPA, "DPA" }, + { PCIZ_TPH_REQ, "TPH Requester" }, + { PCIZ_LTR, "LTR" }, + { 0, NULL } +}; + +static void list_ecaps(int fd, struct pci_conf *p) { + const char *name; uint32_t ecap; uint16_t ptr; + int i; ptr = PCIR_EXTCAP; ecap = read_config(fd, &p->pc_sel, ptr, 4); @@ -647,8 +697,20 @@ list_ecaps(int fd, struct pci_conf *p) case PCIZ_SERNUM: ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap)); break; + case PCIZ_VENDOR: + ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap)); + break; + case PCIZ_SEC_PCIE: + ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap)); + break; default: - printf("unknown %d", PCI_EXTCAP_VER(ecap)); + name = "unknown"; + for (i = 0; ecap_names[i].name != NULL; i++) + if (ecap_names[i].id == PCI_EXTCAP_ID(ecap)) { + name = ecap_names[i].name; + break; + } + printf("%s %d", name, PCI_EXTCAP_VER(ecap)); break; } printf("\n"); Modified: stable/8/usr.sbin/pciconf/err.c ============================================================================== --- stable/8/usr.sbin/pciconf/err.c Wed Feb 27 19:38:25 2013 (r247408) +++ stable/8/usr.sbin/pciconf/err.c Wed Feb 27 19:38:33 2013 (r247409) @@ -91,6 +91,10 @@ static struct bit_table aer_uc[] = { { PCIM_AER_UC_ECRC_ERROR, "ECRC Error" }, { PCIM_AER_UC_UNSUPPORTED_REQUEST, "Unsupported Request" }, { PCIM_AER_UC_ACS_VIOLATION, "ACS Violation" }, + { PCIM_AER_UC_INTERNAL_ERROR, "Uncorrectable Internal Error" }, + { PCIM_AER_UC_MC_BLOCKED_TLP, "MC Blocked TLP" }, + { PCIM_AER_UC_ATOMIC_EGRESS_BLK, "AtomicOp Egress Blocked" }, + { PCIM_AER_UC_TLP_PREFIX_BLOCKED, "TLP Prefix Blocked Error" }, { 0, NULL }, }; @@ -102,6 +106,8 @@ static struct bit_table aer_cor[] = { { PCIM_AER_COR_REPLAY_ROLLOVER, "REPLAY_NUM Rollover" }, { PCIM_AER_COR_REPLAY_TIMEOUT, "Replay Timer Timeout" }, { PCIM_AER_COR_ADVISORY_NF_ERROR, "Advisory Non-Fatal Error" }, + { PCIM_AER_COR_INTERNAL_ERROR, "Corrected Internal Error" }, + { PCIM_AER_COR_HEADER_LOG_OVFLOW, "Header Log Overflow" }, { 0, NULL }, }; From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 27 21:03:19 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E95DD57A; Wed, 27 Feb 2013 21:03:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C25DEF2C; Wed, 27 Feb 2013 21:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RL3JoU003879; Wed, 27 Feb 2013 21:03:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RL3JwK003878; Wed, 27 Feb 2013 21:03:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302272103.r1RL3JwK003878@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Feb 2013 21:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247421 - stable/8/sys/dev/amr X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 21:03:20 -0000 Author: jhb Date: Wed Feb 27 21:03:19 2013 New Revision: 247421 URL: http://svnweb.freebsd.org/changeset/base/247421 Log: MFC 240692,241228: Adjust the ioctl workaround from r234501: - Ensure the native ioctl path always allocates a 4kb buffer if a request uses a buffer size of 0. - Rounding all small requests up to 32k swamped the controller causing firmware hangs. Instead, round requests smaller than 64k up to the next power of 2 as a general rule. To handle the one known special case of a command that accepts a 12k buffer returning a 24k-ish reply, round requests between 8k and 16k up to 32k rather than 16k. The result is that commands less than 8k should now be rounded up to a smaller size (either 4k or 8k) rather than 32k. Modified: stable/8/sys/dev/amr/amr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/amr/ (props changed) Modified: stable/8/sys/dev/amr/amr.c ============================================================================== --- stable/8/sys/dev/amr/amr.c Wed Feb 27 21:03:09 2013 (r247420) +++ stable/8/sys/dev/amr/amr.c Wed Feb 27 21:03:19 2013 (r247421) @@ -546,13 +546,19 @@ shutdown_out: * The amr(4) firmware relies on this feature. In fact, it assumes * the buffer is always a power of 2 up to a max of 64k. There is * also at least one case where it assumes a buffer less than 16k is - * greater than 16k. Force a minimum buffer size of 32k and round - * sizes between 32k and 64k up to 64k as a workaround. + * greater than 16k. However, forcing all buffers to a size of 32k + * causes stalls in the firmware. Force each command smaller than + * 64k up to the next power of two except that commands between 8k + * and 16k are rounded up to 32k instead of 16k. */ static unsigned long amr_ioctl_buffer_length(unsigned long len) { + if (len <= 4 * 1024) + return (4 * 1024); + if (len <= 8 * 1024) + return (8 * 1024); if (len <= 32 * 1024) return (32 * 1024); if (len <= 64 * 1024) @@ -859,11 +865,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, /* handle inbound data buffer */ real_length = amr_ioctl_buffer_length(au_length); + dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO); if (au_length != 0 && au_cmd[0] != 0x06) { - if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) { - error = ENOMEM; - goto out; - } if ((error = copyin(au_buffer, dp, au_length)) != 0) { free(dp, M_AMR); return (error); @@ -933,8 +936,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, error = copyout(dp, au_buffer, au_length); } debug(2, "copyout %ld bytes from %p -> %p", au_length, dp, au_buffer); - if (dp != NULL) - debug(2, "%p status 0x%x", dp, ac->ac_status); + debug(2, "%p status 0x%x", dp, ac->ac_status); *au_statusp = ac->ac_status; out: From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 00:22:05 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9AE9E7EC; Thu, 28 Feb 2013 00:22:05 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C770CB8; Thu, 28 Feb 2013 00:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S0M56C064519; Thu, 28 Feb 2013 00:22:05 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S0M4vm064514; Thu, 28 Feb 2013 00:22:04 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201302280022.r1S0M4vm064514@svn.freebsd.org> From: Jack F Vogel Date: Thu, 28 Feb 2013 00:22: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: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 00:22:05 -0000 Author: jfv Date: Thu Feb 28 00:22:04 2013 New Revision: 247430 URL: http://svnweb.freebsd.org/changeset/base/247430 Log: MFC of the E1000 drivers to STABLE/8, this includes the follow revisions plus a few tweaks: 196969,196970,211516,214646,215781,215789,215808,215910,223350, 223482,223831,228281,228393,229939,231796,232238,234665,235256, 236406,238148,238151,238214,238765,238770,238953,238981,239105, 239109,239304,240518,240693,240968,241037,241856,241885,243570, 243857,245334,246128,246482,247064 Added: stable/8/sys/dev/e1000/e1000_i210.c - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c stable/8/sys/dev/e1000/e1000_i210.h - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h Modified: stable/8/sys/conf/files stable/8/sys/dev/e1000/e1000_82541.c stable/8/sys/dev/e1000/e1000_82543.c stable/8/sys/dev/e1000/e1000_82571.c stable/8/sys/dev/e1000/e1000_82575.c stable/8/sys/dev/e1000/e1000_82575.h stable/8/sys/dev/e1000/e1000_api.c stable/8/sys/dev/e1000/e1000_api.h stable/8/sys/dev/e1000/e1000_defines.h stable/8/sys/dev/e1000/e1000_hw.h stable/8/sys/dev/e1000/e1000_ich8lan.c stable/8/sys/dev/e1000/e1000_ich8lan.h stable/8/sys/dev/e1000/e1000_mac.c stable/8/sys/dev/e1000/e1000_mac.h stable/8/sys/dev/e1000/e1000_manage.c stable/8/sys/dev/e1000/e1000_manage.h stable/8/sys/dev/e1000/e1000_nvm.c stable/8/sys/dev/e1000/e1000_nvm.h stable/8/sys/dev/e1000/e1000_osdep.h stable/8/sys/dev/e1000/e1000_phy.c stable/8/sys/dev/e1000/e1000_phy.h stable/8/sys/dev/e1000/e1000_regs.h stable/8/sys/dev/e1000/if_em.c (contents, props changed) stable/8/sys/dev/e1000/if_igb.c (contents, props changed) stable/8/sys/dev/e1000/if_igb.h stable/8/sys/dev/e1000/if_lem.c stable/8/sys/modules/em/Makefile stable/8/sys/modules/igb/Makefile Directory Properties: stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013 (r247429) +++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013 (r247430) @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_ich8lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_i210.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em | igb \ Modified: stable/8/sys/dev/e1000/e1000_82541.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:18:56 2013 (r247429) +++ stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:22:04 2013 (r247430) @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st * of MAC speed/duplex configuration. So we only need to * configure Collision Distance in the MAC. */ - e1000_config_collision_dist_generic(hw); + mac->ops.config_collision_dist(hw); /* * Configure Flow Control now that Auto-Neg has completed. Modified: stable/8/sys/dev/e1000/e1000_82543.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:18:56 2013 (r247429) +++ stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:22:04 2013 (r247430) @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 DEBUGOUT("Valid link established!!!\n"); /* Config the MAC and PHY after link is up */ if (hw->mac.type == e1000_82544) { - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); } else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( /* Take the link out of reset */ ctrl &= ~E1000_CTRL_LRST; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); ret_val = e1000_commit_fc_settings_generic(hw); if (ret_val) @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 * settings. */ if (mac->type == e1000_82544) - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) { @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 if (phy_data & M88E1000_PSSR_DPLX) ctrl |= E1000_CTRL_FD; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); /* * Set up speed in the Device Control register depending on Modified: stable/8/sys/dev/e1000/e1000_82571.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:18:56 2013 (r247429) +++ stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:22:04 2013 (r247430) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,8 +32,7 @@ ******************************************************************************/ /*$FreeBSD$*/ -/* - * 82571EB Gigabit Ethernet Controller +/* 82571EB Gigabit Ethernet Controller * 82571EB Gigabit Ethernet Controller (Copper) * 82571EB Gigabit Ethernet Controller (Fiber) * 82571EB Dual Port Gigabit Mezzanine Adapter @@ -51,9 +50,6 @@ #include "e1000_api.h" -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); static void e1000_release_nvm_82571(struct e1000_hw *hw); static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_init_phy_params_82571"); if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; - goto out; + return E1000_SUCCESS; } phy->addr = 1; @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574; break; default: - ret_val = -E1000_ERR_PHY; - goto out; + return -E1000_ERR_PHY; break; } @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s ret_val = e1000_get_phy_id_82571(hw); if (ret_val) { DEBUGOUT("Error getting PHY ID\n"); - goto out; + return ret_val; } /* Verify phy id */ @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s if (ret_val) DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); -out: return ret_val; } @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s if (((eecd >> 15) & 0x3) == 0x3) { nvm->type = e1000_nvm_flash_hw; nvm->word_size = 2048; - /* - * Autonomous Flash update bit must be cleared due + /* Autonomous Flash update bit must be cleared due * to Flash update issue. */ eecd &= ~E1000_EECD_AUPDEN; @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value + /* Added to a constant, "size" becomes the left-shift value * for setting word_size. */ size += NVM_WORD_SIZE_BASE_SHIFT; @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s /* FWSM register */ mac->has_fwsm = TRUE; - /* - * ARC supported; valid only if manageability features are + /* ARC supported; valid only if manageability features are * enabled. */ - mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & - E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & + E1000_FWSM_MODE_MASK); break; case e1000_82574: case e1000_82583: @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s break; } - /* - * Ensure that the inter-port SWSM.SMBI lock bit is clear before + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before * first NVM or PHY acess. This should be done for single-port * devices, and for one port only on dual-port devices so that * for those devices we can still use the SMBI lock to synchronize @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | E1000_SWSM2_LOCK); force_clear_smbi = TRUE; - } else + } else { force_clear_smbi = FALSE; + } break; default: force_clear_smbi = TRUE; @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); } - /* - * Initialze device specific counter of SMBI acquisition - * timeouts. - */ + /* Initialze device specific counter of SMBI acquisition timeouts. */ hw->dev_spec._82571.smb_counter = 0; return E1000_SUCCESS; @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_id = 0; DEBUGFUNC("e1000_get_phy_id_82571"); @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct switch (hw->mac.type) { case e1000_82571: case e1000_82572: - /* - * The 82571 firmware may still be configuring the PHY. + /* The 82571 firmware may still be configuring the PHY. * In this case, we cannot access the PHY until the * configuration is done. So we explicitly set the * PHY ID. @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct phy->id = IGP01E1000_I_PHY_ID; break; case e1000_82573: - ret_val = e1000_get_phy_id(hw); + return e1000_get_phy_id(hw); break; case e1000_82574: case e1000_82583: ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); if (ret_val) - goto out; + return ret_val; phy->id = (u32)(phy_id << 16); usec_delay(20); ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); if (ret_val) - goto out; + return ret_val; phy->id |= (u32)(phy_id); phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); break; default: - ret_val = -E1000_ERR_PHY; + return -E1000_ERR_PHY; break; } -out: - return ret_val; + + return E1000_SUCCESS; } /** @@ -528,15 +514,13 @@ out: static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; - s32 ret_val = E1000_SUCCESS; s32 sw_timeout = hw->nvm.word_size + 1; s32 fw_timeout = hw->nvm.word_size + 1; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore_82571"); - /* - * If we have timedout 3 times on trying to acquire + /* If we have timedout 3 times on trying to acquire * the inter-port SMBI semaphore, there is old code * operating on the other port, and it is not * releasing SMBI. Modify the number of times that @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( /* Release semaphores */ e1000_put_hw_semaphore_82571(hw); DEBUGOUT("Driver can't access the NVM\n"); - ret_val = -E1000_ERR_NVM; - goto out; + return -E1000_ERR_NVM; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) { u32 extcnf_ctrl; - s32 ret_val = E1000_SUCCESS; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore_82573"); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; do { + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) break; - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; - msec_delay(2); i++; } while (i < MDIO_OWNERSHIP_TIMEOUT); @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( /* Release semaphores */ e1000_put_hw_semaphore_82573(hw); DEBUGOUT("Driver can't access the PHY\n"); - ret_val = -E1000_ERR_PHY; - goto out; + return -E1000_ERR_PHY; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 **/ static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) { - u16 data = E1000_READ_REG(hw, E1000_POEMB); + u32 data = E1000_READ_REG(hw, E1000_POEMB); DEBUGFUNC("e1000_set_d0_lplu_state_82574"); @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 **/ static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active) { - u16 data = E1000_READ_REG(hw, E1000_POEMB); + u32 data = E1000_READ_REG(hw, E1000_POEMB); DEBUGFUNC("e1000_set_d3_lplu_state_82574"); @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc ret_val = e1000_get_hw_semaphore_82571(hw); if (ret_val) - goto out; + return ret_val; switch (hw->mac.type) { case e1000_82573: @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc if (ret_val) e1000_put_hw_semaphore_82571(hw); -out: return ret_val; } @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_write_nvm_82571"); @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 ret_val = e1000_update_nvm_checksum_generic(hw); if (ret_val) - goto out; + return ret_val; - /* - * If our nvm is an EEPROM, then we're done + /* If our nvm is an EEPROM, then we're done * otherwise, commit the checksum to the flash NVM. */ if (hw->nvm.type != e1000_nvm_flash_hw) - goto out; + return E1000_SUCCESS; /* Check for pending operations. */ for (i = 0; i < E1000_FLASH_UPDATES; i++) { msec_delay(1); - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) break; } - if (i == E1000_FLASH_UPDATES) { - ret_val = -E1000_ERR_NVM; - goto out; - } + if (i == E1000_FLASH_UPDATES) + return -E1000_ERR_NVM; /* Reset the firmware if using STM opcode. */ if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) { - /* - * The enabling of and the actual reset must be done + /* The enabling of and the actual reset must be done * in two write cycles. */ E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE); @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 for (i = 0; i < E1000_FLASH_UPDATES; i++) { msec_delay(1); - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) break; } - if (i == E1000_FLASH_UPDATES) { - ret_val = -E1000_ERR_NVM; - goto out; - } + if (i == E1000_FLASH_UPDATES) + return -E1000_ERR_NVM; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st { struct e1000_nvm_info *nvm = &hw->nvm; u32 i, eewr = 0; - s32 ret_val = 0; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_write_nvm_eewr_82571"); - /* - * A check for invalid values: offset too large, too many words, + /* A check for invalid values: offset too large, too many words, * and not enough words. */ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || (words == 0)) { DEBUGOUT("nvm parameter(s) out of bounds\n"); - ret_val = -E1000_ERR_NVM; - goto out; + return -E1000_ERR_NVM; } for (i = 0; i < words; i++) { @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st break; } -out: return ret_val; } @@ -988,7 +954,6 @@ out: static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) { s32 timeout = PHY_CFG_TIMEOUT; - s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_get_cfg_done_82571"); @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru } if (!timeout) { DEBUGOUT("MNG configuration cycle has not completed.\n"); - ret_val = -E1000_ERR_RESET; - goto out; + return -E1000_ERR_RESET; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1023,39 +986,40 @@ out: static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 data; DEBUGFUNC("e1000_set_d0_lplu_state_82571"); if (!(phy->ops.read_reg)) - goto out; + return E1000_SUCCESS; ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); if (ret_val) - goto out; + return ret_val; if (active) { data |= IGP02E1000_PM_D0_LPLU; ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, data); if (ret_val) - goto out; + return ret_val; /* When LPLU is enabled, we should disable SmartSpeed */ ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &data); + if (ret_val) + return ret_val; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } else { data &= ~IGP02E1000_PM_D0_LPLU; ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, data); - /* - * LPLU and SmartSpeed are mutually exclusive. LPLU is used + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used * during Dx states where the power conservation is most * important. During driver activity we should enable * SmartSpeed, so performance is maintained. @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 IGP01E1000_PHY_PORT_CONFIG, &data); if (ret_val) - goto out; + return ret_val; data |= IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } else if (phy->smart_speed == e1000_smart_speed_off) { ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &data); if (ret_val) - goto out; + return ret_val; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, data); if (ret_val) - goto out; + return ret_val; } } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1101,13 +1064,12 @@ out: **/ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) { - u32 ctrl, ctrl_ext; + u32 ctrl, ctrl_ext, eecd, tctl; s32 ret_val; DEBUGFUNC("e1000_reset_hw_82571"); - /* - * Prevent the PCI-E bus from sticking if there is no TLP connection + /* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ ret_val = e1000_disable_pcie_master_generic(hw); @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); E1000_WRITE_REG(hw, E1000_RCTL, 0); - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); + tctl = E1000_READ_REG(hw, E1000_TCTL); + tctl &= ~E1000_TCTL_EN; + E1000_WRITE_REG(hw, E1000_TCTL, tctl); E1000_WRITE_FLUSH(hw); msec_delay(10); - /* - * Must acquire the MDIO ownership before MAC reset. + /* Must acquire the MDIO ownership before MAC reset. * Ownership defaults to firmware after a reset. */ switch (hw->mac.type) { @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) /* We don't want to continue accessing MAC registers. */ - goto out; + return ret_val; - /* - * Phy configuration from NVM just starts after EECD_AUTO_RD is set. + /* Phy configuration from NVM just starts after EECD_AUTO_RD is set. * Need to wait for Phy configuration completion before accessing * NVM and Phy. */ switch (hw->mac.type) { + case e1000_82571: + case e1000_82572: + /* REQ and GNT bits need to be cleared when using AUTO_RD + * to access the EEPROM. + */ + eecd = E1000_READ_REG(hw, E1000_EECD); + eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT); + E1000_WRITE_REG(hw, E1000_EECD, eecd); + break; case e1000_82573: case e1000_82574: case e1000_82583: @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e /* Install any alternate MAC address into RAR0 */ ret_val = e1000_check_alt_mac_addr_generic(hw); if (ret_val) - goto out; + return ret_val; e1000_set_laa_state_82571(hw, TRUE); } @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e if (hw->phy.media_type == e1000_media_type_internal_serdes) hw->mac.serdes_link_state = e1000_serdes_link_down; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); + /* An error is not fatal and we should not stop init due to this */ if (ret_val) DEBUGOUT("Error initializing identification LED\n"); - /* This is not fatal and we should not stop init due to this */ /* Disabling VLAN filtering */ DEBUGOUT("Initializing the IEEE VLAN\n"); mac->ops.clear_vfta(hw); - /* Setup the receive address. */ - /* + /* Setup the receive address. * If, however, a locally administered address was assigned to the * 82571, we must reserve a RAR for it to work around an issue where * resetting one port will reload the MAC on the other port. @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 break; } - /* - * Clear all of the statistics registers (clear on read). It is + /* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link. @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); } - /* - * Workaround for hardware errata. + /* Workaround for hardware errata. * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 */ if ((hw->mac.type == e1000_82571) || @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); } + /* Disable IPv6 extension header parsing because some malformed + * IPv6 headers can hang the Rx. + */ + if (hw->mac.type <= e1000_82573) { + reg = E1000_READ_REG(hw, E1000_RFCTL); + reg |= (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS); + E1000_WRITE_REG(hw, E1000_RFCTL, reg); + } + /* PCI-Ex Control Registers */ switch (hw->mac.type) { case e1000_82574: @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 reg |= (1 << 22); E1000_WRITE_REG(hw, E1000_GCR, reg); - /* - * Workaround for hardware errata. + /* Workaround for hardware errata. * apply workaround for hardware errata documented in errata * docs Fixes issue where some error prone or unreliable PCIe * completions are occurring, particularly with ASPM enabled. @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc case e1000_82574: case e1000_82583: if (hw->mng_cookie.vlan_id != 0) { - /* - * The VFTA is a 4096b bit-field, each identifying + /* The VFTA is a 4096b bit-field, each identifying * a single VLAN ID. The following operations * determine which 32b entry (i.e. offset) into the * array we want to set the VLAN ID (i.e. bit) of * the manageability unit. */ vfta_offset = (hw->mng_cookie.vlan_id >> - E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; - vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); + E1000_VFTA_ENTRY_SHIFT) & + E1000_VFTA_ENTRY_MASK; + vfta_bit_in_reg = + 1 << (hw->mng_cookie.vlan_id & + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); } break; default: break; } for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { - /* - * If the offset we want to clear is the same offset of the + /* If the offset we want to clear is the same offset of the * manageability VLAN ID, then clear all bits except that of * the manageability unit. */ @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 ctrl = hw->mac.ledctl_mode2; if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { - /* - * If no link, then turn LED on by setting the invert bit + /* If no link, then turn LED on by setting the invert bit * for each LED that's "on" (0x0E) in ledctl_mode2. */ for (i = 0; i < 4; i++) @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ { u16 status_1kbt = 0; u16 receive_errors = 0; - bool phy_hung = FALSE; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_check_phy_82574"); - /* - * Read PHY Receive Error counter first, if its is max - all F's then + /* Read PHY Receive Error counter first, if its is max - all F's then * read the Base1000T status register If both are max then PHY is hung. */ ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); if (ret_val) - goto out; + return FALSE; if (receive_errors == E1000_RECEIVE_ERROR_MAX) { ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, &status_1kbt); if (ret_val) - goto out; + return FALSE; if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == E1000_IDLE_ERROR_COUNT_MASK) - phy_hung = TRUE; + return TRUE; } -out: - return phy_hung; + + return FALSE; } @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct { DEBUGFUNC("e1000_setup_link_82571"); - /* - * 82573 does not have a word in the NVM to determine + /* 82573 does not have a word in the NVM to determine * the default flow control setting, so we explicitly * set it to full. */ @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 ret_val = e1000_copper_link_setup_igp(hw); break; default: - ret_val = -E1000_ERR_PHY; + return -E1000_ERR_PHY; break; } if (ret_val) - goto out; - - ret_val = e1000_setup_copper_link_generic(hw); + return ret_val; -out: - return ret_val; + return e1000_setup_copper_link_generic(hw); } /** @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link switch (hw->mac.type) { case e1000_82571: case e1000_82572: - /* - * If SerDes loopback mode is entered, there is no form + /* If SerDes loopback mode is entered, there is no form * of reset to take the adapter out of that mode. So we * have to explicitly take the adapter out of loopback * mode. This prevents drivers from twiddling their thumbs @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 ctrl = E1000_READ_REG(hw, E1000_CTRL); status = E1000_READ_REG(hw, E1000_STATUS); + E1000_READ_REG(hw, E1000_RXCW); + /* SYNCH bit and IV bit are sticky */ + usec_delay(10); rxcw = E1000_READ_REG(hw, E1000_RXCW); if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { - /* Receiver is synchronized with no invalid bits. */ switch (mac->serdes_link_state) { case e1000_serdes_link_autoneg_complete: if (!(status & E1000_STATUS_LU)) { - /* - * We have lost link, retry autoneg before + /* We have lost link, retry autoneg before * reporting link failure */ mac->serdes_link_state = @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 break; case e1000_serdes_link_forced_up: - /* - * If we are receiving /C/ ordered sets, re-enable + /* If we are receiving /C/ ordered sets, re-enable * auto-negotiation in the TXCW register and disable * forced link in the Device Control register in an * attempt to auto-negotiate with our link partner. - * If the partner code word is null, stop forcing - * and restart auto negotiation. */ - if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { + if (rxcw & E1000_RXCW_C) { /* Enable autoneg, and unforce link up */ E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); E1000_WRITE_REG(hw, E1000_CTRL, @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 case e1000_serdes_link_autoneg_progress: if (rxcw & E1000_RXCW_C) { - /* - * We received /C/ ordered sets, meaning the + /* We received /C/ ordered sets, meaning the * link partner has autonegotiated, and we can * trust the Link Up (LU) status bit. */ @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 DEBUGOUT("AN_PROG -> DOWN\n"); } } else { - /* - * The link partner did not autoneg. + /* The link partner did not autoneg. * Force link up and full duplex, and change * state to forced. */ @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 case e1000_serdes_link_down: default: - /* - * The link was down but the receiver has now gained + /* The link was down but the receiver has now gained * valid sync, so lets see if we can bring the link * up. */ @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 mac->serdes_link_state = e1000_serdes_link_down; DEBUGOUT("ANYSTATE -> DOWN\n"); } else { - /* - * Check several times, if Sync and Config - * both are consistently 1 then simply ignore - * the Invalid bit and restart Autoneg + /* Check several times, if SYNCH bit and CONFIG + * bit both are consistently 1 then simply ignore + * the IV bit and restart Autoneg */ for (i = 0; i < AN_RETRY_COUNT; i++) { usec_delay(10); rxcw = E1000_READ_REG(hw, E1000_RXCW); - if ((rxcw & E1000_RXCW_IV) && - !((rxcw & E1000_RXCW_SYNCH) && - (rxcw & E1000_RXCW_C))) { + if ((rxcw & E1000_RXCW_SYNCH) && + (rxcw & E1000_RXCW_C)) + continue; + + if (rxcw & E1000_RXCW_IV) { mac->serdes_has_link = FALSE; mac->serdes_link_state = e1000_serdes_link_down; @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); if (ret_val) { DEBUGOUT("NVM Read Error\n"); - goto out; + return ret_val; } switch (hw->mac.type) { @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 break; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 /* If workaround is activated... */ if (state) - /* - * Hold a copy of the LAA in RAR[14] This is done so that + /* Hold a copy of the LAA in RAR[14] This is done so that * between the time RAR[0] gets clobbered and the time it * gets fixed, the actual LAA is in one of the RARs and no * incoming packets directed to this port are dropped. * Eventually the LAA will be in RAR[0] and RAR[14]. */ - e1000_rar_set_generic(hw, hw->mac.addr, - hw->mac.rar_entry_count - 1); + hw->mac.ops.rar_set(hw, hw->mac.addr, + hw->mac.rar_entry_count - 1); return; } @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) { struct e1000_nvm_info *nvm = &hw->nvm; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 data; DEBUGFUNC("e1000_fix_nvm_checksum_82571"); if (nvm->type != e1000_nvm_flash_hw) - goto out; + return E1000_SUCCESS; - /* - * Check bit 4 of word 10h. If it is 0, firmware is done updating + /* Check bit 4 of word 10h. If it is 0, firmware is done updating * 10h-12h. Checksum may need to be fixed. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 02:23:45 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EBD267EB; Thu, 28 Feb 2013 02:23:44 +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 7F81D245; Thu, 28 Feb 2013 02:23:44 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (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 1117B23F645; Wed, 27 Feb 2013 21:23:35 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.8.0 onyx.glenbarber.us 1117B23F645 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 27 Feb 2013 21:23:33 -0500 From: Glen Barber To: Jack F Vogel Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb Message-ID: <20130228022333.GC70215@glenbarber.us> References: <201302280022.r1S0M4vm064514@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: <201302280022.r1S0M4vm064514@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 02:23:45 -0000 --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jack, This commit seems to break the build for at least powerpc and sparc64. Glen On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote: > Author: jfv > Date: Thu Feb 28 00:22:04 2013 > New Revision: 247430 > URL: http://svnweb.freebsd.org/changeset/base/247430 >=20 > Log: > MFC of the E1000 drivers to STABLE/8, this includes the follow revisions > plus a few tweaks: > 196969,196970,211516,214646,215781,215789,215808,215910,223350, > 223482,223831,228281,228393,229939,231796,232238,234665,235256, > 236406,238148,238151,238214,238765,238770,238953,238981,239105, > 239109,239304,240518,240693,240968,241037,241856,241885,243570, > 243857,245334,246128,246482,247064 >=20 > Added: > stable/8/sys/dev/e1000/e1000_i210.c > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c > stable/8/sys/dev/e1000/e1000_i210.h > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h > Modified: > stable/8/sys/conf/files > stable/8/sys/dev/e1000/e1000_82541.c > stable/8/sys/dev/e1000/e1000_82543.c > stable/8/sys/dev/e1000/e1000_82571.c > stable/8/sys/dev/e1000/e1000_82575.c > stable/8/sys/dev/e1000/e1000_82575.h > stable/8/sys/dev/e1000/e1000_api.c > stable/8/sys/dev/e1000/e1000_api.h > stable/8/sys/dev/e1000/e1000_defines.h > stable/8/sys/dev/e1000/e1000_hw.h > stable/8/sys/dev/e1000/e1000_ich8lan.c > stable/8/sys/dev/e1000/e1000_ich8lan.h > stable/8/sys/dev/e1000/e1000_mac.c > stable/8/sys/dev/e1000/e1000_mac.h > stable/8/sys/dev/e1000/e1000_manage.c > stable/8/sys/dev/e1000/e1000_manage.h > stable/8/sys/dev/e1000/e1000_nvm.c > stable/8/sys/dev/e1000/e1000_nvm.h > stable/8/sys/dev/e1000/e1000_osdep.h > stable/8/sys/dev/e1000/e1000_phy.c > stable/8/sys/dev/e1000/e1000_phy.h > stable/8/sys/dev/e1000/e1000_regs.h > stable/8/sys/dev/e1000/if_em.c (contents, props changed) > stable/8/sys/dev/e1000/if_igb.c (contents, props changed) > stable/8/sys/dev/e1000/if_igb.h > stable/8/sys/dev/e1000/if_lem.c > stable/8/sys/modules/em/Makefile > stable/8/sys/modules/igb/Makefile > Directory Properties: > stable/8/sys/dev/e1000/ (props changed) >=20 > Modified: stable/8/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013 (r247429) > +++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013 (r247430) > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i > compile-with "${NORMAL_C} -I$S/dev/e1000" > dev/e1000/e1000_ich8lan.c optional em | igb \ > compile-with "${NORMAL_C} -I$S/dev/e1000" > +dev/e1000/e1000_i210.c optional em | igb \ > + compile-with "${NORMAL_C} -I$S/dev/e1000" > dev/e1000/e1000_api.c optional em | igb \ > compile-with "${NORMAL_C} -I$S/dev/e1000" > dev/e1000/e1000_mac.c optional em | igb \ >=20 > Modified: stable/8/sys/dev/e1000/e1000_82541.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:18:56 2013 (r24742= 9) > +++ stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:22:04 2013 (r24743= 0) > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st > * of MAC speed/duplex configuration. So we only need to > * configure Collision Distance in the MAC. > */ > - e1000_config_collision_dist_generic(hw); > + mac->ops.config_collision_dist(hw); > =20 > /* > * Configure Flow Control now that Auto-Neg has completed. >=20 > Modified: stable/8/sys/dev/e1000/e1000_82543.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:18:56 2013 (r24742= 9) > +++ stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:22:04 2013 (r24743= 0) > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 > DEBUGOUT("Valid link established!!!\n"); > /* Config the MAC and PHY after link is up */ > if (hw->mac.type =3D=3D e1000_82544) { > - e1000_config_collision_dist_generic(hw); > + hw->mac.ops.config_collision_dist(hw); > } else { > ret_val =3D e1000_config_mac_to_phy_82543(hw); > if (ret_val) > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( > /* Take the link out of reset */ > ctrl &=3D ~E1000_CTRL_LRST; > =20 > - e1000_config_collision_dist_generic(hw); > + hw->mac.ops.config_collision_dist(hw); > =20 > ret_val =3D e1000_commit_fc_settings_generic(hw); > if (ret_val) > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 > * settings. > */ > if (mac->type =3D=3D e1000_82544) > - e1000_config_collision_dist_generic(hw); > + hw->mac.ops.config_collision_dist(hw); > else { > ret_val =3D e1000_config_mac_to_phy_82543(hw); > if (ret_val) { > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 > if (phy_data & M88E1000_PSSR_DPLX) > ctrl |=3D E1000_CTRL_FD; > =20 > - e1000_config_collision_dist_generic(hw); > + hw->mac.ops.config_collision_dist(hw); > =20 > /* > * Set up speed in the Device Control register depending on >=20 > Modified: stable/8/sys/dev/e1000/e1000_82571.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:18:56 2013 (r24742= 9) > +++ stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:22:04 2013 (r24743= 0) > @@ -1,6 +1,6 @@ > /***********************************************************************= ******* > =20 > - Copyright (c) 2001-2011, Intel Corporation=20 > + Copyright (c) 2001-2013, Intel Corporation=20 > All rights reserved. > =20 > Redistribution and use in source and binary forms, with or without=20 > @@ -32,8 +32,7 @@ > ************************************************************************= ******/ > /*$FreeBSD$*/ > =20 > -/* > - * 82571EB Gigabit Ethernet Controller > +/* 82571EB Gigabit Ethernet Controller > * 82571EB Gigabit Ethernet Controller (Copper) > * 82571EB Gigabit Ethernet Controller (Fiber) > * 82571EB Dual Port Gigabit Mezzanine Adapter > @@ -51,9 +50,6 @@ > =20 > #include "e1000_api.h" > =20 > -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); > -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); > -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); > static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); > static void e1000_release_nvm_82571(struct e1000_hw *hw); > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, > @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); > static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); > -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); > static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); > static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); > static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ > static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) > { > struct e1000_phy_info *phy =3D &hw->phy; > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > =20 > DEBUGFUNC("e1000_init_phy_params_82571"); > =20 > if (hw->phy.media_type !=3D e1000_media_type_copper) { > phy->type =3D e1000_phy_none; > - goto out; > + return E1000_SUCCESS; > } > =20 > phy->addr =3D 1; > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s > phy->ops.set_d3_lplu_state =3D e1000_set_d3_lplu_state_82574; > break; > default: > - ret_val =3D -E1000_ERR_PHY; > - goto out; > + return -E1000_ERR_PHY; > break; > } > =20 > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s > ret_val =3D e1000_get_phy_id_82571(hw); > if (ret_val) { > DEBUGOUT("Error getting PHY ID\n"); > - goto out; > + return ret_val; > } > =20 > /* Verify phy id */ > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s > if (ret_val) > DEBUGOUT1("PHY ID unknown: type =3D 0x%08x\n", phy->id); > =20 > -out: > return ret_val; > } > =20 > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s > if (((eecd >> 15) & 0x3) =3D=3D 0x3) { > nvm->type =3D e1000_nvm_flash_hw; > nvm->word_size =3D 2048; > - /* > - * Autonomous Flash update bit must be cleared due > + /* Autonomous Flash update bit must be cleared due > * to Flash update issue. > */ > eecd &=3D ~E1000_EECD_AUPDEN; > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s > nvm->type =3D e1000_nvm_eeprom_spi; > size =3D (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> > E1000_EECD_SIZE_EX_SHIFT); > - /* > - * Added to a constant, "size" becomes the left-shift value > + /* Added to a constant, "size" becomes the left-shift value > * for setting word_size. > */ > size +=3D NVM_WORD_SIZE_BASE_SHIFT; > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s > =20 > /* FWSM register */ > mac->has_fwsm =3D TRUE; > - /* > - * ARC supported; valid only if manageability features are > + /* ARC supported; valid only if manageability features are > * enabled. > */ > - mac->arc_subsystem_valid =3D (E1000_READ_REG(hw, E1000_FWSM) & > - E1000_FWSM_MODE_MASK) ? TRUE : FALSE; > + mac->arc_subsystem_valid =3D !!(E1000_READ_REG(hw, E1000_FWSM) & > + E1000_FWSM_MODE_MASK); > break; > case e1000_82574: > case e1000_82583: > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s > break; > } > =20 > - /* > - * Ensure that the inter-port SWSM.SMBI lock bit is clear before > + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before > * first NVM or PHY acess. This should be done for single-port > * devices, and for one port only on dual-port devices so that > * for those devices we can still use the SMBI lock to synchronize > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s > E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | > E1000_SWSM2_LOCK); > force_clear_smbi =3D TRUE; > - } else > + } else { > force_clear_smbi =3D FALSE; > + } > break; > default: > force_clear_smbi =3D TRUE; > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s > E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); > } > =20 > - /* > - * Initialze device specific counter of SMBI acquisition > - * timeouts. > - */ > + /* Initialze device specific counter of SMBI acquisition timeouts. */ > hw->dev_spec._82571.smb_counter =3D 0; > =20 > return E1000_SUCCESS; > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) > { > struct e1000_phy_info *phy =3D &hw->phy; > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > u16 phy_id =3D 0; > =20 > DEBUGFUNC("e1000_get_phy_id_82571"); > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct > switch (hw->mac.type) { > case e1000_82571: > case e1000_82572: > - /* > - * The 82571 firmware may still be configuring the PHY. > + /* The 82571 firmware may still be configuring the PHY. > * In this case, we cannot access the PHY until the > * configuration is done. So we explicitly set the > * PHY ID. > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct > phy->id =3D IGP01E1000_I_PHY_ID; > break; > case e1000_82573: > - ret_val =3D e1000_get_phy_id(hw); > + return e1000_get_phy_id(hw); > break; > case e1000_82574: > case e1000_82583: > ret_val =3D phy->ops.read_reg(hw, PHY_ID1, &phy_id); > if (ret_val) > - goto out; > + return ret_val; > =20 > phy->id =3D (u32)(phy_id << 16); > usec_delay(20); > ret_val =3D phy->ops.read_reg(hw, PHY_ID2, &phy_id); > if (ret_val) > - goto out; > + return ret_val; > =20 > phy->id |=3D (u32)(phy_id); > phy->revision =3D (u32)(phy_id & ~PHY_REVISION_MASK); > break; > default: > - ret_val =3D -E1000_ERR_PHY; > + return -E1000_ERR_PHY; > break; > } > -out: > - return ret_val; > + > + return E1000_SUCCESS; > } > =20 > /** > @@ -528,15 +514,13 @@ out: > static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) > { > u32 swsm; > - s32 ret_val =3D E1000_SUCCESS; > s32 sw_timeout =3D hw->nvm.word_size + 1; > s32 fw_timeout =3D hw->nvm.word_size + 1; > s32 i =3D 0; > =20 > DEBUGFUNC("e1000_get_hw_semaphore_82571"); > =20 > - /* > - * If we have timedout 3 times on trying to acquire > + /* If we have timedout 3 times on trying to acquire > * the inter-port SMBI semaphore, there is old code > * operating on the other port, and it is not > * releasing SMBI. Modify the number of times that > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( > /* Release semaphores */ > e1000_put_hw_semaphore_82571(hw); > DEBUGOUT("Driver can't access the NVM\n"); > - ret_val =3D -E1000_ERR_NVM; > - goto out; > + return -E1000_ERR_NVM; > } > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 > static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) > { > u32 extcnf_ctrl; > - s32 ret_val =3D E1000_SUCCESS; > s32 i =3D 0; > =20 > DEBUGFUNC("e1000_get_hw_semaphore_82573"); > =20 > extcnf_ctrl =3D E1000_READ_REG(hw, E1000_EXTCNF_CTRL); > - extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > do { > + extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); > extcnf_ctrl =3D E1000_READ_REG(hw, E1000_EXTCNF_CTRL); > =20 > if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) > break; > =20 > - extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > - > msec_delay(2); > i++; > } while (i < MDIO_OWNERSHIP_TIMEOUT); > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( > /* Release semaphores */ > e1000_put_hw_semaphore_82573(hw); > DEBUGOUT("Driver can't access the PHY\n"); > - ret_val =3D -E1000_ERR_PHY; > - goto out; > + return -E1000_ERR_PHY; > } > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 > **/ > static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool activ= e) > { > - u16 data =3D E1000_READ_REG(hw, E1000_POEMB); > + u32 data =3D E1000_READ_REG(hw, E1000_POEMB); > =20 > DEBUGFUNC("e1000_set_d0_lplu_state_82574"); > =20 > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 > **/ > static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool activ= e) > { > - u16 data =3D E1000_READ_REG(hw, E1000_POEMB); > + u32 data =3D E1000_READ_REG(hw, E1000_POEMB); > =20 > DEBUGFUNC("e1000_set_d3_lplu_state_82574"); > =20 > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc > =20 > ret_val =3D e1000_get_hw_semaphore_82571(hw); > if (ret_val) > - goto out; > + return ret_val; > =20 > switch (hw->mac.type) { > case e1000_82573: > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc > if (ret_val) > e1000_put_hw_semaphore_82571(hw); > =20 > -out: > return ret_val; > } > =20 > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 wo= rds, > u16 *data) > { > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > =20 > DEBUGFUNC("e1000_write_nvm_82571"); > =20 > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 > =20 > ret_val =3D e1000_update_nvm_checksum_generic(hw); > if (ret_val) > - goto out; > + return ret_val; > =20 > - /* > - * If our nvm is an EEPROM, then we're done > + /* If our nvm is an EEPROM, then we're done > * otherwise, commit the checksum to the flash NVM. > */ > if (hw->nvm.type !=3D e1000_nvm_flash_hw) > - goto out; > + return E1000_SUCCESS; > =20 > /* Check for pending operations. */ > for (i =3D 0; i < E1000_FLASH_UPDATES; i++) { > msec_delay(1); > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) =3D=3D 0) > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) > break; > } > =20 > - if (i =3D=3D E1000_FLASH_UPDATES) { > - ret_val =3D -E1000_ERR_NVM; > - goto out; > - } > + if (i =3D=3D E1000_FLASH_UPDATES) > + return -E1000_ERR_NVM; > =20 > /* Reset the firmware if using STM opcode. */ > if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) =3D=3D E1000_STM_OPCODE) { > - /* > - * The enabling of and the actual reset must be done > + /* The enabling of and the actual reset must be done > * in two write cycles. > */ > E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE); > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 > =20 > for (i =3D 0; i < E1000_FLASH_UPDATES; i++) { > msec_delay(1); > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) =3D=3D 0) > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) > break; > } > =20 > - if (i =3D=3D E1000_FLASH_UPDATES) { > - ret_val =3D -E1000_ERR_NVM; > - goto out; > - } > + if (i =3D=3D E1000_FLASH_UPDATES) > + return -E1000_ERR_NVM; > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st > { > struct e1000_nvm_info *nvm =3D &hw->nvm; > u32 i, eewr =3D 0; > - s32 ret_val =3D 0; > + s32 ret_val =3D E1000_SUCCESS; > =20 > DEBUGFUNC("e1000_write_nvm_eewr_82571"); > =20 > - /* > - * A check for invalid values: offset too large, too many words, > + /* A check for invalid values: offset too large, too many words, > * and not enough words. > */ > if ((offset >=3D nvm->word_size) || (words > (nvm->word_size - offset))= || > (words =3D=3D 0)) { > DEBUGOUT("nvm parameter(s) out of bounds\n"); > - ret_val =3D -E1000_ERR_NVM; > - goto out; > + return -E1000_ERR_NVM; > } > =20 > for (i =3D 0; i < words; i++) { > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st > break; > } > =20 > -out: > return ret_val; > } > =20 > @@ -988,7 +954,6 @@ out: > static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) > { > s32 timeout =3D PHY_CFG_TIMEOUT; > - s32 ret_val =3D E1000_SUCCESS; > =20 > DEBUGFUNC("e1000_get_cfg_done_82571"); > =20 > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru > } > if (!timeout) { > DEBUGOUT("MNG configuration cycle has not completed.\n"); > - ret_val =3D -E1000_ERR_RESET; > - goto out; > + return -E1000_ERR_RESET; > } > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -1023,39 +986,40 @@ out: > static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool activ= e) > { > struct e1000_phy_info *phy =3D &hw->phy; > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > u16 data; > =20 > DEBUGFUNC("e1000_set_d0_lplu_state_82571"); > =20 > if (!(phy->ops.read_reg)) > - goto out; > + return E1000_SUCCESS; > =20 > ret_val =3D phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); > if (ret_val) > - goto out; > + return ret_val; > =20 > if (active) { > data |=3D IGP02E1000_PM_D0_LPLU; > ret_val =3D phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, > data); > if (ret_val) > - goto out; > + return ret_val; > =20 > /* When LPLU is enabled, we should disable SmartSpeed */ > ret_val =3D phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, > &data); > + if (ret_val) > + return ret_val; > data &=3D ~IGP01E1000_PSCFR_SMART_SPEED; > ret_val =3D phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, > data); > if (ret_val) > - goto out; > + return ret_val; > } else { > data &=3D ~IGP02E1000_PM_D0_LPLU; > ret_val =3D phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, > data); > - /* > - * LPLU and SmartSpeed are mutually exclusive. LPLU is used > + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used > * during Dx states where the power conservation is most > * important. During driver activity we should enable > * SmartSpeed, so performance is maintained. > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 > IGP01E1000_PHY_PORT_CONFIG, > &data); > if (ret_val) > - goto out; > + return ret_val; > =20 > data |=3D IGP01E1000_PSCFR_SMART_SPEED; > ret_val =3D phy->ops.write_reg(hw, > IGP01E1000_PHY_PORT_CONFIG, > data); > if (ret_val) > - goto out; > + return ret_val; > } else if (phy->smart_speed =3D=3D e1000_smart_speed_off) { > ret_val =3D phy->ops.read_reg(hw, > IGP01E1000_PHY_PORT_CONFIG, > &data); > if (ret_val) > - goto out; > + return ret_val; > =20 > data &=3D ~IGP01E1000_PSCFR_SMART_SPEED; > ret_val =3D phy->ops.write_reg(hw, > IGP01E1000_PHY_PORT_CONFIG, > data); > if (ret_val) > - goto out; > + return ret_val; > } > } > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -1101,13 +1064,12 @@ out: > **/ > static s32 e1000_reset_hw_82571(struct e1000_hw *hw) > { > - u32 ctrl, ctrl_ext; > + u32 ctrl, ctrl_ext, eecd, tctl; > s32 ret_val; > =20 > DEBUGFUNC("e1000_reset_hw_82571"); > =20 > - /* > - * Prevent the PCI-E bus from sticking if there is no TLP connection > + /* Prevent the PCI-E bus from sticking if there is no TLP connection > * on the last TLP read/write transaction when MAC is reset. > */ > ret_val =3D e1000_disable_pcie_master_generic(hw); > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e > E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); > =20 > E1000_WRITE_REG(hw, E1000_RCTL, 0); > - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); > + tctl =3D E1000_READ_REG(hw, E1000_TCTL); > + tctl &=3D ~E1000_TCTL_EN; > + E1000_WRITE_REG(hw, E1000_TCTL, tctl); > E1000_WRITE_FLUSH(hw); > =20 > msec_delay(10); > =20 > - /* > - * Must acquire the MDIO ownership before MAC reset. > + /* Must acquire the MDIO ownership before MAC reset. > * Ownership defaults to firmware after a reset. > */ > switch (hw->mac.type) { > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e > ret_val =3D e1000_get_auto_rd_done_generic(hw); > if (ret_val) > /* We don't want to continue accessing MAC registers. */ > - goto out; > + return ret_val; > =20 > - /* > - * Phy configuration from NVM just starts after EECD_AUTO_RD is set. > + /* Phy configuration from NVM just starts after EECD_AUTO_RD is set. > * Need to wait for Phy configuration completion before accessing > * NVM and Phy. > */ > =20 > switch (hw->mac.type) { > + case e1000_82571: > + case e1000_82572: > + /* REQ and GNT bits need to be cleared when using AUTO_RD > + * to access the EEPROM. > + */ > + eecd =3D E1000_READ_REG(hw, E1000_EECD); > + eecd &=3D ~(E1000_EECD_REQ | E1000_EECD_GNT); > + E1000_WRITE_REG(hw, E1000_EECD, eecd); > + break; > case e1000_82573: > case e1000_82574: > case e1000_82583: > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e > /* Install any alternate MAC address into RAR0 */ > ret_val =3D e1000_check_alt_mac_addr_generic(hw); > if (ret_val) > - goto out; > + return ret_val; > =20 > e1000_set_laa_state_82571(hw, TRUE); > } > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e > if (hw->phy.media_type =3D=3D e1000_media_type_internal_serdes) > hw->mac.serdes_link_state =3D e1000_serdes_link_down; > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 > =20 > /* Initialize identification LED */ > ret_val =3D mac->ops.id_led_init(hw); > + /* An error is not fatal and we should not stop init due to this */ > if (ret_val) > DEBUGOUT("Error initializing identification LED\n"); > - /* This is not fatal and we should not stop init due to this */ > =20 > /* Disabling VLAN filtering */ > DEBUGOUT("Initializing the IEEE VLAN\n"); > mac->ops.clear_vfta(hw); > =20 > - /* Setup the receive address. */ > - /* > + /* Setup the receive address. > * If, however, a locally administered address was assigned to the > * 82571, we must reserve a RAR for it to work around an issue where > * resetting one port will reload the MAC on the other port. > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 > break; > } > =20 > - /* > - * Clear all of the statistics registers (clear on read). It is > + /* Clear all of the statistics registers (clear on read). It is > * important that we do this after we have tried to establish link > * because the symbol error count will increment wildly if there > * is no link. > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 > E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); > } > =20 > - /* > - * Workaround for hardware errata. > + /* Workaround for hardware errata. > * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 > */ > if ((hw->mac.type =3D=3D e1000_82571) || > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 > E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); > } > =20 > + /* Disable IPv6 extension header parsing because some malformed > + * IPv6 headers can hang the Rx. > + */ > + if (hw->mac.type <=3D e1000_82573) { > + reg =3D E1000_READ_REG(hw, E1000_RFCTL); > + reg |=3D (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS); > + E1000_WRITE_REG(hw, E1000_RFCTL, reg); > + } > + > /* PCI-Ex Control Registers */ > switch (hw->mac.type) { > case e1000_82574: > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 > reg |=3D (1 << 22); > E1000_WRITE_REG(hw, E1000_GCR, reg); > =20 > - /* > - * Workaround for hardware errata. > + /* Workaround for hardware errata. > * apply workaround for hardware errata documented in errata > * docs Fixes issue where some error prone or unreliable PCIe > * completions are occurring, particularly with ASPM enabled. > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc > case e1000_82574: > case e1000_82583: > if (hw->mng_cookie.vlan_id !=3D 0) { > - /* > - * The VFTA is a 4096b bit-field, each identifying > + /* The VFTA is a 4096b bit-field, each identifying > * a single VLAN ID. The following operations > * determine which 32b entry (i.e. offset) into the > * array we want to set the VLAN ID (i.e. bit) of > * the manageability unit. > */ > vfta_offset =3D (hw->mng_cookie.vlan_id >> > - E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; > - vfta_bit_in_reg =3D 1 << (hw->mng_cookie.vlan_id & > - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); > + E1000_VFTA_ENTRY_SHIFT) & > + E1000_VFTA_ENTRY_MASK; > + vfta_bit_in_reg =3D > + 1 << (hw->mng_cookie.vlan_id & > + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); > } > break; > default: > break; > } > for (offset =3D 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { > - /* > - * If the offset we want to clear is the same offset of the > + /* If the offset we want to clear is the same offset of the > * manageability VLAN ID, then clear all bits except that of > * the manageability unit. > */ > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 > =20 > ctrl =3D hw->mac.ledctl_mode2; > if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { > - /* > - * If no link, then turn LED on by setting the invert bit > + /* If no link, then turn LED on by setting the invert bit > * for each LED that's "on" (0x0E) in ledctl_mode2. > */ > for (i =3D 0; i < 4; i++) > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ > { > u16 status_1kbt =3D 0; > u16 receive_errors =3D 0; > - bool phy_hung =3D FALSE; > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > =20 > DEBUGFUNC("e1000_check_phy_82574"); > =20 > - /* > - * Read PHY Receive Error counter first, if its is max - all F's then > + /* Read PHY Receive Error counter first, if its is max - all F's then > * read the Base1000T status register If both are max then PHY is hung. > */ > ret_val =3D hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, > &receive_errors); > if (ret_val) > - goto out; > + return FALSE; > if (receive_errors =3D=3D E1000_RECEIVE_ERROR_MAX) { > ret_val =3D hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, > &status_1kbt); > if (ret_val) > - goto out; > + return FALSE; > if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) =3D=3D > E1000_IDLE_ERROR_COUNT_MASK) > - phy_hung =3D TRUE; > + return TRUE; > } > -out: > - return phy_hung; > + > + return FALSE; > } > =20 > =20 > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct > { > DEBUGFUNC("e1000_setup_link_82571"); > =20 > - /* > - * 82573 does not have a word in the NVM to determine > + /* 82573 does not have a word in the NVM to determine > * the default flow control setting, so we explicitly > * set it to full. > */ > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 > ret_val =3D e1000_copper_link_setup_igp(hw); > break; > default: > - ret_val =3D -E1000_ERR_PHY; > + return -E1000_ERR_PHY; > break; > } > =20 > if (ret_val) > - goto out; > - > - ret_val =3D e1000_setup_copper_link_generic(hw); > + return ret_val; > =20 > -out: > - return ret_val; > + return e1000_setup_copper_link_generic(hw); > } > =20 > /** > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link > switch (hw->mac.type) { > case e1000_82571: > case e1000_82572: > - /* > - * If SerDes loopback mode is entered, there is no form > + /* If SerDes loopback mode is entered, there is no form > * of reset to take the adapter out of that mode. So we > * have to explicitly take the adapter out of loopback > * mode. This prevents drivers from twiddling their thumbs > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 > =20 > ctrl =3D E1000_READ_REG(hw, E1000_CTRL); > status =3D E1000_READ_REG(hw, E1000_STATUS); > + E1000_READ_REG(hw, E1000_RXCW); > + /* SYNCH bit and IV bit are sticky */ > + usec_delay(10); > rxcw =3D E1000_READ_REG(hw, E1000_RXCW); > =20 > if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { > - > /* Receiver is synchronized with no invalid bits. */ > switch (mac->serdes_link_state) { > case e1000_serdes_link_autoneg_complete: > if (!(status & E1000_STATUS_LU)) { > - /* > - * We have lost link, retry autoneg before > + /* We have lost link, retry autoneg before > * reporting link failure > */ > mac->serdes_link_state =3D > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 > break; > =20 > case e1000_serdes_link_forced_up: > - /* > - * If we are receiving /C/ ordered sets, re-enable > + /* If we are receiving /C/ ordered sets, re-enable > * auto-negotiation in the TXCW register and disable > * forced link in the Device Control register in an > * attempt to auto-negotiate with our link partner. > - * If the partner code word is null, stop forcing > - * and restart auto negotiation. > */ > - if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { > + if (rxcw & E1000_RXCW_C) { > /* Enable autoneg, and unforce link up */ > E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); > E1000_WRITE_REG(hw, E1000_CTRL, > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 > =20 > case e1000_serdes_link_autoneg_progress: > if (rxcw & E1000_RXCW_C) { > - /* > - * We received /C/ ordered sets, meaning the > + /* We received /C/ ordered sets, meaning the > * link partner has autonegotiated, and we can > * trust the Link Up (LU) status bit. > */ > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 > DEBUGOUT("AN_PROG -> DOWN\n"); > } > } else { > - /* > - * The link partner did not autoneg. > + /* The link partner did not autoneg. > * Force link up and full duplex, and change > * state to forced. > */ > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 > =20 > case e1000_serdes_link_down: > default: > - /* > - * The link was down but the receiver has now gained > + /* The link was down but the receiver has now gained > * valid sync, so lets see if we can bring the link > * up. > */ > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 > mac->serdes_link_state =3D e1000_serdes_link_down; > DEBUGOUT("ANYSTATE -> DOWN\n"); > } else { > - /* > - * Check several times, if Sync and Config > - * both are consistently 1 then simply ignore > - * the Invalid bit and restart Autoneg > + /* Check several times, if SYNCH bit and CONFIG > + * bit both are consistently 1 then simply ignore > + * the IV bit and restart Autoneg > */ > for (i =3D 0; i < AN_RETRY_COUNT; i++) { > usec_delay(10); > rxcw =3D E1000_READ_REG(hw, E1000_RXCW); > - if ((rxcw & E1000_RXCW_IV) && > - !((rxcw & E1000_RXCW_SYNCH) && > - (rxcw & E1000_RXCW_C))) { > + if ((rxcw & E1000_RXCW_SYNCH) && > + (rxcw & E1000_RXCW_C)) > + continue; > + > + if (rxcw & E1000_RXCW_IV) { > mac->serdes_has_link =3D FALSE; > mac->serdes_link_state =3D > e1000_serdes_link_down; > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 > ret_val =3D hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); > if (ret_val) { > DEBUGOUT("NVM Read Error\n"); > - goto out; > + return ret_val; > } > =20 > switch (hw->mac.type) { > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 > break; > } > =20 > -out: > - return ret_val; > + return E1000_SUCCESS; > } > =20 > /** > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 > =20 > /* If workaround is activated... */ > if (state) > - /* > - * Hold a copy of the LAA in RAR[14] This is done so that > + /* Hold a copy of the LAA in RAR[14] This is done so that > * between the time RAR[0] gets clobbered and the time it > * gets fixed, the actual LAA is in one of the RARs and no > * incoming packets directed to this port are dropped. > * Eventually the LAA will be in RAR[0] and RAR[14]. > */ > - e1000_rar_set_generic(hw, hw->mac.addr, > - hw->mac.rar_entry_count - 1); > + hw->mac.ops.rar_set(hw, hw->mac.addr, > + hw->mac.rar_entry_count - 1); > return; > } > =20 > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) > { > struct e1000_nvm_info *nvm =3D &hw->nvm; > - s32 ret_val =3D E1000_SUCCESS; > + s32 ret_val; > u16 data; > =20 > DEBUGFUNC("e1000_fix_nvm_checksum_82571"); > =20 > if (nvm->type !=3D e1000_nvm_flash_hw) > - goto out; > + return E1000_SUCCESS; > =20 > - /* > - * Check bit 4 of word 10h. If it is 0, firmware is done updating > + /* Check bit 4 of word 10h. If it is 0, firmware is done updating > * 10h-12h. Checksum may need to be fixed. > */ >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.or= g" --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRLr+lAAoJEFJPDDeguUaj+8MH/1NbMjgLJcaSRJqnlVrqbtlC uRAtZB12ImzxshbSxaj3ZuWsAQ/5Sg+J6nJwB5iKyFO7jkoCuDVGi5XJraGHdXWM RSNsJPrt5w9Hk0JDHMZkbvJaMrvOYUGT9Iz1aID399Zn5GdoWsrGeDPSXwunBobz mRR4RuBBZLawDnMSxp7LwkUp2zlVIY578hfw9GskTAWDU4ADrbzr7eHgmbBZ48fJ Jd+QNrwfRKPhLiFjrcSaa5YbVXCp5kDumL5Y34FF99H4Rq91yS+UkPu4Ait6Nooq xA0X24FFfi8+tnpbK04MNdWfH+SxznQV79eCJ9JDZcMl1kV0EcT/uCtCg7bMGD8= =oUZH -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu-- From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 05:40:07 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AAAB4B23; Thu, 28 Feb 2013 05:40:07 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx1.freebsd.org (Postfix) with ESMTP id E27CEC03; Thu, 28 Feb 2013 05:40:06 +0000 (UTC) Received: by mail-ve0-f181.google.com with SMTP id d10so1414816vea.12 for ; Wed, 27 Feb 2013 21:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=XHBXTGjg8jNk5KQeC1TWNWYLVGpEVGO1iWaH3cA2Hok=; b=wpSTZ4Vyq/a4bsIS0KGU4z91uxJFbXEQWzdK9tw7hMpdaD54kmmkBEx+jSNx/5slbJ Eu64a6lo5Mrh0nzJlHs+ctoDv+oXgA1+sEO25is9sNq0wzJuToq4SMASalnjBk0cdgEV E23ByO1hGoh20kOSkAec/WupSbQEEB+NlZUgjZrqQRYLHF8w5JbX9puK32RCFF2ET9qW edHsOArHrRXQjlY2svz2+25OPh9EpzzEPJJKZpHcb/aD0jtLAIXLSut4GuTwM57rW1VK 7QcPAAoe8vjoSmKb5LYmcI8r58czEvJKPQmRar7+iwJNTe/sbnQ9b6DFHgR18Qjjdm76 PuOg== MIME-Version: 1.0 X-Received: by 10.221.2.71 with SMTP id nt7mr1951324vcb.71.1362029999756; Wed, 27 Feb 2013 21:39:59 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 21:39:59 -0800 (PST) In-Reply-To: <20130228022333.GC70215@glenbarber.us> References: <201302280022.r1S0M4vm064514@svn.freebsd.org> <20130228022333.GC70215@glenbarber.us> Date: Wed, 27 Feb 2013 21:39:59 -0800 Message-ID: Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb From: Jack Vogel To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jack F Vogel , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 05:40:07 -0000 Oh, that's odd, then HEAD should be broken too, do you have more detail? Jack On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber wrote: > Jack, > > This commit seems to break the build for at least powerpc and sparc64. > > Glen > > On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote: > > Author: jfv > > Date: Thu Feb 28 00:22:04 2013 > > New Revision: 247430 > > URL: http://svnweb.freebsd.org/changeset/base/247430 > > > > Log: > > MFC of the E1000 drivers to STABLE/8, this includes the follow > revisions > > plus a few tweaks: > > 196969,196970,211516,214646,215781,215789,215808,215910,223350, > > 223482,223831,228281,228393,229939,231796,232238,234665,235256, > > 236406,238148,238151,238214,238765,238770,238953,238981,239105, > > 239109,239304,240518,240693,240968,241037,241856,241885,243570, > > 243857,245334,246128,246482,247064 > > > > Added: > > stable/8/sys/dev/e1000/e1000_i210.c > > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c > > stable/8/sys/dev/e1000/e1000_i210.h > > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h > > Modified: > > stable/8/sys/conf/files > > stable/8/sys/dev/e1000/e1000_82541.c > > stable/8/sys/dev/e1000/e1000_82543.c > > stable/8/sys/dev/e1000/e1000_82571.c > > stable/8/sys/dev/e1000/e1000_82575.c > > stable/8/sys/dev/e1000/e1000_82575.h > > stable/8/sys/dev/e1000/e1000_api.c > > stable/8/sys/dev/e1000/e1000_api.h > > stable/8/sys/dev/e1000/e1000_defines.h > > stable/8/sys/dev/e1000/e1000_hw.h > > stable/8/sys/dev/e1000/e1000_ich8lan.c > > stable/8/sys/dev/e1000/e1000_ich8lan.h > > stable/8/sys/dev/e1000/e1000_mac.c > > stable/8/sys/dev/e1000/e1000_mac.h > > stable/8/sys/dev/e1000/e1000_manage.c > > stable/8/sys/dev/e1000/e1000_manage.h > > stable/8/sys/dev/e1000/e1000_nvm.c > > stable/8/sys/dev/e1000/e1000_nvm.h > > stable/8/sys/dev/e1000/e1000_osdep.h > > stable/8/sys/dev/e1000/e1000_phy.c > > stable/8/sys/dev/e1000/e1000_phy.h > > stable/8/sys/dev/e1000/e1000_regs.h > > stable/8/sys/dev/e1000/if_em.c (contents, props changed) > > stable/8/sys/dev/e1000/if_igb.c (contents, props changed) > > stable/8/sys/dev/e1000/if_igb.h > > stable/8/sys/dev/e1000/if_lem.c > > stable/8/sys/modules/em/Makefile > > stable/8/sys/modules/igb/Makefile > > Directory Properties: > > stable/8/sys/dev/e1000/ (props changed) > > > > Modified: stable/8/sys/conf/files > > > ============================================================================== > > --- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013 (r247429) > > +++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013 (r247430) > > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i > > compile-with "${NORMAL_C} -I$S/dev/e1000" > > dev/e1000/e1000_ich8lan.c optional em | igb \ > > compile-with "${NORMAL_C} -I$S/dev/e1000" > > +dev/e1000/e1000_i210.c optional em | igb \ > > + compile-with "${NORMAL_C} -I$S/dev/e1000" > > dev/e1000/e1000_api.c optional em | igb \ > > compile-with "${NORMAL_C} -I$S/dev/e1000" > > dev/e1000/e1000_mac.c optional em | igb \ > > > > Modified: stable/8/sys/dev/e1000/e1000_82541.c > > > ============================================================================== > > --- stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:18:56 2013 > (r247429) > > +++ stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:22:04 2013 > (r247430) > > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st > > * of MAC speed/duplex configuration. So we only need to > > * configure Collision Distance in the MAC. > > */ > > - e1000_config_collision_dist_generic(hw); > > + mac->ops.config_collision_dist(hw); > > > > /* > > * Configure Flow Control now that Auto-Neg has completed. > > > > Modified: stable/8/sys/dev/e1000/e1000_82543.c > > > ============================================================================== > > --- stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:18:56 2013 > (r247429) > > +++ stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:22:04 2013 > (r247430) > > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 > > DEBUGOUT("Valid link established!!!\n"); > > /* Config the MAC and PHY after link is up */ > > if (hw->mac.type == e1000_82544) { > > - e1000_config_collision_dist_generic(hw); > > + hw->mac.ops.config_collision_dist(hw); > > } else { > > ret_val = e1000_config_mac_to_phy_82543(hw); > > if (ret_val) > > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( > > /* Take the link out of reset */ > > ctrl &= ~E1000_CTRL_LRST; > > > > - e1000_config_collision_dist_generic(hw); > > + hw->mac.ops.config_collision_dist(hw); > > > > ret_val = e1000_commit_fc_settings_generic(hw); > > if (ret_val) > > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 > > * settings. > > */ > > if (mac->type == e1000_82544) > > - e1000_config_collision_dist_generic(hw); > > + hw->mac.ops.config_collision_dist(hw); > > else { > > ret_val = e1000_config_mac_to_phy_82543(hw); > > if (ret_val) { > > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 > > if (phy_data & M88E1000_PSSR_DPLX) > > ctrl |= E1000_CTRL_FD; > > > > - e1000_config_collision_dist_generic(hw); > > + hw->mac.ops.config_collision_dist(hw); > > > > /* > > * Set up speed in the Device Control register depending on > > > > Modified: stable/8/sys/dev/e1000/e1000_82571.c > > > ============================================================================== > > --- stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:18:56 2013 > (r247429) > > +++ stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:22:04 2013 > (r247430) > > @@ -1,6 +1,6 @@ > > > /****************************************************************************** > > > > - Copyright (c) 2001-2011, Intel Corporation > > + Copyright (c) 2001-2013, Intel Corporation > > All rights reserved. > > > > Redistribution and use in source and binary forms, with or without > > @@ -32,8 +32,7 @@ > > > ******************************************************************************/ > > /*$FreeBSD$*/ > > > > -/* > > - * 82571EB Gigabit Ethernet Controller > > +/* 82571EB Gigabit Ethernet Controller > > * 82571EB Gigabit Ethernet Controller (Copper) > > * 82571EB Gigabit Ethernet Controller (Fiber) > > * 82571EB Dual Port Gigabit Mezzanine Adapter > > @@ -51,9 +50,6 @@ > > > > #include "e1000_api.h" > > > > -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); > > -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); > > -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); > > static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); > > static void e1000_release_nvm_82571(struct e1000_hw *hw); > > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, > > @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 > > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); > > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); > > static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); > > -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); > > static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); > > static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); > > static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); > > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ > > static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) > > { > > struct e1000_phy_info *phy = &hw->phy; > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > > > DEBUGFUNC("e1000_init_phy_params_82571"); > > > > if (hw->phy.media_type != e1000_media_type_copper) { > > phy->type = e1000_phy_none; > > - goto out; > > + return E1000_SUCCESS; > > } > > > > phy->addr = 1; > > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s > > phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574; > > break; > > default: > > - ret_val = -E1000_ERR_PHY; > > - goto out; > > + return -E1000_ERR_PHY; > > break; > > } > > > > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s > > ret_val = e1000_get_phy_id_82571(hw); > > if (ret_val) { > > DEBUGOUT("Error getting PHY ID\n"); > > - goto out; > > + return ret_val; > > } > > > > /* Verify phy id */ > > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s > > if (ret_val) > > DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); > > > > -out: > > return ret_val; > > } > > > > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s > > if (((eecd >> 15) & 0x3) == 0x3) { > > nvm->type = e1000_nvm_flash_hw; > > nvm->word_size = 2048; > > - /* > > - * Autonomous Flash update bit must be cleared due > > + /* Autonomous Flash update bit must be cleared due > > * to Flash update issue. > > */ > > eecd &= ~E1000_EECD_AUPDEN; > > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s > > nvm->type = e1000_nvm_eeprom_spi; > > size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> > > E1000_EECD_SIZE_EX_SHIFT); > > - /* > > - * Added to a constant, "size" becomes the left-shift value > > + /* Added to a constant, "size" becomes the left-shift value > > * for setting word_size. > > */ > > size += NVM_WORD_SIZE_BASE_SHIFT; > > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s > > > > /* FWSM register */ > > mac->has_fwsm = TRUE; > > - /* > > - * ARC supported; valid only if manageability features are > > + /* ARC supported; valid only if manageability features are > > * enabled. > > */ > > - mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) > & > > - E1000_FWSM_MODE_MASK) ? TRUE : > FALSE; > > + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, > E1000_FWSM) & > > + E1000_FWSM_MODE_MASK); > > break; > > case e1000_82574: > > case e1000_82583: > > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s > > break; > > } > > > > - /* > > - * Ensure that the inter-port SWSM.SMBI lock bit is clear before > > + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before > > * first NVM or PHY acess. This should be done for single-port > > * devices, and for one port only on dual-port devices so that > > * for those devices we can still use the SMBI lock to synchronize > > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s > > E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | > > E1000_SWSM2_LOCK); > > force_clear_smbi = TRUE; > > - } else > > + } else { > > force_clear_smbi = FALSE; > > + } > > break; > > default: > > force_clear_smbi = TRUE; > > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s > > E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); > > } > > > > - /* > > - * Initialze device specific counter of SMBI acquisition > > - * timeouts. > > - */ > > + /* Initialze device specific counter of SMBI acquisition timeouts. > */ > > hw->dev_spec._82571.smb_counter = 0; > > > > return E1000_SUCCESS; > > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( > > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) > > { > > struct e1000_phy_info *phy = &hw->phy; > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > u16 phy_id = 0; > > > > DEBUGFUNC("e1000_get_phy_id_82571"); > > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct > > switch (hw->mac.type) { > > case e1000_82571: > > case e1000_82572: > > - /* > > - * The 82571 firmware may still be configuring the PHY. > > + /* The 82571 firmware may still be configuring the PHY. > > * In this case, we cannot access the PHY until the > > * configuration is done. So we explicitly set the > > * PHY ID. > > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct > > phy->id = IGP01E1000_I_PHY_ID; > > break; > > case e1000_82573: > > - ret_val = e1000_get_phy_id(hw); > > + return e1000_get_phy_id(hw); > > break; > > case e1000_82574: > > case e1000_82583: > > ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > phy->id = (u32)(phy_id << 16); > > usec_delay(20); > > ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > phy->id |= (u32)(phy_id); > > phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); > > break; > > default: > > - ret_val = -E1000_ERR_PHY; > > + return -E1000_ERR_PHY; > > break; > > } > > -out: > > - return ret_val; > > + > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -528,15 +514,13 @@ out: > > static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) > > { > > u32 swsm; > > - s32 ret_val = E1000_SUCCESS; > > s32 sw_timeout = hw->nvm.word_size + 1; > > s32 fw_timeout = hw->nvm.word_size + 1; > > s32 i = 0; > > > > DEBUGFUNC("e1000_get_hw_semaphore_82571"); > > > > - /* > > - * If we have timedout 3 times on trying to acquire > > + /* If we have timedout 3 times on trying to acquire > > * the inter-port SMBI semaphore, there is old code > > * operating on the other port, and it is not > > * releasing SMBI. Modify the number of times that > > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( > > /* Release semaphores */ > > e1000_put_hw_semaphore_82571(hw); > > DEBUGOUT("Driver can't access the NVM\n"); > > - ret_val = -E1000_ERR_NVM; > > - goto out; > > + return -E1000_ERR_NVM; > > } > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 > > static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) > > { > > u32 extcnf_ctrl; > > - s32 ret_val = E1000_SUCCESS; > > s32 i = 0; > > > > DEBUGFUNC("e1000_get_hw_semaphore_82573"); > > > > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); > > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > > do { > > + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > > E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); > > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); > > > > if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) > > break; > > > > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; > > - > > msec_delay(2); > > i++; > > } while (i < MDIO_OWNERSHIP_TIMEOUT); > > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( > > /* Release semaphores */ > > e1000_put_hw_semaphore_82573(hw); > > DEBUGOUT("Driver can't access the PHY\n"); > > - ret_val = -E1000_ERR_PHY; > > - goto out; > > + return -E1000_ERR_PHY; > > } > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 > > **/ > > static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool > active) > > { > > - u16 data = E1000_READ_REG(hw, E1000_POEMB); > > + u32 data = E1000_READ_REG(hw, E1000_POEMB); > > > > DEBUGFUNC("e1000_set_d0_lplu_state_82574"); > > > > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 > > **/ > > static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool > active) > > { > > - u16 data = E1000_READ_REG(hw, E1000_POEMB); > > + u32 data = E1000_READ_REG(hw, E1000_POEMB); > > > > DEBUGFUNC("e1000_set_d3_lplu_state_82574"); > > > > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc > > > > ret_val = e1000_get_hw_semaphore_82571(hw); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > switch (hw->mac.type) { > > case e1000_82573: > > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc > > if (ret_val) > > e1000_put_hw_semaphore_82571(hw); > > > > -out: > > return ret_val; > > } > > > > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru > > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 > words, > > u16 *data) > > { > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > > > DEBUGFUNC("e1000_write_nvm_82571"); > > > > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 > > > > ret_val = e1000_update_nvm_checksum_generic(hw); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > - /* > > - * If our nvm is an EEPROM, then we're done > > + /* If our nvm is an EEPROM, then we're done > > * otherwise, commit the checksum to the flash NVM. > > */ > > if (hw->nvm.type != e1000_nvm_flash_hw) > > - goto out; > > + return E1000_SUCCESS; > > > > /* Check for pending operations. */ > > for (i = 0; i < E1000_FLASH_UPDATES; i++) { > > msec_delay(1); > > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == > 0) > > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) > > break; > > } > > > > - if (i == E1000_FLASH_UPDATES) { > > - ret_val = -E1000_ERR_NVM; > > - goto out; > > - } > > + if (i == E1000_FLASH_UPDATES) > > + return -E1000_ERR_NVM; > > > > /* Reset the firmware if using STM opcode. */ > > if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) > { > > - /* > > - * The enabling of and the actual reset must be done > > + /* The enabling of and the actual reset must be done > > * in two write cycles. > > */ > > E1000_WRITE_REG(hw, E1000_HICR, > E1000_HICR_FW_RESET_ENABLE); > > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 > > > > for (i = 0; i < E1000_FLASH_UPDATES; i++) { > > msec_delay(1); > > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == > 0) > > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) > > break; > > } > > > > - if (i == E1000_FLASH_UPDATES) { > > - ret_val = -E1000_ERR_NVM; > > - goto out; > > - } > > + if (i == E1000_FLASH_UPDATES) > > + return -E1000_ERR_NVM; > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st > > { > > struct e1000_nvm_info *nvm = &hw->nvm; > > u32 i, eewr = 0; > > - s32 ret_val = 0; > > + s32 ret_val = E1000_SUCCESS; > > > > DEBUGFUNC("e1000_write_nvm_eewr_82571"); > > > > - /* > > - * A check for invalid values: offset too large, too many words, > > + /* A check for invalid values: offset too large, too many words, > > * and not enough words. > > */ > > if ((offset >= nvm->word_size) || (words > (nvm->word_size - > offset)) || > > (words == 0)) { > > DEBUGOUT("nvm parameter(s) out of bounds\n"); > > - ret_val = -E1000_ERR_NVM; > > - goto out; > > + return -E1000_ERR_NVM; > > } > > > > for (i = 0; i < words; i++) { > > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st > > break; > > } > > > > -out: > > return ret_val; > > } > > > > @@ -988,7 +954,6 @@ out: > > static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) > > { > > s32 timeout = PHY_CFG_TIMEOUT; > > - s32 ret_val = E1000_SUCCESS; > > > > DEBUGFUNC("e1000_get_cfg_done_82571"); > > > > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru > > } > > if (!timeout) { > > DEBUGOUT("MNG configuration cycle has not completed.\n"); > > - ret_val = -E1000_ERR_RESET; > > - goto out; > > + return -E1000_ERR_RESET; > > } > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -1023,39 +986,40 @@ out: > > static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool > active) > > { > > struct e1000_phy_info *phy = &hw->phy; > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > u16 data; > > > > DEBUGFUNC("e1000_set_d0_lplu_state_82571"); > > > > if (!(phy->ops.read_reg)) > > - goto out; > > + return E1000_SUCCESS; > > > > ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > if (active) { > > data |= IGP02E1000_PM_D0_LPLU; > > ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, > > data); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > /* When LPLU is enabled, we should disable SmartSpeed */ > > ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, > > &data); > > + if (ret_val) > > + return ret_val; > > data &= ~IGP01E1000_PSCFR_SMART_SPEED; > > ret_val = phy->ops.write_reg(hw, > IGP01E1000_PHY_PORT_CONFIG, > > data); > > if (ret_val) > > - goto out; > > + return ret_val; > > } else { > > data &= ~IGP02E1000_PM_D0_LPLU; > > ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, > > data); > > - /* > > - * LPLU and SmartSpeed are mutually exclusive. LPLU is > used > > + /* LPLU and SmartSpeed are mutually exclusive. LPLU is > used > > * during Dx states where the power conservation is most > > * important. During driver activity we should enable > > * SmartSpeed, so performance is maintained. > > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 > > > IGP01E1000_PHY_PORT_CONFIG, > > &data); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > data |= IGP01E1000_PSCFR_SMART_SPEED; > > ret_val = phy->ops.write_reg(hw, > > > IGP01E1000_PHY_PORT_CONFIG, > > data); > > if (ret_val) > > - goto out; > > + return ret_val; > > } else if (phy->smart_speed == e1000_smart_speed_off) { > > ret_val = phy->ops.read_reg(hw, > > > IGP01E1000_PHY_PORT_CONFIG, > > &data); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > data &= ~IGP01E1000_PSCFR_SMART_SPEED; > > ret_val = phy->ops.write_reg(hw, > > > IGP01E1000_PHY_PORT_CONFIG, > > data); > > if (ret_val) > > - goto out; > > + return ret_val; > > } > > } > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -1101,13 +1064,12 @@ out: > > **/ > > static s32 e1000_reset_hw_82571(struct e1000_hw *hw) > > { > > - u32 ctrl, ctrl_ext; > > + u32 ctrl, ctrl_ext, eecd, tctl; > > s32 ret_val; > > > > DEBUGFUNC("e1000_reset_hw_82571"); > > > > - /* > > - * Prevent the PCI-E bus from sticking if there is no TLP > connection > > + /* Prevent the PCI-E bus from sticking if there is no TLP > connection > > * on the last TLP read/write transaction when MAC is reset. > > */ > > ret_val = e1000_disable_pcie_master_generic(hw); > > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e > > E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); > > > > E1000_WRITE_REG(hw, E1000_RCTL, 0); > > - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); > > + tctl = E1000_READ_REG(hw, E1000_TCTL); > > + tctl &= ~E1000_TCTL_EN; > > + E1000_WRITE_REG(hw, E1000_TCTL, tctl); > > E1000_WRITE_FLUSH(hw); > > > > msec_delay(10); > > > > - /* > > - * Must acquire the MDIO ownership before MAC reset. > > + /* Must acquire the MDIO ownership before MAC reset. > > * Ownership defaults to firmware after a reset. > > */ > > switch (hw->mac.type) { > > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e > > ret_val = e1000_get_auto_rd_done_generic(hw); > > if (ret_val) > > /* We don't want to continue accessing MAC registers. */ > > - goto out; > > + return ret_val; > > > > - /* > > - * Phy configuration from NVM just starts after EECD_AUTO_RD is > set. > > + /* Phy configuration from NVM just starts after EECD_AUTO_RD is > set. > > * Need to wait for Phy configuration completion before accessing > > * NVM and Phy. > > */ > > > > switch (hw->mac.type) { > > + case e1000_82571: > > + case e1000_82572: > > + /* REQ and GNT bits need to be cleared when using AUTO_RD > > + * to access the EEPROM. > > + */ > > + eecd = E1000_READ_REG(hw, E1000_EECD); > > + eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT); > > + E1000_WRITE_REG(hw, E1000_EECD, eecd); > > + break; > > case e1000_82573: > > case e1000_82574: > > case e1000_82583: > > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e > > /* Install any alternate MAC address into RAR0 */ > > ret_val = e1000_check_alt_mac_addr_generic(hw); > > if (ret_val) > > - goto out; > > + return ret_val; > > > > e1000_set_laa_state_82571(hw, TRUE); > > } > > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e > > if (hw->phy.media_type == e1000_media_type_internal_serdes) > > hw->mac.serdes_link_state = e1000_serdes_link_down; > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 > > > > /* Initialize identification LED */ > > ret_val = mac->ops.id_led_init(hw); > > + /* An error is not fatal and we should not stop init due to this */ > > if (ret_val) > > DEBUGOUT("Error initializing identification LED\n"); > > - /* This is not fatal and we should not stop init due to > this */ > > > > /* Disabling VLAN filtering */ > > DEBUGOUT("Initializing the IEEE VLAN\n"); > > mac->ops.clear_vfta(hw); > > > > - /* Setup the receive address. */ > > - /* > > + /* Setup the receive address. > > * If, however, a locally administered address was assigned to the > > * 82571, we must reserve a RAR for it to work around an issue > where > > * resetting one port will reload the MAC on the other port. > > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 > > break; > > } > > > > - /* > > - * Clear all of the statistics registers (clear on read). It is > > + /* Clear all of the statistics registers (clear on read). It is > > * important that we do this after we have tried to establish link > > * because the symbol error count will increment wildly if there > > * is no link. > > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 > > E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); > > } > > > > - /* > > - * Workaround for hardware errata. > > + /* Workaround for hardware errata. > > * Ensure that DMA Dynamic Clock gating is disabled on 82571 and > 82572 > > */ > > if ((hw->mac.type == e1000_82571) || > > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 > > E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); > > } > > > > + /* Disable IPv6 extension header parsing because some malformed > > + * IPv6 headers can hang the Rx. > > + */ > > + if (hw->mac.type <= e1000_82573) { > > + reg = E1000_READ_REG(hw, E1000_RFCTL); > > + reg |= (E1000_RFCTL_IPV6_EX_DIS | > E1000_RFCTL_NEW_IPV6_EXT_DIS); > > + E1000_WRITE_REG(hw, E1000_RFCTL, reg); > > + } > > + > > /* PCI-Ex Control Registers */ > > switch (hw->mac.type) { > > case e1000_82574: > > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 > > reg |= (1 << 22); > > E1000_WRITE_REG(hw, E1000_GCR, reg); > > > > - /* > > - * Workaround for hardware errata. > > + /* Workaround for hardware errata. > > * apply workaround for hardware errata documented in > errata > > * docs Fixes issue where some error prone or unreliable > PCIe > > * completions are occurring, particularly with ASPM > enabled. > > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc > > case e1000_82574: > > case e1000_82583: > > if (hw->mng_cookie.vlan_id != 0) { > > - /* > > - * The VFTA is a 4096b bit-field, each identifying > > + /* The VFTA is a 4096b bit-field, each identifying > > * a single VLAN ID. The following operations > > * determine which 32b entry (i.e. offset) into the > > * array we want to set the VLAN ID (i.e. bit) of > > * the manageability unit. > > */ > > vfta_offset = (hw->mng_cookie.vlan_id >> > > - E1000_VFTA_ENTRY_SHIFT) & > E1000_VFTA_ENTRY_MASK; > > - vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & > > - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); > > + E1000_VFTA_ENTRY_SHIFT) & > > + E1000_VFTA_ENTRY_MASK; > > + vfta_bit_in_reg = > > + 1 << (hw->mng_cookie.vlan_id & > > + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); > > } > > break; > > default: > > break; > > } > > for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { > > - /* > > - * If the offset we want to clear is the same offset of the > > + /* If the offset we want to clear is the same offset of the > > * manageability VLAN ID, then clear all bits except that > of > > * the manageability unit. > > */ > > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 > > > > ctrl = hw->mac.ledctl_mode2; > > if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { > > - /* > > - * If no link, then turn LED on by setting the invert bit > > + /* If no link, then turn LED on by setting the invert bit > > * for each LED that's "on" (0x0E) in ledctl_mode2. > > */ > > for (i = 0; i < 4; i++) > > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ > > { > > u16 status_1kbt = 0; > > u16 receive_errors = 0; > > - bool phy_hung = FALSE; > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > > > DEBUGFUNC("e1000_check_phy_82574"); > > > > - /* > > - * Read PHY Receive Error counter first, if its is max - all F's > then > > + /* Read PHY Receive Error counter first, if its is max - all F's > then > > * read the Base1000T status register If both are max then PHY is > hung. > > */ > > ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, > > &receive_errors); > > if (ret_val) > > - goto out; > > + return FALSE; > > if (receive_errors == E1000_RECEIVE_ERROR_MAX) { > > ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, > > &status_1kbt); > > if (ret_val) > > - goto out; > > + return FALSE; > > if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == > > E1000_IDLE_ERROR_COUNT_MASK) > > - phy_hung = TRUE; > > + return TRUE; > > } > > -out: > > - return phy_hung; > > + > > + return FALSE; > > } > > > > > > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct > > { > > DEBUGFUNC("e1000_setup_link_82571"); > > > > - /* > > - * 82573 does not have a word in the NVM to determine > > + /* 82573 does not have a word in the NVM to determine > > * the default flow control setting, so we explicitly > > * set it to full. > > */ > > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 > > ret_val = e1000_copper_link_setup_igp(hw); > > break; > > default: > > - ret_val = -E1000_ERR_PHY; > > + return -E1000_ERR_PHY; > > break; > > } > > > > if (ret_val) > > - goto out; > > - > > - ret_val = e1000_setup_copper_link_generic(hw); > > + return ret_val; > > > > -out: > > - return ret_val; > > + return e1000_setup_copper_link_generic(hw); > > } > > > > /** > > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link > > switch (hw->mac.type) { > > case e1000_82571: > > case e1000_82572: > > - /* > > - * If SerDes loopback mode is entered, there is no form > > + /* If SerDes loopback mode is entered, there is no form > > * of reset to take the adapter out of that mode. So we > > * have to explicitly take the adapter out of loopback > > * mode. This prevents drivers from twiddling their thumbs > > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 > > > > ctrl = E1000_READ_REG(hw, E1000_CTRL); > > status = E1000_READ_REG(hw, E1000_STATUS); > > + E1000_READ_REG(hw, E1000_RXCW); > > + /* SYNCH bit and IV bit are sticky */ > > + usec_delay(10); > > rxcw = E1000_READ_REG(hw, E1000_RXCW); > > > > if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { > > - > > /* Receiver is synchronized with no invalid bits. */ > > switch (mac->serdes_link_state) { > > case e1000_serdes_link_autoneg_complete: > > if (!(status & E1000_STATUS_LU)) { > > - /* > > - * We have lost link, retry autoneg before > > + /* We have lost link, retry autoneg before > > * reporting link failure > > */ > > mac->serdes_link_state = > > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 > > break; > > > > case e1000_serdes_link_forced_up: > > - /* > > - * If we are receiving /C/ ordered sets, re-enable > > + /* If we are receiving /C/ ordered sets, re-enable > > * auto-negotiation in the TXCW register and > disable > > * forced link in the Device Control register in an > > * attempt to auto-negotiate with our link partner. > > - * If the partner code word is null, stop forcing > > - * and restart auto negotiation. > > */ > > - if ((rxcw & E1000_RXCW_C) || !(rxcw & > E1000_RXCW_CW)) { > > + if (rxcw & E1000_RXCW_C) { > > /* Enable autoneg, and unforce link up */ > > E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); > > E1000_WRITE_REG(hw, E1000_CTRL, > > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 > > > > case e1000_serdes_link_autoneg_progress: > > if (rxcw & E1000_RXCW_C) { > > - /* > > - * We received /C/ ordered sets, meaning > the > > + /* We received /C/ ordered sets, meaning > the > > * link partner has autonegotiated, and we > can > > * trust the Link Up (LU) status bit. > > */ > > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 > > DEBUGOUT("AN_PROG -> DOWN\n"); > > } > > } else { > > - /* > > - * The link partner did not autoneg. > > + /* The link partner did not autoneg. > > * Force link up and full duplex, and > change > > * state to forced. > > */ > > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 > > > > case e1000_serdes_link_down: > > default: > > - /* > > - * The link was down but the receiver has now > gained > > + /* The link was down but the receiver has now > gained > > * valid sync, so lets see if we can bring the link > > * up. > > */ > > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 > > mac->serdes_link_state = e1000_serdes_link_down; > > DEBUGOUT("ANYSTATE -> DOWN\n"); > > } else { > > - /* > > - * Check several times, if Sync and Config > > - * both are consistently 1 then simply ignore > > - * the Invalid bit and restart Autoneg > > + /* Check several times, if SYNCH bit and CONFIG > > + * bit both are consistently 1 then simply ignore > > + * the IV bit and restart Autoneg > > */ > > for (i = 0; i < AN_RETRY_COUNT; i++) { > > usec_delay(10); > > rxcw = E1000_READ_REG(hw, E1000_RXCW); > > - if ((rxcw & E1000_RXCW_IV) && > > - !((rxcw & E1000_RXCW_SYNCH) && > > - (rxcw & E1000_RXCW_C))) { > > + if ((rxcw & E1000_RXCW_SYNCH) && > > + (rxcw & E1000_RXCW_C)) > > + continue; > > + > > + if (rxcw & E1000_RXCW_IV) { > > mac->serdes_has_link = FALSE; > > mac->serdes_link_state = > > > e1000_serdes_link_down; > > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 > > ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); > > if (ret_val) { > > DEBUGOUT("NVM Read Error\n"); > > - goto out; > > + return ret_val; > > } > > > > switch (hw->mac.type) { > > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 > > break; > > } > > > > -out: > > - return ret_val; > > + return E1000_SUCCESS; > > } > > > > /** > > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 > > > > /* If workaround is activated... */ > > if (state) > > - /* > > - * Hold a copy of the LAA in RAR[14] This is done so that > > + /* Hold a copy of the LAA in RAR[14] This is done so that > > * between the time RAR[0] gets clobbered and the time it > > * gets fixed, the actual LAA is in one of the RARs and no > > * incoming packets directed to this port are dropped. > > * Eventually the LAA will be in RAR[0] and RAR[14]. > > */ > > - e1000_rar_set_generic(hw, hw->mac.addr, > > - hw->mac.rar_entry_count - 1); > > + hw->mac.ops.rar_set(hw, hw->mac.addr, > > + hw->mac.rar_entry_count - 1); > > return; > > } > > > > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 > > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) > > { > > struct e1000_nvm_info *nvm = &hw->nvm; > > - s32 ret_val = E1000_SUCCESS; > > + s32 ret_val; > > u16 data; > > > > DEBUGFUNC("e1000_fix_nvm_checksum_82571"); > > > > if (nvm->type != e1000_nvm_flash_hw) > > - goto out; > > + return E1000_SUCCESS; > > > > - /* > > - * Check bit 4 of word 10h. If it is 0, firmware is done updating > > + /* Check bit 4 of word 10h. If it is 0, firmware is done updating > > * 10h-12h. Checksum may need to be fixed. > > */ > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > _______________________________________________ > > svn-src-stable-8@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > > To unsubscribe, send any mail to " > svn-src-stable-8-unsubscribe@freebsd.org" > From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 05:41:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 88BE0C94; Thu, 28 Feb 2013 05:41:14 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx1.freebsd.org (Postfix) with ESMTP id AC645C12; Thu, 28 Feb 2013 05:41:13 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id k1so932094vck.38 for ; Wed, 27 Feb 2013 21:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=6MvJGkOilA1JGT1vPQkdYeWy6wImDTQV0mxEdEjmLbQ=; b=c9lZ7DRRo6tVjveS8JWQW2GwYQqyynQ1nPzX7VjWY0ygTDHw+jLiUGgeL7SLS9oN6t /tUpGvWW9T3F2r3PUhB6AweErMXiO10bSkdFnehL3Vub0BzBYtyk8rWnpQ/4mirCBrHH Qm9mCEmDIWkKOUm9dncdoOW27jEMIDubfzR9rL265YvpYk4kHtf1iGrevKG2NvuEvjae Mrs4KBMAJKTiGwPHfv/M/WDbG3O0ith4nsXwpTyH54yDZuR5Xc/4qHiEUmUavRg2uavX HUmrtUobbNsEe1y8t3wlt4x1KXitoTQYzCsdYidKNkWisdfa/XLPUuJXftOlB/oYMwbu tKPQ== MIME-Version: 1.0 X-Received: by 10.52.30.48 with SMTP id p16mr1779773vdh.118.1362030066832; Wed, 27 Feb 2013 21:41:06 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 21:41:06 -0800 (PST) In-Reply-To: References: <201302280022.r1S0M4vm064514@svn.freebsd.org> <20130228022333.GC70215@glenbarber.us> Date: Wed, 27 Feb 2013 21:41:06 -0800 Message-ID: Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb From: Jack Vogel To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jack F Vogel , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 05:41:14 -0000 LOL, I would see the messages just as I sent this, never mind. Jack On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel wrote: > Oh, that's odd, then HEAD should be broken too, do you have more detail? > > Jack > > > On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber wrote: > >> Jack, >> >> This commit seems to break the build for at least powerpc and sparc64. >> >> Glen >> >> On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote: >> > Author: jfv >> > Date: Thu Feb 28 00:22:04 2013 >> > New Revision: 247430 >> > URL: http://svnweb.freebsd.org/changeset/base/247430 >> > >> > Log: >> > MFC of the E1000 drivers to STABLE/8, this includes the follow >> revisions >> > plus a few tweaks: >> > 196969,196970,211516,214646,215781,215789,215808,215910,223350, >> > 223482,223831,228281,228393,229939,231796,232238,234665,235256, >> > 236406,238148,238151,238214,238765,238770,238953,238981,239105, >> > 239109,239304,240518,240693,240968,241037,241856,241885,243570, >> > 243857,245334,246128,246482,247064 >> > >> > Added: >> > stable/8/sys/dev/e1000/e1000_i210.c >> > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c >> > stable/8/sys/dev/e1000/e1000_i210.h >> > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h >> > Modified: >> > stable/8/sys/conf/files >> > stable/8/sys/dev/e1000/e1000_82541.c >> > stable/8/sys/dev/e1000/e1000_82543.c >> > stable/8/sys/dev/e1000/e1000_82571.c >> > stable/8/sys/dev/e1000/e1000_82575.c >> > stable/8/sys/dev/e1000/e1000_82575.h >> > stable/8/sys/dev/e1000/e1000_api.c >> > stable/8/sys/dev/e1000/e1000_api.h >> > stable/8/sys/dev/e1000/e1000_defines.h >> > stable/8/sys/dev/e1000/e1000_hw.h >> > stable/8/sys/dev/e1000/e1000_ich8lan.c >> > stable/8/sys/dev/e1000/e1000_ich8lan.h >> > stable/8/sys/dev/e1000/e1000_mac.c >> > stable/8/sys/dev/e1000/e1000_mac.h >> > stable/8/sys/dev/e1000/e1000_manage.c >> > stable/8/sys/dev/e1000/e1000_manage.h >> > stable/8/sys/dev/e1000/e1000_nvm.c >> > stable/8/sys/dev/e1000/e1000_nvm.h >> > stable/8/sys/dev/e1000/e1000_osdep.h >> > stable/8/sys/dev/e1000/e1000_phy.c >> > stable/8/sys/dev/e1000/e1000_phy.h >> > stable/8/sys/dev/e1000/e1000_regs.h >> > stable/8/sys/dev/e1000/if_em.c (contents, props changed) >> > stable/8/sys/dev/e1000/if_igb.c (contents, props changed) >> > stable/8/sys/dev/e1000/if_igb.h >> > stable/8/sys/dev/e1000/if_lem.c >> > stable/8/sys/modules/em/Makefile >> > stable/8/sys/modules/igb/Makefile >> > Directory Properties: >> > stable/8/sys/dev/e1000/ (props changed) >> > >> > Modified: stable/8/sys/conf/files >> > >> ============================================================================== >> > --- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013 (r247429) >> > +++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013 (r247430) >> > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i >> > compile-with "${NORMAL_C} -I$S/dev/e1000" >> > dev/e1000/e1000_ich8lan.c optional em | igb \ >> > compile-with "${NORMAL_C} -I$S/dev/e1000" >> > +dev/e1000/e1000_i210.c optional em | igb \ >> > + compile-with "${NORMAL_C} -I$S/dev/e1000" >> > dev/e1000/e1000_api.c optional em | igb \ >> > compile-with "${NORMAL_C} -I$S/dev/e1000" >> > dev/e1000/e1000_mac.c optional em | igb \ >> > >> > Modified: stable/8/sys/dev/e1000/e1000_82541.c >> > >> ============================================================================== >> > --- stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:18:56 2013 >> (r247429) >> > +++ stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:22:04 2013 >> (r247430) >> > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st >> > * of MAC speed/duplex configuration. So we only need to >> > * configure Collision Distance in the MAC. >> > */ >> > - e1000_config_collision_dist_generic(hw); >> > + mac->ops.config_collision_dist(hw); >> > >> > /* >> > * Configure Flow Control now that Auto-Neg has completed. >> > >> > Modified: stable/8/sys/dev/e1000/e1000_82543.c >> > >> ============================================================================== >> > --- stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:18:56 2013 >> (r247429) >> > +++ stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:22:04 2013 >> (r247430) >> > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 >> > DEBUGOUT("Valid link established!!!\n"); >> > /* Config the MAC and PHY after link is up */ >> > if (hw->mac.type == e1000_82544) { >> > - e1000_config_collision_dist_generic(hw); >> > + hw->mac.ops.config_collision_dist(hw); >> > } else { >> > ret_val = e1000_config_mac_to_phy_82543(hw); >> > if (ret_val) >> > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( >> > /* Take the link out of reset */ >> > ctrl &= ~E1000_CTRL_LRST; >> > >> > - e1000_config_collision_dist_generic(hw); >> > + hw->mac.ops.config_collision_dist(hw); >> > >> > ret_val = e1000_commit_fc_settings_generic(hw); >> > if (ret_val) >> > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 >> > * settings. >> > */ >> > if (mac->type == e1000_82544) >> > - e1000_config_collision_dist_generic(hw); >> > + hw->mac.ops.config_collision_dist(hw); >> > else { >> > ret_val = e1000_config_mac_to_phy_82543(hw); >> > if (ret_val) { >> > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 >> > if (phy_data & M88E1000_PSSR_DPLX) >> > ctrl |= E1000_CTRL_FD; >> > >> > - e1000_config_collision_dist_generic(hw); >> > + hw->mac.ops.config_collision_dist(hw); >> > >> > /* >> > * Set up speed in the Device Control register depending on >> > >> > Modified: stable/8/sys/dev/e1000/e1000_82571.c >> > >> ============================================================================== >> > --- stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:18:56 2013 >> (r247429) >> > +++ stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:22:04 2013 >> (r247430) >> > @@ -1,6 +1,6 @@ >> > >> /****************************************************************************** >> > >> > - Copyright (c) 2001-2011, Intel Corporation >> > + Copyright (c) 2001-2013, Intel Corporation >> > All rights reserved. >> > >> > Redistribution and use in source and binary forms, with or without >> > @@ -32,8 +32,7 @@ >> > >> ******************************************************************************/ >> > /*$FreeBSD$*/ >> > >> > -/* >> > - * 82571EB Gigabit Ethernet Controller >> > +/* 82571EB Gigabit Ethernet Controller >> > * 82571EB Gigabit Ethernet Controller (Copper) >> > * 82571EB Gigabit Ethernet Controller (Fiber) >> > * 82571EB Dual Port Gigabit Mezzanine Adapter >> > @@ -51,9 +50,6 @@ >> > >> > #include "e1000_api.h" >> > >> > -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); >> > -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); >> > -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); >> > static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); >> > static void e1000_release_nvm_82571(struct e1000_hw *hw); >> > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, >> > @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 >> > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); >> > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); >> > static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); >> > -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); >> > static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); >> > static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); >> > static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); >> > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ >> > static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) >> > { >> > struct e1000_phy_info *phy = &hw->phy; >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > >> > DEBUGFUNC("e1000_init_phy_params_82571"); >> > >> > if (hw->phy.media_type != e1000_media_type_copper) { >> > phy->type = e1000_phy_none; >> > - goto out; >> > + return E1000_SUCCESS; >> > } >> > >> > phy->addr = 1; >> > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s >> > phy->ops.set_d3_lplu_state = >> e1000_set_d3_lplu_state_82574; >> > break; >> > default: >> > - ret_val = -E1000_ERR_PHY; >> > - goto out; >> > + return -E1000_ERR_PHY; >> > break; >> > } >> > >> > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s >> > ret_val = e1000_get_phy_id_82571(hw); >> > if (ret_val) { >> > DEBUGOUT("Error getting PHY ID\n"); >> > - goto out; >> > + return ret_val; >> > } >> > >> > /* Verify phy id */ >> > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s >> > if (ret_val) >> > DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); >> > >> > -out: >> > return ret_val; >> > } >> > >> > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s >> > if (((eecd >> 15) & 0x3) == 0x3) { >> > nvm->type = e1000_nvm_flash_hw; >> > nvm->word_size = 2048; >> > - /* >> > - * Autonomous Flash update bit must be cleared due >> > + /* Autonomous Flash update bit must be cleared due >> > * to Flash update issue. >> > */ >> > eecd &= ~E1000_EECD_AUPDEN; >> > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s >> > nvm->type = e1000_nvm_eeprom_spi; >> > size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> >> > E1000_EECD_SIZE_EX_SHIFT); >> > - /* >> > - * Added to a constant, "size" becomes the left-shift >> value >> > + /* Added to a constant, "size" becomes the left-shift >> value >> > * for setting word_size. >> > */ >> > size += NVM_WORD_SIZE_BASE_SHIFT; >> > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s >> > >> > /* FWSM register */ >> > mac->has_fwsm = TRUE; >> > - /* >> > - * ARC supported; valid only if manageability features are >> > + /* ARC supported; valid only if manageability features are >> > * enabled. >> > */ >> > - mac->arc_subsystem_valid = (E1000_READ_REG(hw, >> E1000_FWSM) & >> > - E1000_FWSM_MODE_MASK) ? TRUE : >> FALSE; >> > + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, >> E1000_FWSM) & >> > + E1000_FWSM_MODE_MASK); >> > break; >> > case e1000_82574: >> > case e1000_82583: >> > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s >> > break; >> > } >> > >> > - /* >> > - * Ensure that the inter-port SWSM.SMBI lock bit is clear before >> > + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before >> > * first NVM or PHY acess. This should be done for single-port >> > * devices, and for one port only on dual-port devices so that >> > * for those devices we can still use the SMBI lock to synchronize >> > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s >> > E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | >> > E1000_SWSM2_LOCK); >> > force_clear_smbi = TRUE; >> > - } else >> > + } else { >> > force_clear_smbi = FALSE; >> > + } >> > break; >> > default: >> > force_clear_smbi = TRUE; >> > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s >> > E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); >> > } >> > >> > - /* >> > - * Initialze device specific counter of SMBI acquisition >> > - * timeouts. >> > - */ >> > + /* Initialze device specific counter of SMBI acquisition >> timeouts. */ >> > hw->dev_spec._82571.smb_counter = 0; >> > >> > return E1000_SUCCESS; >> > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( >> > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) >> > { >> > struct e1000_phy_info *phy = &hw->phy; >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > u16 phy_id = 0; >> > >> > DEBUGFUNC("e1000_get_phy_id_82571"); >> > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct >> > switch (hw->mac.type) { >> > case e1000_82571: >> > case e1000_82572: >> > - /* >> > - * The 82571 firmware may still be configuring the PHY. >> > + /* The 82571 firmware may still be configuring the PHY. >> > * In this case, we cannot access the PHY until the >> > * configuration is done. So we explicitly set the >> > * PHY ID. >> > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct >> > phy->id = IGP01E1000_I_PHY_ID; >> > break; >> > case e1000_82573: >> > - ret_val = e1000_get_phy_id(hw); >> > + return e1000_get_phy_id(hw); >> > break; >> > case e1000_82574: >> > case e1000_82583: >> > ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > phy->id = (u32)(phy_id << 16); >> > usec_delay(20); >> > ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > phy->id |= (u32)(phy_id); >> > phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); >> > break; >> > default: >> > - ret_val = -E1000_ERR_PHY; >> > + return -E1000_ERR_PHY; >> > break; >> > } >> > -out: >> > - return ret_val; >> > + >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -528,15 +514,13 @@ out: >> > static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) >> > { >> > u32 swsm; >> > - s32 ret_val = E1000_SUCCESS; >> > s32 sw_timeout = hw->nvm.word_size + 1; >> > s32 fw_timeout = hw->nvm.word_size + 1; >> > s32 i = 0; >> > >> > DEBUGFUNC("e1000_get_hw_semaphore_82571"); >> > >> > - /* >> > - * If we have timedout 3 times on trying to acquire >> > + /* If we have timedout 3 times on trying to acquire >> > * the inter-port SMBI semaphore, there is old code >> > * operating on the other port, and it is not >> > * releasing SMBI. Modify the number of times that >> > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( >> > /* Release semaphores */ >> > e1000_put_hw_semaphore_82571(hw); >> > DEBUGOUT("Driver can't access the NVM\n"); >> > - ret_val = -E1000_ERR_NVM; >> > - goto out; >> > + return -E1000_ERR_NVM; >> > } >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 >> > static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) >> > { >> > u32 extcnf_ctrl; >> > - s32 ret_val = E1000_SUCCESS; >> > s32 i = 0; >> > >> > DEBUGFUNC("e1000_get_hw_semaphore_82573"); >> > >> > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); >> > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >> > do { >> > + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >> > E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); >> > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); >> > >> > if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) >> > break; >> > >> > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >> > - >> > msec_delay(2); >> > i++; >> > } while (i < MDIO_OWNERSHIP_TIMEOUT); >> > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( >> > /* Release semaphores */ >> > e1000_put_hw_semaphore_82573(hw); >> > DEBUGOUT("Driver can't access the PHY\n"); >> > - ret_val = -E1000_ERR_PHY; >> > - goto out; >> > + return -E1000_ERR_PHY; >> > } >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 >> > **/ >> > static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool >> active) >> > { >> > - u16 data = E1000_READ_REG(hw, E1000_POEMB); >> > + u32 data = E1000_READ_REG(hw, E1000_POEMB); >> > >> > DEBUGFUNC("e1000_set_d0_lplu_state_82574"); >> > >> > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 >> > **/ >> > static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool >> active) >> > { >> > - u16 data = E1000_READ_REG(hw, E1000_POEMB); >> > + u32 data = E1000_READ_REG(hw, E1000_POEMB); >> > >> > DEBUGFUNC("e1000_set_d3_lplu_state_82574"); >> > >> > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc >> > >> > ret_val = e1000_get_hw_semaphore_82571(hw); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > switch (hw->mac.type) { >> > case e1000_82573: >> > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc >> > if (ret_val) >> > e1000_put_hw_semaphore_82571(hw); >> > >> > -out: >> > return ret_val; >> > } >> > >> > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru >> > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 >> words, >> > u16 *data) >> > { >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > >> > DEBUGFUNC("e1000_write_nvm_82571"); >> > >> > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 >> > >> > ret_val = e1000_update_nvm_checksum_generic(hw); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > - /* >> > - * If our nvm is an EEPROM, then we're done >> > + /* If our nvm is an EEPROM, then we're done >> > * otherwise, commit the checksum to the flash NVM. >> > */ >> > if (hw->nvm.type != e1000_nvm_flash_hw) >> > - goto out; >> > + return E1000_SUCCESS; >> > >> > /* Check for pending operations. */ >> > for (i = 0; i < E1000_FLASH_UPDATES; i++) { >> > msec_delay(1); >> > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) >> == 0) >> > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) >> > break; >> > } >> > >> > - if (i == E1000_FLASH_UPDATES) { >> > - ret_val = -E1000_ERR_NVM; >> > - goto out; >> > - } >> > + if (i == E1000_FLASH_UPDATES) >> > + return -E1000_ERR_NVM; >> > >> > /* Reset the firmware if using STM opcode. */ >> > if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == >> E1000_STM_OPCODE) { >> > - /* >> > - * The enabling of and the actual reset must be done >> > + /* The enabling of and the actual reset must be done >> > * in two write cycles. >> > */ >> > E1000_WRITE_REG(hw, E1000_HICR, >> E1000_HICR_FW_RESET_ENABLE); >> > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 >> > >> > for (i = 0; i < E1000_FLASH_UPDATES; i++) { >> > msec_delay(1); >> > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) >> == 0) >> > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) >> > break; >> > } >> > >> > - if (i == E1000_FLASH_UPDATES) { >> > - ret_val = -E1000_ERR_NVM; >> > - goto out; >> > - } >> > + if (i == E1000_FLASH_UPDATES) >> > + return -E1000_ERR_NVM; >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st >> > { >> > struct e1000_nvm_info *nvm = &hw->nvm; >> > u32 i, eewr = 0; >> > - s32 ret_val = 0; >> > + s32 ret_val = E1000_SUCCESS; >> > >> > DEBUGFUNC("e1000_write_nvm_eewr_82571"); >> > >> > - /* >> > - * A check for invalid values: offset too large, too many words, >> > + /* A check for invalid values: offset too large, too many words, >> > * and not enough words. >> > */ >> > if ((offset >= nvm->word_size) || (words > (nvm->word_size - >> offset)) || >> > (words == 0)) { >> > DEBUGOUT("nvm parameter(s) out of bounds\n"); >> > - ret_val = -E1000_ERR_NVM; >> > - goto out; >> > + return -E1000_ERR_NVM; >> > } >> > >> > for (i = 0; i < words; i++) { >> > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st >> > break; >> > } >> > >> > -out: >> > return ret_val; >> > } >> > >> > @@ -988,7 +954,6 @@ out: >> > static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) >> > { >> > s32 timeout = PHY_CFG_TIMEOUT; >> > - s32 ret_val = E1000_SUCCESS; >> > >> > DEBUGFUNC("e1000_get_cfg_done_82571"); >> > >> > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru >> > } >> > if (!timeout) { >> > DEBUGOUT("MNG configuration cycle has not completed.\n"); >> > - ret_val = -E1000_ERR_RESET; >> > - goto out; >> > + return -E1000_ERR_RESET; >> > } >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -1023,39 +986,40 @@ out: >> > static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool >> active) >> > { >> > struct e1000_phy_info *phy = &hw->phy; >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > u16 data; >> > >> > DEBUGFUNC("e1000_set_d0_lplu_state_82571"); >> > >> > if (!(phy->ops.read_reg)) >> > - goto out; >> > + return E1000_SUCCESS; >> > >> > ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > if (active) { >> > data |= IGP02E1000_PM_D0_LPLU; >> > ret_val = phy->ops.write_reg(hw, >> IGP02E1000_PHY_POWER_MGMT, >> > data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > /* When LPLU is enabled, we should disable SmartSpeed */ >> > ret_val = phy->ops.read_reg(hw, >> IGP01E1000_PHY_PORT_CONFIG, >> > &data); >> > + if (ret_val) >> > + return ret_val; >> > data &= ~IGP01E1000_PSCFR_SMART_SPEED; >> > ret_val = phy->ops.write_reg(hw, >> IGP01E1000_PHY_PORT_CONFIG, >> > data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > } else { >> > data &= ~IGP02E1000_PM_D0_LPLU; >> > ret_val = phy->ops.write_reg(hw, >> IGP02E1000_PHY_POWER_MGMT, >> > data); >> > - /* >> > - * LPLU and SmartSpeed are mutually exclusive. LPLU is >> used >> > + /* LPLU and SmartSpeed are mutually exclusive. LPLU is >> used >> > * during Dx states where the power conservation is most >> > * important. During driver activity we should enable >> > * SmartSpeed, so performance is maintained. >> > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 >> > >> IGP01E1000_PHY_PORT_CONFIG, >> > &data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > data |= IGP01E1000_PSCFR_SMART_SPEED; >> > ret_val = phy->ops.write_reg(hw, >> > >> IGP01E1000_PHY_PORT_CONFIG, >> > data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > } else if (phy->smart_speed == e1000_smart_speed_off) { >> > ret_val = phy->ops.read_reg(hw, >> > >> IGP01E1000_PHY_PORT_CONFIG, >> > &data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > data &= ~IGP01E1000_PSCFR_SMART_SPEED; >> > ret_val = phy->ops.write_reg(hw, >> > >> IGP01E1000_PHY_PORT_CONFIG, >> > data); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > } >> > } >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -1101,13 +1064,12 @@ out: >> > **/ >> > static s32 e1000_reset_hw_82571(struct e1000_hw *hw) >> > { >> > - u32 ctrl, ctrl_ext; >> > + u32 ctrl, ctrl_ext, eecd, tctl; >> > s32 ret_val; >> > >> > DEBUGFUNC("e1000_reset_hw_82571"); >> > >> > - /* >> > - * Prevent the PCI-E bus from sticking if there is no TLP >> connection >> > + /* Prevent the PCI-E bus from sticking if there is no TLP >> connection >> > * on the last TLP read/write transaction when MAC is reset. >> > */ >> > ret_val = e1000_disable_pcie_master_generic(hw); >> > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e >> > E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); >> > >> > E1000_WRITE_REG(hw, E1000_RCTL, 0); >> > - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); >> > + tctl = E1000_READ_REG(hw, E1000_TCTL); >> > + tctl &= ~E1000_TCTL_EN; >> > + E1000_WRITE_REG(hw, E1000_TCTL, tctl); >> > E1000_WRITE_FLUSH(hw); >> > >> > msec_delay(10); >> > >> > - /* >> > - * Must acquire the MDIO ownership before MAC reset. >> > + /* Must acquire the MDIO ownership before MAC reset. >> > * Ownership defaults to firmware after a reset. >> > */ >> > switch (hw->mac.type) { >> > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e >> > ret_val = e1000_get_auto_rd_done_generic(hw); >> > if (ret_val) >> > /* We don't want to continue accessing MAC registers. */ >> > - goto out; >> > + return ret_val; >> > >> > - /* >> > - * Phy configuration from NVM just starts after EECD_AUTO_RD is >> set. >> > + /* Phy configuration from NVM just starts after EECD_AUTO_RD is >> set. >> > * Need to wait for Phy configuration completion before accessing >> > * NVM and Phy. >> > */ >> > >> > switch (hw->mac.type) { >> > + case e1000_82571: >> > + case e1000_82572: >> > + /* REQ and GNT bits need to be cleared when using AUTO_RD >> > + * to access the EEPROM. >> > + */ >> > + eecd = E1000_READ_REG(hw, E1000_EECD); >> > + eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT); >> > + E1000_WRITE_REG(hw, E1000_EECD, eecd); >> > + break; >> > case e1000_82573: >> > case e1000_82574: >> > case e1000_82583: >> > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e >> > /* Install any alternate MAC address into RAR0 */ >> > ret_val = e1000_check_alt_mac_addr_generic(hw); >> > if (ret_val) >> > - goto out; >> > + return ret_val; >> > >> > e1000_set_laa_state_82571(hw, TRUE); >> > } >> > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e >> > if (hw->phy.media_type == e1000_media_type_internal_serdes) >> > hw->mac.serdes_link_state = e1000_serdes_link_down; >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 >> > >> > /* Initialize identification LED */ >> > ret_val = mac->ops.id_led_init(hw); >> > + /* An error is not fatal and we should not stop init due to this >> */ >> > if (ret_val) >> > DEBUGOUT("Error initializing identification LED\n"); >> > - /* This is not fatal and we should not stop init due to >> this */ >> > >> > /* Disabling VLAN filtering */ >> > DEBUGOUT("Initializing the IEEE VLAN\n"); >> > mac->ops.clear_vfta(hw); >> > >> > - /* Setup the receive address. */ >> > - /* >> > + /* Setup the receive address. >> > * If, however, a locally administered address was assigned to the >> > * 82571, we must reserve a RAR for it to work around an issue >> where >> > * resetting one port will reload the MAC on the other port. >> > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 >> > break; >> > } >> > >> > - /* >> > - * Clear all of the statistics registers (clear on read). It is >> > + /* Clear all of the statistics registers (clear on read). It is >> > * important that we do this after we have tried to establish link >> > * because the symbol error count will increment wildly if there >> > * is no link. >> > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 >> > E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); >> > } >> > >> > - /* >> > - * Workaround for hardware errata. >> > + /* Workaround for hardware errata. >> > * Ensure that DMA Dynamic Clock gating is disabled on 82571 and >> 82572 >> > */ >> > if ((hw->mac.type == e1000_82571) || >> > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 >> > E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); >> > } >> > >> > + /* Disable IPv6 extension header parsing because some malformed >> > + * IPv6 headers can hang the Rx. >> > + */ >> > + if (hw->mac.type <= e1000_82573) { >> > + reg = E1000_READ_REG(hw, E1000_RFCTL); >> > + reg |= (E1000_RFCTL_IPV6_EX_DIS | >> E1000_RFCTL_NEW_IPV6_EXT_DIS); >> > + E1000_WRITE_REG(hw, E1000_RFCTL, reg); >> > + } >> > + >> > /* PCI-Ex Control Registers */ >> > switch (hw->mac.type) { >> > case e1000_82574: >> > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 >> > reg |= (1 << 22); >> > E1000_WRITE_REG(hw, E1000_GCR, reg); >> > >> > - /* >> > - * Workaround for hardware errata. >> > + /* Workaround for hardware errata. >> > * apply workaround for hardware errata documented in >> errata >> > * docs Fixes issue where some error prone or unreliable >> PCIe >> > * completions are occurring, particularly with ASPM >> enabled. >> > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc >> > case e1000_82574: >> > case e1000_82583: >> > if (hw->mng_cookie.vlan_id != 0) { >> > - /* >> > - * The VFTA is a 4096b bit-field, each identifying >> > + /* The VFTA is a 4096b bit-field, each identifying >> > * a single VLAN ID. The following operations >> > * determine which 32b entry (i.e. offset) into >> the >> > * array we want to set the VLAN ID (i.e. bit) of >> > * the manageability unit. >> > */ >> > vfta_offset = (hw->mng_cookie.vlan_id >> >> > - E1000_VFTA_ENTRY_SHIFT) & >> E1000_VFTA_ENTRY_MASK; >> > - vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & >> > - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); >> > + E1000_VFTA_ENTRY_SHIFT) & >> > + E1000_VFTA_ENTRY_MASK; >> > + vfta_bit_in_reg = >> > + 1 << (hw->mng_cookie.vlan_id & >> > + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); >> > } >> > break; >> > default: >> > break; >> > } >> > for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { >> > - /* >> > - * If the offset we want to clear is the same offset of >> the >> > + /* If the offset we want to clear is the same offset of >> the >> > * manageability VLAN ID, then clear all bits except that >> of >> > * the manageability unit. >> > */ >> > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 >> > >> > ctrl = hw->mac.ledctl_mode2; >> > if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { >> > - /* >> > - * If no link, then turn LED on by setting the invert bit >> > + /* If no link, then turn LED on by setting the invert bit >> > * for each LED that's "on" (0x0E) in ledctl_mode2. >> > */ >> > for (i = 0; i < 4; i++) >> > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ >> > { >> > u16 status_1kbt = 0; >> > u16 receive_errors = 0; >> > - bool phy_hung = FALSE; >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > >> > DEBUGFUNC("e1000_check_phy_82574"); >> > >> > - /* >> > - * Read PHY Receive Error counter first, if its is max - all F's >> then >> > + /* Read PHY Receive Error counter first, if its is max - all F's >> then >> > * read the Base1000T status register If both are max then PHY is >> hung. >> > */ >> > ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, >> > &receive_errors); >> > if (ret_val) >> > - goto out; >> > + return FALSE; >> > if (receive_errors == E1000_RECEIVE_ERROR_MAX) { >> > ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, >> > &status_1kbt); >> > if (ret_val) >> > - goto out; >> > + return FALSE; >> > if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == >> > E1000_IDLE_ERROR_COUNT_MASK) >> > - phy_hung = TRUE; >> > + return TRUE; >> > } >> > -out: >> > - return phy_hung; >> > + >> > + return FALSE; >> > } >> > >> > >> > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct >> > { >> > DEBUGFUNC("e1000_setup_link_82571"); >> > >> > - /* >> > - * 82573 does not have a word in the NVM to determine >> > + /* 82573 does not have a word in the NVM to determine >> > * the default flow control setting, so we explicitly >> > * set it to full. >> > */ >> > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 >> > ret_val = e1000_copper_link_setup_igp(hw); >> > break; >> > default: >> > - ret_val = -E1000_ERR_PHY; >> > + return -E1000_ERR_PHY; >> > break; >> > } >> > >> > if (ret_val) >> > - goto out; >> > - >> > - ret_val = e1000_setup_copper_link_generic(hw); >> > + return ret_val; >> > >> > -out: >> > - return ret_val; >> > + return e1000_setup_copper_link_generic(hw); >> > } >> > >> > /** >> > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link >> > switch (hw->mac.type) { >> > case e1000_82571: >> > case e1000_82572: >> > - /* >> > - * If SerDes loopback mode is entered, there is no form >> > + /* If SerDes loopback mode is entered, there is no form >> > * of reset to take the adapter out of that mode. So we >> > * have to explicitly take the adapter out of loopback >> > * mode. This prevents drivers from twiddling their >> thumbs >> > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 >> > >> > ctrl = E1000_READ_REG(hw, E1000_CTRL); >> > status = E1000_READ_REG(hw, E1000_STATUS); >> > + E1000_READ_REG(hw, E1000_RXCW); >> > + /* SYNCH bit and IV bit are sticky */ >> > + usec_delay(10); >> > rxcw = E1000_READ_REG(hw, E1000_RXCW); >> > >> > if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { >> > - >> > /* Receiver is synchronized with no invalid bits. */ >> > switch (mac->serdes_link_state) { >> > case e1000_serdes_link_autoneg_complete: >> > if (!(status & E1000_STATUS_LU)) { >> > - /* >> > - * We have lost link, retry autoneg before >> > + /* We have lost link, retry autoneg before >> > * reporting link failure >> > */ >> > mac->serdes_link_state = >> > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 >> > break; >> > >> > case e1000_serdes_link_forced_up: >> > - /* >> > - * If we are receiving /C/ ordered sets, re-enable >> > + /* If we are receiving /C/ ordered sets, re-enable >> > * auto-negotiation in the TXCW register and >> disable >> > * forced link in the Device Control register in >> an >> > * attempt to auto-negotiate with our link >> partner. >> > - * If the partner code word is null, stop forcing >> > - * and restart auto negotiation. >> > */ >> > - if ((rxcw & E1000_RXCW_C) || !(rxcw & >> E1000_RXCW_CW)) { >> > + if (rxcw & E1000_RXCW_C) { >> > /* Enable autoneg, and unforce link up */ >> > E1000_WRITE_REG(hw, E1000_TXCW, >> mac->txcw); >> > E1000_WRITE_REG(hw, E1000_CTRL, >> > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 >> > >> > case e1000_serdes_link_autoneg_progress: >> > if (rxcw & E1000_RXCW_C) { >> > - /* >> > - * We received /C/ ordered sets, meaning >> the >> > + /* We received /C/ ordered sets, meaning >> the >> > * link partner has autonegotiated, and >> we can >> > * trust the Link Up (LU) status bit. >> > */ >> > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 >> > DEBUGOUT("AN_PROG -> DOWN\n"); >> > } >> > } else { >> > - /* >> > - * The link partner did not autoneg. >> > + /* The link partner did not autoneg. >> > * Force link up and full duplex, and >> change >> > * state to forced. >> > */ >> > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 >> > >> > case e1000_serdes_link_down: >> > default: >> > - /* >> > - * The link was down but the receiver has now >> gained >> > + /* The link was down but the receiver has now >> gained >> > * valid sync, so lets see if we can bring the >> link >> > * up. >> > */ >> > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 >> > mac->serdes_link_state = e1000_serdes_link_down; >> > DEBUGOUT("ANYSTATE -> DOWN\n"); >> > } else { >> > - /* >> > - * Check several times, if Sync and Config >> > - * both are consistently 1 then simply ignore >> > - * the Invalid bit and restart Autoneg >> > + /* Check several times, if SYNCH bit and CONFIG >> > + * bit both are consistently 1 then simply ignore >> > + * the IV bit and restart Autoneg >> > */ >> > for (i = 0; i < AN_RETRY_COUNT; i++) { >> > usec_delay(10); >> > rxcw = E1000_READ_REG(hw, E1000_RXCW); >> > - if ((rxcw & E1000_RXCW_IV) && >> > - !((rxcw & E1000_RXCW_SYNCH) && >> > - (rxcw & E1000_RXCW_C))) { >> > + if ((rxcw & E1000_RXCW_SYNCH) && >> > + (rxcw & E1000_RXCW_C)) >> > + continue; >> > + >> > + if (rxcw & E1000_RXCW_IV) { >> > mac->serdes_has_link = FALSE; >> > mac->serdes_link_state = >> > >> e1000_serdes_link_down; >> > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 >> > ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); >> > if (ret_val) { >> > DEBUGOUT("NVM Read Error\n"); >> > - goto out; >> > + return ret_val; >> > } >> > >> > switch (hw->mac.type) { >> > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 >> > break; >> > } >> > >> > -out: >> > - return ret_val; >> > + return E1000_SUCCESS; >> > } >> > >> > /** >> > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 >> > >> > /* If workaround is activated... */ >> > if (state) >> > - /* >> > - * Hold a copy of the LAA in RAR[14] This is done so that >> > + /* Hold a copy of the LAA in RAR[14] This is done so that >> > * between the time RAR[0] gets clobbered and the time it >> > * gets fixed, the actual LAA is in one of the RARs and no >> > * incoming packets directed to this port are dropped. >> > * Eventually the LAA will be in RAR[0] and RAR[14]. >> > */ >> > - e1000_rar_set_generic(hw, hw->mac.addr, >> > - hw->mac.rar_entry_count - 1); >> > + hw->mac.ops.rar_set(hw, hw->mac.addr, >> > + hw->mac.rar_entry_count - 1); >> > return; >> > } >> > >> > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 >> > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) >> > { >> > struct e1000_nvm_info *nvm = &hw->nvm; >> > - s32 ret_val = E1000_SUCCESS; >> > + s32 ret_val; >> > u16 data; >> > >> > DEBUGFUNC("e1000_fix_nvm_checksum_82571"); >> > >> > if (nvm->type != e1000_nvm_flash_hw) >> > - goto out; >> > + return E1000_SUCCESS; >> > >> > - /* >> > - * Check bit 4 of word 10h. If it is 0, firmware is done updating >> > + /* Check bit 4 of word 10h. If it is 0, firmware is done updating >> > * 10h-12h. Checksum may need to be fixed. >> > */ >> > >> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> > _______________________________________________ >> > svn-src-stable-8@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 >> > To unsubscribe, send any mail to " >> svn-src-stable-8-unsubscribe@freebsd.org" >> > > From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 05:47:54 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9075E4A; Thu, 28 Feb 2013 05:47:54 +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 95EBAC47; Thu, 28 Feb 2013 05:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S5ls9T064455; Thu, 28 Feb 2013 05:47:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S5loBf064426; Thu, 28 Feb 2013 05:47:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302280547.r1S5loBf064426@svn.freebsd.org> From: Xin LI Date: Thu, 28 Feb 2013 05:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247448 - stable/8/contrib/bzip2 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 05:47:54 -0000 Author: delphij Date: Thu Feb 28 05:47:50 2013 New Revision: 247448 URL: http://svnweb.freebsd.org/changeset/base/247448 Log: MFC r215041 (obrien): Upgrade to bzip2 version 1.0.6. Modified: stable/8/contrib/bzip2/CHANGES stable/8/contrib/bzip2/LICENSE stable/8/contrib/bzip2/Makefile stable/8/contrib/bzip2/Makefile-libbz2_so stable/8/contrib/bzip2/README stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS stable/8/contrib/bzip2/blocksort.c stable/8/contrib/bzip2/bzip2.1 stable/8/contrib/bzip2/bzip2.c stable/8/contrib/bzip2/bzip2recover.c stable/8/contrib/bzip2/bzlib.c stable/8/contrib/bzip2/bzlib.h stable/8/contrib/bzip2/bzlib_private.h stable/8/contrib/bzip2/compress.c stable/8/contrib/bzip2/crctable.c stable/8/contrib/bzip2/decompress.c stable/8/contrib/bzip2/huffman.c stable/8/contrib/bzip2/randtable.c stable/8/contrib/bzip2/spewG.c stable/8/contrib/bzip2/unzcrash.c Directory Properties: stable/8/contrib/bzip2/ (props changed) Modified: stable/8/contrib/bzip2/CHANGES ============================================================================== --- stable/8/contrib/bzip2/CHANGES Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/CHANGES Thu Feb 28 05:47:50 2013 (r247448) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -317,3 +317,11 @@ Fixes some minor bugs since the last ver ~~~~~~~~~~~~~~~~~ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2. + +1.0.6 (6 Sept 10) +~~~~~~~~~~~~~~~~~ + +* Security fix for CVE-2010-0405. This was reported by Mikolaj + Izdebski. + +* Make the documentation build on Ubuntu 10.04 Modified: stable/8/contrib/bzip2/LICENSE ============================================================================== --- stable/8/contrib/bzip2/LICENSE Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/LICENSE Thu Feb 28 05:47:50 2013 (r247448) @@ -2,7 +2,7 @@ -------------------------------------------------------------------------- This program, "bzip2", the associated library "libbzip2", and all -documentation, are copyright (C) 1996-2007 Julian R Seward. All +documentation, are copyright (C) 1996-2010 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.5 of 10 December 2007 +bzip2/libbzip2 version 1.0.6 of 6 September 2010 -------------------------------------------------------------------------- Modified: stable/8/contrib/bzip2/Makefile ============================================================================== --- stable/8/contrib/bzip2/Makefile Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/Makefile Thu Feb 28 05:47:50 2013 (r247448) @@ -2,8 +2,8 @@ # This file is part of bzip2/libbzip2, a program and library for # lossless, block-sorting data compression. # -# bzip2/libbzip2 version 1.0.5 of 10 December 2007 -# Copyright (C) 1996-2007 Julian Seward +# bzip2/libbzip2 version 1.0.6 of 6 September 2010 +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c distclean: clean rm -f manual.ps manual.html manual.pdf -DISTNAME=bzip2-1.0.5 +DISTNAME=bzip2-1.0.6 dist: check manual rm -f $(DISTNAME) ln -s -f . $(DISTNAME) Modified: stable/8/contrib/bzip2/Makefile-libbz2_so ============================================================================== --- stable/8/contrib/bzip2/Makefile-libbz2_so Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/Makefile-libbz2_so Thu Feb 28 05:47:50 2013 (r247448) @@ -1,6 +1,6 @@ # This Makefile builds a shared version of the library, -# libbz2.so.1.0.4, with soname libbz2.so.1.0, +# libbz2.so.1.0.6, with soname libbz2.so.1.0, # at least on x86-Linux (RedHat 7.2), # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). # Please see the README file for some important info @@ -10,8 +10,8 @@ # This file is part of bzip2/libbzip2, a program and library for # lossless, block-sorting data compression. # -# bzip2/libbzip2 version 1.0.5 of 10 December 2007 -# Copyright (C) 1996-2007 Julian Seward +# bzip2/libbzip2 version 1.0.6 of 6 September 2010 +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -35,13 +35,13 @@ OBJS= blocksort.o \ bzlib.o all: $(OBJS) - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.4 $(OBJS) - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4 + $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 rm -f libbz2.so.1.0 - ln -s libbz2.so.1.0.4 libbz2.so.1.0 + ln -s libbz2.so.1.0.6 libbz2.so.1.0 clean: - rm -f $(OBJS) bzip2.o libbz2.so.1.0.4 libbz2.so.1.0 bzip2-shared + rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared blocksort.o: blocksort.c $(CC) $(CFLAGS) -c blocksort.c Modified: stable/8/contrib/bzip2/README ============================================================================== --- stable/8/contrib/bzip2/README Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/README Thu Feb 28 05:47:50 2013 (r247448) @@ -6,8 +6,8 @@ This version is fully compatible with th This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.5 of 10 December 2007 -Copyright (C) 1996-2007 Julian Seward +bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -181,6 +181,10 @@ WHAT'S NEW IN 1.0.5 ? See the CHANGES file. +WHAT'S NEW IN 1.0.6 ? + + See the CHANGES file. + I hope you find bzip2 useful. Feel free to contact me at jseward@bzip.org @@ -208,3 +212,4 @@ Cambridge, UK. 15 February 2005 (bzip2, version 1.0.3) 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) + 6 Sept 2010 (bzip2, version 1.0.6) Modified: stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS Thu Feb 28 05:47:50 2013 (r247448) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.5 of 10 December 2007 -Copyright (C) 1996-2007 Julian Seward +bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.5 should compile without problems on the vast majority of +bzip2-1.0.6 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: stable/8/contrib/bzip2/blocksort.c ============================================================================== --- stable/8/contrib/bzip2/blocksort.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/blocksort.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/bzip2.1 ============================================================================== --- stable/8/contrib/bzip2/bzip2.1 Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzip2.1 Thu Feb 28 05:47:50 2013 (r247448) @@ -1,7 +1,7 @@ .PU .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.4 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 .br bzcat \- decompresses files to stdout .br @@ -405,11 +405,11 @@ I/O error messages are not as helpful as tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.4 of +This manual page pertains to version 1.0.6 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions -0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, but with the following +0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following exception: 0.9.0 and above can correctly decompress multiple concatenated compressed files. 0.1pl2 cannot do this; it will stop after decompressing just the first file in the stream. Modified: stable/8/contrib/bzip2/bzip2.c ============================================================================== --- stable/8/contrib/bzip2/bzip2.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzip2.c Thu Feb 28 05:47:50 2013 (r247448) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -1605,11 +1605,11 @@ void license ( void ) "bzip2, a block-sorting file compressor. " "Version %s.\n" " \n" - " Copyright (C) 1996-2007 by Julian Seward.\n" + " Copyright (C) 1996-2010 by Julian Seward.\n" " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.5 source distribution.\n" + " in the bzip2-1.0.6 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" Modified: stable/8/contrib/bzip2/bzip2recover.c ============================================================================== --- stable/8/contrib/bzip2/bzip2recover.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzip2recover.c Thu Feb 28 05:47:50 2013 (r247448) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -313,7 +313,7 @@ Int32 main ( Int32 argc, Char** argv ) inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", Modified: stable/8/contrib/bzip2/bzlib.c ============================================================================== --- stable/8/contrib/bzip2/bzlib.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzlib.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/bzlib.h ============================================================================== --- stable/8/contrib/bzip2/bzlib.h Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzlib.h Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/bzlib_private.h ============================================================================== --- stable/8/contrib/bzip2/bzlib_private.h Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/bzlib_private.h Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.5, 10-Dec-2007" +#define BZ_VERSION "1.0.6, 6-Sept-2010" typedef char Char; typedef unsigned char Bool; Modified: stable/8/contrib/bzip2/compress.c ============================================================================== --- stable/8/contrib/bzip2/compress.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/compress.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/crctable.c ============================================================================== --- stable/8/contrib/bzip2/crctable.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/crctable.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/decompress.c ============================================================================== --- stable/8/contrib/bzip2/decompress.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/decompress.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -492,15 +492,28 @@ Int32 BZ2_decompress ( DState* s ) RETURN(BZ_DATA_ERROR); /*-- Set up cftab to facilitate generation of T^(-1) --*/ + /* Check: unzftab entries in range. */ + for (i = 0; i <= 255; i++) { + if (s->unzftab[i] < 0 || s->unzftab[i] > nblock) + RETURN(BZ_DATA_ERROR); + } + /* Actually generate cftab. */ s->cftab[0] = 0; for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; + /* Check: cftab entries in range. */ for (i = 0; i <= 256; i++) { if (s->cftab[i] < 0 || s->cftab[i] > nblock) { /* s->cftab[i] can legitimately be == nblock */ RETURN(BZ_DATA_ERROR); } } + /* Check: cftab entries non-descending. */ + for (i = 1; i <= 256; i++) { + if (s->cftab[i-1] > s->cftab[i]) { + RETURN(BZ_DATA_ERROR); + } + } s->state_out_len = 0; s->state_out_ch = 0; Modified: stable/8/contrib/bzip2/huffman.c ============================================================================== --- stable/8/contrib/bzip2/huffman.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/huffman.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/randtable.c ============================================================================== --- stable/8/contrib/bzip2/randtable.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/randtable.c Thu Feb 28 05:47:50 2013 (r247448) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/spewG.c ============================================================================== --- stable/8/contrib/bzip2/spewG.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/spewG.c Thu Feb 28 05:47:50 2013 (r247448) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/8/contrib/bzip2/unzcrash.c ============================================================================== --- stable/8/contrib/bzip2/unzcrash.c Thu Feb 28 05:18:15 2013 (r247447) +++ stable/8/contrib/bzip2/unzcrash.c Thu Feb 28 05:47:50 2013 (r247448) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 06:00:27 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6082EDC; Thu, 28 Feb 2013 06:00:27 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx1.freebsd.org (Postfix) with ESMTP id 98FB0D02; Thu, 28 Feb 2013 06:00:26 +0000 (UTC) Received: by mail-ve0-f180.google.com with SMTP id jx10so1401167veb.39 for ; Wed, 27 Feb 2013 22:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=kWFqQg1D2iSTSqxPV7HXvwQTD5lXWM9o/cj91sIckwI=; b=dpMI2Vf4yiK6E//ZGcM4nTVQON0vsPqrA5cGCEcBj/rpl/CbTupJfvaYsHavlWn/d3 ethCcc04Yg0XmKoqDOdxd6uRvPO7SK30xm/bvn1/H6n8u1HTFTSkE69VX/3RvNsetLTb 6faCcQiTqDZpH691Yhrx2fH9n3LCAAt+JGpvEqwA1Cwlq5TyzDRpd2JNDjKoOpa7byAY rhD4xzcY5yrWwadSlsqVNhCbK/Bll8HUn1zbSCpXaL5gcg1FIJ7mqGnNZ6n+daRAmlsP MBZ0IoK6r8/MFM4cfQdDLd70T2FLC41vm1DcUieKNMM4sFJvrytwoEUEUjpPNg8QjA72 fHMg== MIME-Version: 1.0 X-Received: by 10.58.56.161 with SMTP id b1mr2095922veq.42.1362031220028; Wed, 27 Feb 2013 22:00:20 -0800 (PST) Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 22:00:19 -0800 (PST) In-Reply-To: References: <201302280022.r1S0M4vm064514@svn.freebsd.org> <20130228022333.GC70215@glenbarber.us> Date: Wed, 27 Feb 2013 22:00:19 -0800 Message-ID: Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb From: Jack Vogel To: Glen Barber Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jack F Vogel , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 06:00:27 -0000 I am checking with Luigi to see if an MFC of his code is a viable solution, if not I will change my core code. Stay tuned... Jack On Wed, Feb 27, 2013 at 9:41 PM, Jack Vogel wrote: > LOL, I would see the messages just as I sent this, never mind. > > Jack > > > On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel wrote: > >> Oh, that's odd, then HEAD should be broken too, do you have more detail? >> >> Jack >> >> >> On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber wrote: >> >>> Jack, >>> >>> This commit seems to break the build for at least powerpc and sparc64. >>> >>> Glen >>> >>> On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote: >>> > Author: jfv >>> > Date: Thu Feb 28 00:22:04 2013 >>> > New Revision: 247430 >>> > URL: http://svnweb.freebsd.org/changeset/base/247430 >>> > >>> > Log: >>> > MFC of the E1000 drivers to STABLE/8, this includes the follow >>> revisions >>> > plus a few tweaks: >>> > 196969,196970,211516,214646,215781,215789,215808,215910,223350, >>> > 223482,223831,228281,228393,229939,231796,232238,234665,235256, >>> > 236406,238148,238151,238214,238765,238770,238953,238981,239105, >>> > 239109,239304,240518,240693,240968,241037,241856,241885,243570, >>> > 243857,245334,246128,246482,247064 >>> > >>> > Added: >>> > stable/8/sys/dev/e1000/e1000_i210.c >>> > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c >>> > stable/8/sys/dev/e1000/e1000_i210.h >>> > - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h >>> > Modified: >>> > stable/8/sys/conf/files >>> > stable/8/sys/dev/e1000/e1000_82541.c >>> > stable/8/sys/dev/e1000/e1000_82543.c >>> > stable/8/sys/dev/e1000/e1000_82571.c >>> > stable/8/sys/dev/e1000/e1000_82575.c >>> > stable/8/sys/dev/e1000/e1000_82575.h >>> > stable/8/sys/dev/e1000/e1000_api.c >>> > stable/8/sys/dev/e1000/e1000_api.h >>> > stable/8/sys/dev/e1000/e1000_defines.h >>> > stable/8/sys/dev/e1000/e1000_hw.h >>> > stable/8/sys/dev/e1000/e1000_ich8lan.c >>> > stable/8/sys/dev/e1000/e1000_ich8lan.h >>> > stable/8/sys/dev/e1000/e1000_mac.c >>> > stable/8/sys/dev/e1000/e1000_mac.h >>> > stable/8/sys/dev/e1000/e1000_manage.c >>> > stable/8/sys/dev/e1000/e1000_manage.h >>> > stable/8/sys/dev/e1000/e1000_nvm.c >>> > stable/8/sys/dev/e1000/e1000_nvm.h >>> > stable/8/sys/dev/e1000/e1000_osdep.h >>> > stable/8/sys/dev/e1000/e1000_phy.c >>> > stable/8/sys/dev/e1000/e1000_phy.h >>> > stable/8/sys/dev/e1000/e1000_regs.h >>> > stable/8/sys/dev/e1000/if_em.c (contents, props changed) >>> > stable/8/sys/dev/e1000/if_igb.c (contents, props changed) >>> > stable/8/sys/dev/e1000/if_igb.h >>> > stable/8/sys/dev/e1000/if_lem.c >>> > stable/8/sys/modules/em/Makefile >>> > stable/8/sys/modules/igb/Makefile >>> > Directory Properties: >>> > stable/8/sys/dev/e1000/ (props changed) >>> > >>> > Modified: stable/8/sys/conf/files >>> > >>> ============================================================================== >>> > --- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013 (r247429) >>> > +++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013 (r247430) >>> > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i >>> > compile-with "${NORMAL_C} -I$S/dev/e1000" >>> > dev/e1000/e1000_ich8lan.c optional em | igb \ >>> > compile-with "${NORMAL_C} -I$S/dev/e1000" >>> > +dev/e1000/e1000_i210.c optional em | igb \ >>> > + compile-with "${NORMAL_C} -I$S/dev/e1000" >>> > dev/e1000/e1000_api.c optional em | igb \ >>> > compile-with "${NORMAL_C} -I$S/dev/e1000" >>> > dev/e1000/e1000_mac.c optional em | igb \ >>> > >>> > Modified: stable/8/sys/dev/e1000/e1000_82541.c >>> > >>> ============================================================================== >>> > --- stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:18:56 2013 >>> (r247429) >>> > +++ stable/8/sys/dev/e1000/e1000_82541.c Thu Feb 28 00:22:04 2013 >>> (r247430) >>> > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st >>> > * of MAC speed/duplex configuration. So we only need to >>> > * configure Collision Distance in the MAC. >>> > */ >>> > - e1000_config_collision_dist_generic(hw); >>> > + mac->ops.config_collision_dist(hw); >>> > >>> > /* >>> > * Configure Flow Control now that Auto-Neg has completed. >>> > >>> > Modified: stable/8/sys/dev/e1000/e1000_82543.c >>> > >>> ============================================================================== >>> > --- stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:18:56 2013 >>> (r247429) >>> > +++ stable/8/sys/dev/e1000/e1000_82543.c Thu Feb 28 00:22:04 2013 >>> (r247430) >>> > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 >>> > DEBUGOUT("Valid link established!!!\n"); >>> > /* Config the MAC and PHY after link is up */ >>> > if (hw->mac.type == e1000_82544) { >>> > - e1000_config_collision_dist_generic(hw); >>> > + hw->mac.ops.config_collision_dist(hw); >>> > } else { >>> > ret_val = e1000_config_mac_to_phy_82543(hw); >>> > if (ret_val) >>> > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( >>> > /* Take the link out of reset */ >>> > ctrl &= ~E1000_CTRL_LRST; >>> > >>> > - e1000_config_collision_dist_generic(hw); >>> > + hw->mac.ops.config_collision_dist(hw); >>> > >>> > ret_val = e1000_commit_fc_settings_generic(hw); >>> > if (ret_val) >>> > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 >>> > * settings. >>> > */ >>> > if (mac->type == e1000_82544) >>> > - e1000_config_collision_dist_generic(hw); >>> > + hw->mac.ops.config_collision_dist(hw); >>> > else { >>> > ret_val = e1000_config_mac_to_phy_82543(hw); >>> > if (ret_val) { >>> > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 >>> > if (phy_data & M88E1000_PSSR_DPLX) >>> > ctrl |= E1000_CTRL_FD; >>> > >>> > - e1000_config_collision_dist_generic(hw); >>> > + hw->mac.ops.config_collision_dist(hw); >>> > >>> > /* >>> > * Set up speed in the Device Control register depending on >>> > >>> > Modified: stable/8/sys/dev/e1000/e1000_82571.c >>> > >>> ============================================================================== >>> > --- stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:18:56 2013 >>> (r247429) >>> > +++ stable/8/sys/dev/e1000/e1000_82571.c Thu Feb 28 00:22:04 2013 >>> (r247430) >>> > @@ -1,6 +1,6 @@ >>> > >>> /****************************************************************************** >>> > >>> > - Copyright (c) 2001-2011, Intel Corporation >>> > + Copyright (c) 2001-2013, Intel Corporation >>> > All rights reserved. >>> > >>> > Redistribution and use in source and binary forms, with or without >>> > @@ -32,8 +32,7 @@ >>> > >>> ******************************************************************************/ >>> > /*$FreeBSD$*/ >>> > >>> > -/* >>> > - * 82571EB Gigabit Ethernet Controller >>> > +/* 82571EB Gigabit Ethernet Controller >>> > * 82571EB Gigabit Ethernet Controller (Copper) >>> > * 82571EB Gigabit Ethernet Controller (Fiber) >>> > * 82571EB Dual Port Gigabit Mezzanine Adapter >>> > @@ -51,9 +50,6 @@ >>> > >>> > #include "e1000_api.h" >>> > >>> > -static s32 e1000_init_phy_params_82571(struct e1000_hw *hw); >>> > -static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw); >>> > -static s32 e1000_init_mac_params_82571(struct e1000_hw *hw); >>> > static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw); >>> > static void e1000_release_nvm_82571(struct e1000_hw *hw); >>> > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, >>> > @@ -78,7 +74,6 @@ static s32 e1000_get_hw_semaphore_82571 >>> > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); >>> > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); >>> > static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); >>> > -static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); >>> > static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); >>> > static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); >>> > static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); >>> > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_ >>> > static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) >>> > { >>> > struct e1000_phy_info *phy = &hw->phy; >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > >>> > DEBUGFUNC("e1000_init_phy_params_82571"); >>> > >>> > if (hw->phy.media_type != e1000_media_type_copper) { >>> > phy->type = e1000_phy_none; >>> > - goto out; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > phy->addr = 1; >>> > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s >>> > phy->ops.set_d3_lplu_state = >>> e1000_set_d3_lplu_state_82574; >>> > break; >>> > default: >>> > - ret_val = -E1000_ERR_PHY; >>> > - goto out; >>> > + return -E1000_ERR_PHY; >>> > break; >>> > } >>> > >>> > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s >>> > ret_val = e1000_get_phy_id_82571(hw); >>> > if (ret_val) { >>> > DEBUGOUT("Error getting PHY ID\n"); >>> > - goto out; >>> > + return ret_val; >>> > } >>> > >>> > /* Verify phy id */ >>> > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s >>> > if (ret_val) >>> > DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); >>> > >>> > -out: >>> > return ret_val; >>> > } >>> > >>> > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s >>> > if (((eecd >> 15) & 0x3) == 0x3) { >>> > nvm->type = e1000_nvm_flash_hw; >>> > nvm->word_size = 2048; >>> > - /* >>> > - * Autonomous Flash update bit must be cleared >>> due >>> > + /* Autonomous Flash update bit must be cleared >>> due >>> > * to Flash update issue. >>> > */ >>> > eecd &= ~E1000_EECD_AUPDEN; >>> > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s >>> > nvm->type = e1000_nvm_eeprom_spi; >>> > size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> >>> > E1000_EECD_SIZE_EX_SHIFT); >>> > - /* >>> > - * Added to a constant, "size" becomes the left-shift >>> value >>> > + /* Added to a constant, "size" becomes the left-shift >>> value >>> > * for setting word_size. >>> > */ >>> > size += NVM_WORD_SIZE_BASE_SHIFT; >>> > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s >>> > >>> > /* FWSM register */ >>> > mac->has_fwsm = TRUE; >>> > - /* >>> > - * ARC supported; valid only if manageability features >>> are >>> > + /* ARC supported; valid only if manageability features >>> are >>> > * enabled. >>> > */ >>> > - mac->arc_subsystem_valid = (E1000_READ_REG(hw, >>> E1000_FWSM) & >>> > - E1000_FWSM_MODE_MASK) ? TRUE >>> : FALSE; >>> > + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, >>> E1000_FWSM) & >>> > + E1000_FWSM_MODE_MASK); >>> > break; >>> > case e1000_82574: >>> > case e1000_82583: >>> > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s >>> > break; >>> > } >>> > >>> > - /* >>> > - * Ensure that the inter-port SWSM.SMBI lock bit is clear before >>> > + /* Ensure that the inter-port SWSM.SMBI lock bit is clear before >>> > * first NVM or PHY acess. This should be done for single-port >>> > * devices, and for one port only on dual-port devices so that >>> > * for those devices we can still use the SMBI lock to >>> synchronize >>> > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s >>> > E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | >>> > E1000_SWSM2_LOCK); >>> > force_clear_smbi = TRUE; >>> > - } else >>> > + } else { >>> > force_clear_smbi = FALSE; >>> > + } >>> > break; >>> > default: >>> > force_clear_smbi = TRUE; >>> > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s >>> > E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI); >>> > } >>> > >>> > - /* >>> > - * Initialze device specific counter of SMBI acquisition >>> > - * timeouts. >>> > - */ >>> > + /* Initialze device specific counter of SMBI acquisition >>> timeouts. */ >>> > hw->dev_spec._82571.smb_counter = 0; >>> > >>> > return E1000_SUCCESS; >>> > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571( >>> > static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) >>> > { >>> > struct e1000_phy_info *phy = &hw->phy; >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > u16 phy_id = 0; >>> > >>> > DEBUGFUNC("e1000_get_phy_id_82571"); >>> > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct >>> > switch (hw->mac.type) { >>> > case e1000_82571: >>> > case e1000_82572: >>> > - /* >>> > - * The 82571 firmware may still be configuring the PHY. >>> > + /* The 82571 firmware may still be configuring the PHY. >>> > * In this case, we cannot access the PHY until the >>> > * configuration is done. So we explicitly set the >>> > * PHY ID. >>> > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct >>> > phy->id = IGP01E1000_I_PHY_ID; >>> > break; >>> > case e1000_82573: >>> > - ret_val = e1000_get_phy_id(hw); >>> > + return e1000_get_phy_id(hw); >>> > break; >>> > case e1000_82574: >>> > case e1000_82583: >>> > ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > phy->id = (u32)(phy_id << 16); >>> > usec_delay(20); >>> > ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > phy->id |= (u32)(phy_id); >>> > phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); >>> > break; >>> > default: >>> > - ret_val = -E1000_ERR_PHY; >>> > + return -E1000_ERR_PHY; >>> > break; >>> > } >>> > -out: >>> > - return ret_val; >>> > + >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -528,15 +514,13 @@ out: >>> > static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) >>> > { >>> > u32 swsm; >>> > - s32 ret_val = E1000_SUCCESS; >>> > s32 sw_timeout = hw->nvm.word_size + 1; >>> > s32 fw_timeout = hw->nvm.word_size + 1; >>> > s32 i = 0; >>> > >>> > DEBUGFUNC("e1000_get_hw_semaphore_82571"); >>> > >>> > - /* >>> > - * If we have timedout 3 times on trying to acquire >>> > + /* If we have timedout 3 times on trying to acquire >>> > * the inter-port SMBI semaphore, there is old code >>> > * operating on the other port, and it is not >>> > * releasing SMBI. Modify the number of times that >>> > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571( >>> > /* Release semaphores */ >>> > e1000_put_hw_semaphore_82571(hw); >>> > DEBUGOUT("Driver can't access the NVM\n"); >>> > - ret_val = -E1000_ERR_NVM; >>> > - goto out; >>> > + return -E1000_ERR_NVM; >>> > } >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571 >>> > static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) >>> > { >>> > u32 extcnf_ctrl; >>> > - s32 ret_val = E1000_SUCCESS; >>> > s32 i = 0; >>> > >>> > DEBUGFUNC("e1000_get_hw_semaphore_82573"); >>> > >>> > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); >>> > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >>> > do { >>> > + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >>> > E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); >>> > extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); >>> > >>> > if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) >>> > break; >>> > >>> > - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; >>> > - >>> > msec_delay(2); >>> > i++; >>> > } while (i < MDIO_OWNERSHIP_TIMEOUT); >>> > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573( >>> > /* Release semaphores */ >>> > e1000_put_hw_semaphore_82573(hw); >>> > DEBUGOUT("Driver can't access the PHY\n"); >>> > - ret_val = -E1000_ERR_PHY; >>> > - goto out; >>> > + return -E1000_ERR_PHY; >>> > } >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574 >>> > **/ >>> > static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool >>> active) >>> > { >>> > - u16 data = E1000_READ_REG(hw, E1000_POEMB); >>> > + u32 data = E1000_READ_REG(hw, E1000_POEMB); >>> > >>> > DEBUGFUNC("e1000_set_d0_lplu_state_82574"); >>> > >>> > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574 >>> > **/ >>> > static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool >>> active) >>> > { >>> > - u16 data = E1000_READ_REG(hw, E1000_POEMB); >>> > + u32 data = E1000_READ_REG(hw, E1000_POEMB); >>> > >>> > DEBUGFUNC("e1000_set_d3_lplu_state_82574"); >>> > >>> > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc >>> > >>> > ret_val = e1000_get_hw_semaphore_82571(hw); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > switch (hw->mac.type) { >>> > case e1000_82573: >>> > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc >>> > if (ret_val) >>> > e1000_put_hw_semaphore_82571(hw); >>> > >>> > -out: >>> > return ret_val; >>> > } >>> > >>> > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru >>> > static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 >>> words, >>> > u16 *data) >>> > { >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > >>> > DEBUGFUNC("e1000_write_nvm_82571"); >>> > >>> > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825 >>> > >>> > ret_val = e1000_update_nvm_checksum_generic(hw); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > - /* >>> > - * If our nvm is an EEPROM, then we're done >>> > + /* If our nvm is an EEPROM, then we're done >>> > * otherwise, commit the checksum to the flash NVM. >>> > */ >>> > if (hw->nvm.type != e1000_nvm_flash_hw) >>> > - goto out; >>> > + return E1000_SUCCESS; >>> > >>> > /* Check for pending operations. */ >>> > for (i = 0; i < E1000_FLASH_UPDATES; i++) { >>> > msec_delay(1); >>> > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) >>> == 0) >>> > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) >>> > break; >>> > } >>> > >>> > - if (i == E1000_FLASH_UPDATES) { >>> > - ret_val = -E1000_ERR_NVM; >>> > - goto out; >>> > - } >>> > + if (i == E1000_FLASH_UPDATES) >>> > + return -E1000_ERR_NVM; >>> > >>> > /* Reset the firmware if using STM opcode. */ >>> > if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == >>> E1000_STM_OPCODE) { >>> > - /* >>> > - * The enabling of and the actual reset must be done >>> > + /* The enabling of and the actual reset must be done >>> > * in two write cycles. >>> > */ >>> > E1000_WRITE_REG(hw, E1000_HICR, >>> E1000_HICR_FW_RESET_ENABLE); >>> > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825 >>> > >>> > for (i = 0; i < E1000_FLASH_UPDATES; i++) { >>> > msec_delay(1); >>> > - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) >>> == 0) >>> > + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)) >>> > break; >>> > } >>> > >>> > - if (i == E1000_FLASH_UPDATES) { >>> > - ret_val = -E1000_ERR_NVM; >>> > - goto out; >>> > - } >>> > + if (i == E1000_FLASH_UPDATES) >>> > + return -E1000_ERR_NVM; >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st >>> > { >>> > struct e1000_nvm_info *nvm = &hw->nvm; >>> > u32 i, eewr = 0; >>> > - s32 ret_val = 0; >>> > + s32 ret_val = E1000_SUCCESS; >>> > >>> > DEBUGFUNC("e1000_write_nvm_eewr_82571"); >>> > >>> > - /* >>> > - * A check for invalid values: offset too large, too many words, >>> > + /* A check for invalid values: offset too large, too many words, >>> > * and not enough words. >>> > */ >>> > if ((offset >= nvm->word_size) || (words > (nvm->word_size - >>> offset)) || >>> > (words == 0)) { >>> > DEBUGOUT("nvm parameter(s) out of bounds\n"); >>> > - ret_val = -E1000_ERR_NVM; >>> > - goto out; >>> > + return -E1000_ERR_NVM; >>> > } >>> > >>> > for (i = 0; i < words; i++) { >>> > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st >>> > break; >>> > } >>> > >>> > -out: >>> > return ret_val; >>> > } >>> > >>> > @@ -988,7 +954,6 @@ out: >>> > static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) >>> > { >>> > s32 timeout = PHY_CFG_TIMEOUT; >>> > - s32 ret_val = E1000_SUCCESS; >>> > >>> > DEBUGFUNC("e1000_get_cfg_done_82571"); >>> > >>> > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru >>> > } >>> > if (!timeout) { >>> > DEBUGOUT("MNG configuration cycle has not completed.\n"); >>> > - ret_val = -E1000_ERR_RESET; >>> > - goto out; >>> > + return -E1000_ERR_RESET; >>> > } >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -1023,39 +986,40 @@ out: >>> > static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool >>> active) >>> > { >>> > struct e1000_phy_info *phy = &hw->phy; >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > u16 data; >>> > >>> > DEBUGFUNC("e1000_set_d0_lplu_state_82571"); >>> > >>> > if (!(phy->ops.read_reg)) >>> > - goto out; >>> > + return E1000_SUCCESS; >>> > >>> > ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, >>> &data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > if (active) { >>> > data |= IGP02E1000_PM_D0_LPLU; >>> > ret_val = phy->ops.write_reg(hw, >>> IGP02E1000_PHY_POWER_MGMT, >>> > data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > /* When LPLU is enabled, we should disable SmartSpeed */ >>> > ret_val = phy->ops.read_reg(hw, >>> IGP01E1000_PHY_PORT_CONFIG, >>> > &data); >>> > + if (ret_val) >>> > + return ret_val; >>> > data &= ~IGP01E1000_PSCFR_SMART_SPEED; >>> > ret_val = phy->ops.write_reg(hw, >>> IGP01E1000_PHY_PORT_CONFIG, >>> > data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > } else { >>> > data &= ~IGP02E1000_PM_D0_LPLU; >>> > ret_val = phy->ops.write_reg(hw, >>> IGP02E1000_PHY_POWER_MGMT, >>> > data); >>> > - /* >>> > - * LPLU and SmartSpeed are mutually exclusive. LPLU is >>> used >>> > + /* LPLU and SmartSpeed are mutually exclusive. LPLU is >>> used >>> > * during Dx states where the power conservation is most >>> > * important. During driver activity we should enable >>> > * SmartSpeed, so performance is maintained. >>> > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571 >>> > >>> IGP01E1000_PHY_PORT_CONFIG, >>> > &data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > data |= IGP01E1000_PSCFR_SMART_SPEED; >>> > ret_val = phy->ops.write_reg(hw, >>> > >>> IGP01E1000_PHY_PORT_CONFIG, >>> > data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > } else if (phy->smart_speed == e1000_smart_speed_off) { >>> > ret_val = phy->ops.read_reg(hw, >>> > >>> IGP01E1000_PHY_PORT_CONFIG, >>> > &data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > data &= ~IGP01E1000_PSCFR_SMART_SPEED; >>> > ret_val = phy->ops.write_reg(hw, >>> > >>> IGP01E1000_PHY_PORT_CONFIG, >>> > data); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > } >>> > } >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -1101,13 +1064,12 @@ out: >>> > **/ >>> > static s32 e1000_reset_hw_82571(struct e1000_hw *hw) >>> > { >>> > - u32 ctrl, ctrl_ext; >>> > + u32 ctrl, ctrl_ext, eecd, tctl; >>> > s32 ret_val; >>> > >>> > DEBUGFUNC("e1000_reset_hw_82571"); >>> > >>> > - /* >>> > - * Prevent the PCI-E bus from sticking if there is no TLP >>> connection >>> > + /* Prevent the PCI-E bus from sticking if there is no TLP >>> connection >>> > * on the last TLP read/write transaction when MAC is reset. >>> > */ >>> > ret_val = e1000_disable_pcie_master_generic(hw); >>> > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e >>> > E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); >>> > >>> > E1000_WRITE_REG(hw, E1000_RCTL, 0); >>> > - E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); >>> > + tctl = E1000_READ_REG(hw, E1000_TCTL); >>> > + tctl &= ~E1000_TCTL_EN; >>> > + E1000_WRITE_REG(hw, E1000_TCTL, tctl); >>> > E1000_WRITE_FLUSH(hw); >>> > >>> > msec_delay(10); >>> > >>> > - /* >>> > - * Must acquire the MDIO ownership before MAC reset. >>> > + /* Must acquire the MDIO ownership before MAC reset. >>> > * Ownership defaults to firmware after a reset. >>> > */ >>> > switch (hw->mac.type) { >>> > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e >>> > ret_val = e1000_get_auto_rd_done_generic(hw); >>> > if (ret_val) >>> > /* We don't want to continue accessing MAC registers. */ >>> > - goto out; >>> > + return ret_val; >>> > >>> > - /* >>> > - * Phy configuration from NVM just starts after EECD_AUTO_RD is >>> set. >>> > + /* Phy configuration from NVM just starts after EECD_AUTO_RD is >>> set. >>> > * Need to wait for Phy configuration completion before accessing >>> > * NVM and Phy. >>> > */ >>> > >>> > switch (hw->mac.type) { >>> > + case e1000_82571: >>> > + case e1000_82572: >>> > + /* REQ and GNT bits need to be cleared when using AUTO_RD >>> > + * to access the EEPROM. >>> > + */ >>> > + eecd = E1000_READ_REG(hw, E1000_EECD); >>> > + eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT); >>> > + E1000_WRITE_REG(hw, E1000_EECD, eecd); >>> > + break; >>> > case e1000_82573: >>> > case e1000_82574: >>> > case e1000_82583: >>> > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e >>> > /* Install any alternate MAC address into RAR0 */ >>> > ret_val = e1000_check_alt_mac_addr_generic(hw); >>> > if (ret_val) >>> > - goto out; >>> > + return ret_val; >>> > >>> > e1000_set_laa_state_82571(hw, TRUE); >>> > } >>> > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e >>> > if (hw->phy.media_type == e1000_media_type_internal_serdes) >>> > hw->mac.serdes_link_state = e1000_serdes_link_down; >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1 >>> > >>> > /* Initialize identification LED */ >>> > ret_val = mac->ops.id_led_init(hw); >>> > + /* An error is not fatal and we should not stop init due to this >>> */ >>> > if (ret_val) >>> > DEBUGOUT("Error initializing identification LED\n"); >>> > - /* This is not fatal and we should not stop init due to >>> this */ >>> > >>> > /* Disabling VLAN filtering */ >>> > DEBUGOUT("Initializing the IEEE VLAN\n"); >>> > mac->ops.clear_vfta(hw); >>> > >>> > - /* Setup the receive address. */ >>> > - /* >>> > + /* Setup the receive address. >>> > * If, however, a locally administered address was assigned to >>> the >>> > * 82571, we must reserve a RAR for it to work around an issue >>> where >>> > * resetting one port will reload the MAC on the other port. >>> > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1 >>> > break; >>> > } >>> > >>> > - /* >>> > - * Clear all of the statistics registers (clear on read). It is >>> > + /* Clear all of the statistics registers (clear on read). It is >>> > * important that we do this after we have tried to establish >>> link >>> > * because the symbol error count will increment wildly if there >>> > * is no link. >>> > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825 >>> > E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); >>> > } >>> > >>> > - /* >>> > - * Workaround for hardware errata. >>> > + /* Workaround for hardware errata. >>> > * Ensure that DMA Dynamic Clock gating is disabled on 82571 and >>> 82572 >>> > */ >>> > if ((hw->mac.type == e1000_82571) || >>> > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825 >>> > E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); >>> > } >>> > >>> > + /* Disable IPv6 extension header parsing because some malformed >>> > + * IPv6 headers can hang the Rx. >>> > + */ >>> > + if (hw->mac.type <= e1000_82573) { >>> > + reg = E1000_READ_REG(hw, E1000_RFCTL); >>> > + reg |= (E1000_RFCTL_IPV6_EX_DIS | >>> E1000_RFCTL_NEW_IPV6_EXT_DIS); >>> > + E1000_WRITE_REG(hw, E1000_RFCTL, reg); >>> > + } >>> > + >>> > /* PCI-Ex Control Registers */ >>> > switch (hw->mac.type) { >>> > case e1000_82574: >>> > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825 >>> > reg |= (1 << 22); >>> > E1000_WRITE_REG(hw, E1000_GCR, reg); >>> > >>> > - /* >>> > - * Workaround for hardware errata. >>> > + /* Workaround for hardware errata. >>> > * apply workaround for hardware errata documented in >>> errata >>> > * docs Fixes issue where some error prone or unreliable >>> PCIe >>> > * completions are occurring, particularly with ASPM >>> enabled. >>> > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc >>> > case e1000_82574: >>> > case e1000_82583: >>> > if (hw->mng_cookie.vlan_id != 0) { >>> > - /* >>> > - * The VFTA is a 4096b bit-field, each >>> identifying >>> > + /* The VFTA is a 4096b bit-field, each >>> identifying >>> > * a single VLAN ID. The following operations >>> > * determine which 32b entry (i.e. offset) into >>> the >>> > * array we want to set the VLAN ID (i.e. bit) of >>> > * the manageability unit. >>> > */ >>> > vfta_offset = (hw->mng_cookie.vlan_id >> >>> > - E1000_VFTA_ENTRY_SHIFT) & >>> E1000_VFTA_ENTRY_MASK; >>> > - vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & >>> > - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); >>> > + E1000_VFTA_ENTRY_SHIFT) & >>> > + E1000_VFTA_ENTRY_MASK; >>> > + vfta_bit_in_reg = >>> > + 1 << (hw->mng_cookie.vlan_id & >>> > + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); >>> > } >>> > break; >>> > default: >>> > break; >>> > } >>> > for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { >>> > - /* >>> > - * If the offset we want to clear is the same offset of >>> the >>> > + /* If the offset we want to clear is the same offset of >>> the >>> > * manageability VLAN ID, then clear all bits except >>> that of >>> > * the manageability unit. >>> > */ >>> > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10 >>> > >>> > ctrl = hw->mac.ledctl_mode2; >>> > if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) { >>> > - /* >>> > - * If no link, then turn LED on by setting the invert bit >>> > + /* If no link, then turn LED on by setting the invert bit >>> > * for each LED that's "on" (0x0E) in ledctl_mode2. >>> > */ >>> > for (i = 0; i < 4; i++) >>> > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_ >>> > { >>> > u16 status_1kbt = 0; >>> > u16 receive_errors = 0; >>> > - bool phy_hung = FALSE; >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > >>> > DEBUGFUNC("e1000_check_phy_82574"); >>> > >>> > - /* >>> > - * Read PHY Receive Error counter first, if its is max - all F's >>> then >>> > + /* Read PHY Receive Error counter first, if its is max - all F's >>> then >>> > * read the Base1000T status register If both are max then PHY >>> is hung. >>> > */ >>> > ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, >>> > &receive_errors); >>> > if (ret_val) >>> > - goto out; >>> > + return FALSE; >>> > if (receive_errors == E1000_RECEIVE_ERROR_MAX) { >>> > ret_val = hw->phy.ops.read_reg(hw, >>> E1000_BASE1000T_STATUS, >>> > &status_1kbt); >>> > if (ret_val) >>> > - goto out; >>> > + return FALSE; >>> > if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == >>> > E1000_IDLE_ERROR_COUNT_MASK) >>> > - phy_hung = TRUE; >>> > + return TRUE; >>> > } >>> > -out: >>> > - return phy_hung; >>> > + >>> > + return FALSE; >>> > } >>> > >>> > >>> > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct >>> > { >>> > DEBUGFUNC("e1000_setup_link_82571"); >>> > >>> > - /* >>> > - * 82573 does not have a word in the NVM to determine >>> > + /* 82573 does not have a word in the NVM to determine >>> > * the default flow control setting, so we explicitly >>> > * set it to full. >>> > */ >>> > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571 >>> > ret_val = e1000_copper_link_setup_igp(hw); >>> > break; >>> > default: >>> > - ret_val = -E1000_ERR_PHY; >>> > + return -E1000_ERR_PHY; >>> > break; >>> > } >>> > >>> > if (ret_val) >>> > - goto out; >>> > - >>> > - ret_val = e1000_setup_copper_link_generic(hw); >>> > + return ret_val; >>> > >>> > -out: >>> > - return ret_val; >>> > + return e1000_setup_copper_link_generic(hw); >>> > } >>> > >>> > /** >>> > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link >>> > switch (hw->mac.type) { >>> > case e1000_82571: >>> > case e1000_82572: >>> > - /* >>> > - * If SerDes loopback mode is entered, there is no form >>> > + /* If SerDes loopback mode is entered, there is no form >>> > * of reset to take the adapter out of that mode. So we >>> > * have to explicitly take the adapter out of loopback >>> > * mode. This prevents drivers from twiddling their >>> thumbs >>> > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8 >>> > >>> > ctrl = E1000_READ_REG(hw, E1000_CTRL); >>> > status = E1000_READ_REG(hw, E1000_STATUS); >>> > + E1000_READ_REG(hw, E1000_RXCW); >>> > + /* SYNCH bit and IV bit are sticky */ >>> > + usec_delay(10); >>> > rxcw = E1000_READ_REG(hw, E1000_RXCW); >>> > >>> > if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { >>> > - >>> > /* Receiver is synchronized with no invalid bits. */ >>> > switch (mac->serdes_link_state) { >>> > case e1000_serdes_link_autoneg_complete: >>> > if (!(status & E1000_STATUS_LU)) { >>> > - /* >>> > - * We have lost link, retry autoneg >>> before >>> > + /* We have lost link, retry autoneg >>> before >>> > * reporting link failure >>> > */ >>> > mac->serdes_link_state = >>> > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8 >>> > break; >>> > >>> > case e1000_serdes_link_forced_up: >>> > - /* >>> > - * If we are receiving /C/ ordered sets, >>> re-enable >>> > + /* If we are receiving /C/ ordered sets, >>> re-enable >>> > * auto-negotiation in the TXCW register and >>> disable >>> > * forced link in the Device Control register in >>> an >>> > * attempt to auto-negotiate with our link >>> partner. >>> > - * If the partner code word is null, stop forcing >>> > - * and restart auto negotiation. >>> > */ >>> > - if ((rxcw & E1000_RXCW_C) || !(rxcw & >>> E1000_RXCW_CW)) { >>> > + if (rxcw & E1000_RXCW_C) { >>> > /* Enable autoneg, and unforce link up */ >>> > E1000_WRITE_REG(hw, E1000_TXCW, >>> mac->txcw); >>> > E1000_WRITE_REG(hw, E1000_CTRL, >>> > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8 >>> > >>> > case e1000_serdes_link_autoneg_progress: >>> > if (rxcw & E1000_RXCW_C) { >>> > - /* >>> > - * We received /C/ ordered sets, meaning >>> the >>> > + /* We received /C/ ordered sets, meaning >>> the >>> > * link partner has autonegotiated, and >>> we can >>> > * trust the Link Up (LU) status bit. >>> > */ >>> > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8 >>> > DEBUGOUT("AN_PROG -> DOWN\n"); >>> > } >>> > } else { >>> > - /* >>> > - * The link partner did not autoneg. >>> > + /* The link partner did not autoneg. >>> > * Force link up and full duplex, and >>> change >>> > * state to forced. >>> > */ >>> > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8 >>> > >>> > case e1000_serdes_link_down: >>> > default: >>> > - /* >>> > - * The link was down but the receiver has now >>> gained >>> > + /* The link was down but the receiver has now >>> gained >>> > * valid sync, so lets see if we can bring the >>> link >>> > * up. >>> > */ >>> > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8 >>> > mac->serdes_link_state = e1000_serdes_link_down; >>> > DEBUGOUT("ANYSTATE -> DOWN\n"); >>> > } else { >>> > - /* >>> > - * Check several times, if Sync and Config >>> > - * both are consistently 1 then simply ignore >>> > - * the Invalid bit and restart Autoneg >>> > + /* Check several times, if SYNCH bit and CONFIG >>> > + * bit both are consistently 1 then simply ignore >>> > + * the IV bit and restart Autoneg >>> > */ >>> > for (i = 0; i < AN_RETRY_COUNT; i++) { >>> > usec_delay(10); >>> > rxcw = E1000_READ_REG(hw, E1000_RXCW); >>> > - if ((rxcw & E1000_RXCW_IV) && >>> > - !((rxcw & E1000_RXCW_SYNCH) && >>> > - (rxcw & E1000_RXCW_C))) { >>> > + if ((rxcw & E1000_RXCW_SYNCH) && >>> > + (rxcw & E1000_RXCW_C)) >>> > + continue; >>> > + >>> > + if (rxcw & E1000_RXCW_IV) { >>> > mac->serdes_has_link = FALSE; >>> > mac->serdes_link_state = >>> > >>> e1000_serdes_link_down; >>> > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571 >>> > ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); >>> > if (ret_val) { >>> > DEBUGOUT("NVM Read Error\n"); >>> > - goto out; >>> > + return ret_val; >>> > } >>> > >>> > switch (hw->mac.type) { >>> > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571 >>> > break; >>> > } >>> > >>> > -out: >>> > - return ret_val; >>> > + return E1000_SUCCESS; >>> > } >>> > >>> > /** >>> > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1 >>> > >>> > /* If workaround is activated... */ >>> > if (state) >>> > - /* >>> > - * Hold a copy of the LAA in RAR[14] This is done so that >>> > + /* Hold a copy of the LAA in RAR[14] This is done so that >>> > * between the time RAR[0] gets clobbered and the time it >>> > * gets fixed, the actual LAA is in one of the RARs and >>> no >>> > * incoming packets directed to this port are dropped. >>> > * Eventually the LAA will be in RAR[0] and RAR[14]. >>> > */ >>> > - e1000_rar_set_generic(hw, hw->mac.addr, >>> > - hw->mac.rar_entry_count - 1); >>> > + hw->mac.ops.rar_set(hw, hw->mac.addr, >>> > + hw->mac.rar_entry_count - 1); >>> > return; >>> > } >>> > >>> > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1 >>> > static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) >>> > { >>> > struct e1000_nvm_info *nvm = &hw->nvm; >>> > - s32 ret_val = E1000_SUCCESS; >>> > + s32 ret_val; >>> > u16 data; >>> > >>> > DEBUGFUNC("e1000_fix_nvm_checksum_82571"); >>> > >>> > if (nvm->type != e1000_nvm_flash_hw) >>> > - goto out; >>> > + return E1000_SUCCESS; >>> > >>> > - /* >>> > - * Check bit 4 of word 10h. If it is 0, firmware is done >>> updating >>> > + /* Check bit 4 of word 10h. If it is 0, firmware is done >>> updating >>> > * 10h-12h. Checksum may need to be fixed. >>> > */ >>> > >>> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>> > _______________________________________________ >>> > svn-src-stable-8@freebsd.org mailing list >>> > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 >>> > To unsubscribe, send any mail to " >>> svn-src-stable-8-unsubscribe@freebsd.org" >>> >> >> > From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 08:11:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9FCE5B4D; Thu, 28 Feb 2013 08:11:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78B3D1177; Thu, 28 Feb 2013 08:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S8BbHE008898; Thu, 28 Feb 2013 08:11:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S8BbnI008897; Thu, 28 Feb 2013 08:11:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302280811.r1S8BbnI008897@svn.freebsd.org> From: Xin LI Date: Thu, 28 Feb 2013 08:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247450 - stable/8/etc/rc.d X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 08:11:37 -0000 Author: delphij Date: Thu Feb 28 08:11:36 2013 New Revision: 247450 URL: http://svnweb.freebsd.org/changeset/base/247450 Log: When getting the MIB, remove largest suffix instead of smallest suffix of =. This makes the following syntax work: dev.hdaa.4.nid25_config=as=1,seq=15 This is a direct commit to RELENG_8 as this file have been replaced in -HEAD. Submitted by: Andreas Nilsson Modified: stable/8/etc/rc.d/sysctl Modified: stable/8/etc/rc.d/sysctl ============================================================================== --- stable/8/etc/rc.d/sysctl Thu Feb 28 08:06:43 2013 (r247449) +++ stable/8/etc/rc.d/sysctl Thu Feb 28 08:11:36 2013 (r247450) @@ -26,7 +26,7 @@ parse_file() \#*|'') ;; *) - mib=${var%=*} + mib=${var%%=*} val=${var#*=} if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 08:19:56 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A3A9F6E; Thu, 28 Feb 2013 08:19:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C94711D7; Thu, 28 Feb 2013 08:19:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S8Jutv010041; Thu, 28 Feb 2013 08:19:56 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S8JuOf010040; Thu, 28 Feb 2013 08:19:56 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201302280819.r1S8JuOf010040@svn.freebsd.org> From: Jack F Vogel Date: Thu, 28 Feb 2013 08:19:56 +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: r247451 - stable/8/sys/conf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 08:19:56 -0000 Author: jfv Date: Thu Feb 28 08:19:55 2013 New Revision: 247451 URL: http://svnweb.freebsd.org/changeset/base/247451 Log: Remove DEV_NETMAP from stable/8 options, this was suggested and approved by the owner, although there is code in some drivers in support of it, the feature itself is not fully supported in this release. Modified: stable/8/sys/conf/options Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Thu Feb 28 08:11:36 2013 (r247450) +++ stable/8/sys/conf/options Thu Feb 28 08:19:55 2013 (r247451) @@ -682,7 +682,6 @@ ISAPNP opt_isa.h # various 'device presence' options. DEV_BPF opt_bpf.h -DEV_NETMAP opt_global.h DEV_MCA opt_mca.h DEV_CARP opt_carp.h DEV_PTY opt_tty.h From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 15:21:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 055095E9; Thu, 28 Feb 2013 15:21:14 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA618B15; Thu, 28 Feb 2013 15:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SFLDGj040122; Thu, 28 Feb 2013 15:21:13 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SFLDrh040120; Thu, 28 Feb 2013 15:21:13 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201302281521.r1SFLDrh040120@svn.freebsd.org> From: Niclas Zeising Date: Thu, 28 Feb 2013 15:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247466 - stable/8/lib/libc/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 15:21:14 -0000 Author: zeising (doc,ports committer) Date: Thu Feb 28 15:21:12 2013 New Revision: 247466 URL: http://svnweb.freebsd.org/changeset/base/247466 Log: MFC r246809 Change examples to be consistent with what style(9) says. Approved by: joel (mentor) Modified: stable/8/lib/libc/net/getaddrinfo.3 stable/8/lib/libc/net/getnameinfo.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/getaddrinfo.3 ============================================================================== --- stable/8/lib/libc/net/getaddrinfo.3 Thu Feb 28 15:17:24 2013 (r247465) +++ stable/8/lib/libc/net/getaddrinfo.3 Thu Feb 28 15:21:12 2013 (r247466) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2009 +.Dd February 14, 2013 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -339,7 +339,7 @@ hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("www.kame.net", "http", &hints, &res0); if (error) { errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ + /* NOTREACHED */ } s = -1; for (res = res0; res; res = res->ai_next) { @@ -361,7 +361,7 @@ for (res = res0; res; res = res->ai_next } if (s < 0) { err(1, "%s", cause); - /*NOTREACHED*/ + /* NOTREACHED */ } freeaddrinfo(res0); .Ed @@ -383,7 +383,7 @@ hints.ai_flags = AI_PASSIVE; error = getaddrinfo(NULL, "http", &hints, &res0); if (error) { errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ + /* NOTREACHED */ } nsock = 0; for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) { @@ -405,7 +405,7 @@ for (res = res0; res && nsock < MAXSOCK; } if (nsock == 0) { err(1, "%s", cause); - /*NOTREACHED*/ + /* NOTREACHED */ } freeaddrinfo(res0); .Ed Modified: stable/8/lib/libc/net/getnameinfo.3 ============================================================================== --- stable/8/lib/libc/net/getnameinfo.3 Thu Feb 28 15:17:24 2013 (r247465) +++ stable/8/lib/libc/net/getnameinfo.3 Thu Feb 28 15:21:12 2013 (r247466) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2007 +.Dd February 14, 2013 .Dt GETNAMEINFO 3 .Os .Sh NAME @@ -157,7 +157,7 @@ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) { errx(1, "could not get numeric hostname"); - /*NOTREACHED*/ + /* NOTREACHED */ } printf("host=%s, serv=%s\en", hbuf, sbuf); .Ed @@ -170,7 +170,7 @@ char hbuf[NI_MAXHOST]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) { errx(1, "could not resolve hostname"); - /*NOTREACHED*/ + /* NOTREACHED */ } printf("host=%s\en", hbuf); .Ed From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 16:25:34 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CB9DA738; Thu, 28 Feb 2013 16:25:34 +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 BC45FF5F; Thu, 28 Feb 2013 16:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGPYG7059510; Thu, 28 Feb 2013 16:25:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGPYB9059509; Thu, 28 Feb 2013 16:25:34 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302281625.r1SGPYB9059509@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 28 Feb 2013 16:25: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: r247468 - stable/8/sys/dev/usb/input X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 16:25:34 -0000 Author: hselasky Date: Thu Feb 28 16:25:34 2013 New Revision: 247468 URL: http://svnweb.freebsd.org/changeset/base/247468 Log: MFC r235451: Move reset of USB mouse parameters from the USB mouse attach to the USB mouse device open. Protect against multi character device open. Some other nits. Modified: stable/8/sys/dev/usb/input/ums.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Thu Feb 28 16:22:49 2013 (r247467) +++ stable/8/sys/dev/usb/input/ums.c Thu Feb 28 16:25:34 2013 (r247468) @@ -134,6 +134,7 @@ struct ums_softc { struct usb_xfer *sc_xfer[UMS_N_TRANSFER]; int sc_pollrate; + int sc_fflags; uint8_t sc_buttons; uint8_t sc_iid; @@ -648,32 +649,13 @@ ums_attach(device_t dev) DPRINTF("size=%d, id=%d\n", isize, sc->sc_iid); #endif - if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) - sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; - else - sc->sc_hw.buttons = sc->sc_buttons; - - sc->sc_hw.iftype = MOUSE_IF_USB; - sc->sc_hw.type = MOUSE_MOUSE; - sc->sc_hw.model = MOUSE_MODEL_GENERIC; - sc->sc_hw.hwid = 0; - - sc->sc_mode.protocol = MOUSE_PROTO_MSC; - sc->sc_mode.rate = -1; - sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; - sc->sc_mode.accelfactor = 0; - sc->sc_mode.level = 0; - sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; - sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; - sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; - err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ums_fifo_methods, &sc->sc_fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); - if (err) { + if (err) goto detach; - } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD, @@ -796,7 +778,7 @@ ums_put_queue(struct ums_softc *sc, int3 static void ums_reset_buf(struct ums_softc *sc) { - /* reset read queue */ + /* reset read queue, must be called locked */ usb_fifo_reset(sc->sc_fifo.fp[USB_FIFO_RX]); } @@ -807,7 +789,33 @@ ums_open(struct usb_fifo *fifo, int ffla DPRINTFN(2, "\n"); - if (fflags & FREAD) { + /* check for duplicate open, should not happen */ + if (sc->sc_fflags & fflags) + return (EBUSY); + + /* check for first open */ + if (sc->sc_fflags == 0) { + + /* reset all USB mouse parameters */ + + if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) + sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; + else + sc->sc_hw.buttons = sc->sc_buttons; + + sc->sc_hw.iftype = MOUSE_IF_USB; + sc->sc_hw.type = MOUSE_MOUSE; + sc->sc_hw.model = MOUSE_MODEL_GENERIC; + sc->sc_hw.hwid = 0; + + sc->sc_mode.protocol = MOUSE_PROTO_MSC; + sc->sc_mode.rate = -1; + sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; + sc->sc_mode.accelfactor = 0; + sc->sc_mode.level = 0; + sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; + sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; + sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; /* reset status */ @@ -818,21 +826,31 @@ ums_open(struct usb_fifo *fifo, int ffla sc->sc_status.dy = 0; sc->sc_status.dz = 0; /* sc->sc_status.dt = 0; */ + } + if (fflags & FREAD) { + /* allocate RX buffer */ if (usb_fifo_alloc_buffer(fifo, UMS_BUF_SIZE, UMS_IFQ_MAXLEN)) { return (ENOMEM); } } + + sc->sc_fflags |= fflags & (FREAD | FWRITE); return (0); } static void ums_close(struct usb_fifo *fifo, int fflags) { - if (fflags & FREAD) { + struct ums_softc *sc = usb_fifo_softc(fifo); + + DPRINTFN(2, "\n"); + + if (fflags & FREAD) usb_fifo_free_buffer(fifo); - } + + sc->sc_fflags &= ~(fflags & (FREAD | FWRITE)); } static int @@ -862,7 +880,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long /* don't change the current setting */ } else if ((mode.level < 0) || (mode.level > 1)) { error = EINVAL; - goto done; + break; } else { sc->sc_mode.level = mode.level; } @@ -899,7 +917,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long case MOUSE_SETLEVEL: if (*(int *)addr < 0 || *(int *)addr > 1) { error = EINVAL; - goto done; + break; } sc->sc_mode.level = *(int *)addr; @@ -946,9 +964,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long } default: error = ENOTTY; + break; } -done: mtx_unlock(&sc->sc_mtx); return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 16:32:26 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2F90D1B; Thu, 28 Feb 2013 16:32:26 +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 A48D6FBC; Thu, 28 Feb 2013 16:32:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGWQNW062349; Thu, 28 Feb 2013 16:32:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGWQ85062342; Thu, 28 Feb 2013 16:32:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302281632.r1SGWQ85062342@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 28 Feb 2013 16:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247469 - in stable/8/sys/dev/usb: . net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 16:32:26 -0000 Author: hselasky Date: Thu Feb 28 16:32:25 2013 New Revision: 247469 URL: http://svnweb.freebsd.org/changeset/base/247469 Log: MFC r246021 and r228637: Add new USB IDs. PR: usb/175639 Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Thu Feb 28 16:25:34 2013 (r247468) +++ stable/8/sys/dev/usb/net/if_axe.c Thu Feb 28 16:32:25 2013 (r247469) @@ -151,6 +151,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(ASIX, AX88772, AXE_FLAG_772), AXE_DEV(ASIX, AX88772A, AXE_FLAG_772A), AXE_DEV(ASIX, AX88772B, AXE_FLAG_772B), + AXE_DEV(ASIX, AX88772B_1, AXE_FLAG_772B), AXE_DEV(ATEN, UC210T, 0), AXE_DEV(BELKIN, F5D5055, AXE_FLAG_178), AXE_DEV(BILLIONTON, USB2AR, 0), @@ -158,6 +159,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(COREGA, FETHER_USB2_TX, 0), AXE_DEV(DLINK, DUBE100, 0), AXE_DEV(DLINK, DUBE100B1, AXE_FLAG_772), + AXE_DEV(DLINK, DUBE100C1, AXE_FLAG_772B), AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Feb 28 16:25:34 2013 (r247468) +++ stable/8/sys/dev/usb/usbdevs Thu Feb 28 16:32:25 2013 (r247469) @@ -1486,6 +1486,7 @@ product DIGIANSWER ZIGBEE802154 0x000a Z /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial*/ product DLINK DUBE100 0x1a00 10/100 Ethernet +product DLINK DUBE100C1 0x1a02 DUB-E100 rev C1 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWL122 0x3700 DWL-122 From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 16:36:12 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E92682C7; Thu, 28 Feb 2013 16:36:12 +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 DB445FF1; Thu, 28 Feb 2013 16:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGaCqF063145; Thu, 28 Feb 2013 16:36:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGaCDF063143; Thu, 28 Feb 2013 16:36:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302281636.r1SGaCDF063143@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 28 Feb 2013 16:36:12 +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: r247471 - stable/8/sys/dev/usb/wlan X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 16:36:13 -0000 Author: hselasky Date: Thu Feb 28 16:36:12 2013 New Revision: 247471 URL: http://svnweb.freebsd.org/changeset/base/247471 Log: MFC r246944: Fix bad EEPROM parsing code. Modified: stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_upgtvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Thu Feb 28 16:32:36 2013 (r247470) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Thu Feb 28 16:36:12 2013 (r247471) @@ -1122,12 +1122,23 @@ upgt_eeprom_parse(struct upgt_softc *sc) (sizeof(struct upgt_eeprom_header) + preamble_len)); while (!option_end) { + + /* sanity check */ + if (eeprom_option >= (struct upgt_eeprom_option *) + (sc->sc_eeprom + UPGT_EEPROM_SIZE)) { + return (EINVAL); + } + /* the eeprom option length is stored in words */ option_len = (le16toh(eeprom_option->len) - 1) * sizeof(uint16_t); option_type = le16toh(eeprom_option->type); + /* sanity check */ + if (option_len == 0 || option_len >= UPGT_EEPROM_SIZE) + return (EINVAL); + switch (option_type) { case UPGT_EEPROM_TYPE_NAME: DPRINTF(sc, UPGT_DEBUG_FW, @@ -1198,7 +1209,6 @@ upgt_eeprom_parse(struct upgt_softc *sc) eeprom_option = (struct upgt_eeprom_option *) (eeprom_option->data + option_len); } - return (0); } @@ -1207,7 +1217,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft { struct upgt_eeprom_freq3_header *freq3_header; struct upgt_lmac_freq3 *freq3; - int i, elements, flags; + int i; + int elements; + int flags; unsigned channel; freq3_header = (struct upgt_eeprom_freq3_header *)data; @@ -1219,6 +1231,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d\n", flags, elements); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq3[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq3[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) @@ -1237,7 +1252,11 @@ upgt_eeprom_parse_freq4(struct upgt_soft struct upgt_eeprom_freq4_header *freq4_header; struct upgt_eeprom_freq4_1 *freq4_1; struct upgt_eeprom_freq4_2 *freq4_2; - int i, j, elements, settings, flags; + int i; + int j; + int elements; + int settings; + int flags; unsigned channel; freq4_header = (struct upgt_eeprom_freq4_header *)data; @@ -1252,6 +1271,9 @@ upgt_eeprom_parse_freq4(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d settings=%d\n", flags, elements, settings); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq4_1[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq4_1[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) @@ -1272,7 +1294,8 @@ void upgt_eeprom_parse_freq6(struct upgt_softc *sc, uint8_t *data, int len) { struct upgt_lmac_freq6 *freq6; - int i, elements; + int i; + int elements; unsigned channel; freq6 = (struct upgt_lmac_freq6 *)data; @@ -1280,6 +1303,9 @@ upgt_eeprom_parse_freq6(struct upgt_soft DPRINTF(sc, UPGT_DEBUG_FW, "elements=%d\n", elements); + if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq6[0]))) + return; + for (i = 0; i < elements; i++) { channel = ieee80211_mhz2ieee(le16toh(freq6[i].freq), 0); if (channel >= IEEE80211_CHAN_MAX) Modified: stable/8/sys/dev/usb/wlan/if_upgtvar.h ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgtvar.h Thu Feb 28 16:32:36 2013 (r247470) +++ stable/8/sys/dev/usb/wlan/if_upgtvar.h Thu Feb 28 16:36:12 2013 (r247471) @@ -451,7 +451,7 @@ struct upgt_softc { struct upgt_memory sc_memory; /* data which we found in the EEPROM */ - uint8_t sc_eeprom[UPGT_EEPROM_SIZE]; + uint8_t sc_eeprom[2 * UPGT_EEPROM_SIZE] __aligned(4); uint16_t sc_eeprom_hwrx; struct upgt_lmac_freq3 sc_eeprom_freq3[IEEE80211_CHAN_MAX]; struct upgt_lmac_freq4 sc_eeprom_freq4[IEEE80211_CHAN_MAX][8]; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 18:10:36 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94C17F81; Thu, 28 Feb 2013 18:10:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 769538B8; Thu, 28 Feb 2013 18:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIAaoA093102; Thu, 28 Feb 2013 18:10:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIAa41093100; Thu, 28 Feb 2013 18:10:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281810.r1SIAa41093100@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 18:10: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: r247479 - stable/8/sys/dev/ixgbe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 18:10:36 -0000 Author: jhb Date: Thu Feb 28 18:10:35 2013 New Revision: 247479 URL: http://svnweb.freebsd.org/changeset/base/247479 Log: MFC 240968: Merge similar fixes from 223198 from igb to ixgbe: - Use a dedicated task to handle deferred transmits from the if_transmit method instead of reusing the existing per-queue interrupt task. Reusing the per-queue interrupt task could result in both an interrupt thread and the taskqueue thread trying to handle received packets on a single queue resulting in out-of-order packet processing and lock contention. - Don't define ixgbe_start() at all when if_transmit is used. Modified: stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Thu Feb 28 18:10:20 2013 (r247478) +++ stable/8/sys/dev/ixgbe/ixgbe.c Thu Feb 28 18:10:35 2013 (r247479) @@ -102,13 +102,15 @@ static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); static int ixgbe_shutdown(device_t); -static void ixgbe_start(struct ifnet *); -static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); #if __FreeBSD_version >= 800000 static int ixgbe_mq_start(struct ifnet *, struct mbuf *); static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static void ixgbe_qflush(struct ifnet *); +static void ixgbe_deferred_mq_start(void *, int); +#else +static void ixgbe_start(struct ifnet *); +static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); #endif static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); static void ixgbe_init(void *); @@ -621,6 +623,7 @@ ixgbe_detach(device_t dev) { struct adapter *adapter = device_get_softc(dev); struct ix_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_detach: begin"); @@ -635,8 +638,11 @@ ixgbe_detach(device_t dev) ixgbe_stop(adapter); IXGBE_CORE_UNLOCK(adapter); - for (int i = 0; i < adapter->num_queues; i++, que++) { + for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { if (que->tq) { +#if __FreeBSD_version >= 800000 + taskqueue_drain(que->tq, &txr->txq_task); +#endif taskqueue_drain(que->tq, &que->que_task); taskqueue_free(que->tq); } @@ -695,6 +701,7 @@ ixgbe_shutdown(device_t dev) } +#if __FreeBSD_version < 800000 /********************************************************************* * Transmit entry point * @@ -766,7 +773,7 @@ ixgbe_start(struct ifnet *ifp) return; } -#if __FreeBSD_version >= 800000 +#else /* ** Multiqueue Transmit driver ** @@ -794,7 +801,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct IXGBE_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } return (err); @@ -864,6 +871,22 @@ ixgbe_mq_start_locked(struct ifnet *ifp, } /* + * Called from a taskqueue to drain queued transmit packets. + */ +static void +ixgbe_deferred_mq_start(void *arg, int pending) +{ + struct tx_ring *txr = arg; + struct adapter *adapter = txr->adapter; + struct ifnet *ifp = adapter->ifp; + + IXGBE_TX_LOCK(txr); + if (!drbr_empty(ifp, txr->br)) + ixgbe_mq_start_locked(ifp, txr, NULL); + IXGBE_TX_UNLOCK(txr); +} + +/* ** Flush all ring buffers */ static void @@ -2158,6 +2181,9 @@ ixgbe_allocate_legacy(struct adapter *ad { device_t dev = adapter->dev; struct ix_queue *que = adapter->queues; +#if __FreeBSD_version >= 800000 + struct tx_ring *txr = adapter->tx_rings; +#endif int error, rid = 0; /* MSI RID at 1 */ @@ -2177,6 +2203,9 @@ ixgbe_allocate_legacy(struct adapter *ad * Try allocating a fast interrupt and the associated deferred * processing contexts. */ +#if __FreeBSD_version >= 800000 + TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); +#endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); @@ -2223,9 +2252,10 @@ ixgbe_allocate_msix(struct adapter *adap { device_t dev = adapter->dev; struct ix_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; int error, rid, vector = 0; - for (int i = 0; i < adapter->num_queues; i++, vector++, que++) { + for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) { rid = vector + 1; que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2255,6 +2285,9 @@ ixgbe_allocate_msix(struct adapter *adap if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); +#if __FreeBSD_version >= 800000 + TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); +#endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); @@ -2499,12 +2532,13 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; - ifp->if_start = ixgbe_start; #if __FreeBSD_version >= 800000 ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; +#else + ifp->if_start = ixgbe_start; + IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 2); #endif - ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 2; ether_ifattach(ifp, adapter->hw.mac.addr); Modified: stable/8/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.h Thu Feb 28 18:10:20 2013 (r247478) +++ stable/8/sys/dev/ixgbe/ixgbe.h Thu Feb 28 18:10:35 2013 (r247479) @@ -298,6 +298,7 @@ struct tx_ring { char mtx_name[16]; #if __FreeBSD_version >= 800000 struct buf_ring *br; + struct task txq_task; #endif #ifdef IXGBE_FDIR u16 atr_sample; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 18:22:51 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90E41840; Thu, 28 Feb 2013 18:22:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 757B9A32; Thu, 28 Feb 2013 18:22:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIMpDg098062; Thu, 28 Feb 2013 18:22:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIMoBV098058; Thu, 28 Feb 2013 18:22:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281822.r1SIMoBV098058@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 18:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247482 - in stable/8/sys: amd64/include/pc dev/ipmi i386/include/pc x86/bios X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 18:22:51 -0000 Author: jhb Date: Thu Feb 28 18:22:50 2013 New Revision: 247482 URL: http://svnweb.freebsd.org/changeset/base/247482 Log: MFC 241027: - Re-shuffle the headers to move all kernel-specific bits under #ifdef _KERNEL but leave definitions for various structures defined by standards ($PIR table, SMAP entries, etc.) available to userland. - Consolidate duplicate SMBIOS table structure definitions in ipmi(4) and smbios(4) in and make them available to userland. Modified: stable/8/sys/amd64/include/pc/bios.h stable/8/sys/dev/ipmi/ipmi_smbios.c stable/8/sys/i386/include/pc/bios.h stable/8/sys/x86/bios/smbios.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ipmi/ (props changed) stable/8/sys/i386/ (props changed) stable/8/sys/x86/ (props changed) Modified: stable/8/sys/amd64/include/pc/bios.h ============================================================================== --- stable/8/sys/amd64/include/pc/bios.h Thu Feb 28 18:22:41 2013 (r247481) +++ stable/8/sys/amd64/include/pc/bios.h Thu Feb 28 18:22:50 2013 (r247482) @@ -30,16 +30,9 @@ #ifndef _MACHINE_PC_BIOS_H_ #define _MACHINE_PC_BIOS_H_ -extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen, - int paralen, int sigofs); - -#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) -#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) - /* * Int 15:E820 'SMAP' structure */ - #define SMAP_SIG 0x534D4150 /* 'SMAP' */ #define SMAP_TYPE_MEMORY 1 @@ -58,22 +51,61 @@ struct bios_smap { u_int32_t type; } __packed; +/* + * System Management BIOS + */ +#define SMBIOS_START 0xf0000 +#define SMBIOS_STEP 0x10 +#define SMBIOS_OFF 0 +#define SMBIOS_LEN 4 +#define SMBIOS_SIG "_SM_" + +struct smbios_eps { + uint8_t anchor_string[4]; /* '_SM_' */ + uint8_t checksum; + uint8_t length; + uint8_t major_version; + uint8_t minor_version; + uint16_t maximum_structure_size; + uint8_t entry_point_revision; + uint8_t formatted_area[5]; + uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ + uint8_t intermediate_checksum; + uint16_t structure_table_length; + uint32_t structure_table_address; + uint16_t number_structures; + uint8_t BCD_revision; +}; + +struct smbios_structure_header { + uint8_t type; + uint8_t length; + uint16_t handle; +}; + +#ifdef _KERNEL +#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) +#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) + struct bios_oem_signature { char * anchor; /* search anchor string in BIOS memory */ size_t offset; /* offset from anchor (may be negative) */ size_t totlen; /* total length of BIOS string to copy */ } __packed; + struct bios_oem_range { u_int from; /* shouldn't be below 0xe0000 */ u_int to; /* shouldn't be above 0xfffff */ } __packed; + struct bios_oem { struct bios_oem_range range; struct bios_oem_signature signature[]; } __packed; -extern int -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); - +int bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen, + int sigofs); +#endif #endif /* _MACHINE_PC_BIOS_H_ */ Modified: stable/8/sys/dev/ipmi/ipmi_smbios.c ============================================================================== --- stable/8/sys/dev/ipmi/ipmi_smbios.c Thu Feb 28 18:22:41 2013 (r247481) +++ stable/8/sys/dev/ipmi/ipmi_smbios.c Thu Feb 28 18:22:50 2013 (r247482) @@ -52,29 +52,6 @@ __FBSDID("$FreeBSD$"); #define pmap_unmapbios pmap_unmapdev #endif -struct smbios_table { - uint8_t anchor_string[4]; - uint8_t checksum; - uint8_t length; - uint8_t major_version; - uint8_t minor_version; - uint16_t maximum_structure_size; - uint8_t entry_point_revision; - uint8_t formatted_area[5]; - uint8_t DMI_anchor_string[5]; - uint8_t intermediate_checksum; - uint16_t structure_table_length; - uint32_t structure_table_address; - uint16_t number_structures; - uint8_t BCD_revision; -}; - -struct structure_header { - uint8_t type; - uint8_t length; - uint16_t handle; -}; - struct ipmi_entry { uint8_t type; uint8_t length; @@ -102,13 +79,7 @@ struct ipmi_entry { #define SPACING_32 0x1 #define SPACING_16 0x2 -#define SMBIOS_START 0xf0000 -#define SMBIOS_STEP 0x10 -#define SMBIOS_OFF 0 -#define SMBIOS_LEN 4 -#define SMBIOS_SIG "_SM_" - -typedef void (*smbios_callback_t)(struct structure_header *, void *); +typedef void (*smbios_callback_t)(struct smbios_structure_header *, void *); static struct ipmi_get_info ipmi_info; static int ipmi_probed; @@ -116,13 +87,13 @@ static struct mtx ipmi_info_mtx; MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); static void ipmi_smbios_probe(struct ipmi_get_info *); -static int smbios_cksum(struct smbios_table *); +static int smbios_cksum(struct smbios_eps *); static void smbios_walk_table(uint8_t *, int, smbios_callback_t, void *); -static void smbios_ipmi_info(struct structure_header *, void *); +static void smbios_ipmi_info(struct smbios_structure_header *, void *); static void -smbios_ipmi_info(struct structure_header *h, void *arg) +smbios_ipmi_info(struct smbios_structure_header *h, void *arg) { struct ipmi_get_info *info; struct ipmi_entry *s; @@ -178,10 +149,10 @@ smbios_ipmi_info(struct structure_header static void smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) { - struct structure_header *s; + struct smbios_structure_header *s; while (entries--) { - s = (struct structure_header *)p; + s = (struct smbios_structure_header *)p; cb(s, arg); /* @@ -208,7 +179,7 @@ smbios_walk_table(uint8_t *p, int entrie static void ipmi_smbios_probe(struct ipmi_get_info *info) { - struct smbios_table *header; + struct smbios_eps *header; void *table; u_int32_t addr; @@ -225,9 +196,9 @@ ipmi_smbios_probe(struct ipmi_get_info * * length and then map it a second time with the actual length so * we can verify the checksum. */ - header = pmap_mapbios(addr, sizeof(struct smbios_table)); + header = pmap_mapbios(addr, sizeof(struct smbios_eps)); table = pmap_mapbios(addr, header->length); - pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_table)); + pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps)); header = table; if (smbios_cksum(header) != 0) { pmap_unmapbios((vm_offset_t)header, header->length); @@ -282,7 +253,7 @@ ipmi_smbios_identify(struct ipmi_get_inf } static int -smbios_cksum(struct smbios_table *e) +smbios_cksum(struct smbios_eps *e) { u_int8_t *ptr; u_int8_t cksum; Modified: stable/8/sys/i386/include/pc/bios.h ============================================================================== --- stable/8/sys/i386/include/pc/bios.h Thu Feb 28 18:22:41 2013 (r247481) +++ stable/8/sys/i386/include/pc/bios.h Thu Feb 28 18:22:50 2013 (r247482) @@ -44,31 +44,6 @@ struct bios32_SDheader }; /* - * BIOS32 Service Directory entry. Caller supplies name, bios32_SDlookup - * fills in the rest of the details. - */ -struct bios32_SDentry -{ - union - { - u_int8_t name[4]; /* service identifier */ - u_int32_t id; /* as a 32-bit value */ - } ident; - u_int32_t base; /* base of service */ - u_int32_t len; /* service length */ - u_int32_t entry; /* entrypoint offset from base */ - vm_offset_t ventry; /* entrypoint in kernel virtual segment */ -}; - -extern int bios32_SDlookup(struct bios32_SDentry *ent); -extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen, - int paralen, int sigofs); - -#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) -#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) - - -/* * PnP BIOS presence structure */ struct PnPBIOS_table @@ -88,52 +63,13 @@ struct PnPBIOS_table u_int32_t pmdataseg; /* protected-mode data segment */ } __packed; - -/* - * Exported lookup results - */ -extern struct bios32_SDentry PCIbios; - -struct segment_info { - u_int base; - u_int limit; -}; - -#define BIOSCODE_FLAG 0x01 -#define BIOSDATA_FLAG 0x02 -#define BIOSUTIL_FLAG 0x04 -#define BIOSARGS_FLAG 0x08 - -struct bios_segments { - struct segment_info code32; /* 32-bit code (mandatory) */ - struct segment_info code16; /* 16-bit code */ - struct segment_info data; /* 16-bit data */ - struct segment_info util; /* 16-bit utility */ - struct segment_info args; /* 16-bit args */ -}; - -struct bios_regs { - u_int eax; - u_int ebx; - u_int ecx; - u_int edx; - u_int esi; - u_int edi; -}; - -struct bios_args { - u_int entry; /* entry point of routine */ - struct bios_regs r; - struct bios_segments seg; -}; - /* * PnP BIOS return codes */ #define PNP_SUCCESS 0x00 #define PNP_NOT_SET_STATICALLY 0x7f #define PNP_UNKNOWN_FUNCTION 0x81 -#define PNP_FUNTION_NOT_SUPPORTED 0x82 +#define PNP_FUNCTION_NOT_SUPPORTED 0x82 #define PNP_INVALID_HANDLE 0x83 #define PNP_BAD_PARAMETER 0x84 #define PNP_SET_FAILED 0x85 @@ -219,11 +155,6 @@ struct bios_args { #define PCIBIOS_GET_IRQ_ROUTING 0xb10e #define PCIBIOS_ROUTE_INTERRUPT 0xb10f -extern int bios16(struct bios_args *, char *, ...); -extern int bios16_call(struct bios_regs *, char *); -extern int bios32(struct bios_regs *, u_int, u_short); -extern void set_bios_selectors(struct bios_segments *, int); - /* * PCI interrupt routing table. * @@ -272,7 +203,6 @@ struct PIR_table /* * Int 15:E820 'SMAP' structure */ - #define SMAP_SIG 0x534D4150 /* 'SMAP' */ #define SMAP_TYPE_MEMORY 1 @@ -291,22 +221,122 @@ struct bios_smap { u_int32_t type; } __packed; +/* + * System Management BIOS + */ +#define SMBIOS_START 0xf0000 +#define SMBIOS_STEP 0x10 +#define SMBIOS_OFF 0 +#define SMBIOS_LEN 4 +#define SMBIOS_SIG "_SM_" + +struct smbios_eps { + uint8_t anchor_string[4]; /* '_SM_' */ + uint8_t checksum; + uint8_t length; + uint8_t major_version; + uint8_t minor_version; + uint16_t maximum_structure_size; + uint8_t entry_point_revision; + uint8_t formatted_area[5]; + uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ + uint8_t intermediate_checksum; + uint16_t structure_table_length; + uint32_t structure_table_address; + uint16_t number_structures; + uint8_t BCD_revision; +}; + +struct smbios_structure_header { + uint8_t type; + uint8_t length; + uint16_t handle; +}; + +#ifdef _KERNEL +#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) +#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) + struct bios_oem_signature { char * anchor; /* search anchor string in BIOS memory */ size_t offset; /* offset from anchor (may be negative) */ size_t totlen; /* total length of BIOS string to copy */ } __packed; + struct bios_oem_range { u_int from; /* shouldn't be below 0xe0000 */ u_int to; /* shouldn't be above 0xfffff */ } __packed; + struct bios_oem { struct bios_oem_range range; struct bios_oem_signature signature[]; } __packed; -extern int -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); +struct segment_info { + u_int base; + u_int limit; +}; + +#define BIOSCODE_FLAG 0x01 +#define BIOSDATA_FLAG 0x02 +#define BIOSUTIL_FLAG 0x04 +#define BIOSARGS_FLAG 0x08 + +struct bios_segments { + struct segment_info code32; /* 32-bit code (mandatory) */ + struct segment_info code16; /* 16-bit code */ + struct segment_info data; /* 16-bit data */ + struct segment_info util; /* 16-bit utility */ + struct segment_info args; /* 16-bit args */ +}; + +struct bios_regs { + u_int eax; + u_int ebx; + u_int ecx; + u_int edx; + u_int esi; + u_int edi; +}; + +struct bios_args { + u_int entry; /* entry point of routine */ + struct bios_regs r; + struct bios_segments seg; +}; + +/* + * BIOS32 Service Directory entry. Caller supplies name, bios32_SDlookup + * fills in the rest of the details. + */ +struct bios32_SDentry +{ + union + { + u_int8_t name[4]; /* service identifier */ + u_int32_t id; /* as a 32-bit value */ + } ident; + u_int32_t base; /* base of service */ + u_int32_t len; /* service length */ + u_int32_t entry; /* entrypoint offset from base */ + vm_offset_t ventry; /* entrypoint in kernel virtual segment */ +}; + +/* + * Exported lookup results + */ +extern struct bios32_SDentry PCIbios; + +int bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen, + int sigofs); +int bios16(struct bios_args *, char *, ...); +int bios16_call(struct bios_regs *, char *); +int bios32(struct bios_regs *, u_int, u_short); +int bios32_SDlookup(struct bios32_SDentry *ent); +void set_bios_selectors(struct bios_segments *, int); +#endif #endif /* _MACHINE_PC_BIOS_H_ */ Modified: stable/8/sys/x86/bios/smbios.c ============================================================================== --- stable/8/sys/x86/bios/smbios.c Thu Feb 28 18:22:41 2013 (r247481) +++ stable/8/sys/x86/bios/smbios.c Thu Feb 28 18:22:50 2013 (r247482) @@ -50,30 +50,6 @@ __FBSDID("$FreeBSD$"); * http://www.dmtf.org/standards/published_documents/DSP0134.pdf */ -/* - * SMBIOS Entry Point Structure - */ -struct smbios_eps { - u_int8_t Anchor[4]; /* '_SM_' */ - u_int8_t Checksum; - u_int8_t Length; - - u_int8_t SMBIOS_Major; - u_int8_t SMBIOS_Minor; - u_int16_t Max_Size; - u_int8_t Revision; - u_int8_t Formatted_Area[5]; - - u_int8_t Intermediate_Anchor[5]; /* '_DMI_' */ - u_int8_t Intermediate_Checksum; - - u_int16_t Structure_Table_Length; - u_int32_t Structure_Table_Address; - u_int16_t Structure_Count; - - u_int8_t SMBIOS_BCD_Revision; -} __packed; - struct smbios_softc { device_t dev; struct resource * res; @@ -82,12 +58,6 @@ struct smbios_softc { struct smbios_eps * eps; }; -#define SMBIOS_START 0xf0000 -#define SMBIOS_STEP 0x10 -#define SMBIOS_OFF 0 -#define SMBIOS_LEN 4 -#define SMBIOS_SIG "_SM_" - #define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) #define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) @@ -116,13 +86,13 @@ smbios_identify (driver_t *driver, devic SMBIOS_STEP, SMBIOS_OFF); if (addr != 0) { rid = 0; - length = ADDR2EPS(addr)->Length; + length = ADDR2EPS(addr)->length; if (length != 0x1f) { u_int8_t major, minor; - major = ADDR2EPS(addr)->SMBIOS_Major; - minor = ADDR2EPS(addr)->SMBIOS_Minor; + major = ADDR2EPS(addr)->major_version; + minor = ADDR2EPS(addr)->minor_version; /* SMBIOS v2.1 implementation might use 0x1e. */ if (length == 0x1e && major == 2 && minor == 1) @@ -189,11 +159,11 @@ smbios_attach (device_t dev) sc->eps = RES2EPS(sc->res); device_printf(dev, "Version: %u.%u", - sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor); - if (bcd2bin(sc->eps->SMBIOS_BCD_Revision)) + sc->eps->major_version, sc->eps->minor_version); + if (bcd2bin(sc->eps->BCD_revision)) printf(", BCD Revision: %u.%u", - bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4), - bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f)); + bcd2bin(sc->eps->BCD_revision >> 4), + bcd2bin(sc->eps->BCD_revision & 0x0f)); printf("\n"); return (0); @@ -269,7 +239,7 @@ smbios_cksum (struct smbios_eps *e) ptr = (u_int8_t *)e; cksum = 0; - for (i = 0; i < e->Length; i++) { + for (i = 0; i < e->length; i++) { cksum += ptr[i]; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 18:24:16 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB582BA7; Thu, 28 Feb 2013 18:24:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 83215A54; Thu, 28 Feb 2013 18:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIOFAG098346; Thu, 28 Feb 2013 18:24:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIOFJL098345; Thu, 28 Feb 2013 18:24:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281824.r1SIOFJL098345@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 18:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247484 - stable/8/usr.bin/top X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 18:24:16 -0000 Author: jhb Date: Thu Feb 28 18:24:14 2013 New Revision: 247484 URL: http://svnweb.freebsd.org/changeset/base/247484 Log: MFC 241730: Correct the order of the MFU and MRU labels. Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Thu Feb 28 18:24:07 2013 (r247483) +++ stable/8/usr.bin/top/machine.c Thu Feb 28 18:24:14 2013 (r247484) @@ -178,7 +178,7 @@ char *memorynames[] = { int arc_stats[7]; char *arcnames[] = { - "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", + "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", NULL }; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 18:49:41 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AF5D6BC; Thu, 28 Feb 2013 18:49:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6DA1FBE7; Thu, 28 Feb 2013 18:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SInfnV005445; Thu, 28 Feb 2013 18:49:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SInfpn005444; Thu, 28 Feb 2013 18:49:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281849.r1SInfpn005444@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 18:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247488 - 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-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 18:49:41 -0000 Author: jhb Date: Thu Feb 28 18:49:40 2013 New Revision: 247488 URL: http://svnweb.freebsd.org/changeset/base/247488 Log: MFC 241748: When checking to see if a video output's _ADR matches an entry in the parent adapter's _DOD list, only check the low 16 bits of both _ADR and _DOD. The language in the ACPI spec seems to indicate that the _ADR values should exactly match the entries in _DOD. However, I assume that the masking added to _DOD values was added to work around some known busted machines (the commit history doesn't indicate either way), and the ACPI spec does require that the low 16 bits are unique for all video outputs, so only checking the low 16 bits should be fine. This fixes recognition of video outputs that use the new standardized device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops. Modified: stable/8/sys/dev/acpica/acpi_video.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_video.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_video.c Thu Feb 28 18:49:31 2013 (r247487) +++ stable/8/sys/dev/acpica/acpi_video.c Thu Feb 28 18:49:40 2013 (r247488) @@ -874,7 +874,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle for (i = 0; i < argset->dod_pkg->Package.Count; i++) { if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && - (val & DOD_DEVID_MASK_FULL) == adr) { + (val & DOD_DEVID_MASK_FULL) == + (adr & DOD_DEVID_MASK_FULL)) { argset->callback(handle, val, argset->context); argset->count++; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 18:59:01 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25D04A87; Thu, 28 Feb 2013 18:59:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18C61C3D; Thu, 28 Feb 2013 18:59:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIx0jp008648; Thu, 28 Feb 2013 18:59:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIx0fo008647; Thu, 28 Feb 2013 18:59:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281859.r1SIx0fo008647@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 18:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247490 - stable/8/sys/dev/puc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 18:59:01 -0000 Author: jhb Date: Thu Feb 28 18:59:00 2013 New Revision: 247490 URL: http://svnweb.freebsd.org/changeset/base/247490 Log: MFC 245471: Do not require a filter-only interrupt handler for puc ports that are not serial devices (such as printer ports). This allows ppc devices attached to puc to correctly setup an interrupt handler and work. Modified: stable/8/sys/dev/puc/puc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/puc/ (props changed) Modified: stable/8/sys/dev/puc/puc.c ============================================================================== --- stable/8/sys/dev/puc/puc.c Thu Feb 28 18:58:37 2013 (r247489) +++ stable/8/sys/dev/puc/puc.c Thu Feb 28 18:59:00 2013 (r247490) @@ -622,7 +622,7 @@ puc_bus_setup_intr(device_t dev, device_ if (cookiep == NULL || res != port->p_ires) return (EINVAL); /* We demand that serdev devices use filter_only interrupts. */ - if (ihand != NULL) + if (port->p_type == PUC_TYPE_SERIAL && ihand != NULL) return (ENXIO); if (rman_get_device(port->p_ires) != originator) return (ENXIO); From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 19:01:05 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7EDE1D5E; Thu, 28 Feb 2013 19:01:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59205CC2; Thu, 28 Feb 2013 19:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJ154I010764; Thu, 28 Feb 2013 19:01:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJ15tH010762; Thu, 28 Feb 2013 19:01:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302281901.r1SJ15tH010762@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 19:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247492 - in stable/8/sys: fs/nfs nfsclient X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 19:01:05 -0000 Author: jhb Date: Thu Feb 28 19:01:04 2013 New Revision: 247492 URL: http://svnweb.freebsd.org/changeset/base/247492 Log: MFC 245476: - More properly handle interrupted NFS requests on an interruptible mount by returning an error of EINTR rather than EACCES. - While here, bring back some (but not all) of the NFS RPC statistics lost when krpc was committed. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/nfsclient/nfs_krpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/nfsclient/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 28 19:00:57 2013 (r247491) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 28 19:01:04 2013 (r247492) @@ -695,12 +695,18 @@ tryagain: if (stat == RPC_SUCCESS) { error = 0; } else if (stat == RPC_TIMEDOUT) { + NFSINCRGLOBAL(newnfsstats.rpctimeouts); error = ETIMEDOUT; } else if (stat == RPC_VERSMISMATCH) { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EOPNOTSUPP; } else if (stat == RPC_PROGVERSMISMATCH) { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EPROTONOSUPPORT; + } else if (stat == RPC_INTR) { + error = EINTR; } else { + NFSINCRGLOBAL(newnfsstats.rpcinvalid); error = EACCES; } if (error) { Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu Feb 28 19:00:57 2013 (r247491) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu Feb 28 19:01:04 2013 (r247492) @@ -549,14 +549,21 @@ tryagain: */ if (stat == RPC_SUCCESS) error = 0; - else if (stat == RPC_TIMEDOUT) + else if (stat == RPC_TIMEDOUT) { + nfsstats.rpctimeouts++; error = ETIMEDOUT; - else if (stat == RPC_VERSMISMATCH) + } else if (stat == RPC_VERSMISMATCH) { + nfsstats.rpcinvalid++; error = EOPNOTSUPP; - else if (stat == RPC_PROGVERSMISMATCH) + } else if (stat == RPC_PROGVERSMISMATCH) { + nfsstats.rpcinvalid++; error = EPROTONOSUPPORT; - else + } else if (stat == RPC_INTR) { + error = EINTR; + } else { + nfsstats.rpcinvalid++; error = EACCES; + } if (error) goto nfsmout; @@ -572,6 +579,7 @@ tryagain: if (error == ENOMEM) { m_freem(mrep); AUTH_DESTROY(auth); + nfsstats.rpcinvalid++; return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 21:24:20 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57A0EF6D; Thu, 28 Feb 2013 21:24:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ABAF2B5; Thu, 28 Feb 2013 21:24:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLOKwk054837; Thu, 28 Feb 2013 21:24:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLOKrV054836; Thu, 28 Feb 2013 21:24:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302282124.r1SLOKrV054836@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 21:24: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: r247499 - 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-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 21:24:20 -0000 Author: jhb Date: Thu Feb 28 21:24:19 2013 New Revision: 247499 URL: http://svnweb.freebsd.org/changeset/base/247499 Log: MFC 245238: Add an option to not drop options from the third retransmitted SYN. If the SYNs (or SYN/ACK replies) are dropped due to network congestion, then the remote end of the connection may act as if options such as window scaling are enabled but the local end will think they are not. This can result in very slow data transfers in the case of window scaling disagreements. Note that the unlike HEAD the existing behavior is preserved by default, but it can be disabled by setting the net.inet.tcp.rexmit_drop_options sysctl to zero. Modified: stable/8/sys/netinet/tcp_timer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/tcp_timer.c ============================================================================== --- stable/8/sys/netinet/tcp_timer.c Thu Feb 28 21:24:10 2013 (r247498) +++ stable/8/sys/netinet/tcp_timer.c Thu Feb 28 21:24:19 2013 (r247499) @@ -117,6 +117,11 @@ int tcp_maxpersistidle; /* max idle time in persist */ int tcp_maxidle; +static int tcp_rexmit_drop_options = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexmit_drop_options, CTLFLAG_RW, + &tcp_rexmit_drop_options, 0, + "Drop TCP options from 3rd and later retransmitted SYN"); + /* * Tcp protocol timeout routine called every 500 ms. * Updates timestamps used for TCP @@ -552,7 +557,8 @@ tcp_timer_rexmt(void * xtp) * header compression code which trashes TCP segments containing * unknown-to-them TCP options. */ - if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) + if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) && + (tp->t_rxtshift == 3)) tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP); /* * If we backed off this far, our srtt estimate is probably bogus. From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 21:32:48 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BEC242B7; Thu, 28 Feb 2013 21:32:48 +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 ABFE331E; Thu, 28 Feb 2013 21:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLWm5B057727; Thu, 28 Feb 2013 21:32:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLWlXQ057721; Thu, 28 Feb 2013 21:32:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302282132.r1SLWlXQ057721@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 28 Feb 2013 21:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247500 - in stable/8/lib/libc: gen stdlib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 21:32:48 -0000 Author: des Date: Thu Feb 28 21:32:47 2013 New Revision: 247500 URL: http://svnweb.freebsd.org/changeset/base/247500 Log: MFH (r240107,240111,240361): warn against using weak PRNGs Modified: stable/8/lib/libc/gen/rand48.3 stable/8/lib/libc/stdlib/rand.3 stable/8/lib/libc/stdlib/random.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/rand48.3 ============================================================================== --- stable/8/lib/libc/gen/rand48.3 Thu Feb 28 21:24:19 2013 (r247499) +++ stable/8/lib/libc/gen/rand48.3 Thu Feb 28 21:32:47 2013 (r247500) @@ -12,7 +12,7 @@ .\" @(#)rand48.3 V1.0 MB 8 Oct 1993 .\" $FreeBSD$ .\" -.Dd February 2, 2010 +.Dd September 4, 2012 .Dt RAND48 3 .Os .Sh NAME @@ -49,6 +49,14 @@ .Ft void .Fn lcong48 "unsigned short p[7]" .Sh DESCRIPTION +.Bf -symbolic +The functions described in this manual page are not cryptographically +secure. +Cryptographic applications should use +.Xr arc4random 3 +instead. +.Ef +.Pp The .Fn rand48 family of functions generates pseudo-random numbers using a linear @@ -174,10 +182,8 @@ It is thus not possible to use values gr Note that all three methods of seeding the random number generator always also set the multiplicand and addend for any of the six generator calls. -.Pp -For a more powerful random number generator, see -.Xr random 3 . .Sh SEE ALSO +.Xr arc4random 3 , .Xr rand 3 , .Xr random 3 .Sh AUTHORS Modified: stable/8/lib/libc/stdlib/rand.3 ============================================================================== --- stable/8/lib/libc/stdlib/rand.3 Thu Feb 28 21:24:19 2013 (r247499) +++ stable/8/lib/libc/stdlib/rand.3 Thu Feb 28 21:32:47 2013 (r247500) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 6, 2010 +.Dd September 4, 2012 .Dt RAND 3 .Os .Sh NAME @@ -55,9 +55,15 @@ .Fn rand_r "unsigned *ctx" .Sh DESCRIPTION .Bf -symbolic +The functions described in this manual page are not cryptographically +secure. +Cryptographic applications should use +.Xr arc4random 3 +instead. +.Ef +.Pp These interfaces are obsoleted by .Xr random 3 . -.Ef .Pp The .Fn rand @@ -88,9 +94,6 @@ The function initializes a seed using the .Xr random 4 random number device which returns good random numbers. -However, the -.Fn rand -function still remains unsuitable for cryptographic use. .Pp The .Fn rand_r @@ -105,8 +108,6 @@ For better generator quality, use .Xr random 3 or .Xr lrand48 3 . -Applications requiring cryptographic quality randomness should use -.Xr arc4random 3 . .Sh SEE ALSO .Xr arc4random 3 , .Xr lrand48 3 , Modified: stable/8/lib/libc/stdlib/random.3 ============================================================================== --- stable/8/lib/libc/stdlib/random.3 Thu Feb 28 21:24:19 2013 (r247499) +++ stable/8/lib/libc/stdlib/random.3 Thu Feb 28 21:32:47 2013 (r247500) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd September 4, 2012 .Dt RANDOM 3 .Os .Sh NAME @@ -53,6 +53,14 @@ .Ft char * .Fn setstate "char *state" .Sh DESCRIPTION +.Bf -symbolic +The functions described in this manual page are not cryptographically +secure. +Cryptographic applications should use +.Xr arc4random 3 +instead. +.Ef +.Pp The .Fn random function @@ -98,10 +106,8 @@ as the seed. .Pp The .Fn srandomdev -routine initializes a state array using the -.Xr random 4 -random number device which returns good random numbers, -suitable for cryptographic use. +routine initializes a state array using data from +.Xr random 4 . Note that this particular seeding procedure can generate states which are impossible to reproduce by calling @@ -175,7 +181,6 @@ messages are printed on the standard err .Xr arc4random 3 , .Xr lrand48 3 , .Xr rand 3 , -.Xr srand 3 , .Xr random 4 .Sh HISTORY These @@ -191,6 +196,3 @@ The historical implementation used to ha random sequence did not vary much with the seed. The current implementation employs a better pseudo-random number generator for the initial state calculation. -.Pp -Applications requiring cryptographic quality randomness should use -.Xr arc4random 3 . From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 21:55:58 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8270B7C3; Thu, 28 Feb 2013 21:55:58 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB9F402; Thu, 28 Feb 2013 21:55:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLtwrF064119; Thu, 28 Feb 2013 21:55:58 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLtwBE064117; Thu, 28 Feb 2013 21:55:58 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201302282155.r1SLtwBE064117@svn.freebsd.org> From: Jack F Vogel Date: Thu, 28 Feb 2013 21:55:58 +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: r247501 - stable/8/sys/dev/ixgbe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 21:55:58 -0000 Author: jfv Date: Thu Feb 28 21:55:57 2013 New Revision: 247501 URL: http://svnweb.freebsd.org/changeset/base/247501 Log: MFC of the ixgbe driver including revisions: 217556,219902,228276,229767,229939,230572,231796,232238, 234137,234229,235547,235964,236627,236729,238149,239940, 240155,240366,240968,241037,241616,241646,241856,241885, 242403,242421,243714,243716,243718,243721,243724,243725, 243728,243729,243733,243735,243736,243741,243833,243857, 244514,245952,246128,246482,247035,247056 Modified: stable/8/sys/dev/ixgbe/ixgbe.c (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82598.c stable/8/sys/dev/ixgbe/ixgbe_82598.h (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_osdep.h stable/8/sys/dev/ixgbe/ixgbe_phy.c stable/8/sys/dev/ixgbe/ixgbe_type.h stable/8/sys/dev/ixgbe/ixgbe_vf.c stable/8/sys/dev/ixgbe/ixgbe_x540.c (contents, props changed) stable/8/sys/dev/ixgbe/ixv.c Directory Properties: stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/ixgbe/ixgbe_82599.h (props changed) stable/8/sys/dev/ixgbe/ixgbe_x540.h (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Thu Feb 28 21:32:47 2013 (r247500) +++ stable/8/sys/dev/ixgbe/ixgbe.c Thu Feb 28 21:55:57 2013 (r247501) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.4.5"; +char ixgbe_driver_version[] = "2.5.0 - 8"; /********************************************************************* * PCI Device ID Table @@ -80,8 +80,10 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} @@ -102,16 +104,16 @@ static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); static int ixgbe_shutdown(device_t); -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX +static void ixgbe_start(struct ifnet *); +static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); +#else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static void ixgbe_qflush(struct ifnet *); static void ixgbe_deferred_mq_start(void *, int); -#else -static void ixgbe_start(struct ifnet *); -static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); -#endif +#endif /* IXGBE_LEGACY_TX */ static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); static void ixgbe_init(void *); static void ixgbe_init_locked(struct adapter *); @@ -148,7 +150,7 @@ static void ixgbe_enable_intr(struct static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); static bool ixgbe_txeof(struct tx_ring *); -static bool ixgbe_rxeof(struct ix_queue *, int); +static bool ixgbe_rxeof(struct ix_queue *); static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); @@ -161,10 +163,10 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static void ixgbe_add_rx_process_limit(struct adapter *, const char *, - const char *, int *, int); -static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *); +static int ixgbe_tx_ctx_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); +static int ixgbe_tso_setup(struct tx_ring *, + struct mbuf *, u32 *, u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -179,6 +181,9 @@ static __inline void ixgbe_rx_discard(st static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u32); +static void ixgbe_enable_rx_drop(struct adapter *); +static void ixgbe_disable_rx_drop(struct adapter *); + /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); static void ixgbe_setup_optics(struct adapter *); @@ -211,7 +216,8 @@ static device_method_t ixgbe_methods[] = DEVMETHOD(device_attach, ixgbe_attach), DEVMETHOD(device_detach, ixgbe_detach), DEVMETHOD(device_shutdown, ixgbe_shutdown), - {0, 0} + + DEVMETHOD_END }; static driver_t ixgbe_driver = { @@ -237,16 +243,16 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); -static int ixgbe_max_interrupt_rate = (8000000 / IXGBE_LOW_LATENCY); +static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); /* How many packets rxeof tries to clean at a time */ -static int ixgbe_rx_process_limit = 128; +static int ixgbe_rx_process_limit = 256; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); -/* Flow control setting, default to full */ -static int ixgbe_flow_control = ixgbe_fc_full; -TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); +/* How many packets txeof tries to clean at a time */ +static int ixgbe_tx_process_limit = 256; +TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); /* ** Smart speed setting, default to on @@ -265,15 +271,6 @@ static int ixgbe_enable_msix = 1; TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); /* - * Header split: this causes the hardware to DMA - * the header into a separate mbuf from the payload, - * it can be a performance win in some workloads, but - * in others it actually hurts, its off by default. - */ -static int ixgbe_header_split = FALSE; -TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split); - -/* * Number of Queues, can be set to 0, * it then autoconfigures based on the * number of cpus with a max of 8. This @@ -294,6 +291,20 @@ TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); +/* +** HW RSC control: +** this feature only works with +** IPv4, and only on 82599 and later. +** Also this will cause IP forwarding to +** fail and that can't be controlled by +** the stack as LRO can. For all these +** reasons I've deemed it best to leave +** this off and not bother with a tuneable +** interface, this would need to be compiled +** to enable. +*/ +static bool ixgbe_rsc_enable = FALSE; + /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; @@ -318,6 +329,18 @@ static int atr_sample_rate = 20; static int fdir_pballoc = 1; #endif +#ifdef DEV_NETMAP +/* + * The #ifdef DEV_NETMAP / #endif blocks in this file are meant to + * be a reference on how to implement netmap support in a driver. + * Additional comments are in ixgbe_netmap.h . + * + * contains functions for netmap support + * that extend the standard driver. + */ +#include +#endif /* DEV_NETMAP */ + /********************************************************************* * Device identification routine * @@ -406,11 +429,6 @@ ixgbe_attach(device_t dev) OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "advertise_gig", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_set_advertise, "I", "1G Link"); - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, @@ -516,28 +534,24 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Get Hardware Flow Control setting */ - hw->fc.requested_mode = ixgbe_fc_full; - adapter->fc = hw->fc.requested_mode; - hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.low_water = IXGBE_FC_LO; - hw->fc.high_water[0] = IXGBE_FC_HI; - hw->fc.send_xon = TRUE; - error = ixgbe_init_hw(hw); - if (error == IXGBE_ERR_EEPROM_VERSION) { + switch (error) { + case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " "with your hardware.\n If you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); - } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) + break; + case IXGBE_ERR_SFP_NOT_SUPPORTED: device_printf(dev,"Unsupported SFP+ Module\n"); - - if (error) { error = EIO; - device_printf(dev,"Hardware Initialization Failure\n"); goto err_late; + case IXGBE_ERR_SFP_NOT_PRESENT: + device_printf(dev,"No SFP+ Module found\n"); + /* falls thru */ + default: + break; } /* Detect and set physical type */ @@ -554,11 +568,6 @@ ixgbe_attach(device_t dev) if (ixgbe_setup_interface(dev, adapter) != 0) goto err_late; - /* Sysctl for limiting the amount of work done in the taskqueue */ - ixgbe_add_rx_process_limit(adapter, "rx_processing_limit", - "max number of rx packets to process", &adapter->rx_process_limit, - ixgbe_rx_process_limit); - /* Initialize statistics */ ixgbe_update_stats_counters(adapter); @@ -594,6 +603,9 @@ ixgbe_attach(device_t dev) ixgbe_add_hw_stats(adapter); +#ifdef DEV_NETMAP + ixgbe_netmap_attach(adapter); +#endif /* DEV_NETMAP */ INIT_DEBUGOUT("ixgbe_attach: end"); return (0); err_late: @@ -640,7 +652,7 @@ ixgbe_detach(device_t dev) for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { if (que->tq) { -#if __FreeBSD_version >= 800000 +#ifdef IXGBE_LEGACY_TX taskqueue_drain(que->tq, &txr->txq_task); #endif taskqueue_drain(que->tq, &que->que_task); @@ -672,6 +684,9 @@ ixgbe_detach(device_t dev) ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); +#ifdef DEV_NETMAP + netmap_detach(adapter->ifp); +#endif /* DEV_NETMAP */ ixgbe_free_pci_resources(adapter); bus_generic_detach(dev); if_free(adapter->ifp); @@ -701,7 +716,7 @@ ixgbe_shutdown(device_t dev) } -#if __FreeBSD_version < 800000 +#ifdef IXGBE_LEGACY_TX /********************************************************************* * Transmit entry point * @@ -720,17 +735,14 @@ ixgbe_start_locked(struct tx_ring *txr, IXGBE_TX_LOCK_ASSERT(txr); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; if (!adapter->link_active) return; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) { - txr->queue_status |= IXGBE_QUEUE_DEPLETED; + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) break; - } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) @@ -739,8 +751,6 @@ ixgbe_start_locked(struct tx_ring *txr, if (ixgbe_xmit(txr, &m_head)) { if (m_head != NULL) IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) - txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } /* Send a copy of the frame to the BPF listener */ @@ -773,7 +783,8 @@ ixgbe_start(struct ifnet *ifp) return; } -#else +#else /* ! IXGBE_LEGACY_TX */ + /* ** Multiqueue Transmit driver ** @@ -795,8 +806,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; - if (((txr->queue_status & IXGBE_QUEUE_DEPLETED) == 0) && - IXGBE_TX_TRYLOCK(txr)) { + if (IXGBE_TX_TRYLOCK(txr)) { err = ixgbe_mq_start_locked(ifp, txr, m); IXGBE_TX_UNLOCK(txr); } else { @@ -815,17 +825,12 @@ ixgbe_mq_start_locked(struct ifnet *ifp, int enqueued, err = 0; if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || - (txr->queue_status == IXGBE_QUEUE_DEPLETED) || adapter->link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); return (err); } - /* Call cleanup if number of TX descriptors low */ - if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) - ixgbe_txeof(txr); - enqueued = 0; if (m == NULL) { next = drbr_dequeue(ifp, txr->br); @@ -844,23 +849,21 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; } enqueued++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); - if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) { - txr->queue_status |= IXGBE_QUEUE_DEPLETED; - break; - } next = drbr_dequeue(ifp, txr->br); } if (enqueued > 0) { /* Set watchdog on */ - txr->queue_status |= IXGBE_QUEUE_WORKING; + txr->queue_status = IXGBE_QUEUE_WORKING; txr->watchdog_time = ticks; } @@ -904,7 +907,7 @@ ixgbe_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version >= 800000 */ +#endif /* IXGBE_LEGACY_TX */ /********************************************************************* * Ioctl entry point @@ -919,6 +922,7 @@ static int ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp->if_softc; + struct ixgbe_hw *hw = &adapter->hw; struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1006,6 +1010,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_HWCSUM; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; + if (mask & IFCAP_TSO6) + ifp->if_capenable ^= IFCAP_TSO6; if (mask & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) @@ -1022,7 +1028,22 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c VLAN_CAPABILITIES(ifp); break; } - + case SIOCGI2C: + { + struct ixgbe_i2c_req i2c; + IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error) + break; + if ((i2c.dev_addr != 0xA0) || (i2c.dev_addr != 0xA2)){ + error = EINVAL; + break; + } + hw->phy.ops.read_i2c_byte(hw, i2c.offset, + i2c.dev_addr, i2c.data); + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } default: IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); error = ether_ioctl(ifp, command, data); @@ -1070,7 +1091,7 @@ ixgbe_init_locked(struct adapter *adapte /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO4) + if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); @@ -1095,7 +1116,7 @@ ixgbe_init_locked(struct adapter *adapte /* ** Determine the correct mbuf pool - ** for doing jumbo/headersplit + ** for doing jumbo frames */ if (adapter->max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; @@ -1152,6 +1173,14 @@ ixgbe_init_locked(struct adapter *adapte txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); + /* + * When the internal queue falls below PTHRESH (32), + * start prefetching as long as there are at least + * HTHRESH (1) buffers ready. The values are taken + * from the Intel linux driver 3.8.21. + * Prefetching enables tx line rate even with 1 queue. + */ + txdctl |= (32 << 0) | (1 << 8); IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } @@ -1176,6 +1205,31 @@ ixgbe_init_locked(struct adapter *adapte msec_delay(1); } wmb(); +#ifdef DEV_NETMAP + /* + * In netmap mode, we must preserve the buffers made + * available to userspace before the if_init() + * (this is true by default on the TX side, because + * init makes all buffers available to userspace). + * + * netmap_reset() and the device specific routines + * (e.g. ixgbe_setup_receive_rings()) map these + * buffers at the end of the NIC ring, so here we + * must set the RDT (tail) register to make sure + * they are not overwritten. + * + * In this driver the NIC ring starts at RDH = 0, + * RDT points to the last slot available for reception (?), + * so RDT = num_rx_desc - 1 means the whole ring is available. + */ + if (ifp->if_capenable & IFCAP_NETMAP) { + struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_kring *kring = &na->rx_rings[i]; + int t = na->num_rx_desc - 1 - kring->nr_hwavail; + + IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); + } else +#endif /* DEV_NETMAP */ IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); } @@ -1210,7 +1264,7 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ if (hw->mac.type != ixgbe_mac_82598EB) { - u32 hdrm = 64 << fdir_pballoc; + u32 hdrm = 32 << fdir_pballoc; hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL); ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); @@ -1236,12 +1290,40 @@ ixgbe_init_locked(struct adapter *adapte /* Config/Enable Link */ ixgbe_config_link(adapter); + /* Hardware Packet Buffer & Flow Control setup */ + { + u32 rxpb, frame, size, tmp; + + frame = adapter->max_frame_size; + + /* Calculate High Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_DV_X540(frame, frame); + else + tmp = IXGBE_DV(frame, frame); + size = IXGBE_BT2KB(tmp); + rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10; + hw->fc.high_water[0] = rxpb - size; + + /* Now calculate Low Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_LOW_DV_X540(frame); + else + tmp = IXGBE_LOW_DV(frame); + hw->fc.low_water[0] = IXGBE_BT2KB(tmp); + + adapter->fc = hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.send_xon = TRUE; + } + /* Initialize the FC settings */ + ixgbe_start_hw(hw); + /* And now turn on interrupts */ ixgbe_enable_intr(adapter); /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -1331,10 +1413,10 @@ ixgbe_handle_que(void *context, int pend bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que, adapter->rx_process_limit); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX if (!drbr_empty(ifp, txr->br)) ixgbe_mq_start_locked(ifp, txr, NULL); #else @@ -1342,7 +1424,7 @@ ixgbe_handle_que(void *context, int pend ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + if (more) { taskqueue_enqueue(que->tq, &que->que_task); return; } @@ -1379,7 +1461,7 @@ ixgbe_legacy_irq(void *arg) return; } - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); do { @@ -1425,7 +1507,7 @@ ixgbe_msix_que(void *arg) ixgbe_disable_queue(adapter, que->msix); ++que->irqs; - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); + more_rx = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); more_tx = ixgbe_txeof(txr); @@ -1434,7 +1516,7 @@ ixgbe_msix_que(void *arg) ** has anything queued the task gets ** scheduled to handle it. */ -#if __FreeBSD_version < 800000 +#ifdef IXGBE_LEGACY_TX if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd)) #else if (!drbr_empty(adapter->ifp, txr->br)) @@ -1525,10 +1607,8 @@ ixgbe_msix_link(void *arg) /* This is probably overkill :) */ if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1)) return; - /* Clear the interrupt */ - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_FLOW_DIR); - /* Turn off the interface */ - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + /* Disable the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR); taskqueue_enqueue(adapter->tq, &adapter->fdir_task); } else #endif @@ -1602,7 +1682,7 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_100_TX | IFM_FDX; break; case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + ifmr->ifm_active |= adapter->optics | IFM_FDX; break; case IXGBE_LINK_SPEED_10GB_FULL: ifmr->ifm_active |= adapter->optics | IFM_FDX; @@ -1661,9 +1741,9 @@ ixgbe_xmit(struct tx_ring *txr, struct m { struct adapter *adapter = txr->adapter; u32 olinfo_status = 0, cmd_type_len; - u32 paylen = 0; int i, j, error, nsegs; - int first, last = 0; + int first; + bool remap = TRUE; struct mbuf *m_head; bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; @@ -1691,74 +1771,58 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* * Map the packet for DMA. */ +retry: error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error == EFBIG) { + if (__predict_false(error)) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); - if (m == NULL) { - adapter->mbuf_defrag_failed++; - m_freem(*m_headp); - *m_headp = NULL; - return (ENOBUFS); - } - *m_headp = m; - - /* Try it again */ - error = bus_dmamap_load_mbuf_sg(txr->txtag, map, - *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - - if (error == ENOMEM) { - adapter->no_tx_dma_setup++; + switch (error) { + case EFBIG: + /* Try it again? - one try */ + if (remap == TRUE) { + remap = FALSE; + m = m_defrag(*m_headp, M_NOWAIT); + if (m == NULL) { + adapter->mbuf_defrag_failed++; + m_freem(*m_headp); + *m_headp = NULL; + return (ENOBUFS); + } + *m_headp = m; + goto retry; + } else + return (error); + case ENOMEM: + txr->no_tx_dma_setup++; return (error); - } else if (error != 0) { - adapter->no_tx_dma_setup++; + default: + txr->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } - } else if (error == ENOMEM) { - adapter->no_tx_dma_setup++; - return (error); - } else if (error != 0) { - adapter->no_tx_dma_setup++; - m_freem(*m_headp); - *m_headp = NULL; - return (error); } /* Make certain there are enough descriptors */ if (nsegs > txr->tx_avail - 2) { txr->no_desc_avail++; - error = ENOBUFS; - goto xmit_fail; + bus_dmamap_unload(txr->txtag, map); + return (ENOBUFS); } m_head = *m_headp; /* ** Set up the appropriate offload context - ** this becomes the first descriptor of - ** a packet. + ** this will consume the first descriptor */ - if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, &paylen)) { - cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; - ++adapter->tso_tx; - } else - return (ENXIO); - } else if (ixgbe_tx_ctx_setup(txr, m_head)) - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - -#ifdef IXGBE_IEEE1588 - /* This is changing soon to an mtag detection */ - if (we detect this mbuf has a TSTAMP mtag) - cmd_type_len |= IXGBE_ADVTXD_MAC_TSTAMP; -#endif + error = ixgbe_tx_ctx_setup(txr, m_head, &cmd_type_len, &olinfo_status); + if (__predict_false(error)) { + if (error == ENOBUFS) + *m_headp = NULL; + return (error); + } #ifdef IXGBE_FDIR /* Do the flow director magic */ @@ -1770,10 +1834,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m } } #endif - /* Record payload length */ - if (paylen == 0) - olinfo_status |= m_head->m_pkthdr.len << - IXGBE_ADVTXD_PAYLEN_SHIFT; i = txr->next_avail_desc; for (j = 0; j < nsegs; j++) { @@ -1789,13 +1849,9 @@ ixgbe_xmit(struct tx_ring *txr, struct m txd->read.cmd_type_len = htole32(txr->txd_cmd | cmd_type_len |seglen); txd->read.olinfo_status = htole32(olinfo_status); - last = i; /* descriptor that will get completion IRQ */ - if (++i == adapter->num_tx_desc) + if (++i == txr->num_desc) i = 0; - - txbuf->m_head = NULL; - txbuf->eop_index = -1; } txd->read.cmd_type_len |= @@ -1804,14 +1860,19 @@ ixgbe_xmit(struct tx_ring *txr, struct m txr->next_avail_desc = i; txbuf->m_head = m_head; - /* Swap the dma map between the first and last descriptor */ + /* + ** Here we swap the map so the last descriptor, + ** which gets the completion interrupt has the + ** real map, and the first descriptor gets the + ** unused map from this descriptor. + */ txr->tx_buffers[first].map = txbuf->map; txbuf->map = map; bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE); - /* Set the index of the descriptor that will be marked done */ + /* Set the EOP descriptor that will be marked done */ txbuf = &txr->tx_buffers[first]; - txbuf->eop_index = last; + txbuf->eop = txd; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -1824,10 +1885,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m return (0); -xmit_fail: - bus_dmamap_unload(txr->txtag, txbuf->map); - return (error); - } static void @@ -1946,13 +2003,11 @@ ixgbe_local_timer(void *arg) { struct adapter *adapter = arg; device_t dev = adapter->dev; - struct ifnet *ifp = adapter->ifp; struct ix_queue *que = adapter->queues; struct tx_ring *txr = adapter->tx_rings; - int hung, busy, paused; + int hung = 0, paused = 0; mtx_assert(&adapter->core_mtx, MA_OWNED); - hung = busy = paused = 0; /* Check for pluggable optics */ if (adapter->sfp_probe) @@ -1971,27 +2026,18 @@ ixgbe_local_timer(void *arg) /* ** Check the TX queues status - ** - central locked handling of OACTIVE ** - watchdog only if all queues show hung */ for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { - if ((txr->queue_status & IXGBE_QUEUE_HUNG) && + if ((txr->queue_status == IXGBE_QUEUE_HUNG) && (paused == 0)) ++hung; - if (txr->queue_status & IXGBE_QUEUE_DEPLETED) - ++busy; - if ((txr->queue_status & IXGBE_QUEUE_IDLE) == 0) + else if (txr->queue_status == IXGBE_QUEUE_WORKING) taskqueue_enqueue(que->tq, &que->que_task); } /* Only truely watchdog if all queues show hung */ if (hung == adapter->num_queues) goto watchdog; - /* Only turn off the stack flow when ALL are depleted */ - if (busy == adapter->num_queues) - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - else if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && - (busy < adapter->num_queues)) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; out: ixgbe_rearm_queues(adapter, adapter->que_mask); @@ -2020,7 +2066,6 @@ static void ixgbe_update_link_status(struct adapter *adapter) { struct ifnet *ifp = adapter->ifp; - struct tx_ring *txr = adapter->tx_rings; device_t dev = adapter->dev; @@ -2031,6 +2076,8 @@ ixgbe_update_link_status(struct adapter ((adapter->link_speed == 128)? 10:1), "Full Duplex"); adapter->link_active = TRUE; + /* Update any Flow Control changes */ + ixgbe_fc_enable(&adapter->hw); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -2039,9 +2086,6 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; - for (int i = 0; i < adapter->num_queues; - i++, txr++) - txr->queue_status = IXGBE_QUEUE_IDLE; } } @@ -2072,7 +2116,6 @@ ixgbe_stop(void *arg) /* Let the stack know...*/ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; @@ -2144,6 +2187,11 @@ ixgbe_setup_optics(struct adapter *adapt return; } + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) { + adapter->optics = IFM_1000_SX; + return; + } + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_LR | IXGBE_PHYSICAL_LAYER_10GBASE_LRM)) { adapter->optics = IFM_10G_LR; @@ -2179,12 +2227,12 @@ ixgbe_setup_optics(struct adapter *adapt static int ixgbe_allocate_legacy(struct adapter *adapter) { - device_t dev = adapter->dev; + device_t dev = adapter->dev; struct ix_queue *que = adapter->queues; -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX struct tx_ring *txr = adapter->tx_rings; #endif - int error, rid = 0; + int error, rid = 0; /* MSI RID at 1 */ if (adapter->msix == 1) @@ -2203,7 +2251,7 @@ ixgbe_allocate_legacy(struct adapter *ad * Try allocating a fast interrupt and the associated deferred * processing contexts. */ -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); @@ -2285,7 +2333,7 @@ ixgbe_allocate_msix(struct adapter *adap if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); @@ -2526,13 +2574,12 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_baudrate = 1000000000; ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; #else @@ -2550,16 +2597,14 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_JUMBO_MTU; + ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; - /* Don't enable LRO by default */ - ifp->if_capabilities |= IFCAP_LRO; - /* ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) @@ -2759,6 +2804,7 @@ ixgbe_allocate_queues(struct adapter *ad txr = &adapter->tx_rings[i]; txr->adapter = adapter; txr->me = i; + txr->num_desc = adapter->num_tx_desc; /* Initialize the TX side lock */ snprintf(txr->mtx_name, sizeof(txr->mtx_name), "%s:tx(%d)", @@ -2782,7 +2828,7 @@ ixgbe_allocate_queues(struct adapter *ad error = ENOMEM; goto err_tx_desc; } -#if __FreeBSD_version >= 800000 +#ifndef IXGBE_LEGACY_TX /* Allocate a buf ring */ txr->br = buf_ring_alloc(IXGBE_BR_SIZE, M_DEVBUF, M_WAITOK, &txr->tx_mtx); @@ -2805,6 +2851,7 @@ ixgbe_allocate_queues(struct adapter *ad /* Set up some basics */ rxr->adapter = adapter; rxr->me = i; + rxr->num_desc = adapter->num_rx_desc; /* Initialize the RX side lock */ snprintf(rxr->mtx_name, sizeof(rxr->mtx_name), "%s:rx(%d)", @@ -2928,9 +2975,20 @@ ixgbe_setup_transmit_ring(struct tx_ring struct adapter *adapter = txr->adapter; struct ixgbe_tx_buf *txbuf; int i; +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_slot *slot; +#endif /* DEV_NETMAP */ /* Clear the old ring contents */ IXGBE_TX_LOCK(txr); +#ifdef DEV_NETMAP + /* + * (under lock): if in netmap mode, do some consistency + * checks and set slot to entry 0 of the netmap ring. + */ + slot = netmap_reset(na, NR_TX, txr->me, 0); +#endif /* DEV_NETMAP */ bzero((void *)txr->tx_base, (sizeof(union ixgbe_adv_tx_desc)) * adapter->num_tx_desc); /* Reset indices */ @@ -2939,7 +2997,7 @@ ixgbe_setup_transmit_ring(struct tx_ring /* Free any existing tx buffers. */ txbuf = txr->tx_buffers; - for (i = 0; i < adapter->num_tx_desc; i++, txbuf++) { + for (i = 0; i < txr->num_desc; i++, txbuf++) { if (txbuf->m_head != NULL) { bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_POSTWRITE); @@ -2947,8 +3005,24 @@ ixgbe_setup_transmit_ring(struct tx_ring *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 28 21:58:11 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FAFCACA; Thu, 28 Feb 2013 21:58:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03DF8638; Thu, 28 Feb 2013 21:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLwAO2064515; Thu, 28 Feb 2013 21:58:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLw7cA064499; Thu, 28 Feb 2013 21:58:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302282158.r1SLw7cA064499@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Feb 2013 21:58: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: r247503 - in stable/8/sys: fs/nfs fs/nfsclient fs/nfsserver nfs nfsclient nfsserver X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 21:58:11 -0000 Author: jhb Date: Thu Feb 28 21:58:07 2013 New Revision: 247503 URL: http://svnweb.freebsd.org/changeset/base/247503 Log: MFC 245508,245566,245568,245611,245909: Various fixes to timestamps in NFS: - Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes() instead of comparing the desired time against the current time as a heuristic. - Remove unused nfs_curusec(). - Use vfs_timestamp() to set file timestamps rather than invoking getmicrotime() or getnanotime() directly in NFS. - Use NFSD_MONOSEC (which maps to time_uptime) instead of the seconds portion of wall-time stamps to manage timeouts on events. - Remove unused nd_starttime from the per-request structure in the new NFS server. - Use nanotime() for the modification time on a delegation to get as precise a time as possible. - Use time_second instead of extracting the second from a call to getmicrotime(). Modified: stable/8/sys/fs/nfs/nfs.h stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfs/nfsport.h stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clstate.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c stable/8/sys/nfs/nfs_common.c stable/8/sys/nfs/nfs_common.h stable/8/sys/nfsclient/nfs_krpc.c stable/8/sys/nfsclient/nfs_subs.c stable/8/sys/nfsclient/nfs_vnops.c stable/8/sys/nfsserver/nfs_srvsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/nfs/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/nfsserver/ (props changed) Modified: stable/8/sys/fs/nfs/nfs.h ============================================================================== --- stable/8/sys/fs/nfs/nfs.h Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfs/nfs.h Thu Feb 28 21:58:07 2013 (r247503) @@ -519,7 +519,6 @@ struct nfsrv_descript { int *nd_errp; /* Pointer to ret status */ u_int32_t nd_retxid; /* Reply xid */ struct nfsrvcache *nd_rp; /* Assoc. cache entry */ - struct timeval nd_starttime; /* Time RPC initiated */ fhandle_t nd_fh; /* File handle */ struct ucred *nd_cred; /* Credentials */ uid_t nd_saveduid; /* Saved uid */ Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu Feb 28 21:58:07 2013 (r247503) @@ -413,18 +413,17 @@ nfs_feedback(int type, int proc, void *a { struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg; struct nfsmount *nmp = nf->nf_mount; - struct timeval now; - - getmicrouptime(&now); + time_t now; switch (type) { case FEEDBACK_REXMIT2: case FEEDBACK_RECONNECT: - if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) { + now = NFSD_MONOSEC; + if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) { nfs_down(nmp, nf->nf_td, "not responding", 0, NFSSTA_TIMEO); nf->nf_tprintfmsg = TRUE; - nf->nf_lastmsg = now.tv_sec; + nf->nf_lastmsg = now; } break; @@ -454,7 +453,7 @@ newnfs_request(struct nfsrv_descript *nd u_int16_t procnum; u_int trylater_delay = 1; struct nfs_feedback_arg nf; - struct timeval timo, now; + struct timeval timo; AUTH *auth; struct rpc_callextra ext; enum clnt_stat stat; @@ -570,8 +569,7 @@ newnfs_request(struct nfsrv_descript *nd bzero(&nf, sizeof(struct nfs_feedback_arg)); nf.nf_mount = nmp; nf.nf_td = td; - getmicrouptime(&now); - nf.nf_lastmsg = now.tv_sec - + nf.nf_lastmsg = NFSD_MONOSEC - ((nmp->nm_tprintf_delay)-(nmp->nm_tprintf_initial_delay)); } Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Thu Feb 28 21:58:07 2013 (r247503) @@ -1979,7 +1979,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd struct statfs fs; struct nfsfsinfo fsinf; struct timespec temptime; - struct timeval curtime; NFSACL_T *aclp, *naclp = NULL; #ifdef QUOTA struct dqblk dqb; @@ -2393,8 +2392,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd retnum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEACCESSSET: - NFSGETTIME(&curtime); - if (vap->va_atime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME); *tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT); txdr_nfsv4time(&vap->va_atime, tl); @@ -2423,8 +2421,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd retnum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEMODIFYSET: - NFSGETTIME(&curtime); - if (vap->va_mtime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME); *tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT); txdr_nfsv4time(&vap->va_mtime, tl); Modified: stable/8/sys/fs/nfs/nfsport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsport.h Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfs/nfsport.h Thu Feb 28 21:58:07 2013 (r247503) @@ -522,12 +522,6 @@ void nfsrvd_rcv(struct socket *, void *, #define NCHNAMLEN 9999999 /* - * Define these to use the time of day clock. - */ -#define NFSGETTIME(t) (getmicrotime(t)) -#define NFSGETNANOTIME(t) (getnanotime(t)) - -/* * These macros are defined to initialize and set the timer routine. */ #define NFS_TIMERINIT \ Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Thu Feb 28 21:58:07 2013 (r247503) @@ -702,7 +702,6 @@ nfscl_fillsattr(struct nfsrv_descript *n u_int32_t *tl; struct nfsv2_sattr *sp; nfsattrbit_t attrbits; - struct timeval curtime; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { case ND_NFSV2: @@ -731,7 +730,6 @@ nfscl_fillsattr(struct nfsrv_descript *n txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime); break; case ND_NFSV3: - getmicrotime(&curtime); if (vap->va_mode != (mode_t)VNOVAL) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = newnfs_true; @@ -765,7 +763,7 @@ nfscl_fillsattr(struct nfsrv_descript *n *tl = newnfs_false; } if (vap->va_atime.tv_sec != VNOVAL) { - if (vap->va_atime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&vap->va_atime, tl); @@ -778,7 +776,7 @@ nfscl_fillsattr(struct nfsrv_descript *n *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); } if (vap->va_mtime.tv_sec != VNOVAL) { - if (vap->va_mtime.tv_sec != curtime.tv_sec) { + if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) { NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&vap->va_mtime, tl); Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Feb 28 21:58:07 2013 (r247503) @@ -2394,7 +2394,7 @@ nfscl_renewthread(struct nfsclclient *cl u_int32_t clidrev; int error, cbpathdown, islept, igotlock, ret, clearok; uint32_t recover_done_time = 0; - struct timespec mytime; + time_t mytime; static time_t prevsec = 0; struct nfscllockownerfh *lfhp, *nlfhp; struct nfscllockownerfhhead lfh; @@ -2559,9 +2559,9 @@ tryagain: * Call nfscl_cleanupkext() once per second to check for * open/lock owners where the process has exited. */ - NFSGETNANOTIME(&mytime); - if (prevsec != mytime.tv_sec) { - prevsec = mytime.tv_sec; + mytime = NFSD_MONOSEC; + if (prevsec != mytime) { + prevsec = mytime; nfscl_cleanupkext(clp, &lfh); } @@ -4174,7 +4174,7 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - NFSGETNANOTIME(&dp->nfsdl_modtime); + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Feb 28 21:58:07 2013 (r247503) @@ -3162,7 +3162,7 @@ nfsfifo_read(struct vop_read_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NACC; - getnanotime(&np->n_atim); + vfs_timestamp(&np->n_atim); mtx_unlock(&np->n_mtx); error = fifo_specops.vop_read(ap); return error; @@ -3181,7 +3181,7 @@ nfsfifo_write(struct vop_write_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NUPD; - getnanotime(&np->n_mtim); + vfs_timestamp(&np->n_mtim); mtx_unlock(&np->n_mtx); return(fifo_specops.vop_write(ap)); } @@ -3201,7 +3201,7 @@ nfsfifo_close(struct vop_close_args *ap) mtx_lock(&np->n_mtx); if (np->n_flag & (NACC | NUPD)) { - getnanotime(&ts); + vfs_timestamp(&ts); if (np->n_flag & NACC) np->n_atim = ts; if (np->n_flag & NUPD) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 28 21:58:07 2013 (r247503) @@ -290,7 +290,6 @@ nfs_proc(struct nfsrv_descript *nd, u_in } else { isdgram = 1; } - NFSGETTIME(&nd->nd_starttime); /* * Two cases: Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Thu Feb 28 21:58:07 2013 (r247503) @@ -1471,7 +1471,7 @@ nfsvno_updfilerev(struct vnode *vp, stru struct vattr va; VATTR_NULL(&va); - getnanotime(&va.va_mtime); + vfs_timestamp(&va.va_mtime); (void) VOP_SETATTR(vp, &va, cred); (void) nfsvno_getattr(vp, nvap, cred, p, 1); } @@ -2244,7 +2244,6 @@ nfsrv_sattr(struct nfsrv_descript *nd, s { u_int32_t *tl; struct nfsv2_sattr *sp; - struct timeval curtime; int error = 0, toclient = 0; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { @@ -2303,9 +2302,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s toclient = 1; break; case NFSV3SATTRTIME_TOSERVER: - NFSGETTIME(&curtime); - nvap->na_atime.tv_sec = curtime.tv_sec; - nvap->na_atime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_atime); nvap->na_vaflags |= VA_UTIMES_NULL; break; }; @@ -2317,9 +2314,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s nvap->na_vaflags &= ~VA_UTIMES_NULL; break; case NFSV3SATTRTIME_TOSERVER: - NFSGETTIME(&curtime); - nvap->na_mtime.tv_sec = curtime.tv_sec; - nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_mtime); if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; break; @@ -2349,7 +2344,6 @@ nfsv4_sattr(struct nfsrv_descript *nd, s u_char *cp, namestr[NFSV4_SMALLSTR + 1]; uid_t uid; gid_t gid; - struct timeval curtime; error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup); if (error) @@ -2484,9 +2478,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s toclient = 1; attrsum += NFSX_V4TIME; } else { - NFSGETTIME(&curtime); - nvap->na_atime.tv_sec = curtime.tv_sec; - nvap->na_atime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_atime); nvap->na_vaflags |= VA_UTIMES_NULL; } break; @@ -2511,9 +2503,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s nvap->na_vaflags &= ~VA_UTIMES_NULL; attrsum += NFSX_V4TIME; } else { - NFSGETTIME(&curtime); - nvap->na_mtime.tv_sec = curtime.tv_sec; - nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000; + vfs_timestamp(&nvap->na_mtime); if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Thu Feb 28 21:58:07 2013 (r247503) @@ -3966,7 +3966,6 @@ nfsrv_setupstable(NFSPROC_T *p) int error, i, tryagain; off_t off = 0; int aresid, len; - struct timeval curtime; /* * If NFSNSF_UPDATEDONE is set, this is a restart of the nfsds without @@ -3977,8 +3976,7 @@ nfsrv_setupstable(NFSPROC_T *p) /* * Set Grace over just until the file reads successfully. */ - NFSGETTIME(&curtime); - nfsrvboottime = curtime.tv_sec; + nfsrvboottime = time_second; LIST_INIT(&sf->nsf_head); sf->nsf_flags = (NFSNSF_GRACEOVER | NFSNSF_NEEDLOCK); sf->nsf_eograce = NFSD_MONOSEC + NFSRV_LEASEDELTA; @@ -4649,8 +4647,7 @@ out: APPLESTATIC void nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p) { - struct timespec mytime; - int32_t starttime; + time_t starttime; int error; /* @@ -4674,8 +4671,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO * Now, call nfsrv_checkremove() in a loop while it returns * NFSERR_DELAY. Return upon any other error or when timed out. */ - NFSGETNANOTIME(&mytime); - starttime = (u_int32_t)mytime.tv_sec; + starttime = NFSD_MONOSEC; do { if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); @@ -4683,11 +4679,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO } else error = EPERM; if (error == NFSERR_DELAY) { - NFSGETNANOTIME(&mytime); - if (((u_int32_t)mytime.tv_sec - starttime) > - NFS_REMOVETIMEO && - ((u_int32_t)mytime.tv_sec - starttime) < - 100000) + if (NFSD_MONOSEC - starttime > NFS_REMOVETIMEO) break; /* Sleep for a short period of time */ (void) nfs_catnap(PZERO, 0, "nfsremove"); @@ -4948,9 +4940,7 @@ nfsrv_notsamecredname(struct nfsrv_descr static time_t nfsrv_leaseexpiry(void) { - struct timeval curtime; - NFSGETTIME(&curtime); if (nfsrv_stablefirst.nsf_eograce > NFSD_MONOSEC) return (NFSD_MONOSEC + 2 * (nfsrv_lease + NFSRV_LEASEDELTA)); return (NFSD_MONOSEC + nfsrv_lease + NFSRV_LEASEDELTA); Modified: stable/8/sys/nfs/nfs_common.c ============================================================================== --- stable/8/sys/nfs/nfs_common.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfs/nfs_common.c Thu Feb 28 21:58:07 2013 (r247503) @@ -90,15 +90,6 @@ static int nfs_realign_count; SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD, &nfs_realign_count, 0, "Number of mbuf realignments done"); -u_quad_t -nfs_curusec(void) -{ - struct timeval tv; - - getmicrotime(&tv); - return ((u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec); -} - /* * copies mbuf chain to the uio scatter/gather list */ Modified: stable/8/sys/nfs/nfs_common.h ============================================================================== --- stable/8/sys/nfs/nfs_common.h Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfs/nfs_common.h Thu Feb 28 21:58:07 2013 (r247503) @@ -46,7 +46,6 @@ extern nfstype nfsv3_type[]; #define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))]) int nfs_adv(struct mbuf **, caddr_t *, int, int); -u_quad_t nfs_curusec(void); void *nfsm_disct(struct mbuf **, caddr_t *, int, int, int); int nfs_realign(struct mbuf **, int); Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu Feb 28 21:58:07 2013 (r247503) @@ -394,18 +394,17 @@ nfs_feedback(int type, int proc, void *a { struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg; struct nfsmount *nmp = nf->nf_mount; - struct timeval now; - - getmicrouptime(&now); + time_t now; switch (type) { case FEEDBACK_REXMIT2: case FEEDBACK_RECONNECT: - if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) { + now = time_uptime; + if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) { nfs_down(nmp, nf->nf_td, "not responding", 0, NFSSTA_TIMEO); nf->nf_tprintfmsg = TRUE; - nf->nf_lastmsg = now.tv_sec; + nf->nf_lastmsg = now; } break; @@ -438,7 +437,6 @@ nfs_request(struct vnode *vp, struct mbu time_t waituntil; caddr_t dpos; int error = 0, timeo; - struct timeval now; AUTH *auth = NULL; enum nfs_rto_timer_t timer; struct nfs_feedback_arg nf; @@ -455,8 +453,7 @@ nfs_request(struct vnode *vp, struct mbu bzero(&nf, sizeof(struct nfs_feedback_arg)); nf.nf_mount = nmp; nf.nf_td = td; - getmicrouptime(&now); - nf.nf_lastmsg = now.tv_sec - + nf.nf_lastmsg = time_uptime - ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay)); /* Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfsclient/nfs_subs.c Thu Feb 28 21:58:07 2013 (r247503) @@ -1119,7 +1119,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in *tl = nfs_false; } if (va->va_atime.tv_sec != VNOVAL) { - if (va->va_atime.tv_sec != time_second) { + if ((va->va_vaflags & VA_UTIMES_NULL) == 0) { tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&va->va_atime, tl); @@ -1132,7 +1132,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); } if (va->va_mtime.tv_sec != VNOVAL) { - if (va->va_mtime.tv_sec != time_second) { + if ((va->va_vaflags & VA_UTIMES_NULL) == 0) { tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos); *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); txdr_nfsv3time(&va->va_mtime, tl); Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfsclient/nfs_vnops.c Thu Feb 28 21:58:07 2013 (r247503) @@ -3461,7 +3461,7 @@ nfsfifo_read(struct vop_read_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NACC; - getnanotime(&np->n_atim); + vfs_timestamp(&np->n_atim); mtx_unlock(&np->n_mtx); error = fifo_specops.vop_read(ap); return error; @@ -3480,7 +3480,7 @@ nfsfifo_write(struct vop_write_args *ap) */ mtx_lock(&np->n_mtx); np->n_flag |= NUPD; - getnanotime(&np->n_mtim); + vfs_timestamp(&np->n_mtim); mtx_unlock(&np->n_mtx); return(fifo_specops.vop_write(ap)); } @@ -3500,7 +3500,7 @@ nfsfifo_close(struct vop_close_args *ap) mtx_lock(&np->n_mtx); if (np->n_flag & (NACC | NUPD)) { - getnanotime(&ts); + vfs_timestamp(&ts); if (np->n_flag & NACC) np->n_atim = ts; if (np->n_flag & NUPD) Modified: stable/8/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- stable/8/sys/nfsserver/nfs_srvsubs.c Thu Feb 28 21:57:38 2013 (r247502) +++ stable/8/sys/nfsserver/nfs_srvsubs.c Thu Feb 28 21:58:07 2013 (r247503) @@ -1430,7 +1430,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct toclient = 1; break; case NFSV3SATTRTIME_TOSERVER: - getnanotime(&(a)->va_atime); + vfs_timestamp(&a->va_atime); a->va_vaflags |= VA_UTIMES_NULL; break; } @@ -1446,7 +1446,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct a->va_vaflags &= ~VA_UTIMES_NULL; break; case NFSV3SATTRTIME_TOSERVER: - getnanotime(&(a)->va_mtime); + vfs_timestamp(&a->va_mtime); if (toclient == 0) a->va_vaflags |= VA_UTIMES_NULL; break; From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 1 00:46:42 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8FC77CAC; Fri, 1 Mar 2013 00:46:42 +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 819A7BEA; Fri, 1 Mar 2013 00:46:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210kgEh016623; Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210kgKv016622; Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303010046.r210kgKv016622@svn.freebsd.org> From: Xin LI Date: Fri, 1 Mar 2013 00:46: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: r247511 - in stable: 6/sys/dev/random 7/sys/dev/random 8/sys/dev/random 9/sys/dev/random X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2013 00:46:42 -0000 Author: delphij Date: Fri Mar 1 00:46:41 2013 New Revision: 247511 URL: http://svnweb.freebsd.org/changeset/base/247511 Log: MFC r247334: Correct a typo introduced in r153575, which gives inverted logic when handling blocking semantics when seeding. PR: kern/143298 Submitted by: James Juran Reviewed by: markm Modified: stable/8/sys/dev/random/randomdev_soft.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/random/ (props changed) Changes in other areas also in this revision: Modified: stable/6/sys/dev/random/randomdev_soft.c stable/7/sys/dev/random/randomdev_soft.c stable/9/sys/dev/random/randomdev_soft.c Directory Properties: stable/6/sys/ (props changed) stable/7/sys/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/sys/dev/random/randomdev_soft.c ============================================================================== --- stable/8/sys/dev/random/randomdev_soft.c Fri Mar 1 00:15:58 2013 (r247510) +++ stable/8/sys/dev/random/randomdev_soft.c Fri Mar 1 00:46:41 2013 (r247511) @@ -391,7 +391,7 @@ random_yarrow_block(int flag) mtx_lock(&random_reseed_mtx); /* Blocking logic */ - while (random_systat.seeded && !error) { + while (!random_systat.seeded && !error) { if (flag & O_NONBLOCK) error = EWOULDBLOCK; else { From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 1 00:52:19 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 210F43CD; Fri, 1 Mar 2013 00:52:19 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D21C3CBE; Fri, 1 Mar 2013 00:52:18 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 32316827D; Fri, 1 Mar 2013 00:52:17 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id BA7C99C4E; Fri, 1 Mar 2013 01:52:16 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org Subject: Re: svn commit: r247500 - in stable/8/lib/libc: gen stdlib References: <201302282132.r1SLWlXQ057721@svn.freebsd.org> Date: Fri, 01 Mar 2013 01:52:15 +0100 In-Reply-To: <201302282132.r1SLWlXQ057721@svn.freebsd.org> (Dag-Erling SmXXrgrav's message of "Thu, 28 Feb 2013 21:32:47 +0000 (UTC)") Message-ID: <868v6854cg.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2013 00:52:19 -0000 Dag-Erling SmXXrgrav writes: > Log: > MFH (r240107,240111,240361): warn against using weak PRNGs I just realized I never merged this into 9 either... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-8@FreeBSD.ORG Fri Mar 1 00:58:47 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 654C4849; Fri, 1 Mar 2013 00:58: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 544B1CF6; Fri, 1 Mar 2013 00:58:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210wlqi020108; Fri, 1 Mar 2013 00:58:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210wj3S020087; Fri, 1 Mar 2013 00:58:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303010058.r210wj3S020087@svn.freebsd.org> From: Xin LI Date: Fri, 1 Mar 2013 00:58:45 +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: r247514 - in stable/8: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2013 00:58:47 -0000 Author: delphij Date: Fri Mar 1 00:58:44 2013 New Revision: 247514 URL: http://svnweb.freebsd.org/changeset/base/247514 Log: MFC: libexpat 2.1.0. Added: stable/8/contrib/expat/FREEBSD-Xlist - copied unchanged from r247511, head/contrib/expat/FREEBSD-Xlist Deleted: stable/8/contrib/expat/FREEBSD-upgrade stable/8/contrib/expat/configure stable/8/contrib/expat/doc/valid-xhtml10.png stable/8/contrib/expat/lib/winconfig.h stable/8/contrib/expat/tests/benchmark/benchmark.dsp stable/8/contrib/expat/tests/benchmark/benchmark.dsw Modified: stable/8/contrib/expat/Changes (contents, props changed) stable/8/contrib/expat/MANIFEST (contents, props changed) stable/8/contrib/expat/Makefile.in (contents, props changed) stable/8/contrib/expat/README (contents, props changed) stable/8/contrib/expat/configure.in (contents, props changed) stable/8/contrib/expat/doc/reference.html (contents, props changed) stable/8/contrib/expat/doc/xmlwf.sgml (contents, props changed) stable/8/contrib/expat/expat_config.h.in (contents, props changed) stable/8/contrib/expat/lib/expat.h (contents, props changed) stable/8/contrib/expat/lib/xmlparse.c (contents, props changed) stable/8/contrib/expat/lib/xmlrole.c (contents, props changed) stable/8/contrib/expat/lib/xmltok.c (contents, props changed) stable/8/contrib/expat/lib/xmltok_impl.c (contents, props changed) stable/8/contrib/expat/tests/README.txt (contents, props changed) stable/8/contrib/expat/tests/minicheck.h (contents, props changed) stable/8/contrib/expat/tests/runtests.c (contents, props changed) stable/8/contrib/expat/tests/xmltest.sh (contents, props changed) stable/8/contrib/expat/xmlwf/readfilemap.c (contents, props changed) stable/8/contrib/expat/xmlwf/xmlwf.c (contents, props changed) stable/8/lib/libexpat/expat_config.h stable/8/lib/libexpat/libbsdxml.3 Directory Properties: stable/8/contrib/expat/ (props changed) stable/8/contrib/expat/COPYING (props changed) stable/8/contrib/expat/doc/expat.png (props changed) stable/8/contrib/expat/doc/style.css (props changed) stable/8/contrib/expat/doc/xmlwf.1 (props changed) stable/8/contrib/expat/examples/elements.c (props changed) stable/8/contrib/expat/examples/outline.c (props changed) stable/8/contrib/expat/lib/ascii.h (props changed) stable/8/contrib/expat/lib/asciitab.h (props changed) stable/8/contrib/expat/lib/expat_external.h (props changed) stable/8/contrib/expat/lib/iasciitab.h (props changed) stable/8/contrib/expat/lib/internal.h (props changed) stable/8/contrib/expat/lib/latin1tab.h (props changed) stable/8/contrib/expat/lib/nametab.h (props changed) stable/8/contrib/expat/lib/utf8tab.h (props changed) stable/8/contrib/expat/lib/xmlrole.h (props changed) stable/8/contrib/expat/lib/xmltok.h (props changed) stable/8/contrib/expat/lib/xmltok_impl.h (props changed) stable/8/contrib/expat/lib/xmltok_ns.c (props changed) stable/8/contrib/expat/tests/benchmark/README.txt (props changed) stable/8/contrib/expat/tests/benchmark/benchmark.c (props changed) stable/8/contrib/expat/tests/chardata.c (props changed) stable/8/contrib/expat/tests/chardata.h (props changed) stable/8/contrib/expat/tests/minicheck.c (props changed) stable/8/contrib/expat/tests/runtestspp.cpp (props changed) stable/8/contrib/expat/xmlwf/codepage.c (props changed) stable/8/contrib/expat/xmlwf/codepage.h (props changed) stable/8/contrib/expat/xmlwf/ct.c (props changed) stable/8/contrib/expat/xmlwf/filemap.h (props changed) stable/8/contrib/expat/xmlwf/unixfilemap.c (props changed) stable/8/contrib/expat/xmlwf/win32filemap.c (props changed) stable/8/contrib/expat/xmlwf/xmlfile.c (props changed) stable/8/contrib/expat/xmlwf/xmlfile.h (props changed) stable/8/contrib/expat/xmlwf/xmlmime.c (props changed) stable/8/contrib/expat/xmlwf/xmlmime.h (props changed) stable/8/contrib/expat/xmlwf/xmltchar.h (props changed) stable/8/contrib/expat/xmlwf/xmlurl.h (props changed) stable/8/contrib/expat/xmlwf/xmlwin32url.cxx (props changed) stable/8/lib/libexpat/ (props changed) Modified: stable/8/contrib/expat/Changes ============================================================================== --- stable/8/contrib/expat/Changes Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/Changes Fri Mar 1 00:58:44 2013 (r247514) @@ -1,5 +1,41 @@ +Release 2.1.0 Sat March 24 2012 + - Bug Fixes: + #1742315: Harmful XML_ParserCreateNS suggestion. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. + #1983953, 2517952, 2517962, 2649838: + Build modifications using autoreconf instead of buildconf.sh. + #2815947, #2884086: OBJEXT and EXEEXT support while building. + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. + #2517938: xmlwf should return non-zero exit status if not well-formed. + #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. + #2855609: Dangling positionPtr after error. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2990652: CMake support. + #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. + #3206497: Unitialized memory returned from XML_Parse. + #3287849: make check fails on mingw-w64. + #3496608: CVE-2012-0876 - Hash DOS attack. + - Patches: + #1749198: pkg-config support. + #3010222: Fix for bug #3010819. + #3312568: CMake support. + #3446384: Report byte offsets for attr names and values. + - New Features / API changes: + Added new API member XML_SetHashSalt() that allows setting an intial + value (salt) for hash calculations. This is part of the fix for + bug #3496608 to randomize hash parameters. + When compiled with XML_ATTR_INFO defined, adds new API member + XML_GetAttributeInfo() that allows retrieving the byte + offsets for attribute names and values (patch #3446384). + Added CMake build system. + See bug #2990652 and patch #3312568. + Added run-benchmark target to Makefile.in - relies on testdata module + present in the same relative location as in the repository. + Release 2.0.1 Tue June 5 2007 - - Fixed bugs #1515266, 1515600: The character data handler's calling + - Fixed bugs #1515266, #1515600: The character data handler's calling of XML_StopParser() was not handled properly; if the parser was stopped and the handler set to NULL, the parser would segfault. - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed @@ -8,7 +44,7 @@ Release 2.0.1 Tue June 5 2007 - Fixed xmlwf bug #1513566: "out of memory" error on file size zero. - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call. - Fixes and improvements for Windows platform: - bugs #1409451, #1476160, 1548182, 1602769, 1717322. + bugs #1409451, #1476160, #1548182, #1602769, #1717322. - Build fixes for various platforms: HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180. All Unix: #1554618 (refreshed config.sub/config.guess). @@ -30,8 +66,8 @@ Release 2.0.0 Wed Jan 11 2006 byte indexes and line/column numbers. - Updated to use libtool 1.5.22 (the most recent). - Added support for AmigaOS. - - Some mostly minor bug fixes. SF issues include: 1006708, - 1021776, 1023646, 1114960, 1156398, 1221160, 1271642. + - Some mostly minor bug fixes. SF issues include: #1006708, + #1021776, #1023646, #1114960, #1156398, #1221160, #1271642. Release 1.95.8 Fri Jul 23 2004 - Major new feature: suspend/resume. Handlers can now request @@ -40,8 +76,8 @@ Release 1.95.8 Fri Jul 23 2004 documentation for more details. - Some mostly minor bug fixes, but compilation should no longer generate warnings on most platforms. SF issues - include: 827319, 840173, 846309, 888329, 896188, 923913, - 928113, 961698, 985192. + include: #827319, #840173, #846309, #888329, #896188, #923913, + #928113, #961698, #985192. Release 1.95.7 Mon Oct 20 2003 - Fixed enum XML_Status issue (reported on SourceForge many @@ -54,19 +90,19 @@ Release 1.95.7 Mon Oct 20 2003 - Improved ability to build without the configure-generated expat_config.h header. This is useful for applications which embed Expat rather than linking in the library. - - Fixed a variety of bugs: see SF issues 458907, 609603, - 676844, 679754, 692878, 692964, 695401, 699323, 699487, - 820946. + - Fixed a variety of bugs: see SF issues #458907, #609603, + #676844, #679754, #692878, #692964, #695401, #699323, #699487, + #820946. - Improved hash table lookups. - Added more regression tests and improved documentation. Release 1.95.6 Tue Jan 28 2003 - Added XML_FreeContentModel(). - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). - - Fixed a variety of bugs: see SF issues 615606, 616863, - 618199, 653180, 673791. + - Fixed a variety of bugs: see SF issues #615606, #616863, + #618199, #653180, #673791. - Enhanced the regression test suite. - - Man page improvements: includes SF issue 632146. + - Man page improvements: includes SF issue #632146. Release 1.95.5 Fri Sep 6 2002 - Added XML_UseForeignDTD() for improved SAX2 support. @@ -84,9 +120,9 @@ Release 1.95.5 Fri Sep 6 2002 - Reduced line-length for all source code and headers to be no longer than 80 characters, to help with AS/400 support. - Reduced memory copying during parsing (SF patch #600964). - - Fixed a variety of bugs: see SF issues 580793, 434664, - 483514, 580503, 581069, 584041, 584183, 584832, 585537, - 596555, 596678, 598352, 598944, 599715, 600479, 600971. + - Fixed a variety of bugs: see SF issues #580793, #434664, + #483514, #580503, #581069, #584041, #584183, #584832, #585537, + #596555, #596678, #598352, #598944, #599715, #600479, #600971. Release 1.95.4 Fri Jul 12 2002 - Added support for VMS, contributed by Craig Berry. See @@ -95,14 +131,14 @@ Release 1.95.4 Fri Jul 12 2002 contributed by Thomas Wegner and Daryle Walker. - Added Borland C++ Builder 5 / BCC 5.5 support, contributed by Patrick McConnell (SF patch #538032). - - Fixed a variety of bugs: see SF issues 441449, 563184, - 564342, 566334, 566901, 569461, 570263, 575168, 579196. + - Fixed a variety of bugs: see SF issues #441449, #563184, + #564342, #566334, #566901, #569461, #570263, #575168, #579196. - Made skippedEntityHandler conform to SAX2 (see source comment) - Re-implemented WFC: Entity Declared from XML 1.0 spec and added a new error "entity declared in parameter entity": - see SF bug report 569461 and SF patch 578161 + see SF bug report #569461 and SF patch #578161 - Re-implemented section 5.1 from XML 1.0 spec: - see SF bug report 570263 and SF patch 578161 + see SF bug report #570263 and SF patch #578161 Release 1.95.3 Mon Jun 3 2002 - Added a project to the MSVC workspace to create a wchar_t @@ -114,9 +150,9 @@ Release 1.95.3 Mon Jun 3 2002 - Made the XML_UNICODE builds usable (thanks, Karl!). - Allow xmlwf to read from standard input. - Install a man page for xmlwf on Unix systems. - - Fixed many bugs; see SF bug reports 231864, 461380, 464837, - 466885, 469226, 477667, 484419, 487840, 494749, 496505, - 547350. Other bugs which we can't test as easily may also + - Fixed many bugs; see SF bug reports #231864, #461380, #464837, + #466885, #469226, #477667, #484419, #487840, #494749, #496505, + #547350. Other bugs which we can't test as easily may also have been fixed, especially in the area of build support. Release 1.95.2 Fri Jul 27 2001 Copied: stable/8/contrib/expat/FREEBSD-Xlist (from r247511, head/contrib/expat/FREEBSD-Xlist) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/contrib/expat/FREEBSD-Xlist Fri Mar 1 00:58:44 2013 (r247514, copy of r247511, head/contrib/expat/FREEBSD-Xlist) @@ -0,0 +1,19 @@ +# $FreeBSD$ +*.MPW +*.cmake +*.def +*.dsp +*.dsw +*.m4 +*.pc.in +*config.h +CMake* +Configure* +amiga +bcb5 +configure +conftools +doc/valid-xhtml10.png +m4 +vms +win32 Modified: stable/8/contrib/expat/MANIFEST ============================================================================== --- stable/8/contrib/expat/MANIFEST Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/MANIFEST Fri Mar 1 00:58:44 2013 (r247514) @@ -1,5 +1,8 @@ -amiga/stdlib.c amiga/launch.c +amiga/expat_68k.c +amiga/expat_68k.h +amiga/expat_68k_handler_stubs.c +amiga/expat_base.h amiga/expat_vectors.c amiga/expat_lib.c amiga/expat.xml @@ -42,25 +45,35 @@ doc/style.css doc/valid-xhtml10.png doc/xmlwf.1 doc/xmlwf.sgml +CMakeLists.txt +CMake.README COPYING Changes +ConfigureChecks.cmake MANIFEST Makefile.in README configure configure.in expat_config.h.in +expat_config.h.cmake +expat.pc.in expat.dsw +aclocal.m4 conftools/PrintPath conftools/ac_c_bigendian_cross.m4 -conftools/config.guess -conftools/config.sub conftools/expat.m4 conftools/get-version.sh +conftools/mkinstalldirs +conftools/config.guess +conftools/config.sub conftools/install-sh -conftools/libtool.m4 conftools/ltmain.sh -conftools/mkinstalldirs +m4/libtool.m4 +m4/ltversion.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/lt~obsolete.m4 examples/elements.c examples/elements.dsp examples/outline.c Modified: stable/8/contrib/expat/Makefile.in ============================================================================== --- stable/8/contrib/expat/Makefile.in Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/Makefile.in Fri Mar 1 00:58:44 2013 (r247514) @@ -31,6 +31,7 @@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ man1dir = @mandir@/man1 +pkgconfigdir = $(libdir)/pkgconfig top_builddir = . @@ -46,18 +47,18 @@ LIBRARY = libexpat.la DESTDIR = $(INSTALL_ROOT) -default: buildlib xmlwf/xmlwf +default: buildlib xmlwf/xmlwf@EXEEXT@ -buildlib: $(LIBRARY) +buildlib: $(LIBRARY) expat.pc -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline clean: - cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs - cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs - cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs - cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o - cd tests && rm -f chardata.o minicheck.o + cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@ + cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@ rm -rf .libs libexpat.la rm -f examples/core tests/core xmlwf/core @@ -65,34 +66,37 @@ clobber: clean distclean: clean rm -f expat_config.h config.status config.log config.cache libtool - rm -f Makefile + rm -f Makefile expat.pc extraclean: distclean rm -f expat_config.h.in configure - rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 + rm -f aclocal.m4 m4/* + rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub check: tests/runtests tests/runtestspp tests/runtests tests/runtestspp -install: xmlwf/xmlwf installlib +install: xmlwf/xmlwf@EXEEXT@ installlib $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) -installlib: $(LIBRARY) $(APIHEADER) - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) +installlib: $(LIBRARY) $(APIHEADER) expat.pc + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir) $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done + $(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc uninstall: uninstalllib - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@ rm -f $(DESTDIR)$(man1dir)/xmlwf.1 uninstalllib: $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) rm -f $(DESTDIR)$(includedir)/expat.h rm -f $(DESTDIR)$(includedir)/expat_external.h + rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc # for VPATH builds (invoked by configure) mkdir-init: @@ -125,6 +129,9 @@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo $(LIBRARY): $(LIB_OBJS) $(LINK_LIB) $(LIB_OBJS) +expat.pc: $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ + lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h @@ -137,46 +144,53 @@ lib/xmltok.lo: lib/xmltok.c lib/xmltok_i $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o -xmlwf/xmlwf.o: xmlwf/xmlwf.c -xmlwf/xmlfile.o: xmlwf/xmlfile.c -xmlwf/codepage.o: xmlwf/codepage.c -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) +XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@ +xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c +xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c +xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c +xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c +xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY) $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) -examples/elements.o: examples/elements.c -examples/elements: examples/elements.o $(LIBRARY) +examples/elements.@OBJEXT@: examples/elements.c +examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) $(LINK_EXE) $< $(LIBRARY) -examples/outline.o: examples/outline.c -examples/outline: examples/outline.o $(LIBRARY) +examples/outline.@OBJEXT@: examples/outline.c +examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) $(LINK_EXE) $< $(LIBRARY) -tests/chardata.o: tests/chardata.c tests/chardata.h -tests/minicheck.o: tests/minicheck.c tests/minicheck.h -tests/runtests.o: tests/runtests.c tests/chardata.h -tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) - $(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) -tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h -tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) - $(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) +tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h +tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h +tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h +tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) +tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h +tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + +run-benchmark: tests/benchmark/benchmark + tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 tests/xmlts.zip: wget --output-document=tests/xmlts.zip \ - http://www.w3.org/XML/Test/xmlts20020606.zip + http://www.w3.org/XML/Test/xmlts20080827.zip tests/XML-Test-Suite: tests/xmlts.zip cd tests && unzip -q xmlts.zip -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite tests/xmltest.sh -.SUFFIXES: .c .cpp .lo .o +.SUFFIXES: .c .cpp .lo .@OBJEXT@ -.cpp.o: +.cpp.@OBJEXT@: $(CXXCOMPILE) -o $@ -c $< -.c.o: +.c.@OBJEXT@: $(COMPILE) -o $@ -c $< .c.lo: $(LTCOMPILE) -o $@ -c $< Modified: stable/8/contrib/expat/README ============================================================================== --- stable/8/contrib/expat/README Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/README Fri Mar 1 00:58:44 2013 (r247514) @@ -1,5 +1,5 @@ - Expat, Release 2.0.1 + Expat, Release 2.1.0 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register @@ -25,8 +25,7 @@ intended to be production grade software If you are building Expat from a check-out from the CVS repository, you need to run a script that generates the configure script using the GNU autoconf and libtool tools. To do this, you need to have -autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred). -Run the script like this: +autoconf 2.58 or newer. Run the script like this: ./buildconf.sh @@ -65,8 +64,8 @@ location. Have a look at the "Makefile" the directories into which things will be installed. If you are interested in building Expat to provide document -information in UTF-16 rather than the default UTF-8, follow these -instructions (after having run "make distclean"): +information in UTF-16 encoding rather than the default UTF-8, follow +these instructions (after having run "make distclean"): 1. For UTF-16 output as unsigned short (and version/error strings as char), run: @@ -106,7 +105,10 @@ use DESTDIR=$(INSTALL_ROOT), even if DES environment, because variable-setting priority is 1) commandline 2) in-makefile -3) environment +3) environment + +Note: This only applies to the Expat library itself, building UTF-16 versions +of xmlwf and the tests is currently not supported. Note for Solaris users: The "ar" command is usually located in "/usr/ccs/bin", which is not in the default PATH. You will need to Modified: stable/8/contrib/expat/configure.in ============================================================================== --- stable/8/contrib/expat/configure.in Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/configure.in Fri Mar 1 00:58:44 2013 (r247514) @@ -10,8 +10,8 @@ dnl under the terms of the License (ba dnl in the file COPYING that comes with this distribution. dnl -dnl Ensure that Expat is configured with autoconf 2.52 or newer -AC_PREREQ(2.52) +dnl Ensure that Expat is configured with autoconf 2.58 or newer +AC_PREREQ(2.58) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 @@ -25,12 +25,13 @@ dnl test. I believe this test will work, dnl GNU M4 to test it right now. define([expat_version], ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], - [2.0.x])) + [2.1.x])) AC_INIT(expat, expat_version, expat-bugs@libexpat.org) undefine([expat_version]) AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_AUX_DIR(conftools) +AC_CONFIG_MACRO_DIR([m4]) dnl @@ -44,13 +45,12 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=6 -LIBREVISION=2 -LIBAGE=5 +LIBCURRENT=7 +LIBREVISION=0 +LIBAGE=6 AC_CONFIG_HEADER(expat_config.h) -sinclude(conftools/libtool.m4) sinclude(conftools/ac_c_bigendian_cross.m4) AC_LIBTOOL_WIN32_DLL @@ -62,6 +62,7 @@ AC_SUBST(LIBAGE) dnl Checks for programs. AC_PROG_CC +AC_PROG_CXX AC_PROG_INSTALL if test "$GCC" = yes ; then @@ -144,7 +145,7 @@ AC_DEFINE([XML_DTD], 1, AC_DEFINE([XML_CONTEXT_BYTES], 1024, [Define to specify how much context to retain around the current parse point.]) -AC_CONFIG_FILES(Makefile) +AC_CONFIG_FILES([Makefile expat.pc]) AC_OUTPUT abs_srcdir="`cd $srcdir && pwd`" Modified: stable/8/contrib/expat/doc/reference.html ============================================================================== --- stable/8/contrib/expat/doc/reference.html Fri Mar 1 00:56:57 2013 (r247513) +++ stable/8/contrib/expat/doc/reference.html Fri Mar 1 00:58:44 2013 (r247514) @@ -129,8 +129,10 @@ interface.

  • XML_GetBase
  • XML_GetSpecifiedAttributeCount
  • XML_GetIdAttributeIndex
  • +
  • XML_GetAttributeInfo
  • XML_SetEncoding
  • XML_SetParamEntityParsing
  • +
  • XML_SetHashSalt
  • XML_UseForeignDTD
  • XML_SetReturnNSTriplet
  • XML_DefaultCurrent
  • @@ -369,6 +371,11 @@ footprint and can be faster. statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. + +
    XML_ATTR_INFO
    +
    If defined, makes the the additional function XML_GetAttributeInfo available +for reporting attribute byte offsets.

    @@ -917,12 +924,15 @@ XML_ParserCreateNS(const XML_Char *encod Constructs a new parser that has namespace processing in effect. Namespace expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI. There is a special case when sep is the null -character '\0': the namespace URI and the local part will be -concatenated without any separator - this is intended to support RDF processors. -It is a programming error to use the null separator with -namespace triplets. +means that you should pick a character for sep that can't be part +of an URI. Since Expat does not check namespace URIs for conformance, the +only safe choice for a namespace separator is a character that is illegal +in XML. For instance, '\xFF' is not legal in UTF-8, and +'\xFFFF' is not legal in UTF-16. There is a special case when +sep is the null character '\0': the namespace URI and +the local part will be concatenated without any separator - this is intended +to support RDF processors. It is a programming error to use the null separator +with namespace triplets.
     XML_Parser XMLCALL
    @@ -2074,6 +2084,27 @@ attribute. If called inside a start hand
     current call.
     
     
    +
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser);
    +
    +
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +
    +Returns an array of XML_AttrInfo structures for the +attribute/value pairs passed in the last call to the +XML_StartElementHandler that were specified +in the start-tag rather than defaulted. Each attribute/value pair counts +as 1; thus the number of entries in the array is +XML_GetSpecifiedAttributeCount(parser) / 2. +
    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
    @@ -2104,6 +2135,24 @@ The choices for code are:
     
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • +Note: If XML_SetParamEntityParsing is called after +XML_Parse or XML_ParseBuffer, then it has +no effect and will always return 0. + + +
    +int XMLCALL
    +XML_SetHashSalt(XML_Parser p,
    +                unsigned long hash_salt);
    +
    +
    +Sets the hash salt to use for internal hash calculations. +Helps in preventing DoS attacks based on predicting hash +function behavior. In order to have an effect this must be called +before parsing has started. Returns 1 if successful, 0 when called +after XML_Parse or XML_ParseBuffer. +

    Note: This call is optional, as the parser will auto-generate a new +random salt value if no value has been set at the start of parsing.

    
    Modified: stable/8/contrib/expat/doc/xmlwf.sgml
    ==============================================================================
    --- stable/8/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -389,11 +389,6 @@ supports both.
       
         BUGS
     	
    -	According to the W3C standard, an XML file without a
    -	declaration at the beginning is not considered well-formed.
    -	However, &dhpackage; allows this to pass.
    -	
    -	
     	&dhpackage; returns a 0 - noerr result,
     	even if the file is not well-formed.  There is no good way for
     	a program to use &dhpackage; to quickly
    
    Modified: stable/8/contrib/expat/expat_config.h.in
    ==============================================================================
    --- stable/8/contrib/expat/expat_config.h.in	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/expat_config.h.in	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -39,6 +39,9 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_STRING_H
     
    +/* Define to 1 if you have the  header file. */
    +#undef HAVE_SYS_PARAM_H
    +
     /* Define to 1 if you have the  header file. */
     #undef HAVE_SYS_STAT_H
     
    @@ -48,6 +51,10 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_UNISTD_H
     
    +/* Define to the sub-directory in which libtool stores uninstalled libraries.
    +   */
    +#undef LT_OBJDIR
    +
     /* Define to the address where bug reports for this package should be sent. */
     #undef PACKAGE_BUGREPORT
     
    @@ -60,6 +67,9 @@
     /* Define to the one symbol short name of this package. */
     #undef PACKAGE_TARNAME
     
    +/* Define to the home page for this package. */
    +#undef PACKAGE_URL
    +
     /* Define to the version of this package. */
     #undef PACKAGE_VERSION
     
    @@ -85,8 +95,8 @@
     /* Define to empty if `const' does not conform to ANSI C. */
     #undef const
     
    -/* Define to `long' if  does not define. */
    +/* Define to `long int' if  does not define. */
     #undef off_t
     
    -/* Define to `unsigned' if  does not define. */
    +/* Define to `unsigned int' if  does not define. */
     #undef size_t
    
    Modified: stable/8/contrib/expat/lib/expat.h
    ==============================================================================
    --- stable/8/contrib/expat/lib/expat.h	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/lib/expat.h	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parse
     XMLPARSEAPI(int)
     XML_GetIdAttributeIndex(XML_Parser parser);
     
    +#ifdef XML_ATTR_INFO
    +/* Source file byte offsets for the start and end of attribute names and values.
    +   The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
    +   file an attribute value of "blah" will yield:
    +   info->valueEnd - info->valueStart = 4 bytes.
    +*/
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
    +   passed in last call to the XML_StartElementHandler that were specified
    +   in the start-tag rather than defaulted. Each attribute/value pair counts
    +   as 1; thus the number of entries in the array is
    +   XML_GetSpecifiedAttributeCount(parser) / 2.
    +*/
    +XMLPARSEAPI(const XML_AttrInfo *)
    +XML_GetAttributeInfo(XML_Parser parser);
    +#endif
    +
     /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
        detected.  The last call to XML_Parse must have isFinal true; len
        may be zero for this call (or any other).
    @@ -883,6 +906,15 @@ XMLPARSEAPI(int)
     XML_SetParamEntityParsing(XML_Parser parser,
                               enum XML_ParamEntityParsing parsing);
     
    +/* Sets the hash salt to use for internal hash calculations.
    +   Helps in preventing DoS attacks based on predicting hash
    +   function behavior. This must be called before parsing is started.
    +   Returns 1 if successful, 0 when called after parsing has started.
    +*/
    +XMLPARSEAPI(int)
    +XML_SetHashSalt(XML_Parser parser,
    +                unsigned long hash_salt);
    +
     /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
        XML_GetErrorCode returns information about the error.
     */
    @@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
       XML_FEATURE_SIZEOF_XML_CHAR,
       XML_FEATURE_SIZEOF_XML_LCHAR,
       XML_FEATURE_NS,
    -  XML_FEATURE_LARGE_SIZE
    +  XML_FEATURE_LARGE_SIZE,
    +  XML_FEATURE_ATTR_INFO
       /* Additional features must be added to the end of this enum. */
     };
     
    @@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
        change to major or minor version.
     */
     #define XML_MAJOR_VERSION 2
    -#define XML_MINOR_VERSION 0
    -#define XML_MICRO_VERSION 1
    +#define XML_MINOR_VERSION 1
    +#define XML_MICRO_VERSION 0
     
     #ifdef __cplusplus
     }
    
    Modified: stable/8/contrib/expat/lib/xmlparse.c
    ==============================================================================
    --- stable/8/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -5,6 +5,8 @@
     #include 
     #include                      /* memset(), memcpy() */
     #include 
    +#include                      /* UINT_MAX */
    +#include                        /* time() */
     
     #define XML_BUILDING_EXPAT 1
     
    @@ -12,7 +14,7 @@
     #include "winconfig.h"
     #elif defined(MACOS_CLASSIC)
     #include "macconfig.h"
    -#elif defined(__amigaos4__)
    +#elif defined(__amigaos__)
     #include "amigaconfig.h"
     #elif defined(__WATCOMC__)
     #include "watcomconfig.h"
    @@ -327,15 +329,15 @@ processXmlDecl(XML_Parser parser, int is
     static enum XML_Error
     initializeEncoding(XML_Parser parser);
     static enum XML_Error
    -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, 
    -         const char *end, int tok, const char *next, const char **nextPtr, 
    +doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
    +         const char *end, int tok, const char *next, const char **nextPtr,
              XML_Bool haveMore);
     static enum XML_Error
    -processInternalEntity(XML_Parser parser, ENTITY *entity, 
    +processInternalEntity(XML_Parser parser, ENTITY *entity,
                           XML_Bool betweenDecl);
     static enum XML_Error
     doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
    -          const char *start, const char *end, const char **endPtr, 
    +          const char *start, const char *end, const char **endPtr,
               XML_Bool haveMore);
     static enum XML_Error
     doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
    @@ -353,7 +355,7 @@ static enum XML_Error
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr);
     static int
    -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, 
    +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
                     XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
     static enum XML_Error
     storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
    @@ -391,12 +393,13 @@ static void dtdReset(DTD *p, const XML_M
     static void
     dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
     static int
    -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
    +dtdCopy(XML_Parser oldParser,
    +        DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
     static int
    -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
    -
    +copyEntityTable(XML_Parser oldParser,
    +                HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
     static NAMED *
    -lookup(HASH_TABLE *table, KEY name, size_t createSize);
    +lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
     static void FASTCALL
     hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
     static void FASTCALL hashTableClear(HASH_TABLE *);
    @@ -429,11 +432,15 @@ static ELEMENT_TYPE *
     getElementType(XML_Parser parser, const ENCODING *enc,
                    const char *ptr, const char *end);
     
    +static unsigned long generate_hash_secret_salt(void);
    +static XML_Bool startParsing(XML_Parser parser);
    +
     static XML_Parser
     parserCreate(const XML_Char *encodingName,
                  const XML_Memory_Handling_Suite *memsuite,
                  const XML_Char *nameSep,
                  DTD *dtd);
    +
     static void
     parserInit(XML_Parser parser, const XML_Char *encodingName);
     
    @@ -533,6 +540,9 @@ struct XML_ParserStruct {
       NS_ATT *m_nsAtts;
       unsigned long m_nsAttsVersion;
       unsigned char m_nsAttsPower;
    +#ifdef XML_ATTR_INFO
    +  XML_AttrInfo *m_attInfo;
    +#endif
       POSITION m_position;
       STRING_POOL m_tempPool;
       STRING_POOL m_temp2Pool;
    @@ -546,6 +556,7 @@ struct XML_ParserStruct {
       XML_Bool m_useForeignDTD;
       enum XML_ParamEntityParsing m_paramEntityParsing;
     #endif
    +  unsigned long m_hash_secret_salt;
     };
     
     #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
    @@ -640,6 +651,7 @@ struct XML_ParserStruct {
     #define nsAtts (parser->m_nsAtts)
     #define nsAttsVersion (parser->m_nsAttsVersion)
     #define nsAttsPower (parser->m_nsAttsPower)
    +#define attInfo (parser->m_attInfo)
     #define tempPool (parser->m_tempPool)
     #define temp2Pool (parser->m_temp2Pool)
     #define groupConnector (parser->m_groupConnector)
    @@ -653,6 +665,7 @@ struct XML_ParserStruct {
     #define useForeignDTD (parser->m_useForeignDTD)
     #define paramEntityParsing (parser->m_paramEntityParsing)
     #endif /* XML_DTD */
    +#define hash_secret_salt (parser->m_hash_secret_salt)
     
     XML_Parser XMLCALL
     XML_ParserCreate(const XML_Char *encodingName)
    @@ -670,29 +683,42 @@ XML_ParserCreateNS(const XML_Char *encod
     
     static const XML_Char implicitContext[] = {
       ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
    -  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, 
    +  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
       ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
       ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
       ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
       ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
     };
     
    +static unsigned long
    +generate_hash_secret_salt(void)
    +{
    +  unsigned int seed = time(NULL) % UINT_MAX;
    +  srand(seed);
    +  return rand();
    +}
    +
    +static XML_Bool  /* only valid for root parser */
    +startParsing(XML_Parser parser)
    +{
    +    /* hash functions must be initialized before setContext() is called */
    +    if (hash_secret_salt == 0)
    +      hash_secret_salt = generate_hash_secret_salt();
    +    if (ns) {
    +      /* implicit context only set for root parser, since child
    +         parsers (i.e. external entity parsers) will inherit it
    +      */
    +      return setContext(parser, implicitContext);
    +    }
    +    return XML_TRUE;
    +}
    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encodingName,
                         const XML_Memory_Handling_Suite *memsuite,
                         const XML_Char *nameSep)
     {
    -  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
    -  if (parser != NULL && ns) {
    -    /* implicit context only set for root parser, since child
    -       parsers (i.e. external entity parsers) will inherit it
    -    */
    -    if (!setContext(parser, implicitContext)) {
    -      XML_ParserFree(parser);
    -      return NULL;
    -    }
    -  }
    -  return parser;
    +  return parserCreate(encodingName, memsuite, nameSep, NULL);
     }
     
     static XML_Parser
    @@ -737,9 +763,20 @@ parserCreate(const XML_Char *encodingNam
         FREE(parser);
         return NULL;
       }
    +#ifdef XML_ATTR_INFO
    +  attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
    +  if (attInfo == NULL) {
    +    FREE(atts);
    +    FREE(parser);
    +    return NULL;
    +  }
    +#endif
       dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
       if (dataBuf == NULL) {
         FREE(atts);
    +#ifdef XML_ATTR_INFO
    +    FREE(attInfo);
    +#endif
         FREE(parser);
         return NULL;
       }
    @@ -752,6 +789,9 @@ parserCreate(const XML_Char *encodingNam
         if (_dtd == NULL) {
           FREE(dataBuf);
           FREE(atts);
    +#ifdef XML_ATTR_INFO
    +      FREE(attInfo);
    +#endif
           FREE(parser);
           return NULL;
         }
    @@ -866,6 +906,7 @@ parserInit(XML_Parser parser, const XML_
       useForeignDTD = XML_FALSE;
       paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
     #endif
    +  hash_secret_salt = 0;
     }
     
     /* moves list of bindings to freeBindingList */
    @@ -913,7 +954,7 @@ XML_ParserReset(XML_Parser parser, const
       poolClear(&temp2Pool);
       parserInit(parser, encodingName);
       dtdReset(_dtd, &parser->m_mem);
    -  return setContext(parser, implicitContext);
    +  return XML_TRUE;
     }
     
     enum XML_Status XMLCALL
    @@ -982,6 +1023,12 @@ XML_ExternalEntityParserCreate(XML_Parse
       int oldInEntityValue = prologState.inEntityValue;
     #endif
       XML_Bool oldns_triplets = ns_triplets;
    +  /* Note that the new parser shares the same hash secret as the old
    +     parser, so that dtdCopy and copyEntityTable can lookup values
    +     from hash tables associated with either parser without us having
    +     to worry which hash secrets each table has.
    +  */
    +  unsigned long oldhash_secret_salt = hash_secret_salt;
     
     #ifdef XML_DTD
       if (!context)
    @@ -1035,13 +1082,14 @@ XML_ExternalEntityParserCreate(XML_Parse
         externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
       defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
       ns_triplets = oldns_triplets;
    +  hash_secret_salt = oldhash_secret_salt;
       parentParser = oldParser;
     #ifdef XML_DTD
       paramEntityParsing = oldParamEntityParsing;
       prologState.inEntityValue = oldInEntityValue;
       if (context) {
     #endif /* XML_DTD */
    -    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
    +    if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
           || !setContext(parser, context)) {
           XML_ParserFree(parser);
           return NULL;
    @@ -1130,6 +1178,9 @@ XML_ParserFree(XML_Parser parser)
     #endif /* XML_DTD */
         dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
       FREE((void *)atts);
    +#ifdef XML_ATTR_INFO
    +  FREE((void *)attInfo);
    +#endif
       FREE(groupConnector);
       FREE(buffer);
       FREE(dataBuf);
    @@ -1210,6 +1261,14 @@ XML_GetIdAttributeIndex(XML_Parser parse
       return idAttIndex;
     }
     
    +#ifdef XML_ATTR_INFO
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser)
    +{
    +  return attInfo;
    +}
    +#endif
    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser parser,
                           XML_StartElementHandler start,
    @@ -1426,6 +1485,17 @@ XML_SetParamEntityParsing(XML_Parser par
     #endif
     }
     
    +int XMLCALL
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 01:02:46 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3604DD84;
     Fri,  1 Mar 2013 01:02:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id 1A01ED34;
     Fri,  1 Mar 2013 01:02:46 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2112jhE022637;
     Fri, 1 Mar 2013 01:02:45 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2112jZY022632;
     Fri, 1 Mar 2013 01:02:45 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010102.r2112jZY022632@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 01:02:45 +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: r247517 - in stable/8: bin/ps usr.bin/w
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:02:46 -0000
    
    Author: jhb
    Date: Fri Mar  1 01:02:44 2013
    New Revision: 247517
    URL: http://svnweb.freebsd.org/changeset/base/247517
    
    Log:
      MFC 245610,245633,245635:
      Include the thread name along with the command name when displaying the
      command name of a thread from a multi-threaded process that doesn't have
      an available argument list (such as kernel processes) and threads display
      is enabled via -H.
    
    Modified:
      stable/8/bin/ps/extern.h
      stable/8/bin/ps/fmt.c
      stable/8/bin/ps/ps.c
      stable/8/usr.bin/w/w.c
    Directory Properties:
      stable/8/bin/ps/   (props changed)
      stable/8/usr.bin/w/   (props changed)
    
    Modified: stable/8/bin/ps/extern.h
    ==============================================================================
    --- stable/8/bin/ps/extern.h	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/extern.h	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -50,7 +50,7 @@ int	 donlist(void);
     void	 elapsed(KINFO *, VARENT *);
     void	 emulname(KINFO *, VARENT *);
     VARENT	*find_varentry(VAR *);
    -const	 char *fmt_argv(char **, char *, size_t);
    +const	 char *fmt_argv(char **, char *, char *, size_t);
     double	 getpcpu(const KINFO *);
     void	 kvar(KINFO *, VARENT *);
     void	 label(KINFO *, VARENT *);
    
    Modified: stable/8/bin/ps/fmt.c
    ==============================================================================
    --- stable/8/bin/ps/fmt.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/fmt.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -105,7 +105,7 @@ cmdpart(char *arg0)
     }
     
     const char *
    -fmt_argv(char **argv, char *cmd, size_t maxlen)
    +fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen)
     {
     	size_t len;
     	char *ap, *cp;
    @@ -122,9 +122,14 @@ fmt_argv(char **argv, char *cmd, size_t 
     	cp = malloc(len);
     	if (cp == NULL)
     		errx(1, "malloc failed");
    -	if (ap == NULL)
    -		sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    -	else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
    +	if (ap == NULL) {
    +		if (thread != NULL) {
    +			asprintf(&ap, "%s/%s", cmd, thread);
    +			sprintf(cp, "[%.*s]", (int)maxlen, ap);
    +			free(ap);
    +		} else
    +			sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    +	} else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
     		sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd);
     	else
     		strcpy(cp, ap);
    
    Modified: stable/8/bin/ps/ps.c
    ==============================================================================
    --- stable/8/bin/ps/ps.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/ps.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -143,7 +143,7 @@ static void	 dynsizevars(KINFO *);
     static void	*expand_list(struct listinfo *);
     static const char *
     		 fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int),
    -		    KINFO *, char *, int);
    +		    KINFO *, char *, char *, int);
     static void	 free_list(struct listinfo *);
     static void	 init_list(struct listinfo *, addelem_rtn, int, const char *);
     static char	*kludge_oldps_options(const char *, char *, const char *);
    @@ -1127,11 +1127,12 @@ sizevars(void)
     
     static const char *
     fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki,
    -    char *comm, int maxlen)
    +    char *comm, char *thread, int maxlen)
     {
     	const char *s;
     
    -	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, maxlen);
    +	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm,
    +	    showthreads && ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen);
     	return (s);
     }
     
    @@ -1159,7 +1160,7 @@ saveuser(KINFO *ki)
     			ki->ki_args = strdup("");
     		else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL))
     			ki->ki_args = strdup(fmt(kvm_getargv, ki,
    -			    ki->ki_p->ki_comm, MAXCOMLEN));
    +			    ki->ki_p->ki_comm, ki->ki_p->ki_ocomm, MAXCOMLEN));
     		else
     			asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm);
     		if (ki->ki_args == NULL)
    @@ -1170,7 +1171,7 @@ saveuser(KINFO *ki)
     	if (needenv) {
     		if (UREADOK(ki))
     			ki->ki_env = strdup(fmt(kvm_getenvv, ki,
    -			    (char *)NULL, 0));
    +			    (char *)NULL, (char *)NULL, 0));
     		else
     			ki->ki_env = strdup("()");
     		if (ki->ki_env == NULL)
    
    Modified: stable/8/usr.bin/w/w.c
    ==============================================================================
    --- stable/8/usr.bin/w/w.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/usr.bin/w/w.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -127,7 +127,7 @@ static struct stat	*ttystat(char *, int)
     static void		 usage(int);
     static int		 this_is_uptime(const char *s);
     
    -char *fmt_argv(char **, char *, int);	/* ../../bin/ps/fmt.c */
    +char *fmt_argv(char **, char *, char *, size_t);	/* ../../bin/ps/fmt.c */
     
     int
     main(int argc, char *argv[])
    @@ -325,7 +325,7 @@ main(int argc, char *argv[])
     			continue;
     		}
     		ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
    -		    ep->kp->ki_comm, MAXCOMLEN);
    +		    ep->kp->ki_comm, NULL, MAXCOMLEN);
     		if (ep->args == NULL)
     			err(1, NULL);
     	}
    @@ -392,7 +392,7 @@ main(int argc, char *argv[])
     				const char *ptr;
     
     				ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth),
    -				    dkp->ki_comm, MAXCOMLEN);
    +				    dkp->ki_comm, NULL, MAXCOMLEN);
     				if (ptr == NULL)
     					ptr = "-";
     				(void)printf("\t\t%-9d %s\n",
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 02:06:05 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 2118F9B9;
     Fri,  1 Mar 2013 02:06:05 +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 E448EF04;
     Fri,  1 Mar 2013 02:06:04 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21264e2041884;
     Fri, 1 Mar 2013 02:06:04 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21264rB041882;
     Fri, 1 Mar 2013 02:06:04 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010206.r21264rB041882@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 02:06: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: r247521 - in stable/8: crypto/openssh
     crypto/openssh/openbsd-compat etc/rc.d secure/lib/libssh secure/usr.bin/ssh
     secure/usr.sbin/sshd share/mk tools/build/options
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:06:05 -0000
    
    Author: des
    Date: Fri Mar  1 02:06:04 2013
    New Revision: 247521
    URL: http://svnweb.freebsd.org/changeset/base/247521
    
    Log:
      Pull in OpenSSH 6.1 from head.
      
      Although ECC-based algorithms are now supported, the order of preference
      has been changed so that RSA and DSA are still the preferred algorithms.
    
    Added:
      stable/8/crypto/openssh/audit-linux.c   (contents, props changed)
         - copied, changed from r221420, head/crypto/openssh/audit-linux.c
         - copied unchanged from r221420, head/crypto/openssh/bufec.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdh.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdhc.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdhs.c
         - copied unchanged from r221420, head/crypto/openssh/openbsd-compat/charclass.h
         - copied unchanged from r215116, head/crypto/openssh/openbsd-compat/strptime.c
         - copied unchanged from r221420, head/crypto/openssh/openbsd-compat/timingsafe_bcmp.c
      stable/8/crypto/openssh/sandbox-darwin.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-darwin.c
      stable/8/crypto/openssh/sandbox-null.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-null.c
      stable/8/crypto/openssh/sandbox-rlimit.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-rlimit.c
      stable/8/crypto/openssh/sandbox-systrace.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-systrace.c
      stable/8/crypto/openssh/ssh-ecdsa.c   (contents, props changed)
         - copied, changed from r221420, head/crypto/openssh/ssh-ecdsa.c
      stable/8/crypto/openssh/ssh-sandbox.h
         - copied unchanged from r226046, head/crypto/openssh/ssh-sandbox.h
      stable/8/tools/build/options/WITH_OPENSSH_NONE_CIPHER
         - copied unchanged from r245527, head/tools/build/options/WITH_OPENSSH_NONE_CIPHER
    Directory Properties:
      stable/8/crypto/openssh/bufec.c   (props changed)
      stable/8/crypto/openssh/kexecdh.c   (props changed)
      stable/8/crypto/openssh/kexecdhc.c   (props changed)
      stable/8/crypto/openssh/kexecdhs.c   (props changed)
      stable/8/crypto/openssh/openbsd-compat/charclass.h   (props changed)
      stable/8/crypto/openssh/openbsd-compat/strptime.c   (props changed)
      stable/8/crypto/openssh/openbsd-compat/timingsafe_bcmp.c   (props changed)
    Deleted:
      stable/8/crypto/openssh/WARNING.RNG
      stable/8/crypto/openssh/ssh-pkcs11-helper.0
      stable/8/crypto/openssh/ssh-rand-helper.8
      stable/8/crypto/openssh/ssh-rand-helper.c
      stable/8/crypto/openssh/version.c
    Modified:
      stable/8/crypto/openssh/ChangeLog
      stable/8/crypto/openssh/INSTALL
      stable/8/crypto/openssh/LICENCE
      stable/8/crypto/openssh/PROTOCOL
      stable/8/crypto/openssh/PROTOCOL.agent
      stable/8/crypto/openssh/PROTOCOL.certkeys
      stable/8/crypto/openssh/PROTOCOL.mux
      stable/8/crypto/openssh/README
      stable/8/crypto/openssh/aclocal.m4
      stable/8/crypto/openssh/addrmatch.c
      stable/8/crypto/openssh/atomicio.c
      stable/8/crypto/openssh/atomicio.h
      stable/8/crypto/openssh/audit-bsm.c
      stable/8/crypto/openssh/audit.c
      stable/8/crypto/openssh/audit.h
      stable/8/crypto/openssh/auth-krb5.c
      stable/8/crypto/openssh/auth-options.c
      stable/8/crypto/openssh/auth-options.h
      stable/8/crypto/openssh/auth-pam.c   (contents, props changed)
      stable/8/crypto/openssh/auth-passwd.c
      stable/8/crypto/openssh/auth-rsa.c
      stable/8/crypto/openssh/auth-skey.c
      stable/8/crypto/openssh/auth.c
      stable/8/crypto/openssh/auth.h
      stable/8/crypto/openssh/auth1.c
      stable/8/crypto/openssh/auth2-gss.c
      stable/8/crypto/openssh/auth2-hostbased.c
      stable/8/crypto/openssh/auth2-jpake.c
      stable/8/crypto/openssh/auth2-none.c
      stable/8/crypto/openssh/auth2-pubkey.c
      stable/8/crypto/openssh/auth2.c
      stable/8/crypto/openssh/authfd.c
      stable/8/crypto/openssh/authfile.c
      stable/8/crypto/openssh/authfile.h
      stable/8/crypto/openssh/bufaux.c
      stable/8/crypto/openssh/buffer.h
      stable/8/crypto/openssh/canohost.c
      stable/8/crypto/openssh/channels.c
      stable/8/crypto/openssh/channels.h
      stable/8/crypto/openssh/cipher-3des1.c
      stable/8/crypto/openssh/cipher-acss.c
      stable/8/crypto/openssh/cipher-aes.c
      stable/8/crypto/openssh/cipher-bf1.c
      stable/8/crypto/openssh/cipher-ctr.c
      stable/8/crypto/openssh/clientloop.c
      stable/8/crypto/openssh/clientloop.h
      stable/8/crypto/openssh/compat.c
      stable/8/crypto/openssh/compat.h
      stable/8/crypto/openssh/compress.c
      stable/8/crypto/openssh/config.guess
      stable/8/crypto/openssh/config.h
      stable/8/crypto/openssh/config.h.in
      stable/8/crypto/openssh/defines.h
      stable/8/crypto/openssh/dh.c
      stable/8/crypto/openssh/dns.c
      stable/8/crypto/openssh/dns.h
      stable/8/crypto/openssh/entropy.c
      stable/8/crypto/openssh/entropy.h
      stable/8/crypto/openssh/gss-serv.c
      stable/8/crypto/openssh/hostfile.c
      stable/8/crypto/openssh/hostfile.h
      stable/8/crypto/openssh/includes.h
      stable/8/crypto/openssh/jpake.c
      stable/8/crypto/openssh/kex.c
      stable/8/crypto/openssh/kex.h
      stable/8/crypto/openssh/kexdhc.c
      stable/8/crypto/openssh/kexdhs.c
      stable/8/crypto/openssh/kexgexc.c
      stable/8/crypto/openssh/kexgexs.c
      stable/8/crypto/openssh/key.c
      stable/8/crypto/openssh/key.h
      stable/8/crypto/openssh/log.c
      stable/8/crypto/openssh/log.h
      stable/8/crypto/openssh/loginrec.c   (contents, props changed)
      stable/8/crypto/openssh/loginrec.h
      stable/8/crypto/openssh/logintest.c
      stable/8/crypto/openssh/mac.c
      stable/8/crypto/openssh/misc.c
      stable/8/crypto/openssh/misc.h
      stable/8/crypto/openssh/moduli
      stable/8/crypto/openssh/moduli.5
      stable/8/crypto/openssh/moduli.c
      stable/8/crypto/openssh/monitor.c
      stable/8/crypto/openssh/monitor.h
      stable/8/crypto/openssh/monitor_wrap.c
      stable/8/crypto/openssh/monitor_wrap.h
      stable/8/crypto/openssh/mux.c
      stable/8/crypto/openssh/myproposal.h
      stable/8/crypto/openssh/openbsd-compat/bindresvport.c
      stable/8/crypto/openssh/openbsd-compat/bsd-arc4random.c
      stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
      stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
      stable/8/crypto/openssh/openbsd-compat/bsd-misc.c
      stable/8/crypto/openssh/openbsd-compat/bsd-misc.h
      stable/8/crypto/openssh/openbsd-compat/getcwd.c
      stable/8/crypto/openssh/openbsd-compat/getgrouplist.c
      stable/8/crypto/openssh/openbsd-compat/getrrsetbyname.c
      stable/8/crypto/openssh/openbsd-compat/glob.c
      stable/8/crypto/openssh/openbsd-compat/glob.h
      stable/8/crypto/openssh/openbsd-compat/inet_ntop.c
      stable/8/crypto/openssh/openbsd-compat/mktemp.c
      stable/8/crypto/openssh/openbsd-compat/openbsd-compat.h
      stable/8/crypto/openssh/openbsd-compat/openssl-compat.c
      stable/8/crypto/openssh/openbsd-compat/openssl-compat.h
      stable/8/crypto/openssh/openbsd-compat/port-linux.c
      stable/8/crypto/openssh/openbsd-compat/port-linux.h
      stable/8/crypto/openssh/openbsd-compat/port-solaris.c
      stable/8/crypto/openssh/openbsd-compat/port-solaris.h
      stable/8/crypto/openssh/openbsd-compat/port-tun.c
      stable/8/crypto/openssh/openbsd-compat/port-uw.c
      stable/8/crypto/openssh/openbsd-compat/setenv.c
      stable/8/crypto/openssh/openbsd-compat/sha2.c   (contents, props changed)
      stable/8/crypto/openssh/openbsd-compat/sha2.h   (contents, props changed)
      stable/8/crypto/openssh/openbsd-compat/strlcpy.c
      stable/8/crypto/openssh/packet.c
      stable/8/crypto/openssh/packet.h
      stable/8/crypto/openssh/pathnames.h
      stable/8/crypto/openssh/platform.c
      stable/8/crypto/openssh/platform.h
      stable/8/crypto/openssh/readconf.c
      stable/8/crypto/openssh/readconf.h
      stable/8/crypto/openssh/readpass.c
      stable/8/crypto/openssh/roaming.h
      stable/8/crypto/openssh/roaming_client.c
      stable/8/crypto/openssh/roaming_common.c
      stable/8/crypto/openssh/schnorr.c
      stable/8/crypto/openssh/scp.1
      stable/8/crypto/openssh/scp.c
      stable/8/crypto/openssh/servconf.c
      stable/8/crypto/openssh/servconf.h
      stable/8/crypto/openssh/serverloop.c
      stable/8/crypto/openssh/session.c
      stable/8/crypto/openssh/sftp-client.c
      stable/8/crypto/openssh/sftp-client.h
      stable/8/crypto/openssh/sftp-glob.c
      stable/8/crypto/openssh/sftp-server.c
      stable/8/crypto/openssh/sftp.1
      stable/8/crypto/openssh/sftp.c
      stable/8/crypto/openssh/ssh-add.1
      stable/8/crypto/openssh/ssh-add.c
      stable/8/crypto/openssh/ssh-agent.1
      stable/8/crypto/openssh/ssh-agent.c
      stable/8/crypto/openssh/ssh-dss.c
      stable/8/crypto/openssh/ssh-keygen.1
      stable/8/crypto/openssh/ssh-keygen.c
      stable/8/crypto/openssh/ssh-keyscan.1
      stable/8/crypto/openssh/ssh-keyscan.c
      stable/8/crypto/openssh/ssh-keysign.8
      stable/8/crypto/openssh/ssh-keysign.c
      stable/8/crypto/openssh/ssh-pkcs11-client.c
      stable/8/crypto/openssh/ssh-pkcs11-helper.c
      stable/8/crypto/openssh/ssh-pkcs11.c
      stable/8/crypto/openssh/ssh-rsa.c
      stable/8/crypto/openssh/ssh.1
      stable/8/crypto/openssh/ssh.c
      stable/8/crypto/openssh/ssh.h
      stable/8/crypto/openssh/ssh2.h
      stable/8/crypto/openssh/ssh_config
      stable/8/crypto/openssh/ssh_config.5
      stable/8/crypto/openssh/ssh_namespace.h
      stable/8/crypto/openssh/sshconnect.c
      stable/8/crypto/openssh/sshconnect.h
      stable/8/crypto/openssh/sshconnect2.c
      stable/8/crypto/openssh/sshd.8
      stable/8/crypto/openssh/sshd.c
      stable/8/crypto/openssh/sshd_config
      stable/8/crypto/openssh/sshd_config.5
      stable/8/crypto/openssh/sshlogin.c
      stable/8/crypto/openssh/umac.c
      stable/8/crypto/openssh/uuencode.c
      stable/8/crypto/openssh/uuencode.h
      stable/8/crypto/openssh/version.h
      stable/8/etc/rc.d/sshd
      stable/8/secure/lib/libssh/Makefile
      stable/8/secure/usr.bin/ssh/Makefile
      stable/8/secure/usr.sbin/sshd/Makefile
      stable/8/share/mk/bsd.own.mk
    Directory Properties:
      stable/8/crypto/openssh/   (props changed)
      stable/8/etc/   (props changed)
      stable/8/secure/lib/libssh/   (props changed)
      stable/8/secure/usr.bin/ssh/   (props changed)
      stable/8/secure/usr.sbin/sshd/   (props changed)
      stable/8/share/mk/   (props changed)
      stable/8/tools/build/options/   (props changed)
    
    Modified: stable/8/crypto/openssh/ChangeLog
    ==============================================================================
    --- stable/8/crypto/openssh/ChangeLog	Fri Mar  1 01:47:11 2013	(r247520)
    +++ stable/8/crypto/openssh/ChangeLog	Fri Mar  1 02:06:04 2013	(r247521)
    @@ -1,2627 +1,2349 @@
    -20100307
    +20120828
    + - (djm) Release openssh-6.1
    +
    +20120828
    + - (dtucker) [openbsd-compat/bsd-cygwin_util.h] define WIN32_LEAN_AND_MEAN
    +   for compatibility with future mingw-w64 headers.  Patch from vinschen at
    +   redhat com.
    +
    +20120822
    + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update version numbers
    +
    +20120731
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/03/07 22:16:01
    +   - jmc@cvs.openbsd.org 2012/07/06 06:38:03
          [ssh-keygen.c]
    -     make internal strptime string match strftime format;
    -     suggested by vinschen AT redhat.com and markus@
    -   - djm@cvs.openbsd.org 2010/03/08 00:28:55
    -     [ssh-keygen.1]
    -     document permit-agent-forwarding certificate constraint; patch from
    -     stevesk@
    -   - djm@cvs.openbsd.org 2010/03/07 22:01:32
    +     missing full stop in usage();
    +   - djm@cvs.openbsd.org 2012/07/10 02:19:15
    +     [servconf.c servconf.h sshd.c sshd_config]
    +     Turn on systrace sandboxing of pre-auth sshd by default for new installs
    +     by shipping a config that overrides the current UsePrivilegeSeparation=yes
    +     default. Make it easier to flip the default in the future by adding too.
    +     prodded markus@ feedback dtucker@ "get it in" deraadt@
    +   - dtucker@cvs.openbsd.org 2012/07/13 01:35:21
    +     [servconf.c]
    +     handle long comments in config files better.  bz#2025, ok markus
    +   - markus@cvs.openbsd.org 2012/07/22 18:19:21
          [version.h]
    -     openssh-5.4
    - - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    -   crank version numbers
    - - (djm) Release OpenSSH-5.4p1
    +     openssh 6.1
     
    -20100307
    - - (dtucker) [auth.c] Bug #1710: call setauthdb on AIX before getpwuid so that
    -   it gets the passwd struct from the LAM that knows about the user which is
    -   not necessarily the default.  Patch from Alexandre Letourneau.
    - - (dtucker) [session.c] Bug #1567: move setpcred call to before chroot and
    -   do not set real uid, since that's needed for the chroot, and will be set
    -   by permanently_set_uid.
    - - (dtucker) [session.c] Also initialize creds to NULL for handing to
    -    setpcred.
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/03/07 11:57:13
    -     [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c]
    -     Hold authentication debug messages until after successful authentication.
    -     Fixes an info leak of environment variables specified in authorized_keys,
    -     reported by Jacob Appelbaum.  ok djm@
    +20120720
    + - (dtucker) Import regened moduli file.
     
    -20100305
    - - OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/03/04 12:51:25
    -     [ssh.1 sshd_config.5]
    -     tweak previous;
    -   - djm@cvs.openbsd.org 2010/03/04 20:35:08
    -     [ssh-keygen.1 ssh-keygen.c]
    -     Add a -L flag to print the contents of a certificate; ok markus@
    -   - jmc@cvs.openbsd.org 2010/03/04 22:52:40
    -     [ssh-keygen.1]
    -     fix Bk/Ek;
    -   - djm@cvs.openbsd.org 2010/03/04 23:17:25
    -     [sshd_config.5]
    -     missing word; spotted by jmc@
    -   - djm@cvs.openbsd.org 2010/03/04 23:19:29
    -     [ssh.1 sshd.8]
    -     move section on CA and revoked keys from ssh.1 to sshd.8's known hosts
    -     format section and rework it a bit; requested by jmc@
    -   - djm@cvs.openbsd.org 2010/03/04 23:27:25
    -     [auth-options.c ssh-keygen.c]
    -     "force-command" is not spelled "forced-command"; spotted by
    -     imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/05 02:58:11
    -     [auth.c]
    -     make the warning for a revoked key louder and more noticable
    -   - jmc@cvs.openbsd.org 2010/03/05 06:50:35
    -     [ssh.1 sshd.8]
    -     tweak previous;
    -   - jmc@cvs.openbsd.org 2010/03/05 08:31:20
    -     [ssh.1]
    -     document certificate authentication; help/ok djm
    -   - djm@cvs.openbsd.org 2010/03/05 10:28:21
    -     [ssh-add.1 ssh.1 ssh_config.5]
    -     mention loading of certificate files from [private]-cert.pub when
    -     they are present; feedback and ok jmc@
    - - (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older
    -   compilers. OK djm@
    - - (djm) [ssh-rand-helper.c] declare optind, avoiding compilation failure
    -   on some platforms
    - - (djm) [configure.ac] set -fno-strict-aliasing for gcc4; ok dtucker@
    -
    -20100304
    - - (djm) [ssh-keygen.c] Use correct local variable, instead of
    -   maybe-undefined global "optarg"
    - - (djm) [contrib/redhat/openssh.spec] Replace obsolete BuildPreReq
    -   on XFree86-devel with neutral /usr/include/X11/Xlib.h;
    -   imorgan AT nas.nasa.gov in bz#1731
    - - (djm) [.cvsignore] Ignore ssh-pkcs11-helper
    - - (djm) [regress/Makefile] Cleanup sshd_proxy_orig
    - - OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/03/03 01:44:36
    -     [auth-options.c key.c]
    -     reject strings with embedded ASCII nul chars in certificate key IDs,
    -     principal names and constraints
    -   - djm@cvs.openbsd.org 2010/03/03 22:49:50
    -     [sshd.8]
    -     the authorized_keys option for CA keys is "cert-authority", not
    -     "from=cert-authority". spotted by imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/03 22:50:40
    -     [PROTOCOL.certkeys]
    -     s/similar same/similar/; from imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/04 01:44:57
    -     [key.c]
    -     use buffer_get_string_ptr_ret() where we are checking the return
    -     value explicitly instead of the fatal()-causing buffer_get_string_ptr()
    -   - djm@cvs.openbsd.org 2010/03/04 10:36:03
    -     [auth-rh-rsa.c auth-rsa.c auth.c auth.h auth2-hostbased.c auth2-pubkey.c]
    -     [authfile.c authfile.h hostfile.c hostfile.h servconf.c servconf.h]
    -     [ssh-keygen.c ssh.1 sshconnect.c sshd_config.5]
    -     Add a TrustedUserCAKeys option to sshd_config to specify CA keys that
    -     are trusted to authenticate users (in addition than doing it per-user
    -     in authorized_keys).
    -     
    -     Add a RevokedKeys option to sshd_config and a @revoked marker to
    -     known_hosts to allow keys to me revoked and banned for user or host
    -     authentication.
    -     
    -     feedback and ok markus@
    -   - djm@cvs.openbsd.org 2010/03/03 00:47:23
    -     [regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     add an extra test to ensure that authentication with the wrong
    -     certificate fails as it should (and it does)
    -   - djm@cvs.openbsd.org 2010/03/04 10:38:23
    -     [regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     additional regression tests for revoked keys and TrustedUserCAKeys
    +20120706
    + - (djm) [sandbox-seccomp-filter.c] fallback to rlimit if seccomp filter is
    +   not available. Allows use of sshd compiled on host with a filter-capable
    +   kernel on hosts that lack the support. bz#2011 ok dtucker@
    + - (djm) [configure.ac] Recursively expand $(bindir) to ensure it has no
    +   unexpanded $(prefix) embedded. bz#2007 patch from nix-corp AT
    +   esperi.org.uk; ok dtucker@
    +- (djm) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/07/06 00:41:59
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add options to specify starting line number and number of lines to process
    +     when screening moduli candidates.  This allows processing of different
    +     parts of a candidate moduli file in parallel.  man page help jmc@, ok djm@
    +   - djm@cvs.openbsd.org 2012/07/06 01:37:21
    +     [mux.c]
    +     fix memory leak of passed-in environment variables and connection
    +     context when new session message is malformed; bz#2003 from Bert.Wesarg
    +     AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/07/06 01:47:38
    +     [ssh.c]
    +     move setting of tty_flag to after config parsing so RequestTTY options
    +     are correctly picked up. bz#1995 patch from przemoc AT gmail.com;
    +     ok dtucker@
    +
    +20120704
    + - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] Add setlinebuf for
    +   platforms that don't have it.  "looks good" tim@
    +
    +20120703
    + - (dtucker) [configure.ac] Detect platforms that can't use select(2) with
    +   setrlimit(RLIMIT_NOFILE, rl_zero) and disable the rlimit sandbox on those.
    + - (dtucker) [configure.ac sandbox-rlimit.c] Test whether or not
    +   setrlimit(RLIMIT_FSIZE, rl_zero) and skip it if it's not supported.  Its
    +   benefit is minor, so it's not worth disabling the sandbox if it doesn't
    +   work.
    +
    +20120702
    +- (dtucker) OpenBSD CVS Sync
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one;
    +     ok dtucker@
    +   - markus@cvs.openbsd.org 2012/06/30 14:35:09
    +     [sandbox-systrace.c sshd.c]
    +     fix a during the load of the sandbox policies (child can still make
    +     the read-syscall and wait forever for systrace-answers) by replacing
    +     the read/write synchronisation with SIGSTOP/SIGCONT;
    +     report and help hshoexer@; ok djm@, dtucker@
    +   - dtucker@cvs.openbsd.org 2012/07/02 08:50:03
    +     [ssh.c]
    +     set interactive ToS for forwarded X11 sessions.  ok djm@
    +   - dtucker@cvs.openbsd.org 2012/07/02 12:13:26
    +     [ssh-pkcs11-helper.c sftp-client.c]
    +     fix a couple of "assigned but not used" warnings.  ok markus@
    +   - dtucker@cvs.openbsd.org 2012/07/02 14:37:06
    +     [regress/connect-privsep.sh]
    +     remove exit from end of test since it prevents reporting failure
    + - (dtucker) [regress/reexec.sh regress/sftp-cmds.sh regress/test-exec.sh]
    +   Move cygwin detection to test-exec and use to skip reexec test on cygwin.
    + - (dtucker) [regress/test-exec.sh] Correct uname for cygwin/w2k.
     
    -20100303
    - - (djm) [PROTOCOL.certkeys] Add RCS Ident
    +20120629
      - OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/02/26 22:09:28
    -     [ssh-keygen.1 ssh.1 sshd.8]
    -     tweak previous;
    -   - otto@cvs.openbsd.org 2010/03/01 11:07:06
    -     [ssh-add.c]
    -     zap what seems to be a left-over debug message; ok markus@
    -   - djm@cvs.openbsd.org 2010/03/02 23:20:57
    -     [ssh-keygen.c]
    -     POSIX strptime is stricter than OpenBSD's so do a little dance to
    -     appease it.
    - - (djm) [regress/cert-userkey.sh] s/echo -n/echon/ here too
    -
    -20100302
    - - (tim) [config.guess config.sub] Bug 1722: Update to latest versions from
    -   http://git.savannah.gnu.org/gitweb/ (2009-12-30 and 2010-01-22
    -   respectively).
    -
    -20100301
    - - (dtucker) [regress/{cert-hostkey,cfgmatch,cipher-speed}.sh} Replace
    -   "echo -n" with "echon" for portability.
    - - (dtucker) [openbsd-compat/port-linux.c] Make failure to write to the OOM
    -   adjust log at verbose only, since according to cjwatson in bug #1470
    -   some virtualization platforms don't allow writes.
    -
    -20100228
    - - (djm) [auth.c] On Cygwin, refuse usernames that have differences in
    -   case from that matched in the system password database. On this
    -   platform, passwords are stored case-insensitively, but sshd requires
    -   exact case matching for Match blocks in sshd_config(5). Based on
    -   a patch from vinschen AT redhat.com.
    - - (tim) [ssh-pkcs11-helper.c] Move declarations before calling functions
    -   to make older compilers (gcc 2.95) happy.
    -
    -20100227
    - - (djm) [ssh-pkcs11-helper.c ] Ensure RNG is initialised and seeded
    - - (djm) [openbsd-compat/bsd-cygwin_util.c] Reduce the set of environment
    -   variables copied into sshd child processes. From vinschen AT redhat.com
    -
    -20100226
    - - OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/26 20:29:54
    -     [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c]
    -     [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c]
    -     [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c]
    -     [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c]
    -     [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c]
    -     [sshconnect2.c sshd.8 sshd.c sshd_config.5]
    -     Add support for certificate key types for users and hosts.
    -     
    -     OpenSSH certificate key types are not X.509 certificates, but a much
    -     simpler format that encodes a public key, identity information and
    -     some validity constraints and signs it with a CA key. CA keys are
    -     regular SSH keys. This certificate style avoids the attack surface
    -     of X.509 certificates and is very easy to deploy.
    -     
    -     Certified host keys allow automatic acceptance of new host keys
    -     when a CA certificate is marked as trusted in ~/.ssh/known_hosts.
    -     see VERIFYING HOST KEYS in ssh(1) for details.
    -     
    -     Certified user keys allow authentication of users when the signing
    -     CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS
    -     FILE FORMAT" in sshd(8) for details.
    -     
    -     Certificates are minted using ssh-keygen(1), documentation is in
    -     the "CERTIFICATES" section of that manpage.
    -     
    -     Documentation on the format of certificates is in the file
    -     PROTOCOL.certkeys
    -     
    -     feedback and ok markus@
    -   - djm@cvs.openbsd.org 2010/02/26 20:33:21
    -     [Makefile regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     regression tests for certified keys
    -
    -20100224
    - - (djm) [pkcs11.h ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   [ssh-pkcs11.h] Add $OpenBSD$ RCS idents so we can sync portable
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/11 20:37:47
    -     [pathnames.h]
    -     correct comment
    -   - dtucker@cvs.openbsd.org 2009/11/09 04:20:04
    -     [regress/Makefile]
    -     add regression test for ssh-keygen pubkey conversions
    -   - dtucker@cvs.openbsd.org 2010/01/11 02:53:44
    -     [regress/forwarding.sh]
    -     regress test for stdio forwarding
    -   - djm@cvs.openbsd.org 2010/02/09 04:57:36
    +   - dtucker@cvs.openbsd.org 2012/06/21 00:16:07
    +     [addrmatch.c]
    +     fix strlcpy truncation check.  from carsten at debian org, ok markus
    +   - dtucker@cvs.openbsd.org 2012/06/22 12:30:26
    +     [monitor.c sshconnect2.c]
    +     remove dead code following 'for (;;)' loops.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/22 14:36:33
    +     [sftp.c]
    +     Remove unused variable leftover from tab-completion changes.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/26 11:02:30
    +     [sandbox-systrace.c]
    +     Add mquery to the list of allowed syscalls for "UsePrivilegeSeparation
    +     sandbox" since malloc now uses it.  From johnw.mail at gmail com.
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [mac.c myproposal.h ssh_config.5 sshd_config.5]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one; ok dtucker@
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
          [regress/addrmatch.sh]
    -     clean up droppings
    -   - djm@cvs.openbsd.org 2010/02/09 06:29:02
    -     [regress/Makefile]
    -     turn on all the malloc(3) checking options when running regression
    -     tests. this has caught a few bugs for me in the past; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/02/24 06:21:56
    -     [regress/test-exec.sh]
    -     wait for sshd to fully stop in cleanup() function; avoids races in tests
    -     that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
    -   - markus@cvs.openbsd.org 2010/02/08 10:52:47
    -     [regress/agent-pkcs11.sh]
    -     test for PKCS#11 support (currently disabled)
    - - (djm) [Makefile.in ssh-pkcs11-helper.8] Add manpage for PKCS#11 helper
    - - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    -   [contrib/suse/openssh.spec] Add PKCS#11 helper binary and manpage
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - djm@cvs.openbsd.org 2012/06/01 00:47:35
    +     [regress/multiplex.sh regress/forwarding.sh]
    +     append to rather than truncate test log; bz#2013 from openssh AT
    +     roumenpetrov.info
    +   - djm@cvs.openbsd.org 2012/06/01 00:52:52
    +     [regress/sftp-cmds.sh]
    +     don't delete .* on cleanup due to unintended env expansion; pointed out in
    +     bz#2014 by openssh AT roumenpetrov.info
    +   - dtucker@cvs.openbsd.org 2012/06/26 12:06:59
    +     [regress/connect-privsep.sh]
    +     test sandbox with every malloc option
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [regress/try-ciphers.sh regress/cipher-speed.sh]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    + - (dtucker) [myproposal.h] Remove trailing backslash to fix compile error.
    + - (dtucker) [key.c] ifdef out sha256 key types on platforms that don't have
    +   the required functions in libcrypto.
    +
    +20120628
    + - (dtucker) [openbsd-compat/getrrsetbyname-ldns.c] bz #2022: prevent null
    +   pointer deref in the client when built with LDNS and using DNSSEC with a
    +   CNAME.  Patch from gregdlg+mr at hochet info.
    +
    +20120622
    + - (dtucker) [contrib/cygwin/ssh-host-config] Ensure that user sshd runs as
    +   can logon as a service.  Patch from vinschen at redhat com.
     
    -20100212
    +20120620
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/02 22:49:34
    -     [bufaux.c]
    -     make buffer_get_string_ret() really non-fatal in all cases (it was
    -     using buffer_get_int(), which could fatal() on buffer empty);
    -     ok markus dtucker
    -   - markus@cvs.openbsd.org 2010/02/08 10:50:20
    -     [pathnames.h readconf.c readconf.h scp.1 sftp.1 ssh-add.1 ssh-add.c]
    -     [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config.5]
    -     replace our obsolete smartcard code with PKCS#11.
    -        ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs-11v2-20.pdf
    -     ssh(1) and ssh-keygen(1) use dlopen(3) directly to talk to a PKCS#11
    -     provider (shared library) while ssh-agent(1) delegates PKCS#11 to
    -     a forked a ssh-pkcs11-helper process.
    -     PKCS#11 is currently a compile time option.
    -     feedback and ok djm@; inspired by patches from Alon Bar-Lev
    -   - jmc@cvs.openbsd.org 2010/02/08 22:03:05
    -     [ssh-add.1 ssh-keygen.1 ssh.1 ssh.c]
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
    +     [mux.c]
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
    +     [mux.c]
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
    +     [mux.c]
    +     fix double-free in new session handler
    +     NB. Id sync only
    +   - djm@cvs.openbsd.org 2012/05/23 03:28:28
    +     [dns.c dns.h key.c key.h ssh-keygen.c]
    +     add support for RFC6594 SSHFP DNS records for ECDSA key types.
    +     patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@
    +   - djm@cvs.openbsd.org 2012/06/01 00:49:35
    +     [PROTOCOL.mux]
    +     correct types of port numbers (integers, not strings); bz#2004 from
    +     bert.wesarg AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/06/01 01:01:22
    +     [mux.c]
    +     fix memory leak when mux socket creation fails; bz#2002 from bert.wesarg
    +     AT googlemail.com
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:43:53
    +     [jpake.c]
    +     correct sizeof usage.  patch from saw at online.de, ok deraadt
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:49:58
    +     [ssh_config.5]
    +     RSA instead of DSA twice.  From Steve.McClellan at radisys com
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:07:07
    +     [ssh.1 sshd.8]
    +     Remove mention of 'three' key files since there are now four.  From
    +     Steve.McClellan at radisys com.
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:17:18
    +     [ssh.1]
    +     Clarify description of -W.  Noted by Steve.McClellan at radisys com,
    +     ok jmc
    +   - markus@cvs.openbsd.org 2012/06/19 18:25:28
    +     [servconf.c servconf.h sshd_config.5]
    +     sshd_config: extend Match to allow AcceptEnv and {Allow,Deny}{Users,Groups}
    +     this allows 'Match LocalPort 1022' combined with 'AllowUser bauer'
    +     ok djm@ (back in March)
    +   - jmc@cvs.openbsd.org 2012/06/19 21:35:54
    +     [sshd_config.5]
          tweak previous; ok markus
    -   - djm@cvs.openbsd.org 2010/02/09 00:50:36
    -     [ssh-agent.c]
    -     fallout from PKCS#11: unbreak -D
    -   - djm@cvs.openbsd.org 2010/02/09 00:50:59
    +   - djm@cvs.openbsd.org 2012/06/20 04:42:58
    +     [clientloop.c serverloop.c]
    +     initialise accept() backoff timer to avoid EINVAL from select(2) in
    +     rekeying
    +
    +20120519
    + - (dtucker) [configure.ac] bz#2010: fix non-portable shell construct.  Patch
    +   from cjwatson at debian org.
    + - (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find
    +   pkg-config so it does the right thing when cross-compiling.  Patch from
    +   cjwatson at debian org.
    +- (dtucker) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
    +     [servconf.h servconf.c sshd.8 sshd.c auth.c sshd_config.5]
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - dtucker@cvs.openbsd.org 2012/05/19 06:30:30
    +     [sshd_config.5]
    +     Document PermitOpen none.  bz#2001, patch from Loganaden Velvindron
    +
    +20120504
    + - (dtucker) [configure.ac] Include  rather than 
    +   to fix building on some plaforms.  Fom bowman at math utah edu and
    +   des at des no.
    +
    +20120427
    + - (dtucker) [regress/addrmatch.sh] skip tests when running on a non-ipv6
    +   platform rather than exiting early, so that we still clean up and return
    +   success or failure to test-exec.sh
    +
    +20120426
    + - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
    +   via Niels
    + - (djm) [auth-krb5.c] Save errno across calls that might modify it;
    +   ok dtucker@
    +
    +20120423
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/04/23 08:18:17
    +     [channels.c]
    +     fix function proto/source mismatch
    +
    +20120422
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/02/29 11:21:26
          [ssh-keygen.c]
    -     fix -Wall
    -   - djm@cvs.openbsd.org 2010/02/09 03:56:28
    -     [buffer.c buffer.h]
    -     constify the arguments to buffer_len, buffer_ptr and buffer_dump
    -   - djm@cvs.openbsd.org 2010/02/09 06:18:46
    +     allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
    +   - guenther@cvs.openbsd.org 2012/03/15 03:10:27
    +     [session.c]
    +     root should always be excluded from the test for /etc/nologin instead
    +     of having it always enforced even when marked as ignorenologin.  This
    +     regressed when the logic was incompletely flipped around in rev 1.251
    +     ok halex@ millert@
    +   - djm@cvs.openbsd.org 2012/03/28 07:23:22
    +     [PROTOCOL.certkeys]
    +     explain certificate extensions/crit split rationale. Mention requirement
    +     that each appear at most once per cert.
    +   - dtucker@cvs.openbsd.org 2012/03/29 23:54:36
    +     [channels.c channels.h servconf.c]
    +     Add PermitOpen none option based on patch from Loganaden Velvindron
    +     (bz #1949).  ok djm@
    +   - djm@cvs.openbsd.org 2012/04/11 13:16:19
    +     [channels.c channels.h clientloop.c serverloop.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:17:54
          [auth.c]
    -     unbreak ChrootDirectory+internal-sftp by skipping check for executable
    -     shell when chrooting; reported by danh AT wzrd.com; ok dtucker@
    -   - markus@cvs.openbsd.org 2010/02/10 23:20:38
    -     [ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5]
    -     pkcs#11 is no longer optional; improve wording; ok jmc@
    -   - jmc@cvs.openbsd.org 2010/02/11 13:23:29
    +     Support "none" as an argument for AuthorizedPrincipalsFile to indicate
    +     no file should be read.
    +   - djm@cvs.openbsd.org 2012/04/11 13:26:40
    +     [sshd.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:34:17
    +     [ssh-keyscan.1 ssh-keyscan.c]
    +     now that sshd defaults to offering ECDSA keys, ssh-keyscan should also
    +     look for them by default; bz#1971
    +   - djm@cvs.openbsd.org 2012/04/12 02:42:32
    +     [servconf.c servconf.h sshd.c sshd_config sshd_config.5]
    +     VersionAddendum option to allow server operators to append some arbitrary
    +     text to the SSH-... banner; ok deraadt@ "don't care" markus@
    +   - djm@cvs.openbsd.org 2012/04/12 02:43:55
    +     [sshd_config sshd_config.5]
    +     mention AuthorizedPrincipalsFile=none default
    +   - djm@cvs.openbsd.org 2012/04/20 03:24:23
    +     [sftp.c]
    +     setlinebuf(3) is more readable than setvbuf(.., _IOLBF, ...)
    +   - jmc@cvs.openbsd.org 2012/04/20 16:26:22
          [ssh.1]
    -     libarary -> library;
    - - (djm) [INSTALL Makefile.in README.smartcard configure.ac scard-opensc.c]
    -   [scard.c scard.h pkcs11.h scard/Makefile.in scard/Ssh.bin.uu scard/Ssh.java]
    -   Remove obsolete smartcard support
    - - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   Make it compile on OSX
    - - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   Use ssh_get_progname to fill __progname
    - - (djm) [configure.ac] Enable PKCS#11 support only when we find a working
    -   dlopen()
    -
    -20100210
    - - (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for
    -   getseuserbyname; patch from calebcase AT gmail.com via
    -   cjwatson AT debian.org
    +     use "brackets" instead of "braces", for consistency;
     
    -20100202
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/30 21:08:33
    -     [sshd.8]
    -     debug output goes to stderr, not "the system log"; ok markus dtucker
    -   - djm@cvs.openbsd.org 2010/01/30 21:12:08
    -     [channels.c]
    -     fake local addr:port when stdio fowarding as some servers (Tectia at
    -     least) validate that they are well-formed;
    -     reported by imorgan AT nas.nasa.gov
    -     ok dtucker
    +20120420
    + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update for release 6.0
    + - (djm) [README] Update URL to release notes.
    + - (djm) Release openssh-6.0
    +
    +20120419
    + - (djm) [configure.ac] Fix compilation error on FreeBSD, whose libutil
    +   contains openpty() but not login()
    +
    +20120404
    + - (djm) [Makefile.in configure.ac sandbox-seccomp-filter.c] Add sandbox
    +   mode for Linux's new seccomp filter; patch from Will Drewry; feedback
    +   and ok dtucker@
    +
    +20120330
    + - (dtucker) [contrib/redhat/openssh.spec] Bug #1992: remove now-gone WARNING
    +   file from spec file.  From crighter at nuclioss com.
    + - (djm) [entropy.c] bz#1991: relax OpenSSL version test to allow running
    +   openssh binaries on a newer fix release than they were compiled on.
    +   with and ok dtucker@
    + - (djm) [openbsd-compat/bsd-cygwin_util.h] #undef _WIN32 to avoid incorrect
    +   assumptions when building on Cygwin; patch from Corinna Vinschen
    +
    +20120309
    + - (djm) [openbsd-compat/port-linux.c] bz#1960: fix crash on SELinux 
    +   systems where sshd is run in te wrong context. Patch from Sven
    +   Vermeulen; ok dtucker@
    + - (djm) [packet.c] bz#1963: Fix IPQoS not being set on non-mapped v4-in-v6
    +   addressed connections. ok dtucker@
    +
    +20120224
    + - (dtucker) [audit-bsm.c configure.ac] bug #1968: enable workarounds for BSM
    +   audit breakage in Solaris 11.  Patch from Magnus Johansson.
    +
    +20120215
    + - (tim) [openbsd-compat/bsd-misc.h sshd.c] Fix conflicting return type for
    +   unsetenv due to rev 1.14 change to setenv.c. Cast unsetenv to void in sshd.c
    +   ok dtucker@
    + - (tim) [defines.h] move chunk introduced in 1.125 before MAXPATHLEN so
    +   it actually works.
    + - (tim) [regress/keytype.sh] stderr redirection needs to be inside back quote
    +   to work. Spotted by Angel Gonzalez
    +
    +20120214
    + - (djm) [openbsd-compat/bsd-cygwin_util.c] Add PROGRAMFILES to list of
    +   preserved Cygwin environment variables; from Corinna Vinschen
     
    -20100130
    +20120211
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/28 00:21:18
    -     [clientloop.c]
    -     downgrade an error() to a debug() - this particular case can be hit in
    -     normal operation for certain sequences of mux slave vs session closure
    -     and is harmless
    -   - djm@cvs.openbsd.org 2010/01/29 00:20:41
    -     [sshd.c]
    -     set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com
    -     ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/29 20:16:17
    -     [mux.c]
    -     kill correct channel (was killing already-dead mux channel, not
    -     its session channel)
    -   - djm@cvs.openbsd.org 2010/01/30 02:54:53
    +   - djm@cvs.openbsd.org 2012/01/05 00:16:56
    +     [monitor.c]
    +     memleak on error path
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
          [mux.c]
    -     don't mark channel as read failed if it is already closing; suppresses
    -     harmless error messages when connecting to SSH.COM Tectia server
    -     report by imorgan AT nas.nasa.gov
    -
    -20100129
    - - (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config()
    -   after registering the hardware engines, which causes the openssl.cnf file to
    -   be processed.  See OpenSSL's man page for OPENSSL_config(3) for details.
    -   Patch from Solomon Peachy, ok djm@.
    +     fix double-free in new session handler
    +   - miod@cvs.openbsd.org 2012/01/08 13:17:11
    +     [ssh-ecdsa.c]
    +     Fix memory leak in ssh_ecdsa_verify(); from Loganaden Velvindron,
    +     ok markus@
    +   - miod@cvs.openbsd.org 2012/01/16 20:34:09
    +     [ssh-pkcs11-client.c]
    +     Fix a memory leak in pkcs11_rsa_private_encrypt(), reported by Jan Klemkow.
    +     While there, be sure to buffer_clear() between send_msg() and recv_msg().
    +     ok markus@
    +   - dtucker@cvs.openbsd.org 2012/01/18 21:46:43
    +     [clientloop.c]
    +     Ensure that $DISPLAY contains only valid characters before using it to
    +     extract xauth data so that it can't be used to play local shell
    +     metacharacter games.  Report from r00t_ati at ihteam.net, ok markus.
    +   - markus@cvs.openbsd.org 2012/01/25 19:26:43
    +     [packet.c]
    +     do not permit SSH2_MSG_SERVICE_REQUEST/ACCEPT during rekeying;
    +     ok dtucker@, djm@
    +   - markus@cvs.openbsd.org 2012/01/25 19:36:31
    +     [authfile.c]
    +     memleak in key_load_file(); from Jan Klemkow
    +   - markus@cvs.openbsd.org 2012/01/25 19:40:09
    +     [packet.c packet.h]
    +     packet_read_poll() is not used anymore.
    +   - markus@cvs.openbsd.org 2012/02/09 20:00:18
    +     [version.h]
    +     move from 6.0-beta to 6.0
     
    -20100128
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/26 02:15:20
    +20120206
    + - (djm) [ssh-keygen.c] Don't fail in do_gen_all_hostkeys on platforms
    +   that don't support ECC. Patch from Phil Oleson
    +
    +20111219
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
          [mux.c]
    -     -Wuninitialized and remove a // comment; from portable
    -     (Id sync only)
    -   - djm@cvs.openbsd.org 2010/01/27 13:26:17
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/02 00:43:57
    +     [mac.c]
    +     fix bz#1934: newer OpenSSL versions will require HMAC_CTX_Init before
    +     HMAC_init (this change in policy seems insane to me)
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
          [mux.c]
    -     fix bug introduced in mux rewrite:
    -     
    -     In a mux master, when a socket to a mux slave closes before its server
    -     session (as may occur when the slave has been signalled), gracefully
    -     close the server session rather than deleting its channel immediately.
    -     A server may have more messages on that channel to send (e.g. an exit
    -     message) that will fatal() the client if they are sent to a channel that
    -     has been prematurely deleted.
    -     
    -     spotted by imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/01/27 19:21:39
    -     [sftp.c]
    -     add missing "p" flag to getopt optstring;
    -     bz#1704 from imorgan AT nas.nasa.gov
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2011/12/07 05:44:38
    +     [auth2.c dh.c packet.c roaming.h roaming_client.c roaming_common.c]
    +     fix some harmless and/or unreachable int overflows;
    +     reported Xi Wang, ok markus@
     
    -20100126
    - - (djm) OpenBSD CVS Sync
    -   - tedu@cvs.openbsd.org 2010/01/17 21:49:09
    -     [ssh-agent.1]
    -     Correct and clarify ssh-add's password asking behavior.
    -     Improved text dtucker and ok jmc
    -   - dtucker@cvs.openbsd.org 2010/01/18 01:50:27
    -     [roaming_client.c]
    -     s/long long unsigned/unsigned long long/, from tim via portable
    -     (Id sync only, change already in portable)
    -   - djm@cvs.openbsd.org 2010/01/26 01:28:35
    -     [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c]
    -     rewrite ssh(1) multiplexing code to a more sensible protocol.
    -     
    -     The new multiplexing code uses channels for the listener and
    -     accepted control sockets to make the mux master non-blocking, so
    -     no stalls when processing messages from a slave.
    -     
    -     avoid use of fatal() in mux master protocol parsing so an errant slave
    -     process cannot take down a running master.
    -     
    -     implement requesting of port-forwards over multiplexed sessions. Any
    -     port forwards requested by the slave are added to those the master has
    -     established.
    -     
    -     add support for stdio forwarding ("ssh -W host:port ...") in mux slaves.
    -     
    -     document master/slave mux protocol so that other tools can use it to
    -     control a running ssh(1). Note: there are no guarantees that this
    -     protocol won't be incompatibly changed (though it is versioned).
    -     
    -     feedback Salvador Fandino, dtucker@
    -     channel changes ok markus@
    -
    -20100122
    - - (tim) [configure.ac] Due to constraints in Windows Sockets in terms of
    -   socket inheritance, reduce the default SO_RCVBUF/SO_SNDBUF buffer size
    -   in Cygwin to 65535. Patch from Corinna Vinschen.
    -
    -20100117
    - - (tim) [configure.ac] OpenServer 5 needs BROKEN_GETADDRINFO too.
    - - (tim) [configure.ac] On SVR5 systems, use the C99-conforming functions
    -   snprintf() and vsnprintf() named _xsnprintf() and _xvsnprintf().
    -
    -20100116
    - - (dtucker) [openbsd-compat/pwcache.c] Pull in includes.h and thus defines.h
    -   so we correctly detect whether or not we have a native user_from_uid.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Prototypes for user_from_uid
    -   and group_from_gid.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Fix prototypes, spotted by
    -   Tim.
    - - (dtucker) OpenBSD CVS Sync
    -   - markus@cvs.openbsd.org 2010/01/15 09:24:23
    -     [sftp-common.c]
    -     unused
    - - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
    -   variable warnings.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Typo.
    - - (tim) [regress/portnum.sh] Shell portability fix.
    - - (tim) [configure.ac] Define BROKEN_GETADDRINFO on SVR5 systems. The native
    -   getaddrinfo() is too old and limited for addr_pton() in addrmatch.c.
    - - (tim) [roaming_client.c] Use of  is not really portable so we
    -   use "openbsd-compat/sys-queue.h". s/long long unsigned/unsigned long long/
    -   to keep USL compilers happy.
    -
    -20100115
    - - (dtucker) OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/01/13 12:48:34
    -     [sftp.1 sftp.c]
    -     sftp.1: put ls -h in the right place
    -     sftp.c: as above, plus add -p to get/put, and shorten their arg names
    -     to keep the help usage nicely aligned
    -     ok djm
    -   - djm@cvs.openbsd.org 2010/01/13 23:47:26
    -     [auth.c]
    -     when using ChrootDirectory, make sure we test for the existence of the
    -     user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
    -     ok dtucker
    -   - dtucker@cvs.openbsd.org 2010/01/14 23:41:49
    -     [sftp-common.c]
    -     use user_from{uid,gid} to lookup up ids since it keeps a small cache.
    -     ok djm
    -   - guenther@cvs.openbsd.org 2010/01/15 00:05:22
    -     [sftp.c]
    -     Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp
    -     inherited SIGTERM as ignored it will still be able to kill the ssh it
    -     starts.
    -     ok dtucker@
    - - (dtucker) [openbsd-compat/pwcache.c] Pull in pwcache.c from OpenBSD (no
    -   changes yet but there will be some to come).
    - - (dtucker) [configure.ac openbsd-compat/{Makefile.in,pwcache.c} Portability
    -   for pwcache.  Also, added caching of negative hits.
    -
    -20100114
    - - (djm) [platform.h] Add missing prototype for
    -   platform_krb5_get_principal_name
    -
    -20100113
    - - (dtucker) [monitor_fdpass.c] Wrap poll.h include in ifdefs.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Resync against OpenBSD's r1.18:
    -   missing restore of SIGTTOU and some whitespace.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.21.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.22.
    -   Fixes bz #1590, where sometimes you could not interrupt a connection while
    -   ssh was prompting for a passphrase or password.
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/13 00:19:04
    -     [sshconnect.c auth.c]
    -     Fix a couple of typos/mispellings in comments
    -   - dtucker@cvs.openbsd.org 2010/01/13 01:10:56
    -     [key.c]
    -     Ignore and log any Protocol 1 keys where the claimed size is not equal to
    -     the actual size.  Noted by Derek Martin, ok djm@
    -   - dtucker@cvs.openbsd.org 2010/01/13 01:20:20
    -     [canohost.c ssh-keysign.c sshconnect2.c]
    -     Make HostBased authentication work with a ProxyCommand.  bz #1569, patch
    -     from imorgan at nas nasa gov, ok djm@
    -   - djm@cvs.openbsd.org 2010/01/13 01:40:16
    -     [sftp.c sftp-server.c sftp.1 sftp-common.c sftp-common.h]
    -     support '-h' (human-readable units) for sftp's ls command, just like
    -     ls(1); ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/13 03:48:13
    -     [servconf.c servconf.h sshd.c]
    -     avoid run-time failures when specifying hostkeys via a relative
    -     path by prepending the cwd in these cases; bz#1290; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/13 04:10:50
    +20111125
    + - OpenBSD CVS Sync
    +   - oga@cvs.openbsd.org 2011/11/16 12:24:28
          [sftp.c]
    -     don't append a space after inserting a completion of a directory (i.e.
    -     a path ending in '/') for a slightly better user experience; ok dtucker@
    - - (dtucker) [sftp-common.c] Wrap include of util.h in an ifdef.
    - - (tim) [defines.h] openbsd-compat/readpassphrase.c now needs _NSIG. 
    -   feedback and ok dtucker@
    +     Don't leak list in complete_cmd_parse if there are no commands found.
    +     Discovered when I was ``borrowing'' this code for something else.
    +     ok djm@
     
    -20100112
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/11 01:39:46
    -     [ssh_config channels.c ssh.1 channels.h ssh.c]
    -     Add a 'netcat mode' (ssh -W).  This connects stdio on the client to a
    -     single port forward on the server.  This allows, for example, using ssh as
    -     a ProxyCommand to route connections via intermediate servers.
    -     bz #1618, man page help from jmc@, ok markus@
    -   - dtucker@cvs.openbsd.org 2010/01/11 04:46:45
    -     [authfile.c sshconnect2.c]
    -     Do not prompt for a passphrase if we fail to open a keyfile, and log the
    -     reason the open failed to debug.
    -     bz #1693, found by tj AT castaglia org, ok djm@
    -   - djm@cvs.openbsd.org 2010/01/11 10:51:07
    -     [ssh-keygen.c]
    -     when converting keys, truncate key comments at 72 chars as per RFC4716;
    -     bz#1630 reported by tj AT castaglia.org; ok markus@
    -   - dtucker@cvs.openbsd.org 2010/01/12 00:16:47
    -     [authfile.c]
    -     Fix bug introduced in r1.78 (incorrect brace location) that broke key auth.
    -     Patch from joachim joachimschipper nl.
    -   - djm@cvs.openbsd.org 2010/01/12 00:58:25
    -     [monitor_fdpass.c]
    -     avoid spinning when fd passing on nonblocking sockets by calling poll()
    -     in the EINTR/EAGAIN path, much like we do in atomicio; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/12 00:59:29
    -     [roaming_common.c]
    -     delete with extreme prejudice a debug() that fired with every keypress;
    -     ok dtucker deraadt
    -   - dtucker@cvs.openbsd.org 2010/01/12 01:31:05
    -     [session.c]
    -     Do not allow logins if /etc/nologin exists but is not readable by the user
    -     logging in.  Noted by Jan.Pechanec at Sun, ok djm@ deraadt@
    -   - djm@cvs.openbsd.org 2010/01/12 01:36:08
    -     [buffer.h bufaux.c]
    -     add a buffer_get_string_ptr_ret() that does the same as
    -     buffer_get_string_ptr() but does not fatal() on error; ok dtucker@
    -   - dtucker@cvs.openbsd.org 2010/01/12 08:33:17
    -     [session.c]
    -     Add explicit stat so we reliably detect nologin with bad perms.
    -     ok djm markus
    +20111121
    + - (dtucker) [configure.ac] Set _FORTIFY_SOURCE.  ok djm@
     
    -20100110
    - - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
    -   Remove hacks add for RoutingDomain in preparation for its removal.
    +20111104
      - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/09 23:04:13
    -     [channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h
    -     ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c
    -     readconf.h scp.1 sftp.1 ssh_config.5 misc.h]
    -     Remove RoutingDomain from ssh since it's now not needed.  It can be
    -     replaced with "route exec" or "nc -V" as a proxycommand.  "route exec"
    -     also ensures that trafic such as DNS lookups stays withing the specified
    -     routingdomain.  For example (from reyk):
    -     # route -T 2 exec /usr/sbin/sshd
    -     or inherited from the parent process
    -     $ route -T 2 exec sh
    -     $ ssh 10.1.2.3
    -     ok deraadt@ markus@ stevesk@ reyk@
    -   - dtucker@cvs.openbsd.org 2010/01/10 03:51:17
    -     [servconf.c]
    -     Add ChrootDirectory to sshd.c test-mode output
    -   - dtucker@cvs.openbsd.org 2010/01/10 07:15:56
    -     [auth.c]
    -     Output a debug if we can't open an existing keyfile.  bz#1694, ok djm@
    +   - djm@cvs.openbsd.org 2011/10/18 05:15:28
    +     [ssh.c]
    +     ssh(1): skip attempting to create ~/.ssh when -F is passed; ok markus@
    +   - djm@cvs.openbsd.org 2011/10/18 23:37:42
    +     [ssh-add.c]
    +     add -k to usage(); reminded by jmc@
    +   - djm@cvs.openbsd.org 2011/10/19 00:06:10
    +     [moduli.c]
    +     s/tmpfile/tmp/ to make this -Wshadow clean
    +   - djm@cvs.openbsd.org 2011/10/19 10:39:48
    +     [umac.c]
    +     typo in comment; patch from Michael W. Bombardieri
    +   - djm@cvs.openbsd.org 2011/10/24 02:10:46
    +     [ssh.c]
    +     bz#1943: unbreak stdio forwarding when ControlPersist is in user - ssh
    +     was incorrectly requesting the forward in both the control master and
    +     slave. skip requesting it in the master to fix. ok markus@
    +   - djm@cvs.openbsd.org 2011/10/24 02:13:13
    +     [session.c]
    +     bz#1859: send tty break to pty master instead of (probably already
    +     closed) slave side; "looks good" markus@
    +   - dtucker@cvs.openbsd.org 011/11/04 00:09:39
    +     [moduli]
    +     regenerated moduli file; ok deraadt
    + - (dtucker) [INSTALL LICENCE configure.ac openbsd-compat/Makefile.in
    +   openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/getrrsetbyname.c]
    +   bz 1320: Add optional support for LDNS, a BSD licensed DNS resolver library
    +   which supports DNSSEC.  Patch from Simon Vallet (svallet at genoscope cns fr)
    +   with some rework from myself and djm.  ok djm.
    +
    +20111025
    + - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file
    +   fails.  Patch from Corinna Vinschen.
    +
    +20111018
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/10/04 14:17:32
    +     [sftp-glob.c]
    +     silence error spam for "ls */foo" in directory with files; bz#1683
    +   - dtucker@cvs.openbsd.org 2011/10/16 11:02:46
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add optional checkpoints for moduli screening.  feedback & ok deraadt
    +   - jmc@cvs.openbsd.org 2011/10/16 15:02:41
    +     [ssh-keygen.c]
    +     put -K in the right place (usage());
    +   - stsp@cvs.openbsd.org 2011/10/16 15:51:39
    +     [moduli.c]
    +     add missing includes to unbreak tree; fix from rpointel
    +   - djm@cvs.openbsd.org 2011/10/18 04:58:26
    +     [auth-options.c key.c]
    +     remove explict search for \0 in packet strings, this job is now done
    +     implicitly by buffer_get_cstring; ok markus
    +   - djm@cvs.openbsd.org 2011/10/18 05:00:48
    +     [ssh-add.1 ssh-add.c]
    +     new "ssh-add -k" option to load plain keys (skipping certificates);
    +     "looks ok" markus@
     
    -20100109
    - - (dtucker) Wrap use of IPPROTO_IPV6 in an ifdef for platforms that don't
    -   have it.
    - - (dtucker) [defines.h] define PRIu64 for platforms that don't have it.
    - - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef.
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 02:09:06 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DC2DEC54;
     Fri,  1 Mar 2013 02:09:06 +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 CE63AF26;
     Fri,  1 Mar 2013 02:09:06 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21296Xt042516;
     Fri, 1 Mar 2013 02:09:06 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21296YZ042515;
     Fri, 1 Mar 2013 02:09:06 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010209.r21296YZ042515@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 02:09:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247522 - stable/8/share/man/man5
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:09:06 -0000
    
    Author: des
    Date: Fri Mar  1 02:09:06 2013
    New Revision: 247522
    URL: http://svnweb.freebsd.org/changeset/base/247522
    
    Log:
      Regenerate
    
    Modified:
      stable/8/share/man/man5/src.conf.5
    
    Modified: stable/8/share/man/man5/src.conf.5
    ==============================================================================
    --- stable/8/share/man/man5/src.conf.5	Fri Mar  1 02:06:04 2013	(r247521)
    +++ stable/8/share/man/man5/src.conf.5	Fri Mar  1 02:09:06 2013	(r247522)
    @@ -1,7 +1,7 @@
     .\" DO NOT EDIT-- this file is automatically generated.
    -.\" from FreeBSD: stable/8/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm
    +.\" from FreeBSD: stable/8/tools/build/options/makeman 236431 2012-06-02 02:26:49Z gjb
     .\" $FreeBSD$
    -.Dd January  4, 2012
    +.Dd March  1, 2013
     .Dt SRC.CONF 5
     .Os
     .Sh NAME
    @@ -204,6 +204,14 @@ and
     .\" from FreeBSD: stable/8/tools/build/options/WITH_BIND_XML 193280 2009-06-01 21:58:59Z dougb
     Set to enable the http statistics interface for named.
     This requires ports/textproc/libxml2 to be installed in /usr/local.
    +.It Va WITHOUT_BINUTILS
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_BINUTILS 236342 2012-05-30 22:31:45Z obrien
    +Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib,
    +ld, nm, objcopy, objdump, readelf, size and strip)
    +.Bf -symbolic
    +The option does not generally work for build targets, unless some alternative
    +toolchain is enabled.
    +.Ef
     .It Va WITHOUT_BLUETOOTH
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru
     Set to not build Bluetooth related kernel modules, programs and libraries.
    @@ -316,6 +324,13 @@ Set to not build
     .It Va WITHOUT_GAMES
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru
     Set to not build games.
    +.It Va WITHOUT_GCC
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GCC 236342 2012-05-30 22:31:45Z obrien
    +Set to not install gcc and g++.
    +.Bf -symbolic
    +The option does not generally work for build targets, unless some alternative
    +toolchain is enabled.
    +.Ef
     .It Va WITHOUT_GCOV
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
     Set to not build the
    @@ -652,6 +667,16 @@ Set to not build Objective C support.
     .It Va WITHOUT_OPENSSH
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSH.
    +.It Va WITH_OPENSSH_NONE_CIPHER
    +.\" $FreeBSD$
    +Set to include the "None" cipher support in OpenSSH and its libraries.
    +Additional adjustments may need to be done to system configuration
    +files, such as
    +.Xr sshd_config 5 ,
    +to enable this cipher.
    +Please see
    +.Pa /usr/src/crypto/openssh/README.hpn
    +for full details.
     .It Va WITHOUT_OPENSSL
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSL.
    @@ -811,6 +836,10 @@ When set, it also enforces the following
     .Pp
     .Bl -item -compact
     .It
    +.Va WITHOUT_BINUTILS
    +.It
    +.Va WITHOUT_GCC
    +.It
     .Va WITHOUT_GDB
     .El
     .It Va WITHOUT_USB
    @@ -843,11 +872,11 @@ protocols (usable only via 802.1X).
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd
     Set to not build ZFS file system.
     .It Va WITHOUT_ZONEINFO
    -.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZONEINFO 171994 2007-08-27 20:01:08Z remko
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZONEINFO 235588 2012-05-18 02:00:41Z gjb
     Set to not build the timezone database.
     .El
     .Sh FILES
    -.Bl -tag -compact
    +.Bl -tag -compact -width Pa
     .It Pa /etc/src.conf
     .It Pa /usr/share/mk/bsd.own.mk
     .El
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 03:05:09 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 60EC57BF;
     Fri,  1 Mar 2013 03:05:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id 53B91213;
     Fri,  1 Mar 2013 03:05:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r213597Z061350;
     Fri, 1 Mar 2013 03:05:09 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21358Dm061345;
     Fri, 1 Mar 2013 03:05:08 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010305.r21358Dm061345@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 03:05:08 +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: r247526 - in stable/8/sys: netinet 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-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 03:05:09 -0000
    
    Author: jhb
    Date: Fri Mar  1 03:05:08 2013
    New Revision: 247526
    URL: http://svnweb.freebsd.org/changeset/base/247526
    
    Log:
      MFC 245823,245824,246210
      - Use decimal values for UDP, TCP, and UNIX domain socket options rather
        than hex to avoid implying that these constants should be treated as bit
        masks.
      - Add placeholder constants to reserve a portion of the socket option
        name space for use by downstream vendors to add custom options.
    
    Modified:
      stable/8/sys/netinet/tcp.h
      stable/8/sys/netinet/udp.h
      stable/8/sys/sys/socket.h
      stable/8/sys/sys/un.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/netinet/   (props changed)
      stable/8/sys/sys/   (props changed)
    
    Modified: stable/8/sys/netinet/tcp.h
    ==============================================================================
    --- stable/8/sys/netinet/tcp.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/netinet/tcp.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -140,16 +140,21 @@ struct tcphdr {
     #endif /* __BSD_VISIBLE */
     
     /*
    - * User-settable options (used with setsockopt).
    + * User-settable options (used with setsockopt).  These are discrete
    + * values and are not masked together.  Some values appear to be
    + * bitmasks for historical reasons.
      */
    -#define	TCP_NODELAY	0x01	/* don't delay send to coalesce packets */
    +#define	TCP_NODELAY	1	/* don't delay send to coalesce packets */
     #if __BSD_VISIBLE
    -#define	TCP_MAXSEG	0x02	/* set maximum segment size */
    -#define TCP_NOPUSH	0x04	/* don't push last block of write */
    -#define TCP_NOOPT	0x08	/* don't use TCP options */
    -#define TCP_MD5SIG	0x10	/* use MD5 digests (RFC2385) */
    -#define	TCP_INFO	0x20	/* retrieve tcp_info structure */
    -#define	TCP_CONGESTION	0x40	/* get/set congestion control algorithm */
    +#define	TCP_MAXSEG	2	/* set maximum segment size */
    +#define TCP_NOPUSH	4	/* don't push last block of write */
    +#define TCP_NOOPT	8	/* don't use TCP options */
    +#define TCP_MD5SIG	16	/* use MD5 digests (RFC2385) */
    +#define	TCP_INFO	32	/* retrieve tcp_info structure */
    +#define	TCP_CONGESTION	64	/* get/set congestion control algorithm */
    +
    +/* Start of reserved space for third-party user-settable options. */
    +#define	TCP_VENDOR	SO_VENDOR
     
     #define	TCP_CA_NAME_MAX	16	/* max congestion control name length */
     
    
    Modified: stable/8/sys/netinet/udp.h
    ==============================================================================
    --- stable/8/sys/netinet/udp.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/netinet/udp.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -48,8 +48,10 @@ struct udphdr {
     /* 
      * User-settable options (used with setsockopt).
      */
    -#define	UDP_ENCAP			0x01
    +#define	UDP_ENCAP			1
     
    +/* Start of reserved space for third-party user-settable options. */
    +#define	UDP_VENDOR			SO_VENDOR
     
     /*
      * UDP Encapsulation of IPsec Packets options.
    
    Modified: stable/8/sys/sys/socket.h
    ==============================================================================
    --- stable/8/sys/sys/socket.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/sys/socket.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -144,6 +144,15 @@ typedef	__uid_t		uid_t;
     #endif
     
     /*
    + * Space reserved for new socket options added by third-party vendors.
    + * This range applies to all socket option levels.  New socket options
    + * in FreeBSD should always use an option value less than SO_VENDOR.
    + */
    +#if __BSD_VISIBLE
    +#define	SO_VENDOR	0x80000000
    +#endif
    +
    +/*
      * Structure used for manipulating linger option.
      */
     struct linger {
    
    Modified: stable/8/sys/sys/un.h
    ==============================================================================
    --- stable/8/sys/sys/un.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/sys/un.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -53,9 +53,12 @@ struct sockaddr_un {
     #if __BSD_VISIBLE
     
     /* Socket options. */
    -#define	LOCAL_PEERCRED		0x001	/* retrieve peer credentials */
    -#define	LOCAL_CREDS		0x002	/* pass credentials to receiver */
    -#define	LOCAL_CONNWAIT		0x004	/* connects block until accepted */
    +#define	LOCAL_PEERCRED		1	/* retrieve peer credentials */
    +#define	LOCAL_CREDS		2	/* pass credentials to receiver */
    +#define	LOCAL_CONNWAIT		4	/* connects block until accepted */
    +
    +/* Start of reserved space for third-party socket options. */
    +#define	LOCAL_VENDOR		SO_VENDOR
     
     #ifndef _KERNEL
     
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 09:39:31 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1857A40B;
     Fri,  1 Mar 2013 09:39:31 +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 E2F2C255;
     Fri,  1 Mar 2013 09:39:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219dUQZ080668;
     Fri, 1 Mar 2013 09:39:30 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219dUKm080666;
     Fri, 1 Mar 2013 09:39:30 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010939.r219dUKm080666@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:39:30 +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: r247537 - in stable/8: . contrib/bsnmp/snmpd contrib/xz
     gnu/usr.bin share/misc usr.bin/chpass usr.bin/su
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:39:31 -0000
    
    Author: des
    Date: Fri Mar  1 09:39:29 2013
    New Revision: 247537
    URL: http://svnweb.freebsd.org/changeset/base/247537
    
    Log:
      Fix a few instances of broken mergeinfo
    
    Modified:
    Directory Properties:
      stable/8/   (props changed)
      stable/8/COPYRIGHT   (props changed)
      stable/8/LOCKS   (props changed)
      stable/8/MAINTAINERS   (props changed)
      stable/8/Makefile   (props changed)
      stable/8/Makefile.inc1   (props changed)
      stable/8/README   (props changed)
      stable/8/bin/   (props changed)
      stable/8/bin/cat/   (props changed)
      stable/8/bin/chio/   (props changed)
      stable/8/bin/chmod/   (props changed)
      stable/8/bin/cp/   (props changed)
      stable/8/bin/date/   (props changed)
      stable/8/bin/df/   (props changed)
      stable/8/bin/echo/   (props changed)
      stable/8/bin/ed/   (props changed)
      stable/8/bin/expr/   (props changed)
      stable/8/bin/getfacl/   (props changed)
      stable/8/bin/kenv/   (props changed)
      stable/8/bin/kill/   (props changed)
      stable/8/bin/ln/   (props changed)
      stable/8/bin/ls/   (props changed)
      stable/8/bin/mv/   (props changed)
      stable/8/bin/pax/   (props changed)
      stable/8/bin/pkill/   (props changed)
      stable/8/bin/ps/   (props changed)
      stable/8/bin/pwait/   (props changed)
      stable/8/bin/rm/   (props changed)
      stable/8/bin/setfacl/   (props changed)
      stable/8/bin/sleep/   (props changed)
      stable/8/bin/stty/   (props changed)
      stable/8/bin/test/   (props changed)
      stable/8/bin/uuidgen/   (props changed)
      stable/8/cddl/   (props changed)
      stable/8/cddl/compat/opensolaris/   (props changed)
      stable/8/cddl/contrib/dtracetoolkit/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/8/cddl/lib/   (props changed)
      stable/8/cddl/lib/libzpool/   (props changed)
      stable/8/cddl/sbin/   (props changed)
      stable/8/cddl/usr.bin/   (props changed)
      stable/8/cddl/usr.sbin/   (props changed)
      stable/8/contrib/bsnmp/   (props changed)
      stable/8/contrib/bsnmp/snmpd/bsnmpd.1   (props changed)
      stable/8/contrib/expat/   (props changed)
      stable/8/contrib/gcc/   (props changed)
      stable/8/contrib/groff/   (props changed)
      stable/8/contrib/one-true-awk/   (props changed)
      stable/8/contrib/pf/   (props changed)
      stable/8/contrib/tcp_wrappers/   (props changed)
      stable/8/contrib/telnet/   (props changed)
      stable/8/contrib/xz/   (props changed)
      stable/8/contrib/xz/AUTHORS   (props changed)
      stable/8/contrib/xz/ChangeLog   (props changed)
      stable/8/contrib/xz/README   (props changed)
      stable/8/contrib/xz/THANKS   (props changed)
      stable/8/contrib/xz/po/   (props changed)
      stable/8/contrib/xz/src/   (props changed)
      stable/8/crypto/   (props changed)
      stable/8/crypto/heimdal/   (props changed)
      stable/8/games/   (props changed)
      stable/8/games/bcd/   (props changed)
      stable/8/games/caesar/   (props changed)
      stable/8/games/factor/   (props changed)
      stable/8/games/fortune/   (props changed)
      stable/8/games/grdc/   (props changed)
      stable/8/games/pom/   (props changed)
      stable/8/games/random/   (props changed)
      stable/8/gnu/   (props changed)
      stable/8/gnu/lib/csu/   (props changed)
      stable/8/gnu/lib/libgcc/   (props changed)
      stable/8/gnu/lib/libstdc++/   (props changed)
      stable/8/gnu/usr.bin/   (props changed)
      stable/8/gnu/usr.bin/Makefile   (props changed)
      stable/8/gnu/usr.bin/cc/include/   (props changed)
      stable/8/gnu/usr.bin/dialog/   (props changed)
      stable/8/gnu/usr.bin/gdb/   (props changed)
      stable/8/gnu/usr.bin/gdb/arch/sparc64/   (props changed)
      stable/8/gnu/usr.bin/gdb/kgdb/   (props changed)
      stable/8/gnu/usr.bin/gperf/   (props changed)
      stable/8/gnu/usr.bin/groff/   (props changed)
      stable/8/gnu/usr.bin/send-pr/   (props changed)
      stable/8/kerberos5/   (props changed)
      stable/8/kerberos5/usr.bin/kdestroy/   (props changed)
      stable/8/kerberos5/usr.bin/kpasswd/   (props changed)
      stable/8/lib/csu/   (props changed)
      stable/8/lib/libbluetooth/   (props changed)
      stable/8/lib/libc_r/   (props changed)
      stable/8/lib/libelf/   (props changed)
      stable/8/lib/libexpat/   (props changed)
      stable/8/lib/libfetch/   (props changed)
      stable/8/lib/libgpib/   (props changed)
      stable/8/lib/libgssapi/   (props changed)
      stable/8/lib/libjail/   (props changed)
      stable/8/lib/libkse/   (props changed)
      stable/8/lib/liblzma/   (props changed)
      stable/8/lib/libpam/   (props changed)
      stable/8/lib/libpmc/   (props changed)
      stable/8/lib/libradius/   (props changed)
      stable/8/lib/librpcsec_gss/   (props changed)
      stable/8/lib/libsm/   (props changed)
      stable/8/lib/libstand/   (props changed)
      stable/8/lib/libtacplus/   (props changed)
      stable/8/lib/libufs/   (props changed)
      stable/8/lib/libusbhid/   (props changed)
      stable/8/lib/libz/   (props changed)
      stable/8/lib/msun/   (props changed)
      stable/8/libexec/   (props changed)
      stable/8/libexec/atrun/   (props changed)
      stable/8/libexec/comsat/   (props changed)
      stable/8/libexec/ftpd/   (props changed)
      stable/8/libexec/rshd/   (props changed)
      stable/8/libexec/save-entropy/   (props changed)
      stable/8/libexec/tftpd/   (props changed)
      stable/8/libexec/ypxfr/   (props changed)
      stable/8/rescue/   (props changed)
      stable/8/rescue/rescue/   (props changed)
      stable/8/secure/   (props changed)
      stable/8/secure/lib/libcrypto/   (props changed)
      stable/8/secure/lib/libssh/   (props changed)
      stable/8/secure/lib/libssl/   (props changed)
      stable/8/secure/usr.bin/bdes/   (props changed)
      stable/8/secure/usr.bin/openssl/   (props changed)
      stable/8/secure/usr.bin/ssh/   (props changed)
      stable/8/share/   (props changed)
      stable/8/share/dict/   (props changed)
      stable/8/share/doc/   (props changed)
      stable/8/share/doc/bind9/   (props changed)
      stable/8/share/doc/papers/devfs/   (props changed)
      stable/8/share/doc/papers/jail/   (props changed)
      stable/8/share/doc/smm/01.setup/   (props changed)
      stable/8/share/examples/   (props changed)
      stable/8/share/examples/csh/   (props changed)
      stable/8/share/examples/cvsup/   (props changed)
      stable/8/share/man/   (props changed)
      stable/8/share/man/man1/   (props changed)
      stable/8/share/man/man3/   (props changed)
      stable/8/share/man/man8/   (props changed)
      stable/8/share/misc/   (props changed)
      stable/8/share/misc/bsd-family-tree   (props changed)
      stable/8/share/mk/   (props changed)
      stable/8/share/skel/   (props changed)
      stable/8/share/syscons/   (props changed)
      stable/8/share/syscons/keymaps/   (props changed)
      stable/8/share/termcap/   (props changed)
      stable/8/tools/   (props changed)
      stable/8/tools/build/mk/   (props changed)
      stable/8/tools/build/options/   (props changed)
      stable/8/tools/debugscripts/   (props changed)
      stable/8/tools/diag/   (props changed)
      stable/8/tools/kerneldoc/   (props changed)
      stable/8/tools/kerneldoc/subsys/   (props changed)
      stable/8/tools/regression/acct/   (props changed)
      stable/8/tools/regression/acltools/   (props changed)
      stable/8/tools/regression/aio/aiotest/   (props changed)
      stable/8/tools/regression/bin/   (props changed)
      stable/8/tools/regression/bin/date/   (props changed)
      stable/8/tools/regression/bin/test/   (props changed)
      stable/8/tools/regression/doat/   (props changed)
      stable/8/tools/regression/fifo/   (props changed)
      stable/8/tools/regression/geom/   (props changed)
      stable/8/tools/regression/lib/libc/   (props changed)
      stable/8/tools/regression/mqueue/mqtest1/   (props changed)
      stable/8/tools/regression/mqueue/mqtest2/   (props changed)
      stable/8/tools/regression/mqueue/mqtest3/   (props changed)
      stable/8/tools/regression/mqueue/mqtest4/   (props changed)
      stable/8/tools/regression/mqueue/mqtest5/   (props changed)
      stable/8/tools/regression/netinet/   (props changed)
      stable/8/tools/regression/pipe/   (props changed)
      stable/8/tools/regression/posixsem/   (props changed)
      stable/8/tools/regression/sockets/   (props changed)
      stable/8/tools/regression/sockets/unix_gc/   (props changed)
      stable/8/tools/regression/usr.bin/   (props changed)
      stable/8/tools/regression/usr.bin/pkill/   (props changed)
      stable/8/tools/regression/usr.bin/sed/   (props changed)
      stable/8/tools/regression/usr.bin/tr/   (props changed)
      stable/8/tools/test/   (props changed)
      stable/8/tools/test/malloc/   (props changed)
      stable/8/tools/tools/   (props changed)
      stable/8/tools/tools/aac/   (props changed)
      stable/8/tools/tools/ath/   (props changed)
      stable/8/tools/tools/cfi/   (props changed)
      stable/8/tools/tools/ether_reflect/   (props changed)
      stable/8/tools/tools/iwi/   (props changed)
      stable/8/tools/tools/mctest/   (props changed)
      stable/8/tools/tools/nanobsd/   (props changed)
      stable/8/tools/tools/netrate/   (props changed)
      stable/8/tools/tools/netrate/netblast/   (props changed)
      stable/8/tools/tools/netrate/netsend/   (props changed)
      stable/8/tools/tools/netrate/tcpp/   (props changed)
      stable/8/tools/tools/sysdoc/   (props changed)
      stable/8/tools/tools/umastat/   (props changed)
      stable/8/usr.bin/   (props changed)
      stable/8/usr.bin/apply/   (props changed)
      stable/8/usr.bin/ar/   (props changed)
      stable/8/usr.bin/awk/   (props changed)
      stable/8/usr.bin/biff/   (props changed)
      stable/8/usr.bin/brandelf/   (props changed)
      stable/8/usr.bin/bsdiff/   (props changed)
      stable/8/usr.bin/c89/   (props changed)
      stable/8/usr.bin/c99/   (props changed)
      stable/8/usr.bin/catman/   (props changed)
      stable/8/usr.bin/checknr/   (props changed)
      stable/8/usr.bin/chpass/   (props changed)
      stable/8/usr.bin/chpass/Makefile   (props changed)
      stable/8/usr.bin/column/   (props changed)
      stable/8/usr.bin/comm/   (props changed)
      stable/8/usr.bin/compress/   (props changed)
      stable/8/usr.bin/cpio/   (props changed)
      stable/8/usr.bin/cpuset/   (props changed)
      stable/8/usr.bin/cut/   (props changed)
      stable/8/usr.bin/du/   (props changed)
      stable/8/usr.bin/ee/   (props changed)
      stable/8/usr.bin/enigma/   (props changed)
      stable/8/usr.bin/find/   (props changed)
      stable/8/usr.bin/finger/   (props changed)
      stable/8/usr.bin/fold/   (props changed)
      stable/8/usr.bin/gcore/   (props changed)
      stable/8/usr.bin/getopt/   (props changed)
      stable/8/usr.bin/gprof/   (props changed)
      stable/8/usr.bin/gzip/   (props changed)
      stable/8/usr.bin/hexdump/   (props changed)
      stable/8/usr.bin/indent/   (props changed)
      stable/8/usr.bin/ipcrm/   (props changed)
      stable/8/usr.bin/ipcs/   (props changed)
      stable/8/usr.bin/join/   (props changed)
      stable/8/usr.bin/jot/   (props changed)
      stable/8/usr.bin/kdump/   (props changed)
      stable/8/usr.bin/killall/   (props changed)
      stable/8/usr.bin/ktrace/   (props changed)
      stable/8/usr.bin/lastcomm/   (props changed)
      stable/8/usr.bin/ldd/   (props changed)
      stable/8/usr.bin/less/   (props changed)
      stable/8/usr.bin/lex/   (props changed)
      stable/8/usr.bin/limits/   (props changed)
      stable/8/usr.bin/locale/   (props changed)
      stable/8/usr.bin/locate/   (props changed)
      stable/8/usr.bin/lock/   (props changed)
      stable/8/usr.bin/lockf/   (props changed)
      stable/8/usr.bin/logger/   (props changed)
      stable/8/usr.bin/m4/   (props changed)
      stable/8/usr.bin/mail/   (props changed)
      stable/8/usr.bin/make/   (props changed)
      stable/8/usr.bin/makewhatis/   (props changed)
      stable/8/usr.bin/minigzip/   (props changed)
      stable/8/usr.bin/mktemp/   (props changed)
      stable/8/usr.bin/msgs/   (props changed)
      stable/8/usr.bin/ncal/   (props changed)
      stable/8/usr.bin/ncplist/   (props changed)
      stable/8/usr.bin/ncplogin/   (props changed)
      stable/8/usr.bin/newgrp/   (props changed)
      stable/8/usr.bin/nfsstat/   (props changed)
      stable/8/usr.bin/nsupdate/   (props changed)
      stable/8/usr.bin/pathchk/   (props changed)
      stable/8/usr.bin/perror/   (props changed)
      stable/8/usr.bin/pr/   (props changed)
      stable/8/usr.bin/printf/   (props changed)
      stable/8/usr.bin/rlogin/   (props changed)
      stable/8/usr.bin/rpcgen/   (props changed)
      stable/8/usr.bin/rpcinfo/   (props changed)
      stable/8/usr.bin/rs/   (props changed)
      stable/8/usr.bin/ruptime/   (props changed)
      stable/8/usr.bin/script/   (props changed)
      stable/8/usr.bin/sed/   (props changed)
      stable/8/usr.bin/showmount/   (props changed)
      stable/8/usr.bin/sockstat/   (props changed)
      stable/8/usr.bin/split/   (props changed)
      stable/8/usr.bin/stat/   (props changed)
      stable/8/usr.bin/stdbuf/   (props changed)
      stable/8/usr.bin/su/   (props changed)
      stable/8/usr.bin/su/Makefile   (props changed)
      stable/8/usr.bin/su/su.1   (props changed)
      stable/8/usr.bin/su/su.c   (props changed)
      stable/8/usr.bin/systat/   (props changed)
      stable/8/usr.bin/tail/   (props changed)
      stable/8/usr.bin/tar/   (props changed)
      stable/8/usr.bin/tftp/   (props changed)
      stable/8/usr.bin/tip/   (props changed)
      stable/8/usr.bin/top/   (props changed)
      stable/8/usr.bin/touch/   (props changed)
      stable/8/usr.bin/tr/   (props changed)
      stable/8/usr.bin/truss/   (props changed)
      stable/8/usr.bin/uname/   (props changed)
      stable/8/usr.bin/unifdef/   (props changed)
      stable/8/usr.bin/uniq/   (props changed)
      stable/8/usr.bin/unzip/   (props changed)
      stable/8/usr.bin/usbhidaction/   (props changed)
      stable/8/usr.bin/usbhidctl/   (props changed)
      stable/8/usr.bin/uudecode/   (props changed)
      stable/8/usr.bin/uuencode/   (props changed)
      stable/8/usr.bin/vmstat/   (props changed)
      stable/8/usr.bin/wall/   (props changed)
      stable/8/usr.bin/who/   (props changed)
      stable/8/usr.bin/xargs/   (props changed)
      stable/8/usr.bin/xinstall/   (props changed)
      stable/8/usr.bin/xlint/   (props changed)
      stable/8/usr.bin/xz/   (props changed)
      stable/8/usr.bin/yacc/   (props changed)
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 09:40:03 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D35536CF;
     Fri,  1 Mar 2013 09:40:03 +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 ADEE225D;
     Fri,  1 Mar 2013 09:40:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219e3Cj080864;
     Fri, 1 Mar 2013 09:40:03 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219e3TG080861;
     Fri, 1 Mar 2013 09:40:03 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010940.r219e3TG080861@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:40:03 +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: r247539 - stable/8/usr.bin/du
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:40:03 -0000
    
    Author: des
    Date: Fri Mar  1 09:40:02 2013
    New Revision: 247539
    URL: http://svnweb.freebsd.org/changeset/base/247539
    
    Log:
      MFH (r238602): add -g (gigabyte) flag
    
    Modified:
      stable/8/usr.bin/du/du.1
      stable/8/usr.bin/du/du.c
    Directory Properties:
      stable/8/usr.bin/du/   (props changed)
    
    Modified: stable/8/usr.bin/du/du.1
    ==============================================================================
    --- stable/8/usr.bin/du/du.1	Fri Mar  1 09:39:53 2013	(r247538)
    +++ stable/8/usr.bin/du/du.1	Fri Mar  1 09:40:02 2013	(r247539)
    @@ -32,7 +32,7 @@
     .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
     .\" $FreeBSD$
     .\"
    -.Dd December 17, 2011
    +.Dd July 18, 2012
     .Dt DU 1
     .Os
     .Sh NAME
    @@ -42,7 +42,7 @@
     .Nm
     .Op Fl Aclnx
     .Op Fl H | L | P
    -.Op Fl h | k | m
    +.Op Fl g | h | k | m
     .Op Fl a | s | d Ar depth
     .Op Fl B Ar blocksize
     .Op Fl I Ar mask
    @@ -67,9 +67,9 @@ Calculate block counts in
     .Ar blocksize
     byte blocks.
     This is different from the
    -.Fl h, k
    +.Fl h, k, m
     and
    -.Fl  m
    +.Fl  g
     options or setting
     .Ev BLOCKSIZE
     and gives an estimate of how much space the examined file hierarchy would
    @@ -99,13 +99,15 @@ Display a grand total.
     Display an entry for all files and directories
     .Ar depth
     directories deep.
    +.It Fl g
    +Display block counts in 1073741824-byte (1 GiB) blocks.
     .It Fl h
     .Dq Human-readable
     output.
     Use unit suffixes: Byte, Kilobyte, Megabyte,
     Gigabyte, Terabyte and Petabyte.
     .It Fl k
    -Display block counts in 1024-byte (1-Kbyte) blocks.
    +Display block counts in 1024-byte (1 kiB) blocks.
     .It Fl l
     If a file has multiple hard links, count its size multiple times.
     The default behavior of
    @@ -116,7 +118,7 @@ When the
     option is specified, the hard link checks are disabled, and these files
     are counted (and displayed) as many times as they are found.
     .It Fl m
    -Display block counts in 1048576-byte (1-Mbyte) blocks.
    +Display block counts in 1048576-byte (1 MiB) blocks.
     .It Fl n
     Ignore files and directories with user
     .Dq nodump
    
    Modified: stable/8/usr.bin/du/du.c
    ==============================================================================
    --- stable/8/usr.bin/du/du.c	Fri Mar  1 09:39:53 2013	(r247538)
    +++ stable/8/usr.bin/du/du.c	Fri Mar  1 09:40:02 2013	(r247539)
    @@ -114,7 +114,7 @@ main(int argc, char *argv[])
     	depth = INT_MAX;
     	SLIST_INIT(&ignores);
     
    -	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1)
    +	while ((ch = getopt(argc, argv, "AB:HI:LPasd:cghklmnrt:x")) != -1)
     		switch (ch) {
     		case 'A':
     			Aflag = 1;
    @@ -161,6 +161,10 @@ main(int argc, char *argv[])
     		case 'c':
     			cflag = 1;
     			break;
    +		case 'g':
    +			hflag = 0;
    +			blocksize = 1073741824;
    +			break;
     		case 'h':
     			hflag = 1;
     			break;
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 09:50:45 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E32A5D1F;
     Fri,  1 Mar 2013 09:50:45 +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 C73682DF;
     Fri,  1 Mar 2013 09:50:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219ojtZ085569;
     Fri, 1 Mar 2013 09:50:45 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219ojkj085568;
     Fri, 1 Mar 2013 09:50:45 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010950.r219ojkj085568@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:50:45 +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: r247542 - in stable/8/sys: . dev/sound
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:50:46 -0000
    
    Author: des
    Date: Fri Mar  1 09:50:45 2013
    New Revision: 247542
    URL: http://svnweb.freebsd.org/changeset/base/247542
    
    Log:
      More misapplied mergeinfo.
    
    Modified:
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/Makefile   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/amd64/include/xen/   (props changed)
      stable/8/sys/arm/   (props changed)
      stable/8/sys/boot/   (props changed)
      stable/8/sys/bsm/   (props changed)
      stable/8/sys/cam/   (props changed)
      stable/8/sys/cddl/   (props changed)
      stable/8/sys/cddl/contrib/opensolaris/   (props changed)
      stable/8/sys/compat/   (props changed)
      stable/8/sys/conf/   (props changed)
      stable/8/sys/contrib/   (props changed)
      stable/8/sys/contrib/dev/acpica/   (props changed)
      stable/8/sys/contrib/pf/   (props changed)
      stable/8/sys/crypto/   (props changed)
      stable/8/sys/ddb/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/aac/   (props changed)
      stable/8/sys/dev/acpi_support/   (props changed)
      stable/8/sys/dev/acpica/   (props changed)
      stable/8/sys/dev/adb/   (props changed)
      stable/8/sys/dev/adlink/   (props changed)
      stable/8/sys/dev/advansys/   (props changed)
      stable/8/sys/dev/ae/   (props changed)
      stable/8/sys/dev/age/   (props changed)
      stable/8/sys/dev/agp/   (props changed)
      stable/8/sys/dev/aha/   (props changed)
      stable/8/sys/dev/ahb/   (props changed)
      stable/8/sys/dev/ahci/   (props changed)
      stable/8/sys/dev/aic/   (props changed)
      stable/8/sys/dev/aic7xxx/   (props changed)
      stable/8/sys/dev/alc/   (props changed)
      stable/8/sys/dev/ale/   (props changed)
      stable/8/sys/dev/amd/   (props changed)
      stable/8/sys/dev/amdsbwd/   (props changed)
      stable/8/sys/dev/amdtemp/   (props changed)
      stable/8/sys/dev/amr/   (props changed)
      stable/8/sys/dev/an/   (props changed)
      stable/8/sys/dev/arcmsr/   (props changed)
      stable/8/sys/dev/asmc/   (props changed)
      stable/8/sys/dev/asr/   (props changed)
      stable/8/sys/dev/ata/   (props changed)
      stable/8/sys/dev/ath/   (props changed)
      stable/8/sys/dev/atkbdc/   (props changed)
      stable/8/sys/dev/auxio/   (props changed)
      stable/8/sys/dev/bce/   (props changed)
      stable/8/sys/dev/bfe/   (props changed)
      stable/8/sys/dev/bge/   (props changed)
      stable/8/sys/dev/bktr/   (props changed)
      stable/8/sys/dev/bm/   (props changed)
      stable/8/sys/dev/buslogic/   (props changed)
      stable/8/sys/dev/bwi/   (props changed)
      stable/8/sys/dev/bwn/   (props changed)
      stable/8/sys/dev/cardbus/   (props changed)
      stable/8/sys/dev/cas/   (props changed)
      stable/8/sys/dev/ce/   (props changed)
      stable/8/sys/dev/cfe/   (props changed)
      stable/8/sys/dev/cfi/   (props changed)
      stable/8/sys/dev/ciss/   (props changed)
      stable/8/sys/dev/cm/   (props changed)
      stable/8/sys/dev/cmx/   (props changed)
      stable/8/sys/dev/coretemp/   (props changed)
      stable/8/sys/dev/cp/   (props changed)
      stable/8/sys/dev/cpuctl/   (props changed)
      stable/8/sys/dev/cpufreq/   (props changed)
      stable/8/sys/dev/cs/   (props changed)
      stable/8/sys/dev/ct/   (props changed)
      stable/8/sys/dev/ctau/   (props changed)
      stable/8/sys/dev/cx/   (props changed)
      stable/8/sys/dev/cxgb/   (props changed)
      stable/8/sys/dev/cxgbe/   (props changed)
      stable/8/sys/dev/cy/   (props changed)
      stable/8/sys/dev/dc/   (props changed)
      stable/8/sys/dev/dcons/   (props changed)
      stable/8/sys/dev/de/   (props changed)
      stable/8/sys/dev/digi/   (props changed)
      stable/8/sys/dev/dpms/   (props changed)
      stable/8/sys/dev/dpt/   (props changed)
      stable/8/sys/dev/drm/   (props changed)
      stable/8/sys/dev/e1000/   (props changed)
      stable/8/sys/dev/ed/   (props changed)
      stable/8/sys/dev/eisa/   (props changed)
      stable/8/sys/dev/en/   (props changed)
      stable/8/sys/dev/ep/   (props changed)
      stable/8/sys/dev/esp/   (props changed)
      stable/8/sys/dev/et/   (props changed)
      stable/8/sys/dev/ex/   (props changed)
      stable/8/sys/dev/exca/   (props changed)
      stable/8/sys/dev/fatm/   (props changed)
      stable/8/sys/dev/fb/   (props changed)
      stable/8/sys/dev/fdc/   (props changed)
      stable/8/sys/dev/fe/   (props changed)
      stable/8/sys/dev/firewire/   (props changed)
      stable/8/sys/dev/flash/   (props changed)
      stable/8/sys/dev/fxp/   (props changed)
      stable/8/sys/dev/gem/   (props changed)
      stable/8/sys/dev/glxsb/   (props changed)
      stable/8/sys/dev/hatm/   (props changed)
      stable/8/sys/dev/hifn/   (props changed)
      stable/8/sys/dev/hme/   (props changed)
      stable/8/sys/dev/hpt27xx/   (props changed)
      stable/8/sys/dev/hptiop/   (props changed)
      stable/8/sys/dev/hptmv/   (props changed)
      stable/8/sys/dev/hptrr/   (props changed)
      stable/8/sys/dev/hwpmc/   (props changed)
      stable/8/sys/dev/ic/   (props changed)
      stable/8/sys/dev/ichsmb/   (props changed)
      stable/8/sys/dev/ichwd/   (props changed)
      stable/8/sys/dev/ida/   (props changed)
      stable/8/sys/dev/ie/   (props changed)
      stable/8/sys/dev/ieee488/   (props changed)
      stable/8/sys/dev/if_ndis/   (props changed)
      stable/8/sys/dev/iicbus/   (props changed)
      stable/8/sys/dev/iir/   (props changed)
      stable/8/sys/dev/io/   (props changed)
      stable/8/sys/dev/ipmi/   (props changed)
      stable/8/sys/dev/ips/   (props changed)
      stable/8/sys/dev/ipw/   (props changed)
      stable/8/sys/dev/isci/   (props changed)
      stable/8/sys/dev/iscsi/   (props changed)
      stable/8/sys/dev/isp/   (props changed)
      stable/8/sys/dev/ispfw/   (props changed)
      stable/8/sys/dev/iwi/   (props changed)
      stable/8/sys/dev/iwn/   (props changed)
      stable/8/sys/dev/ixgb/   (props changed)
      stable/8/sys/dev/ixgbe/   (props changed)
      stable/8/sys/dev/jme/   (props changed)
      stable/8/sys/dev/joy/   (props changed)
      stable/8/sys/dev/kbd/   (props changed)
      stable/8/sys/dev/kbdmux/   (props changed)
      stable/8/sys/dev/ksyms/   (props changed)
      stable/8/sys/dev/le/   (props changed)
      stable/8/sys/dev/led/   (props changed)
      stable/8/sys/dev/lge/   (props changed)
      stable/8/sys/dev/lindev/   (props changed)
      stable/8/sys/dev/lmc/   (props changed)
      stable/8/sys/dev/malo/   (props changed)
      stable/8/sys/dev/mc146818/   (props changed)
      stable/8/sys/dev/mca/   (props changed)
      stable/8/sys/dev/mcd/   (props changed)
      stable/8/sys/dev/md/   (props changed)
      stable/8/sys/dev/mem/   (props changed)
      stable/8/sys/dev/mfi/   (props changed)
      stable/8/sys/dev/mge/   (props changed)
      stable/8/sys/dev/mii/   (props changed)
      stable/8/sys/dev/mk48txx/   (props changed)
      stable/8/sys/dev/mlx/   (props changed)
      stable/8/sys/dev/mly/   (props changed)
      stable/8/sys/dev/mmc/   (props changed)
      stable/8/sys/dev/mn/   (props changed)
      stable/8/sys/dev/mps/   (props changed)
      stable/8/sys/dev/mpt/   (props changed)
      stable/8/sys/dev/mse/   (props changed)
      stable/8/sys/dev/msk/   (props changed)
      stable/8/sys/dev/mvs/   (props changed)
      stable/8/sys/dev/mwl/   (props changed)
      stable/8/sys/dev/mxge/   (props changed)
      stable/8/sys/dev/my/   (props changed)
      stable/8/sys/dev/ncv/   (props changed)
      stable/8/sys/dev/netmap/   (props changed)
      stable/8/sys/dev/nfe/   (props changed)
      stable/8/sys/dev/nge/   (props changed)
      stable/8/sys/dev/nmdm/   (props changed)
      stable/8/sys/dev/nsp/   (props changed)
      stable/8/sys/dev/null/   (props changed)
      stable/8/sys/dev/nve/   (props changed)
      stable/8/sys/dev/nvram/   (props changed)
      stable/8/sys/dev/nxge/   (props changed)
      stable/8/sys/dev/oce/   (props changed)
      stable/8/sys/dev/ofw/   (props changed)
      stable/8/sys/dev/patm/   (props changed)
      stable/8/sys/dev/pbio/   (props changed)
      stable/8/sys/dev/pccard/   (props changed)
      stable/8/sys/dev/pccbb/   (props changed)
      stable/8/sys/dev/pcf/   (props changed)
      stable/8/sys/dev/pci/   (props changed)
      stable/8/sys/dev/pcn/   (props changed)
      stable/8/sys/dev/pdq/   (props changed)
      stable/8/sys/dev/powermac_nvram/   (props changed)
      stable/8/sys/dev/ppbus/   (props changed)
      stable/8/sys/dev/ppc/   (props changed)
      stable/8/sys/dev/pst/   (props changed)
      stable/8/sys/dev/puc/   (props changed)
      stable/8/sys/dev/quicc/   (props changed)
      stable/8/sys/dev/ral/   (props changed)
      stable/8/sys/dev/random/   (props changed)
      stable/8/sys/dev/rc/   (props changed)
      stable/8/sys/dev/re/   (props changed)
      stable/8/sys/dev/rndtest/   (props changed)
      stable/8/sys/dev/rp/   (props changed)
      stable/8/sys/dev/safe/   (props changed)
      stable/8/sys/dev/sbni/   (props changed)
      stable/8/sys/dev/scc/   (props changed)
      stable/8/sys/dev/scd/   (props changed)
      stable/8/sys/dev/sdhci/   (props changed)
      stable/8/sys/dev/sec/   (props changed)
      stable/8/sys/dev/sf/   (props changed)
      stable/8/sys/dev/sge/   (props changed)
      stable/8/sys/dev/si/   (props changed)
      stable/8/sys/dev/siba/   (props changed)
      stable/8/sys/dev/siis/   (props changed)
      stable/8/sys/dev/sio/   (props changed)
      stable/8/sys/dev/sis/   (props changed)
      stable/8/sys/dev/sk/   (props changed)
      stable/8/sys/dev/smbus/   (props changed)
      stable/8/sys/dev/smc/   (props changed)
      stable/8/sys/dev/sn/   (props changed)
      stable/8/sys/dev/snc/   (props changed)
      stable/8/sys/dev/snp/   (props changed)
      stable/8/sys/dev/sound/   (props changed)
      stable/8/sys/dev/sound/chip.h   (props changed)
      stable/8/sys/dev/sound/clone.c   (props changed)
      stable/8/sys/dev/sound/clone.h   (props changed)
      stable/8/sys/dev/sound/driver.c   (props changed)
      stable/8/sys/dev/sound/isa/   (props changed)
      stable/8/sys/dev/sound/macio/   (props changed)
      stable/8/sys/dev/sound/midi/   (props changed)
      stable/8/sys/dev/sound/pci/   (props changed)
      stable/8/sys/dev/sound/pcm/   (props changed)
      stable/8/sys/dev/sound/sbus/   (props changed)
      stable/8/sys/dev/sound/unit.c   (props changed)
      stable/8/sys/dev/sound/unit.h   (props changed)
      stable/8/sys/dev/sound/usb/   (props changed)
      stable/8/sys/dev/sound/version.h   (props changed)
      stable/8/sys/dev/speaker/   (props changed)
      stable/8/sys/dev/spibus/   (props changed)
      stable/8/sys/dev/ste/   (props changed)
      stable/8/sys/dev/stg/   (props changed)
      stable/8/sys/dev/stge/   (props changed)
      stable/8/sys/dev/streams/   (props changed)
      stable/8/sys/dev/sym/   (props changed)
      stable/8/sys/dev/syscons/   (props changed)
      stable/8/sys/dev/tdfx/   (props changed)
      stable/8/sys/dev/ti/   (props changed)
      stable/8/sys/dev/tl/   (props changed)
      stable/8/sys/dev/tpm/   (props changed)
      stable/8/sys/dev/trm/   (props changed)
      stable/8/sys/dev/tsec/   (props changed)
      stable/8/sys/dev/twa/   (props changed)
      stable/8/sys/dev/twe/   (props changed)
      stable/8/sys/dev/tws/   (props changed)
      stable/8/sys/dev/tx/   (props changed)
      stable/8/sys/dev/txp/   (props changed)
      stable/8/sys/dev/uart/   (props changed)
      stable/8/sys/dev/ubsec/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
      stable/8/sys/dev/utopia/   (props changed)
      stable/8/sys/dev/vge/   (props changed)
      stable/8/sys/dev/viawd/   (props changed)
      stable/8/sys/dev/virtio/   (props changed)
      stable/8/sys/dev/vkbd/   (props changed)
      stable/8/sys/dev/vr/   (props changed)
      stable/8/sys/dev/vte/   (props changed)
      stable/8/sys/dev/vx/   (props changed)
      stable/8/sys/dev/watchdog/   (props changed)
      stable/8/sys/dev/wb/   (props changed)
      stable/8/sys/dev/wbwd/   (props changed)
      stable/8/sys/dev/wds/   (props changed)
      stable/8/sys/dev/wi/   (props changed)
      stable/8/sys/dev/wl/   (props changed)
      stable/8/sys/dev/wpi/   (props changed)
      stable/8/sys/dev/xe/   (props changed)
      stable/8/sys/dev/xen/   (props changed)
      stable/8/sys/dev/xl/   (props changed)
      stable/8/sys/fs/   (props changed)
      stable/8/sys/gdb/   (props changed)
      stable/8/sys/geom/   (props changed)
      stable/8/sys/gnu/   (props changed)
      stable/8/sys/i386/   (props changed)
      stable/8/sys/ia64/   (props changed)
      stable/8/sys/isa/   (props changed)
      stable/8/sys/kern/   (props changed)
      stable/8/sys/kgssapi/   (props changed)
      stable/8/sys/libkern/   (props changed)
      stable/8/sys/mips/   (props changed)
      stable/8/sys/modules/   (props changed)
      stable/8/sys/net/   (props changed)
      stable/8/sys/net80211/   (props changed)
      stable/8/sys/netatalk/   (props changed)
      stable/8/sys/netgraph/   (props changed)
      stable/8/sys/netinet/   (props changed)
      stable/8/sys/netinet6/   (props changed)
      stable/8/sys/netipsec/   (props changed)
      stable/8/sys/netipx/   (props changed)
      stable/8/sys/netnatm/   (props changed)
      stable/8/sys/netncp/   (props changed)
      stable/8/sys/netsmb/   (props changed)
      stable/8/sys/nfs/   (props changed)
      stable/8/sys/nfsclient/   (props changed)
      stable/8/sys/nfsserver/   (props changed)
      stable/8/sys/nlm/   (props changed)
      stable/8/sys/opencrypto/   (props changed)
      stable/8/sys/pc98/   (props changed)
      stable/8/sys/pci/   (props changed)
      stable/8/sys/powerpc/   (props changed)
      stable/8/sys/rpc/   (props changed)
      stable/8/sys/security/   (props changed)
      stable/8/sys/sparc64/   (props changed)
      stable/8/sys/sun4v/   (props changed)
      stable/8/sys/sys/   (props changed)
      stable/8/sys/tools/   (props changed)
      stable/8/sys/ufs/   (props changed)
      stable/8/sys/vm/   (props changed)
      stable/8/sys/x86/   (props changed)
      stable/8/sys/xdr/   (props changed)
      stable/8/sys/xen/   (props changed)
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 10:23:37 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 578B9365;
     Fri,  1 Mar 2013 10:23:37 +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 44164648;
     Fri,  1 Mar 2013 10:23:37 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21ANbOB095486;
     Fri, 1 Mar 2013 10:23:37 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21ANbsX095485;
     Fri, 1 Mar 2013 10:23:37 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303011023.r21ANbsX095485@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 10:23:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247543 - stable/8/usr.bin/find
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 10:23:37 -0000
    
    Author: des
    Date: Fri Mar  1 10:23:36 2013
    New Revision: 247543
    URL: http://svnweb.freebsd.org/changeset/base/247543
    
    Log:
      MFH (r240278): document -quit
    
    Modified:
      stable/8/usr.bin/find/find.1
    Directory Properties:
      stable/8/usr.bin/find/   (props changed)
    
    Modified: stable/8/usr.bin/find/find.1
    ==============================================================================
    --- stable/8/usr.bin/find/find.1	Fri Mar  1 09:50:45 2013	(r247542)
    +++ stable/8/usr.bin/find/find.1	Fri Mar  1 10:23:36 2013	(r247543)
    @@ -35,7 +35,7 @@
     .\"	@(#)find.1	8.7 (Berkeley) 5/9/95
     .\" $FreeBSD$
     .\"
    -.Dd February 24, 2008
    +.Dd September 9, 2012
     .Dt FIND 1
     .Os
     .Sh NAME
    @@ -741,6 +741,10 @@ Note, the
     primary has no effect if the
     .Fl d
     option was specified.
    +.It Ic -quit
    +Causes
    +.Nm
    +to immediately terminate.
     .It Ic -regex Ar pattern
     True if the whole path of the file matches
     .Ar pattern
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 14:54:38 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id ED07F91;
     Fri,  1 Mar 2013 14:54:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id DF25F1A9;
     Fri,  1 Mar 2013 14:54:38 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Esc8m077121;
     Fri, 1 Mar 2013 14:54:38 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Esckw077117;
     Fri, 1 Mar 2013 14:54:38 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011454.r21Esckw077117@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 14:54: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: r247548 - in stable/8/sys: amd64/amd64 i386/i386 x86/x86
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 14:54:39 -0000
    
    Author: jhb
    Date: Fri Mar  1 14:54:37 2013
    New Revision: 247548
    URL: http://svnweb.freebsd.org/changeset/base/247548
    
    Log:
      MFC 245577,245640:
      Don't attempt to use clflush on the local APIC register window.  Various
      CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on
      Pentium-M, and trashing of the local APIC registers on a VIA C7).  The
      local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't
      necessary anyway.
    
    Modified:
      stable/8/sys/amd64/amd64/pmap.c
      stable/8/sys/i386/i386/pmap.c
      stable/8/sys/x86/x86/local_apic.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/i386/   (props changed)
      stable/8/sys/x86/   (props changed)
    
    Modified: stable/8/sys/amd64/amd64/pmap.c
    ==============================================================================
    --- stable/8/sys/amd64/amd64/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/amd64/amd64/pmap.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$");
     #include "opt_vm.h"
     
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -137,6 +138,8 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#include 
    +#include 
     #include 
     #include 
     #include 
    @@ -1054,6 +1057,15 @@ pmap_invalidate_cache_range(vm_offset_t 
     		 eva - sva < 2 * 1024 * 1024) {
     
     		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +
    +		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
     		 * included in the write-back.  The processor
    
    Modified: stable/8/sys/i386/i386/pmap.c
    ==============================================================================
    --- stable/8/sys/i386/i386/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/i386/i386/pmap.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
      *	and to when physical maps must be made correct.
      */
     
    +#include "opt_apic.h"
     #include "opt_cpu.h"
     #include "opt_pmap.h"
     #include "opt_smp.h"
    @@ -139,6 +140,11 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#ifdef DEV_APIC
    +#include 
    +#include 
    +#include 
    +#endif
     #include 
     #include 
     #include 
    @@ -1164,6 +1170,16 @@ pmap_invalidate_cache_range(vm_offset_t 
     	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
     		 eva - sva < 2 * 1024 * 1024) {
     
    +#ifdef DEV_APIC
    +		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +#endif
     		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
    
    Modified: stable/8/sys/x86/x86/local_apic.c
    ==============================================================================
    --- stable/8/sys/x86/x86/local_apic.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/x86/x86/local_apic.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -223,8 +223,8 @@ lapic_init(vm_paddr_t addr)
     	/* Map the local APIC and setup the spurious interrupt handler. */
     	KASSERT(trunc_page(addr) == addr,
     	    ("local APIC not aligned on a page boundary"));
    -	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	lapic_paddr = addr;
    +	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL,
     	    GSEL_APIC);
     
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 16:19:10 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 10A40219;
     Fri,  1 Mar 2013 16:19:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id 02C6B7ED;
     Fri,  1 Mar 2013 16:19:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21GJ952002536;
     Fri, 1 Mar 2013 16:19:09 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21GJ9wn002534;
     Fri, 1 Mar 2013 16:19:09 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011619.r21GJ9wn002534@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 16:19: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: r247554 - stable/8/lib/libproc
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 16:19:10 -0000
    
    Author: jhb
    Date: Fri Mar  1 16:19:09 2013
    New Revision: 247554
    URL: http://svnweb.freebsd.org/changeset/base/247554
    
    Log:
      MFC 246035:
      - Compute the correct size to reallocate when doubling the size of the
        array of loaded objects to avoid a buffer overrun.
      - Use reallocf() to avoid leaking memory if the realloc() fails.
      
      PR:		kern/175648
    
    Modified:
      stable/8/lib/libproc/proc_rtld.c
    Directory Properties:
      stable/8/lib/libproc/   (props changed)
    
    Modified: stable/8/lib/libproc/proc_rtld.c
    ==============================================================================
    --- stable/8/lib/libproc/proc_rtld.c	Fri Mar  1 16:18:40 2013	(r247553)
    +++ stable/8/lib/libproc/proc_rtld.c	Fri Mar  1 16:19:09 2013	(r247554)
    @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void *
     
     	if (phdl->nobjs >= phdl->rdobjsz) {
     		phdl->rdobjsz *= 2;
    -		phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz);
    +		phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) *
    +		    phdl->rdobjsz);
     		if (phdl->rdobjs == NULL)
     			return (-1);
     	}
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 17:10:53 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B43063B8;
     Fri,  1 Mar 2013 17:10:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id A6251A4B;
     Fri,  1 Mar 2013 17:10:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21HAr82019408;
     Fri, 1 Mar 2013 17:10:53 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21HAqHR019398;
     Fri, 1 Mar 2013 17:10:52 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011710.r21HAqHR019398@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 17:10:52 +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: r247556 - in stable/8/sys: dev/usb/net kern pci 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-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 17:10:53 -0000
    
    Author: jhb
    Date: Fri Mar  1 17:10:52 2013
    New Revision: 247556
    URL: http://svnweb.freebsd.org/changeset/base/247556
    
    Log:
      MFC 246037:
      Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
      compiler from caching their values in tight loops.
    
    Modified:
      stable/8/sys/dev/usb/net/if_cdce.c
      stable/8/sys/kern/kern_clock.c
      stable/8/sys/kern/kern_tc.c
      stable/8/sys/pci/ncr.c
      stable/8/sys/sys/kernel.h
      stable/8/sys/sys/time.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
      stable/8/sys/kern/   (props changed)
      stable/8/sys/pci/   (props changed)
      stable/8/sys/sys/   (props changed)
    
    Modified: stable/8/sys/dev/usb/net/if_cdce.c
    ==============================================================================
    --- stable/8/sys/dev/usb/net/if_cdce.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/dev/usb/net/if_cdce.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -500,6 +500,7 @@ cdce_attach(device_t dev)
     	const struct usb_interface_descriptor *id;
     	const struct usb_cdc_ethernet_descriptor *ued;
     	const struct usb_config *pcfg;
    +	uint32_t seed;
     	int error;
     	uint8_t i;
     	uint8_t data_iface_no;
    @@ -612,8 +613,9 @@ alloc_transfers:
     		/* fake MAC address */
     
     		device_printf(dev, "faking MAC address\n");
    +		seed = ticks;
     		sc->sc_ue.ue_eaddr[0] = 0x2a;
    -		memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t));
    +		memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t));
     		sc->sc_ue.ue_eaddr[5] = device_get_unit(dev);
     
     	} else {
    
    Modified: stable/8/sys/kern/kern_clock.c
    ==============================================================================
    --- stable/8/sys/kern/kern_clock.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/kern/kern_clock.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -379,7 +379,7 @@ static void watchdog_config(void *, u_in
     int	stathz;
     int	profhz;
     int	profprocs;
    -int	ticks;
    +volatile int	ticks;
     int	psratio;
     
     /*
    @@ -461,7 +461,7 @@ void
     hardclock(int usermode, uintfptr_t pc)
     {
     
    -	atomic_add_int((volatile int *)&ticks, 1);
    +	atomic_add_int(&ticks, 1);
     	hardclock_cpu(usermode);
     	tc_ticktock();
     	/*
    
    Modified: stable/8/sys/kern/kern_tc.c
    ==============================================================================
    --- stable/8/sys/kern/kern_tc.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/kern/kern_tc.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -87,8 +87,8 @@ static struct timehands *volatile timeha
     struct timecounter *timecounter = &dummy_timecounter;
     static struct timecounter *timecounters = &dummy_timecounter;
     
    -time_t time_second = 1;
    -time_t time_uptime = 1;
    +volatile time_t time_second = 1;
    +volatile time_t time_uptime = 1;
     
     static struct bintime boottimebin;
     struct timeval boottime;
    
    Modified: stable/8/sys/pci/ncr.c
    ==============================================================================
    --- stable/8/sys/pci/ncr.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/pci/ncr.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -1386,7 +1386,7 @@ static char *ncr_name (ncb_p np)
      * Kernel variables referenced in the scripts.
      * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY.
      */
    -static void *script_kvars[] =
    +static volatile void *script_kvars[] =
     	{ &time_second, &ticks, &ncr_cache };
     
     static	struct script script0 = {
    
    Modified: stable/8/sys/sys/kernel.h
    ==============================================================================
    --- stable/8/sys/sys/kernel.h	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/sys/kernel.h	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -63,7 +63,7 @@ extern int psratio;			/* ratio: prof / s
     extern int stathz;			/* statistics clock's frequency */
     extern int profhz;			/* profiling clock's frequency */
     extern int profprocs;			/* number of process's profiling */
    -extern int ticks;
    +extern volatile int ticks;
     
     #endif /* _KERNEL */
     
    
    Modified: stable/8/sys/sys/time.h
    ==============================================================================
    --- stable/8/sys/sys/time.h	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/sys/time.h	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -262,8 +262,8 @@ struct clockinfo {
     void	inittodr(time_t base);
     void	resettodr(void);
     
    -extern time_t	time_second;
    -extern time_t	time_uptime;
    +extern volatile time_t	time_second;
    +extern volatile time_t	time_uptime;
     extern struct timeval boottime;
     
     /*
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 18:39:56 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 760E0CBB;
     Fri,  1 Mar 2013 18:39:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id 688C5F22;
     Fri,  1 Mar 2013 18:39:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21IduOJ044708;
     Fri, 1 Mar 2013 18:39:56 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21IdtfS044705;
     Fri, 1 Mar 2013 18:39:55 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011839.r21IdtfS044705@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 18:39: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: r247559 - in stable/8/sys: amd64/linux32 compat/linux
     i386/linux
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 18:39:56 -0000
    
    Author: jhb
    Date: Fri Mar  1 18:39:55 2013
    New Revision: 247559
    URL: http://svnweb.freebsd.org/changeset/base/247559
    
    Log:
      MFC 245849:
      Don't assume that all Linux TCP-level socket options are identical to
      FreeBSD TCP-level socket options (only the first two are).  Instead,
      using a mapping function and fail unsupported options as we do for other
      socket option levels.
    
    Modified:
      stable/8/sys/amd64/linux32/linux.h
      stable/8/sys/compat/linux/linux_socket.c
      stable/8/sys/i386/linux/linux.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/compat/   (props changed)
      stable/8/sys/i386/   (props changed)
    
    Modified: stable/8/sys/amd64/linux32/linux.h
    ==============================================================================
    --- stable/8/sys/amd64/linux32/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/amd64/linux32/linux.h	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -721,6 +721,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    Modified: stable/8/sys/compat/linux/linux_socket.c
    ==============================================================================
    --- stable/8/sys/compat/linux/linux_socket.c	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/compat/linux/linux_socket.c	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #ifdef INET6
     #include 
     #include 
    @@ -334,6 +335,21 @@ linux_to_bsd_so_sockopt(int opt)
     }
     
     static int
    +linux_to_bsd_tcp_sockopt(int opt)
    +{
    +
    +	switch (opt) {
    +	case LINUX_TCP_NODELAY:
    +		return (TCP_NODELAY);
    +	case LINUX_TCP_MAXSEG:
    +		return (TCP_MAXSEG);
    +	case LINUX_TCP_MD5SIG:
    +		return (TCP_MD5SIG);
    +	}
    +	return (-1);
    +}
    +
    +static int
     linux_to_bsd_msg_flags(int flags)
     {
     	int ret_flags = 0;
    @@ -1504,8 +1520,7 @@ linux_setsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    @@ -1599,8 +1614,7 @@ linux_getsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    
    Modified: stable/8/sys/i386/linux/linux.h
    ==============================================================================
    --- stable/8/sys/i386/linux/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/i386/linux/linux.h	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -697,6 +697,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 19:01:53 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id AF1BD7C5;
     Fri,  1 Mar 2013 19:01:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id A20A71019;
     Fri,  1 Mar 2013 19:01:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21J1rJY052785;
     Fri, 1 Mar 2013 19:01:53 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21J1rJ9052783;
     Fri, 1 Mar 2013 19:01:53 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011901.r21J1rJ9052783@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:01:53 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247563 - stable/8/usr.sbin/tcpdrop
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:01:53 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:01:52 2013
    New Revision: 247563
    URL: http://svnweb.freebsd.org/changeset/base/247563
    
    Log:
      MFC 246129:
      Allow the address and ports to be separated by a colon or period rather
      than a space to permit directly pasting the output of commands such as
      netstat and sockstat on the command line.
    
    Modified:
      stable/8/usr.sbin/tcpdrop/tcpdrop.8
      stable/8/usr.sbin/tcpdrop/tcpdrop.c
    Directory Properties:
      stable/8/usr.sbin/tcpdrop/   (props changed)
    
    Modified: stable/8/usr.sbin/tcpdrop/tcpdrop.8
    ==============================================================================
    --- stable/8/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 19:01:40 2013	(r247562)
    +++ stable/8/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 19:01:52 2013	(r247563)
    @@ -17,7 +17,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd March 24, 2009
    +.Dd January 30, 2013
     .Dt TCPDROP 8
     .Os
     .Sh NAME
    @@ -62,6 +62,9 @@ will be dropped.
     .Pp
     Addresses and ports may be specified by name or numeric value.
     Both IPv4 and IPv6 address formats are supported.
    +.Pp
    +The addresses and ports may be separated by periods or colons
    +instead of spaces.
     .Sh EXIT STATUS
     .Ex -std
     .Sh EXAMPLES
    
    Modified: stable/8/usr.sbin/tcpdrop/tcpdrop.c
    ==============================================================================
    --- stable/8/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 19:01:40 2013	(r247562)
    +++ stable/8/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 19:01:52 2013	(r247563)
    @@ -49,6 +49,7 @@ struct host_service {
     
     static bool tcpdrop_list_commands = false;
     
    +static char *findport(const char *);
     static struct xinpgen *getxpcblist(const char *);
     static void sockinfo(const struct sockaddr *, struct host_service *);
     static bool tcpdrop(const struct sockaddr *, const struct sockaddr *);
    @@ -64,6 +65,7 @@ static void usage(void);
     int
     main(int argc, char *argv[])
     {
    +	char *lport, *fport;
     	bool dropall;
     	int ch;
     
    @@ -92,15 +94,43 @@ main(int argc, char *argv[])
     		exit(0);
     	}
     
    -	if (argc != 4 || tcpdrop_list_commands)
    +	if ((argc != 2 && argc != 4) || tcpdrop_list_commands)
     		usage();
     
    -	if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
    +	if (argc == 2) {
    +		lport = findport(argv[0]);
    +		fport = findport(argv[1]);
    +		if (lport == NULL || lport[1] == '\0' || fport == NULL ||
    +		    fport[1] == '\0')
    +			usage();
    +		*lport++ = '\0';
    +		*fport++ = '\0';
    +		if (!tcpdropbyname(argv[0], lport, argv[1], fport))
    +			exit(1);
    +	} else if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
     		exit(1);
     
     	exit(0);
     }
     
    +static char *
    +findport(const char *arg)
    +{
    +	char *dot, *colon;
    +
    +	/* A strrspn() or strrpbrk() would be nice. */
    +	dot = strrchr(arg, '.');
    +	colon = strrchr(arg, ':');
    +	if (dot == NULL)
    +		return (colon);
    +	if (colon == NULL)
    +		return (dot);
    +	if (dot < colon)
    +		return (colon);
    +	else
    +		return (dot);
    +}
    +
     static struct xinpgen *
     getxpcblist(const char *name)
     {
    @@ -236,7 +266,7 @@ tcpdropbyname(const char *lhost, const c
     	error = getaddrinfo(fhost, fport, &hints, &foreign);
     	if (error != 0) {
     		freeaddrinfo(local); /* XXX gratuitous */
    -		errx(1, "getaddrinfo: %s port %s: %s", lhost, lport,
    +		errx(1, "getaddrinfo: %s port %s: %s", fhost, fport,
     		    gai_strerror(error));
     	}
     
    @@ -317,6 +347,8 @@ usage(void)
     {
     	fprintf(stderr,
     "usage: tcpdrop local-address local-port foreign-address foreign-port\n"
    +"       tcpdrop local-address:local-port foreign-address:foreign-port\n"
    +"       tcpdrop local-address.local-port foreign-address.foreign-port\n"
     "       tcpdrop [-l] -a\n");
     	exit(1);
     }
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 19:40:03 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 3BA35A11;
     Fri,  1 Mar 2013 19:40:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id 2E1E111CE;
     Fri,  1 Mar 2013 19:40:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Je3am063722;
     Fri, 1 Mar 2013 19:40:03 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Je20Z063717;
     Fri, 1 Mar 2013 19:40:02 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011940.r21Je20Z063717@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:40: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: r247567 - in stable/8: etc/mtree include usr.sbin/pciconf
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:40:03 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:40:02 2013
    New Revision: 247567
    URL: http://svnweb.freebsd.org/changeset/base/247567
    
    Log:
      MFC 246367:
      Install  and  as userland headers
      in /usr/include.
    
    Modified:
      stable/8/etc/mtree/BSD.include.dist
      stable/8/include/Makefile
      stable/8/usr.sbin/pciconf/Makefile
    Directory Properties:
      stable/8/etc/   (props changed)
      stable/8/include/   (props changed)
      stable/8/usr.sbin/pciconf/   (props changed)
    
    Modified: stable/8/etc/mtree/BSD.include.dist
    ==============================================================================
    --- stable/8/etc/mtree/BSD.include.dist	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/etc/mtree/BSD.include.dist	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -88,6 +88,8 @@
         dev
             acpica
             ..
    +        agp
    +        ..
             an
             ..
             bktr
    @@ -118,6 +120,8 @@
             ..
             pbio
             ..
    +        pci
    +        ..
             powermac_nvram
             ..
             ppbus
    
    Modified: stable/8/include/Makefile
    ==============================================================================
    --- stable/8/include/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/include/Makefile	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -39,9 +39,9 @@ LDIRS=	bsm cam geom net net80211 netatal
     	sys vm
     
     LSUBDIRS=	cam/ata cam/scsi \
    -	dev/acpica dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \
    +	dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \
     	dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
    -	dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
    +	dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
     	dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
     	fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
     	${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
    @@ -150,7 +150,7 @@ copies:
     	done
     .endif
     .endfor
    -.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
    +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
     	    ${DESTDIR}${INCLUDEDIR}/$i
    @@ -158,9 +158,15 @@ copies:
     	cd ${.CURDIR}/../sys/dev/acpica; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/agp
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/pci
     	cd ${.CURDIR}/../sys/contrib/altq/altq; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
     	    ${DESTDIR}${INCLUDEDIR}/altq
    @@ -215,7 +221,7 @@ symlinks:
     		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
     	done
     .endfor
    -.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
    +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
     		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
    @@ -226,11 +232,21 @@ symlinks:
     		ln -fs ../../../../sys/dev/acpica/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
     	done
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	for h in agpreg.h; do \
    +		ln -fs ../../../../sys/dev/agp/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/agp; \
    +	done
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	for h in ioctl_*.h; do \
     		ln -fs ../../../../sys/dev/bktr/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
     	done
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	for h in pcireg.h; do \
    +		ln -fs ../../../../sys/dev/pci/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/pci; \
    +	done
     .for i in ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
    
    Modified: stable/8/usr.sbin/pciconf/Makefile
    ==============================================================================
    --- stable/8/usr.sbin/pciconf/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/usr.sbin/pciconf/Makefile	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -5,6 +5,4 @@ PROG=	pciconf
     SRCS=	pciconf.c cap.c err.c
     MAN=	pciconf.8
     
    -CFLAGS+= -I${.CURDIR}/../../sys
    -
     .include 
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar  1 21:35:53 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C449EF6C;
     Fri,  1 Mar 2013 21:35:53 +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 B69E918C8;
     Fri,  1 Mar 2013 21:35:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21LZrMK000711;
     Fri, 1 Mar 2013 21:35:53 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21LZrMK000710;
     Fri, 1 Mar 2013 21:35:53 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303012135.r21LZrMK000710@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 21:35:53 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247583 - stable/8/share/misc
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:35:53 -0000
    
    Author: des
    Date: Fri Mar  1 21:35:53 2013
    New Revision: 247583
    URL: http://svnweb.freebsd.org/changeset/base/247583
    
    Log:
      Manually fix screwed-up mergeinfo.
    
    Modified:
    Directory Properties:
      stable/8/cddl/compat/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/8/contrib/pf/   (props changed)
      stable/8/games/fortune/   (props changed)
      stable/8/gnu/usr.bin/groff/   (props changed)
      stable/8/lib/libradius/   (props changed)
      stable/8/lib/libstand/   (props changed)
      stable/8/share/misc/   (props changed)
      stable/8/share/misc/bsd-family-tree   (props changed)
      stable/8/tools/kerneldoc/subsys/   (props changed)
      stable/8/usr.bin/find/   (props changed)
      stable/8/usr.bin/gcore/   (props changed)
      stable/8/usr.bin/locale/   (props changed)
      stable/8/usr.bin/systat/   (props changed)
      stable/8/usr.bin/vmstat/   (props changed)
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 01:04:03 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D3DE0A31;
     Sat,  2 Mar 2013 01:04:03 +0000 (UTC)
     (envelope-from delphij@FreeBSD.org)
    Received: from svn.freebsd.org (svn.freebsd.org
     [IPv6:2001:1900:2254:2068::e6a:0])
     by mx1.freebsd.org (Postfix) with ESMTP id C634D1FC8;
     Sat,  2 Mar 2013 01:04:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r221433a067093;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22143jI067092;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303020104.r22143jI067092@svn.freebsd.org>
    From: Xin LI 
    Date: Sat, 2 Mar 2013 01:04:03 +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: r247607 - in stable: 8 9
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 01:04:03 -0000
    
    Author: delphij
    Date: Sat Mar  2 01:04:02 2013
    New Revision: 247607
    URL: http://svnweb.freebsd.org/changeset/base/247607
    
    Log:
      MFC r247422:
      
      Add a reminder that the user should update boot block if they are upgrading
      their existing system and use LZ4 compression for ZFS.
      
      Suggested by:	mm
    
    Modified:
      stable/8/UPDATING   (contents, props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/9/UPDATING   (contents, props changed)
    
    Modified: stable/8/UPDATING
    ==============================================================================
    --- stable/8/UPDATING	Sat Mar  2 01:00:26 2013	(r247606)
    +++ stable/8/UPDATING	Sat Mar  2 01:04:02 2013	(r247607)
    @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
     	debugging tools present in HEAD were left in place because
     	sun4v support still needs work to become production ready.
     
    +20130225:
    +	A new compression method (lz4) has been merged.  Please refer to
    +	zpool-features(7) for more information.
    +
    +	Please refer to the "ZFS notes" section of this file for information
    +	on upgrading boot ZFS pools.
    +
     20121130:
     	A new version of ZFS (pool version 5000) has been merged to 8-STABLE.
     	Starting with this version the old system of ZFS pool versioning
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 16:33:40 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A7371E23;
     Sat,  2 Mar 2013 16:33:40 +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 813EF6B3;
     Sat,  2 Mar 2013 16:33:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GXemp057027;
     Sat, 2 Mar 2013 16:33:40 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GXeDk057025;
     Sat, 2 Mar 2013 16:33:40 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021633.r22GXeDk057025@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:33:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247636 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:33:40 -0000
    
    Author: marius
    Date: Sat Mar  2 16:33:39 2013
    New Revision: 247636
    URL: http://svnweb.freebsd.org/changeset/base/247636
    
    Log:
      MFC: r235643
      
      Properly use LDADD & DPADD to link against libwrap.
    
    Modified:
      stable/8/libexec/tftpd/Makefile
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/Makefile
    ==============================================================================
    --- stable/8/libexec/tftpd/Makefile	Sat Mar  2 16:30:18 2013	(r247635)
    +++ stable/8/libexec/tftpd/Makefile	Sat Mar  2 16:33:39 2013	(r247636)
    @@ -7,6 +7,8 @@ SRCS=	tftp-file.c tftp-io.c tftp-options
     SRCS+=	tftpd.c
     WARNS=	6
     WFORMAT=0
    -LDFLAGS= -lwrap
    +
    +DPADD=	${LIBWRAP}
    +LDADD=	-lwrap
     
     .include 
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 16:39:01 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 64FE6453;
     Sat,  2 Mar 2013 16:39:01 +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 3A28B6EB;
     Sat,  2 Mar 2013 16:39:01 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Gd12H058086;
     Sat, 2 Mar 2013 16:39:01 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Gd0Ko058081;
     Sat, 2 Mar 2013 16:39:00 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021639.r22Gd0Ko058081@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:39:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247639 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:39:01 -0000
    
    Author: marius
    Date: Sat Mar  2 16:39:00 2013
    New Revision: 247639
    URL: http://svnweb.freebsd.org/changeset/base/247639
    
    Log:
      MFC: r241720 (partial)
      
      Fix warnings found by -Wmising-variable-declarations.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
      stable/8/libexec/tftpd/tftp-utils.c
      stable/8/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -53,7 +53,7 @@ struct sockaddr_storage me_sock;
     
     static int send_packet(int peer, uint16_t block, char *pkt, int size);
     
    -struct errmsg {
    +static struct errmsg {
     	int	e_code;
     	const char	*e_msg;
     } errmsgs[] = {
    @@ -375,7 +375,7 @@ send_data(int peer, uint16_t block, char
     /*
      * Receive a packet
      */
    -jmp_buf	timeoutbuf;
    +static jmp_buf timeoutbuf;
     
     static void
     timeout(int sig __unused)
    
    Modified: stable/8/libexec/tftpd/tftp-utils.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -121,7 +121,7 @@ get_field(int peer, char *buffer, ssize_
     /*
      * Logging functions
      */
    -int	_tftp_logtostdout = 1;
    +static int _tftp_logtostdout = 1;
     
     void
     tftp_openlog(const char *ident, int logopt, int facility)
    
    Modified: stable/8/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -107,9 +107,9 @@ static void	tftp_xmitfile(int peer, cons
     static int	validate_access(int peer, char **, int);
     static char	peername[NI_MAXHOST];
     
    -FILE *file;
    +static FILE *file;
     
    -struct formats {
    +static struct formats {
     	const char	*f_mode;
     	int	f_convert;
     } formats[] = {
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:14:55 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 3DB64C7E;
     Sat,  2 Mar 2013 17:14:55 +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 16A3B86D;
     Sat,  2 Mar 2013 17:14:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HEs7p070910;
     Sat, 2 Mar 2013 17:14:54 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HEsZf070906;
     Sat, 2 Mar 2013 17:14:54 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021714.r22HEsZf070906@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:14:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247645 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:14:55 -0000
    
    Author: marius
    Date: Sat Mar  2 17:14:53 2013
    New Revision: 247645
    URL: http://svnweb.freebsd.org/changeset/base/247645
    
    Log:
      MFC: r246106, r246139
      
      Mark tftp_log() as __printflike() and deal with the fallout.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
      stable/8/libexec/tftpd/tftp-options.c
      stable/8/libexec/tftpd/tftp-utils.h
      stable/8/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -107,13 +107,13 @@ send_packet(int peer, uint16_t block, ch
     	for (i = 0; i < 12 ; i++) {
     		DROPPACKETn("send_packet", 0);
     
    -		if (sendto(peer, pkt, size, 0,
    -			(struct sockaddr *)&peer_sock, peer_sock.ss_len)
    -			== size) {
    +		if (sendto(peer, pkt, size, 0, (struct sockaddr *)&peer_sock,
    +		    peer_sock.ss_len) == size) {
     			if (i)
     				tftp_log(LOG_ERR,
     				    "%s block %d, attempt %d successful",
    -				    block, i);
    +		    		    packettype(ntohs(((struct tftphdr *)
    +				    (pkt))->th_opcode)), block, i);
     			return (0);
     		}
     		tftp_log(LOG_ERR,
    @@ -143,7 +143,7 @@ send_error(int peer, int error)
     	char buf[MAXPKTSIZE];
     
     	if (debug&DEBUG_PACKETS)
    -		tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error);
    +		tftp_log(LOG_DEBUG, "Sending ERROR %d", error);
     
     	DROPPACKET("send_error");
     
    
    Modified: stable/8/libexec/tftpd/tftp-options.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-options.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-options.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -99,16 +99,17 @@ option_tsize(int peer __unused, struct t
     int
     option_timeout(int peer)
     {
    +	int to;
     
     	if (options[OPT_TIMEOUT].o_request == NULL)
     		return (0);
     
    -	int to = atoi(options[OPT_TIMEOUT].o_request);
    +	to = atoi(options[OPT_TIMEOUT].o_request);
     	if (to < TIMEOUT_MIN || to > TIMEOUT_MAX) {
     		tftp_log(acting_as_client ? LOG_ERR : LOG_WARNING,
     		    "Received bad value for timeout. "
    -		    "Should be between %d and %d, received %s",
    -		    TIMEOUT_MIN, TIMEOUT_MAX);
    +		    "Should be between %d and %d, received %d",
    +		    TIMEOUT_MIN, TIMEOUT_MAX, to);
     		send_error(peer, EBADOP);
     		if (acting_as_client)
     			return (1);
    @@ -195,14 +196,14 @@ option_blksize(int peer)
     			tftp_log(LOG_ERR,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			send_error(peer, EBADOP);
     			return (1);
     		} else {
     			tftp_log(LOG_WARNING,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			size = maxdgram;
     			/* No reason to return */
     		}
    @@ -257,7 +258,7 @@ option_blksize2(int peer __unused)
     		}
     		tftp_log(LOG_INFO,
     		    "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram "
    -		    "sysctl limits it to %d bytes.\n", size, maxdgram);
    +		    "sysctl limits it to %ld bytes.\n", size, maxdgram);
     		size = sizes[i];
     		/* No need to return */
     	}
    
    Modified: stable/8/libexec/tftpd/tftp-utils.h
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -106,7 +106,7 @@ const char *debug_show(int d);
     extern int tftp_logtostdout;
     void	tftp_openlog(const char *ident, int logopt, int facility);
     void	tftp_closelog(void);
    -void	tftp_log(int priority, const char *message, ...);
    +void	tftp_log(int priority, const char *message, ...) __printflike(2, 3);
     
     /*
      * Performance figures
    
    Modified: stable/8/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -799,8 +800,8 @@ tftp_xmitfile(int peer, const char *mode
     	tftp_send(peer, &block, &ts);
     	read_close();
     	if (debug&DEBUG_SIMPLE)
    -		tftp_log(LOG_INFO, "Sent %d bytes in %d seconds",
    -		    ts.amount, time(NULL) - now);
    +		tftp_log(LOG_INFO, "Sent %jd bytes in %jd seconds",
    +		    (intmax_t)ts.amount, (intmax_t)time(NULL) - now);
     }
     
     static void
    @@ -832,8 +833,8 @@ tftp_recvfile(int peer, const char *mode
     		f = now2.tv_sec - now1.tv_sec +
     		    (now2.tv_usec - now1.tv_usec) / 100000.0;
     		tftp_log(LOG_INFO,
    -		    "Download of %d bytes in %d blocks completed after %0.1f seconds\n",
    -		    ts.amount, block, f);
    +		    "Download of %jd bytes in %d blocks completed after %0.1f seconds\n",
    +		    (intmax_t)ts.amount, block, f);
     	}
     
     	return;
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:18:39 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 56AD0FAE;
     Sat,  2 Mar 2013 17:18:39 +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 3155E894;
     Sat,  2 Mar 2013 17:18:39 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HIdJ7071505;
     Sat, 2 Mar 2013 17:18:39 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HId7Q071503;
     Sat, 2 Mar 2013 17:18:39 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021718.r22HId7Q071503@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:18:39 +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: r247646 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:18:39 -0000
    
    Author: marius
    Date: Sat Mar  2 17:18:38 2013
    New Revision: 247646
    URL: http://svnweb.freebsd.org/changeset/base/247646
    
    Log:
      MFC: r244686
      
      Use correct size in snprintf.
      Remove unused buffer.
      
      PR:		174631
      Submitted by:	Henning Petersen
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:53 2013	(r247645)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:18:38 2013	(r247646)
    @@ -87,14 +87,13 @@ errtomsg(int error)
     {
     	static char ebuf[40];
     	struct errmsg *pe;
    -	char buf[MAXPKTSIZE];
     
     	if (error == 0)
     		return ("success");
     	for (pe = errmsgs; pe->e_code >= 0; pe++)
     		if (pe->e_code == error)
     			return (pe->e_msg);
    -	snprintf(ebuf, sizeof(buf), "error %d", error);
    +	snprintf(ebuf, sizeof(ebuf), "error %d", error);
     	return (ebuf);
     }
     
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:21:45 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3FD8631D;
     Sat,  2 Mar 2013 17:21:45 +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 323EC8D1;
     Sat,  2 Mar 2013 17:21:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HLjO6073532;
     Sat, 2 Mar 2013 17:21:45 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HLjIp073531;
     Sat, 2 Mar 2013 17:21:45 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021721.r22HLjIp073531@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:21:45 +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: r247647 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:21:45 -0000
    
    Author: marius
    Date: Sat Mar  2 17:21:44 2013
    New Revision: 247647
    URL: http://svnweb.freebsd.org/changeset/base/247647
    
    Log:
      MFC: r231973
      
      Avoid error log for transfer stop w/o error code.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:18:38 2013	(r247646)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:21:44 2013	(r247647)
    @@ -462,7 +462,8 @@ receive_packet(int peer, char *data, int
     	}
     
     	if (pkt->th_opcode == ERROR) {
    -		tftp_log(LOG_ERR, "Got ERROR packet: %s", pkt->th_msg);
    +		tftp_log(pkt->th_code == EUNDEF ? LOG_DEBUG : LOG_ERR,
    +		    "Got ERROR packet: %s", pkt->th_msg);
     		return (RP_ERROR);
     	}
     
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:24:29 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id ED109614;
     Sat,  2 Mar 2013 17:24:29 +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 C83CF8EC;
     Sat,  2 Mar 2013 17:24:29 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HOTpn074093;
     Sat, 2 Mar 2013 17:24:29 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HOT9Z074092;
     Sat, 2 Mar 2013 17:24:29 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021724.r22HOT9Z074092@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:24:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247649 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:24:30 -0000
    
    Author: marius
    Date: Sat Mar  2 17:24:29 2013
    New Revision: 247649
    URL: http://svnweb.freebsd.org/changeset/base/247649
    
    Log:
      MFC: r233648 (partial)
      
      Remove trailing whitespace per mdoc lint warning.
    
    Modified:
      stable/8/libexec/tftpd/tftpd.8
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftpd.8
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:23:47 2013	(r247648)
    +++ stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:24:29 2013	(r247649)
    @@ -161,9 +161,9 @@ which is specified.
     .Pp
     If
     .Ar value
    -is specified, then the debug level is set to 
    +is specified, then the debug level is set to
     .Ar value .
    -The debug level is a bitmask implemented in 
    +The debug level is a bitmask implemented in
     .Pa src/libexec/tftpd/tftp-utils.h .
     Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE),
     4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS).  Multiple debug values can be combined
    @@ -262,7 +262,7 @@ TFTP options are mentioned here:
     .Rs
     .%T Extending TFTP
     .%U http://www.compuphase.com/tftp.htm
    -.Re 
    +.Re
     .Sh HISTORY
     The
     .Nm
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:25:45 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BA1D7787;
     Sat,  2 Mar 2013 17:25:45 +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 AC5218FA;
     Sat,  2 Mar 2013 17:25:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HPjg5074347;
     Sat, 2 Mar 2013 17:25:45 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HPjUF074346;
     Sat, 2 Mar 2013 17:25:45 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021725.r22HPjUF074346@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:25:45 +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: r247651 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:25:45 -0000
    
    Author: marius
    Date: Sat Mar  2 17:25:45 2013
    New Revision: 247651
    URL: http://svnweb.freebsd.org/changeset/base/247651
    
    Log:
      MFC: r235857
      
      mdoc: Only use macros inside a reference block.
    
    Modified:
      stable/8/libexec/tftpd/tftpd.8
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftpd.8
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:25:41 2013	(r247650)
    +++ stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:25:45 2013	(r247651)
    @@ -238,20 +238,16 @@ option.
     .Pp
     The following RFC's are supported:
     .Rs
    -RFC 1350
    -.%T The TFTP Protocol (Revision 2)
    +.%T RFC 1350: The TFTP Protocol (Revision 2)
     .Re
     .Rs
    -RFC 2347
    -.%T TFTP Option Extension
    +.%T RFC 2347: TFTP Option Extension
     .Re
     .Rs
    -RFC 2348
    -.%T TFTP Blocksize Option
    +.%T RFC 2348: TFTP Blocksize Option
     .Re
     .Rs
    -RFC 2349
    -.%T TFTP Timeout Interval and Transfer Size Options
    +.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options
     .Re
     .Pp
     The non-standard
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:32:21 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 32594B9A;
     Sat,  2 Mar 2013 17:32:21 +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 15ED2937;
     Sat,  2 Mar 2013 17:32:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HWKSU076905;
     Sat, 2 Mar 2013 17:32:20 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HWKa6076903;
     Sat, 2 Mar 2013 17:32:20 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021732.r22HWKa6076903@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:32: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: r247653 - stable/8/sys/dev/ata
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:32:21 -0000
    
    Author: marius
    Date: Sat Mar  2 17:32:20 2013
    New Revision: 247653
    URL: http://svnweb.freebsd.org/changeset/base/247653
    
    Log:
      MFC: r246257
      
      Improve r238673 (MFC'ed to stable/8 in r239495) to additionally allow
      for odd-aligned buffers as passed in by smartd of smartmontools.
      While at it, hint the compiler that 32-bit PIO is the most likely
      case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
      of bus_{read,write}_multi_stream_2(9) for single count reads/writes.
    
    Modified:
      stable/8/sys/dev/ata/ata-all.h
      stable/8/sys/dev/ata/ata-lowlevel.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/ata/   (props changed)
    
    Modified: stable/8/sys/dev/ata/ata-all.h
    ==============================================================================
    --- stable/8/sys/dev/ata/ata-all.h	Sat Mar  2 17:32:15 2013	(r247652)
    +++ stable/8/sys/dev/ata/ata-all.h	Sat Mar  2 17:32:20 2013	(r247653)
    @@ -698,6 +698,8 @@ MALLOC_DECLARE(M_ATA);
     
     #define ATA_INW(res, offset) \
     	bus_read_2((res), (offset))
    +#define ATA_INW_STRM(res, offset) \
    +	bus_read_stream_2((res), (offset))
     #define ATA_INL(res, offset) \
     	bus_read_4((res), (offset))
     #define ATA_INSW(res, offset, addr, count) \
    @@ -712,6 +714,8 @@ MALLOC_DECLARE(M_ATA);
     	bus_write_1((res), (offset), (value))
     #define ATA_OUTW(res, offset, value) \
     	bus_write_2((res), (offset), (value))
    +#define ATA_OUTW_STRM(res, offset, value) \
    +	bus_write_stream_2((res), (offset), (value))
     #define ATA_OUTL(res, offset, value) \
     	bus_write_4((res), (offset), (value))
     #define ATA_OUTSW(res, offset, addr, count) \
    @@ -729,6 +733,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_INW(ch, idx) \
     	ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    +#define ATA_IDX_INW_STRM(ch, idx) \
    +	ATA_INW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset)
    +
     #define ATA_IDX_INL(ch, idx) \
     	ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    @@ -750,6 +757,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_OUTW(ch, idx, value) \
     	ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    +#define ATA_IDX_OUTW_STRM(ch, idx, value) \
    +	ATA_OUTW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, value)
    +
     #define ATA_IDX_OUTL(ch, idx, value) \
     	ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    
    Modified: stable/8/sys/dev/ata/ata-lowlevel.c
    ==============================================================================
    --- stable/8/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:32:15 2013	(r247652)
    +++ stable/8/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:32:20 2013	(r247653)
    @@ -847,14 +847,28 @@ ata_pio_read(struct ata_request *request
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +		*(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
    +	        addr[i++] = buf[0];
    +	        addr[i++] = buf[1];
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
    -	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
     	    (addr + (size & ~1))[0] = buf[0];
     	}
         } else
    @@ -876,15 +890,30 @@ ata_pio_write(struct ata_request *reques
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
    +    size = min(request->transfersize, length);
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +	        buf[0] = addr[i++];
    +	        buf[1] = addr[i++];
    +		ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
     	    buf[0] = (addr + (size & ~1))[0];
    -	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
     	}
         } else
     	ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t));
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:36:32 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 790D3F5A;
     Sat,  2 Mar 2013 17:36: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 5334A959;
     Sat,  2 Mar 2013 17:36:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HaW8B077598;
     Sat, 2 Mar 2013 17:36:32 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HaWns077597;
     Sat, 2 Mar 2013 17:36:32 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021736.r22HaWns077597@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:36:32 +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: r247655 - stable/8/sys/dev/uart
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:36:32 -0000
    
    Author: marius
    Date: Sat Mar  2 17:36:31 2013
    New Revision: 247655
    URL: http://svnweb.freebsd.org/changeset/base/247655
    
    Log:
      MFC: r246300
      
      - Make pci_ns8250_ids[] const.
      - Use DEVMETHOD_END.
      - Use NULL instead of 0 for pointers.
    
    Modified:
      stable/8/sys/dev/uart/uart_bus_pci.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/uart/   (props changed)
    
    Modified: stable/8/sys/dev/uart/uart_bus_pci.c
    ==============================================================================
    --- stable/8/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:36:29 2013	(r247654)
    +++ stable/8/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:36:31 2013	(r247655)
    @@ -51,7 +51,7 @@ static device_method_t uart_pci_methods[
     	DEVMETHOD(device_probe,		uart_pci_probe),
     	DEVMETHOD(device_attach,	uart_bus_attach),
     	DEVMETHOD(device_detach,	uart_bus_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     static driver_t uart_pci_driver = {
    @@ -70,7 +70,7 @@ struct pci_id {
     	int		rclk;
     };
     
    -static struct pci_id pci_ns8250_ids[] = {
    +static const struct pci_id pci_ns8250_ids[] = {
     { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14,
     	128 * DEFAULT_RCLK },
     { 0x1028, 0x0012, 0xffff, 0, "Dell RAC 4 Daughter Card Virtual UART", 0x14,
    @@ -129,8 +129,8 @@ static struct pci_id pci_ns8250_ids[] = 
     { 0xffff, 0, 0xffff, 0, NULL, 0, 0}
     };
     
    -static struct pci_id *
    -uart_pci_match(device_t dev, struct pci_id *id)
    +const static struct pci_id *
    +uart_pci_match(device_t dev, const struct pci_id *id)
     {
     	uint16_t device, subdev, subven, vendor;
     
    @@ -155,7 +155,7 @@ static int
     uart_pci_probe(device_t dev)
     {
     	struct uart_softc *sc;
    -	struct pci_id *id;
    +	const struct pci_id *id;
     
     	sc = device_get_softc(dev);
     
    @@ -173,4 +173,4 @@ uart_pci_probe(device_t dev)
     	return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0));
     }
     
    -DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, 0, 0);
    +DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL);
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 17:39:21 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 0E32C432;
     Sat,  2 Mar 2013 17:39:21 +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 DC514984;
     Sat,  2 Mar 2013 17:39:20 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HdKml078088;
     Sat, 2 Mar 2013 17:39:20 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HdKKV078087;
     Sat, 2 Mar 2013 17:39:20 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021739.r22HdKKV078087@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:39: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: r247657 - stable/8/sys/kern
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:39:21 -0000
    
    Author: marius
    Date: Sat Mar  2 17:39:20 2013
    New Revision: 247657
    URL: http://svnweb.freebsd.org/changeset/base/247657
    
    Log:
      MFC: r246689, r246696
      
      Make SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
      constant values.
      
      Reviewed by:	kib
    
    Modified:
      stable/8/sys/kern/kern_sysctl.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/kern/   (props changed)
    
    Modified: stable/8/sys/kern/kern_sysctl.c
    ==============================================================================
    --- stable/8/sys/kern/kern_sysctl.c	Sat Mar  2 17:39:11 2013	(r247656)
    +++ stable/8/sys/kern/kern_sysctl.c	Sat Mar  2 17:39:20 2013	(r247657)
    @@ -992,7 +992,10 @@ sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS
     
     
     /*
    - * Handle a long, signed or unsigned.  arg1 points to it.
    + * Handle a long, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     
     int
    @@ -1007,9 +1010,10 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmplong = *(long *)arg1;
    +	if (arg1)
    +		tmplong = *(long *)arg1;
    +	else
    +		tmplong = arg2;
     #ifdef SCTL_MASK32
     	if (req->flags & SCTL_MASK32) {
     		tmpint = tmplong;
    @@ -1021,18 +1025,24 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	if (error || !req->newptr)
     		return (error);
     
    +	if (!arg1)
    +		error = EPERM;
     #ifdef SCTL_MASK32
    -	if (req->flags & SCTL_MASK32) {
    +	else if (req->flags & SCTL_MASK32) {
     		error = SYSCTL_IN(req, &tmpint, sizeof(int));
     		*(long *)arg1 = (long)tmpint;
    -	} else
    +	}
     #endif
    +	else
     		error = SYSCTL_IN(req, arg1, sizeof(long));
     	return (error);
     }
     
     /*
    - * Handle a 64 bit int, signed or unsigned.  arg1 points to it.
    + * Handle a 64 bit int, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     
     int
    @@ -1044,15 +1054,19 @@ sysctl_handle_quad(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmpout = *(uint64_t *)arg1;
    +	if (arg1)
    +		tmpout = *(uint64_t *)arg1;
    +	else
    +		tmpout = arg2;
     	error = SYSCTL_OUT(req, &tmpout, sizeof(uint64_t));
     
     	if (error || !req->newptr)
     		return (error);
     
    -	error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
    +	if (!arg1)
    +		error = EPERM;
    +	else
    +		error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
     	return (error);
     }
     
    
    From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar  2 21:59:09 2013
    Return-Path: 
    Delivered-To: svn-src-stable-8@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 24705308;
     Sat,  2 Mar 2013 21:59:09 +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 081243DC;
     Sat,  2 Mar 2013 21:59:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Lx9Dq058603;
     Sat, 2 Mar 2013 21:59:09 GMT (envelope-from np@svn.freebsd.org)
    Received: (from np@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Lx7QD058594;
     Sat, 2 Mar 2013 21:59:07 GMT (envelope-from np@svn.freebsd.org)
    Message-Id: <201303022159.r22Lx7QD058594@svn.freebsd.org>
    From: Navdeep Parhar 
    Date: Sat, 2 Mar 2013 21:59: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: r247670 - in stable/8: share/man/man4 sys/conf
     sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware
     sys/modules/cxgbe/firmware sys/modules/cxgbe/if_cxgbe tools/tools/cxgbetool
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-stable-8@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: SVN commit messages for only the 8-stable src tree
     
    List-Unsubscribe: , 
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: , 
     
    X-List-Received-Date: Sat, 02 Mar 2013 21:59:09 -0000
    
    Author: np
    Date: Sat Mar  2 21:59:07 2013
    New Revision: 247670
    URL: http://svnweb.freebsd.org/changeset/base/247670
    
    Log:
      MFC r234831, r234833, r237263**, r237436*, r237439, r237463, r237512,
      r237587, r237799, r237819, r237831, r238028, r238054, r238313, r239102,
      r239258, r239259, r239264*, r239266, r239336, r239338*, r239339,
      r239341, r239344, r240443, r240451, r240452*, r240453, r241397, r241398,
      r241399, r241401, r241409, r241416, r241493, r244551, r244580, r245243,
      r245274*, r245276*, r245434*, r245517, r245518, r245520, r245567,
      r245933, r245935, r245936, r246093, r246385, r246575, r247062, r247122,
      r247289, r247291, r247347, r247355.
      
      This brings stable/8's cxgbe(4) up to date with what's in head right
      now.  One major difference is the missing t4_tom (TCP Offload Module);
      there are no plans to backport it to 8.
      
      Build tested with make universe (with -DMAKE_JUST_KERNELS)
      
      *  partial
      ** partial manual backport, not really an MFC
    
    Added:
      stable/8/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
         - copied unchanged from r247289, head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
    Deleted:
      stable/8/sys/dev/cxgbe/common/jhash.h
    Modified:
      stable/8/share/man/man4/cxgbe.4
      stable/8/sys/conf/files
      stable/8/sys/conf/kern.pre.mk
      stable/8/sys/dev/cxgbe/adapter.h
      stable/8/sys/dev/cxgbe/common/common.h
      stable/8/sys/dev/cxgbe/common/t4_hw.c
      stable/8/sys/dev/cxgbe/common/t4_hw.h
      stable/8/sys/dev/cxgbe/common/t4_msg.h
      stable/8/sys/dev/cxgbe/firmware/t4fw_cfg.txt
      stable/8/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt
      stable/8/sys/dev/cxgbe/firmware/t4fw_interface.h
      stable/8/sys/dev/cxgbe/offload.h
      stable/8/sys/dev/cxgbe/osdep.h
      stable/8/sys/dev/cxgbe/t4_ioctl.h
      stable/8/sys/dev/cxgbe/t4_l2t.c
      stable/8/sys/dev/cxgbe/t4_l2t.h
      stable/8/sys/dev/cxgbe/t4_main.c
      stable/8/sys/dev/cxgbe/t4_sge.c
      stable/8/sys/modules/cxgbe/firmware/Makefile
      stable/8/sys/modules/cxgbe/if_cxgbe/Makefile
      stable/8/tools/tools/cxgbetool/cxgbetool.c
    Directory Properties:
      stable/8/share/man/man4/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/conf/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/cxgbe/   (props changed)
      stable/8/sys/modules/   (props changed)
      stable/8/tools/tools/cxgbetool/   (props changed)
    
    Modified: stable/8/share/man/man4/cxgbe.4
    ==============================================================================
    --- stable/8/share/man/man4/cxgbe.4	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/share/man/man4/cxgbe.4	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -1,4 +1,4 @@
    -.\" Copyright (c) 2011, Chelsio Inc
    +.\" Copyright (c) 2011-2012, Chelsio Inc
     .\" All rights reserved.
     .\"
     .\" Redistribution and use in source and binary forms, with or without
    @@ -145,10 +145,9 @@ dev.cxgbe.X.holdoff_tmr_idx sysctl.
     The packet-count index value to use to delay interrupts.
     The packet-count list has the values 1, 8, 16, and 32 by default
     and the index selects a value from this list.
    -The default value is 2 for both 10Gb and 1Gb ports, which means 16
    -packets (or the holdoff timer going off) before an interrupt is
    -generated.
    --1 disables packet counting.
    +The default value is -1 for both 10Gb and 1Gb ports, which means packet
    +counting is disabled and interrupts are generated based solely on the
    +holdoff timer value.
     Different cxgbe interfaces can be assigned different values via the
     dev.cxgbe.X.holdoff_pktc_idx sysctl.
     This sysctl works only when the interface has never been marked up (as done by
    @@ -179,6 +178,15 @@ Bit 0 represents INTx (line interrupts),
     The default is 7 (all allowed).
     The driver will select the best possible type out of the allowed types by
     itself.
    +.It Va hw.cxgbe.fw_install
    +0 prohibits the driver from installing a firmware on the card.
    +1 allows the driver to install a new firmware if internal driver
    +heuristics indicate that the new firmware is preferable to the one
    +already on the card.
    +2 instructs the driver to always install the new firmware on the card as
    +long as it is compatible with the driver and is a different version than
    +the one already on the card.
    +The default is 1.
     .It Va hw.cxgbe.config_file
     Select a pre-packaged device configuration file.
     A configuration file contains a recipe for partitioning and configuring the
    
    Modified: stable/8/sys/conf/files
    ==============================================================================
    --- stable/8/sys/conf/files	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/conf/files	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -815,6 +815,40 @@ dev/cxgbe/t4_l2t.c		optional cxgbe pci \
     	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
     dev/cxgbe/common/t4_hw.c	optional cxgbe pci \
     	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
    +t4fw_cfg.c		optional cxgbe					\
    +	compile-with	"${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \
    +	no-implicit-rule before-depend local				\
    +	clean		"t4fw_cfg.c"
    +t4fw_cfg.fwo		optional cxgbe					\
    +	dependency	"t4fw_cfg.fw"					\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw_cfg.fwo"
    +t4fw_cfg.fw		optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg.txt"		\
    +	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw_cfg.fw"
    +t4fw_cfg_uwire.fwo	optional cxgbe					\
    +	dependency	"t4fw_cfg_uwire.fw"				\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw_cfg_uwire.fwo"
    +t4fw_cfg_uwire.fw	optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg_uwire.txt"	\
    +	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw_cfg_uwire.fw"
    +t4fw.fwo		optional cxgbe					\
    +	dependency	"t4fw.fw"					\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw.fwo"
    +t4fw.fw			optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu"	\
    +	compile-with	"${NORMAL_FW}"					\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw.fw"
     dev/cy/cy.c			optional cy
     dev/cy/cy_isa.c			optional cy isa
     dev/cy/cy_pci.c			optional cy pci
    
    Modified: stable/8/sys/conf/kern.pre.mk
    ==============================================================================
    --- stable/8/sys/conf/kern.pre.mk	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/conf/kern.pre.mk	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -15,6 +15,7 @@ LDSCRIPT?=	$S/conf/${LDSCRIPT_NAME}
     M=	${MACHINE_ARCH}
     
     AWK?=		awk
    +CP?=		cp
     LINT?=		lint
     NM?=		nm
     OBJCOPY?=	objcopy
    
    Modified: stable/8/sys/dev/cxgbe/adapter.h
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/adapter.h	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/adapter.h	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -44,6 +44,7 @@
     #include 
     #include 
     #include 
    +#include 
     #include 
     
     #include "offload.h"
    @@ -77,6 +78,15 @@ prefetch(void *x)
     #define SBUF_DRAIN 1
     #endif
     
    +#if (__FreeBSD_version < 900000)
    +#define IFCAP_RXCSUM_IPV6 0
    +#define IFCAP_TXCSUM_IPV6 0
    +#define CSUM_DATA_VALID_IPV6 0
    +#define IFCAP_HWCSUM_IPV6 0
    +#define CSUM_UDP_IPV6 0
    +#define CSUM_TCP_IPV6 0
    +#endif
    +
     #ifdef __amd64__
     /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
     static __inline uint64_t
    @@ -134,6 +144,7 @@ enum {
     #else
     	FL_BUF_SIZES = 3,	/* cluster, jumbo9k, jumbo16k */
     #endif
    +	OFLD_BUF_SIZE = MJUM16BYTES,	/* size of fl buffer for TOE rxq */
     
     	CTRL_EQ_QSIZE = 128,
     
    @@ -142,6 +153,12 @@ enum {
     	TX_WR_FLITS = SGE_MAX_WR_LEN / 8
     };
     
    +#ifdef T4_PKT_TIMESTAMP
    +#define RX_COPY_THRESHOLD (MINCLSIZE - 8)
    +#else
    +#define RX_COPY_THRESHOLD MINCLSIZE
    +#endif
    +
     enum {
     	/* adapter intr_type */
     	INTR_INTX	= (1 << 0),
    @@ -150,12 +167,23 @@ enum {
     };
     
     enum {
    +	/* flags understood by begin_synchronized_op */
    +	HOLD_LOCK	= (1 << 0),
    +	SLEEP_OK	= (1 << 1),
    +	INTR_OK		= (1 << 2),
    +
    +	/* flags understood by end_synchronized_op */
    +	LOCK_HELD	= HOLD_LOCK,
    +};
    +
    +enum {
     	/* adapter flags */
     	FULL_INIT_DONE	= (1 << 0),
     	FW_OK		= (1 << 1),
     	INTR_DIRECT	= (1 << 2),	/* direct interrupts for everything */
     	MASTER_PF	= (1 << 3),
     	ADAP_SYSCTL_CTX	= (1 << 4),
    +	TOM_INIT_DONE	= (1 << 5),
     
     	CXGBE_BUSY	= (1 << 9),
     
    @@ -165,11 +193,11 @@ enum {
     	PORT_SYSCTL_CTX	= (1 << 2),
     };
     
    -#define IS_DOOMED(pi)	(pi->flags & DOOMED)
    -#define SET_DOOMED(pi)	do {pi->flags |= DOOMED;} while (0)
    -#define IS_BUSY(sc)	(sc->flags & CXGBE_BUSY)
    -#define SET_BUSY(sc)	do {sc->flags |= CXGBE_BUSY;} while (0)
    -#define CLR_BUSY(sc)	do {sc->flags &= ~CXGBE_BUSY;} while (0)
    +#define IS_DOOMED(pi)	((pi)->flags & DOOMED)
    +#define SET_DOOMED(pi)	do {(pi)->flags |= DOOMED;} while (0)
    +#define IS_BUSY(sc)	((sc)->flags & CXGBE_BUSY)
    +#define SET_BUSY(sc)	do {(sc)->flags |= CXGBE_BUSY;} while (0)
    +#define CLR_BUSY(sc)	do {(sc)->flags &= ~CXGBE_BUSY;} while (0)
     
     struct port_info {
     	device_t dev;
    @@ -198,7 +226,7 @@ struct port_info {
     	int first_txq;	/* index of first tx queue */
     	int nrxq;	/* # of rx queues */
     	int first_rxq;	/* index of first rx queue */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int nofldtxq;		/* # of offload tx queues */
     	int first_ofld_txq;	/* index of first offload tx queue */
     	int nofldrxq;		/* # of offload rx queues */
    @@ -271,7 +299,6 @@ struct sge_iq {
     	bus_dma_tag_t desc_tag;
     	bus_dmamap_t desc_map;
     	bus_addr_t ba;		/* bus address of descriptor ring */
    -	char lockname[16];
     	uint32_t flags;
     	uint16_t abs_id;	/* absolute SGE id for the iq */
     	int8_t   intr_pktc_idx;	/* packet count threshold index */
    @@ -295,7 +322,7 @@ struct sge_iq {
     enum {
     	EQ_CTRL		= 1,
     	EQ_ETH		= 2,
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	EQ_OFLD		= 3,
     #endif
     
    @@ -388,7 +415,7 @@ struct sge_txq {
     	/* stats for common events first */
     
     	uint64_t txcsum;	/* # of times hardware assisted with checksum */
    -	uint64_t tso_wrs;	/* # of IPv4 TSO work requests */
    +	uint64_t tso_wrs;	/* # of TSO work requests */
     	uint64_t vlan_insertion;/* # of times VLAN tag was inserted */
     	uint64_t imm_wrs;	/* # of work requests with immediate data */
     	uint64_t sgl_wrs;	/* # of work requests with direct SGL */
    @@ -408,7 +435,7 @@ struct sge_rxq {
     	struct sge_fl fl;	/* MUST follow iq */
     
     	struct ifnet *ifp;	/* the interface this rxq belongs to */
    -#ifdef INET
    +#if defined(INET) || defined(INET6)
     	struct lro_ctrl lro;	/* LRO state */
     #endif
     
    @@ -421,14 +448,36 @@ struct sge_rxq {
     
     } __aligned(CACHE_LINE_SIZE);
     
    -#ifndef TCP_OFFLOAD_DISABLE
    +static inline struct sge_rxq *
    +iq_to_rxq(struct sge_iq *iq)
    +{
    +
    +	return (member2struct(sge_rxq, iq, iq));
    +}
    +
    +
    +#ifdef TCP_OFFLOAD
     /* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */
     struct sge_ofld_rxq {
     	struct sge_iq iq;	/* MUST be first */
     	struct sge_fl fl;	/* MUST follow iq */
     } __aligned(CACHE_LINE_SIZE);
    +
    +static inline struct sge_ofld_rxq *
    +iq_to_ofld_rxq(struct sge_iq *iq)
    +{
    +
    +	return (member2struct(sge_ofld_rxq, iq, iq));
    +}
     #endif
     
    +struct wrqe {
    +	STAILQ_ENTRY(wrqe) link;
    +	struct sge_wrq *wrq;
    +	int wr_len;
    +	uint64_t wr[] __aligned(16);
    +};
    +
     /*
      * wrq: SGE egress queue that is given prebuilt work requests.  Both the control
      * and offload tx queues are of this type.
    @@ -437,8 +486,9 @@ struct sge_wrq {
     	struct sge_eq eq;	/* MUST be first */
     
     	struct adapter *adapter;
    -	struct mbuf *head;	/* held up due to lack of descriptors */
    -	struct mbuf *tail;	/* valid only if head is valid */
    +
    +	/* List of WRs held up due to lack of tx descriptors */
    +	STAILQ_HEAD(, wrqe) wr_list;
     
     	/* stats for common events first */
     
    @@ -456,7 +506,7 @@ struct sge {
     
     	int nrxq;	/* total # of Ethernet rx queues */
     	int ntxq;	/* total # of Ethernet tx tx queues */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int nofldrxq;	/* total # of TOE rx queues */
     	int nofldtxq;	/* total # of TOE tx queues */
     #endif
    @@ -468,7 +518,7 @@ struct sge {
     	struct sge_wrq *ctrlq;	/* Control queues */
     	struct sge_txq *txq;	/* NIC tx queues */
     	struct sge_rxq *rxq;	/* NIC rx queues */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	struct sge_wrq *ofld_txq;	/* TOE tx queues */
     	struct sge_ofld_rxq *ofld_rxq;	/* TOE rx queues */
     #endif
    @@ -482,6 +532,8 @@ struct sge {
     struct rss_header;
     typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *,
         struct mbuf *);
    +typedef int (*an_handler_t)(struct sge_iq *, const struct rsp_ctrl *);
    +typedef int (*fw_msg_handler_t)(struct adapter *, const __be64 *);
     
     struct adapter {
     	SLIST_ENTRY(adapter) link;
    @@ -518,21 +570,22 @@ struct adapter {
     	uint8_t chan_map[NCHAN];
     	uint32_t filter_mode;
     
    -#ifndef TCP_OFFLOAD_DISABLE
    -	struct uld_softc tom;
    +#ifdef TCP_OFFLOAD
    +	void *tom_softc;	/* (struct tom_data *) */
     	struct tom_tunables tt;
     #endif
     	struct l2t_data *l2t;	/* L2 table */
     	struct tid_info tids;
     
     	int open_device_map;
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int offload_map;
     #endif
     	int flags;
     
     	char fw_version[32];
    -	unsigned int cfcsum;
    +	char cfg_file[32];
    +	u_int cfcsum;
     	struct adapter_params params;
     	struct t4_virt_res vres;
     
    @@ -553,7 +606,14 @@ struct adapter {
     	TAILQ_HEAD(, sge_fl) sfl;
     	struct callout sfl_callout;
     
    -	cpl_handler_t cpl_handler[256] __aligned(CACHE_LINE_SIZE);
    +	an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
    +	fw_msg_handler_t fw_msg_handler[5];	/* NUM_FW6_TYPES */
    +	cpl_handler_t cpl_handler[0xef];	/* NUM_CPL_CMDS */
    +
    +#ifdef INVARIANTS
    +	const char *last_op;
    +	const void *last_op_thr;
    +#endif
     };
     
     #define ADAPTER_LOCK(sc)		mtx_lock(&(sc)->sc_lock)
    @@ -561,6 +621,12 @@ struct adapter {
     #define ADAPTER_LOCK_ASSERT_OWNED(sc)	mtx_assert(&(sc)->sc_lock, MA_OWNED)
     #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED)
     
    +/* XXX: not bulletproof, but much better than nothing */
    +#define ASSERT_SYNCHRONIZED_OP(sc)	\
    +    KASSERT(IS_BUSY(sc) && \
    +	(mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \
    +	("%s: operation not synchronized.", __func__))
    +
     #define PORT_LOCK(pi)			mtx_lock(&(pi)->pi_lock)
     #define PORT_UNLOCK(pi)			mtx_unlock(&(pi)->pi_lock)
     #define PORT_LOCK_ASSERT_OWNED(pi)	mtx_assert(&(pi)->pi_lock, MA_OWNED)
    @@ -589,18 +655,18 @@ struct adapter {
     #define TXQ_LOCK_ASSERT_OWNED(txq)	EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
     #define TXQ_LOCK_ASSERT_NOTOWNED(txq)	EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
     
    -#define for_each_txq(pi, iter, txq) \
    -	txq = &pi->adapter->sge.txq[pi->first_txq]; \
    -	for (iter = 0; iter < pi->ntxq; ++iter, ++txq)
    -#define for_each_rxq(pi, iter, rxq) \
    -	rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \
    -	for (iter = 0; iter < pi->nrxq; ++iter, ++rxq)
    -#define for_each_ofld_txq(pi, iter, ofld_txq) \
    -	ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \
    -	for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq)
    -#define for_each_ofld_rxq(pi, iter, ofld_rxq) \
    -	ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \
    -	for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq)
    +#define for_each_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
    +	    iter < pi->ntxq; ++iter, ++q)
    +#define for_each_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \
    +	    iter < pi->nrxq; ++iter, ++q)
    +#define for_each_ofld_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \
    +	    iter < pi->nofldtxq; ++iter, ++q)
    +#define for_each_ofld_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \
    +	    iter < pi->nofldrxq; ++iter, ++q)
     
     /* One for errors, one for firmware events */
     #define T4_EXTRA_INTR 2
    @@ -608,82 +674,96 @@ struct adapter {
     static inline uint32_t
     t4_read_reg(struct adapter *sc, uint32_t reg)
     {
    +
     	return bus_space_read_4(sc->bt, sc->bh, reg);
     }
     
     static inline void
     t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val)
     {
    +
     	bus_space_write_4(sc->bt, sc->bh, reg, val);
     }
     
     static inline uint64_t
     t4_read_reg64(struct adapter *sc, uint32_t reg)
     {
    +
     	return t4_bus_space_read_8(sc->bt, sc->bh, reg);
     }
     
     static inline void
     t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val)
     {
    +
     	t4_bus_space_write_8(sc->bt, sc->bh, reg, val);
     }
     
     static inline void
     t4_os_pci_read_cfg1(struct adapter *sc, int reg, uint8_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 1);
     }
     
     static inline void
     t4_os_pci_write_cfg1(struct adapter *sc, int reg, uint8_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 1);
     }
     
     static inline void
     t4_os_pci_read_cfg2(struct adapter *sc, int reg, uint16_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 2);
     }
     
     static inline void
     t4_os_pci_write_cfg2(struct adapter *sc, int reg, uint16_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 2);
     }
     
     static inline void
     t4_os_pci_read_cfg4(struct adapter *sc, int reg, uint32_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 4);
     }
     
     static inline void
     t4_os_pci_write_cfg4(struct adapter *sc, int reg, uint32_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 4);
     }
     
     static inline struct port_info *
     adap2pinfo(struct adapter *sc, int idx)
     {
    +
     	return (sc->port[idx]);
     }
     
     static inline void
     t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[])
     {
    +
     	bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN);
     }
     
     static inline bool is_10G_port(const struct port_info *pi)
     {
    +
     	return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0);
     }
     
     static inline int tx_resume_threshold(struct sge_eq *eq)
     {
    +
     	return (eq->qsize / 4);
     }
     
    @@ -697,6 +777,11 @@ void t4_os_portmod_changed(const struct 
     void t4_os_link_changed(struct adapter *, int, int);
     void t4_iterate(void (*)(struct adapter *, void *), void *);
     int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t);
    +int t4_register_an_handler(struct adapter *, an_handler_t);
    +int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t);
    +int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
    +int begin_synchronized_op(struct adapter *, struct port_info *, int, char *);
    +void end_synchronized_op(struct adapter *, int);
     
     /* t4_sge.c */
     void t4_sge_modload(void);
    @@ -713,21 +798,45 @@ void t4_intr_all(void *);
     void t4_intr(void *);
     void t4_intr_err(void *);
     void t4_intr_evt(void *);
    -int t4_mgmt_tx(struct adapter *, struct mbuf *);
    -int t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct mbuf *);
    +void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
     int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *);
     void t4_update_fl_bufsize(struct ifnet *);
     int can_resume_tx(struct sge_eq *);
     
    -static inline int t4_wrq_tx(struct adapter *sc, struct sge_wrq *wrq, struct mbuf *m)
    +static inline struct wrqe *
    +alloc_wrqe(int wr_len, struct sge_wrq *wrq)
     {
    -	int rc;
    +	int len = offsetof(struct wrqe, wr) + wr_len;
    +	struct wrqe *wr;
    +
    +	wr = malloc(len, M_CXGBE, M_NOWAIT);
    +	if (__predict_false(wr == NULL))
    +		return (NULL);
    +	wr->wr_len = wr_len;
    +	wr->wrq = wrq;
    +	return (wr);
    +}
    +
    +static inline void *
    +wrtod(struct wrqe *wr)
    +{
    +	return (&wr->wr[0]);
    +}
    +
    +static inline void
    +free_wrqe(struct wrqe *wr)
    +{
    +	free(wr, M_CXGBE);
    +}
    +
    +static inline void
    +t4_wrq_tx(struct adapter *sc, struct wrqe *wr)
    +{
    +	struct sge_wrq *wrq = wr->wrq;
     
     	TXQ_LOCK(wrq);
    -	rc = t4_wrq_tx_locked(sc, wrq, m);
    +	t4_wrq_tx_locked(sc, wrq, wr);
     	TXQ_UNLOCK(wrq);
    -	return (rc);
     }
     
    -
     #endif
    
    Modified: stable/8/sys/dev/cxgbe/common/common.h
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/common/common.h	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/common/common.h	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -38,6 +38,8 @@ enum {
     	SERNUM_LEN     = 24,    /* Serial # length */
     	EC_LEN         = 16,    /* E/C length */
     	ID_LEN         = 16,    /* ID length */
    +	PN_LEN         = 16,    /* Part Number length */
    +	MACADDR_LEN    = 12,    /* MAC Address length */
     };
     
     enum { MEM_EDC0, MEM_EDC1, MEM_MC };
    @@ -62,8 +64,14 @@ enum {
     };
     
     #define FW_VERSION_MAJOR 1
    -#define FW_VERSION_MINOR 4
    -#define FW_VERSION_MICRO 16
    +#define FW_VERSION_MINOR 8
    +#define FW_VERSION_MICRO 4
    +#define FW_VERSION_BUILD 0
    +
    +#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \
    +    V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \
    +    V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \
    +    V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD))
     
     struct port_stats {
     	u64 tx_octets;            /* total # of octets in good frames */
    @@ -219,6 +227,8 @@ struct vpd_params {
     	u8 ec[EC_LEN + 1];
     	u8 sn[SERNUM_LEN + 1];
     	u8 id[ID_LEN + 1];
    +	u8 pn[PN_LEN + 1];
    +	u8 na[MACADDR_LEN + 1];
     };
     
     struct pci_params {
    @@ -356,6 +366,8 @@ void t4_write_indirect(struct adapter *a
     		       unsigned int data_reg, const u32 *vals,
     		       unsigned int nregs, unsigned int start_idx);
     
    +u32 t4_hw_pci_read_cfg4(adapter_t *adapter, int reg);
    +
     struct fw_filter_wr;
     
     void t4_intr_enable(struct adapter *adapter);
    @@ -374,7 +386,7 @@ int t4_seeprom_wp(struct adapter *adapte
     int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords,
     		  u32 *data, int byte_oriented);
     int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
    -int t4_load_boot(struct adapter *adap, const u8 *boot_data,
    +int t4_load_boot(struct adapter *adap, u8 *boot_data,
                      unsigned int boot_addr, unsigned int size);
     unsigned int t4_flash_cfg_addr(struct adapter *adapter);
     int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
    @@ -431,6 +443,9 @@ int t4_mem_read(struct adapter *adap, in
     		__be32 *data);
     
     void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
    +void t4_get_port_stats_offset(struct adapter *adap, int idx,
    +		struct port_stats *stats,
    +		struct port_stats *offset);
     void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p);
     void t4_clr_port_stats(struct adapter *adap, int idx);
     
    @@ -472,6 +487,10 @@ int t4_fw_hello(struct adapter *adap, un
     		enum dev_master master, enum dev_state *state);
     int t4_fw_bye(struct adapter *adap, unsigned int mbox);
     int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
    +int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force);
    +int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset);
    +int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
    +		  const u8 *fw_data, unsigned int size, int force);
     int t4_fw_initialize(struct adapter *adap, unsigned int mbox);
     int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
     		    unsigned int vf, unsigned int nparams, const u32 *params,
    @@ -484,6 +503,10 @@ int t4_cfg_pfvf(struct adapter *adap, un
     		unsigned int rxqi, unsigned int rxq, unsigned int tc,
     		unsigned int vi, unsigned int cmask, unsigned int pmask,
     		unsigned int exactf, unsigned int rcaps, unsigned int wxcaps);
    +int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox,
    +		     unsigned int port, unsigned int pf, unsigned int vf,
    +		     unsigned int nmac, u8 *mac, unsigned int *rss_size,
    +		     unsigned int portfunc, unsigned int idstype);
     int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
     		unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac,
     		unsigned int *rss_size);
    @@ -504,6 +527,8 @@ int t4_enable_vi(struct adapter *adap, u
     		 bool rx_en, bool tx_en);
     int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
     		     unsigned int nblinks);
    +int t4_i2c_rd(struct adapter *adap, unsigned int mbox, unsigned int port_id,
    +	      u8 dev_addr, u8 offset, u8 *valp);
     int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
     	       unsigned int mmd, unsigned int reg, unsigned int *valp);
     int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
    @@ -524,5 +549,7 @@ int t4_sge_ctxt_rd(struct adapter *adap,
     		   enum ctxt_type ctype, u32 *data);
     int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype,
     		      u32 *data);
    +int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox);
     int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
    +int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val);
     #endif /* __CHELSIO_COMMON_H */
    
    Modified: stable/8/sys/dev/cxgbe/common/t4_hw.c
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/common/t4_hw.c	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/common/t4_hw.c	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -1,5 +1,5 @@
     /*-
    - * Copyright (c) 2011 Chelsio Communications, Inc.
    + * Copyright (c) 2012 Chelsio Communications, Inc.
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -27,13 +27,20 @@
     #include 
     __FBSDID("$FreeBSD$");
     
    +#include "opt_inet.h"
    +
     #include "common.h"
     #include "t4_regs.h"
     #include "t4_regs_values.h"
     #include "firmware/t4fw_interface.h"
     
     #undef msleep
    -#define msleep(x) pause("t4hw", (x) * hz / 1000)
    +#define msleep(x) do { \
    +	if (cold) \
    +		DELAY((x) * 1000); \
    +	else \
    +		pause("t4hw", (x) * hz / 1000); \
    +} while (0)
     
     /**
      *	t4_wait_op_done_val - wait until an operation is completed
    @@ -133,6 +140,50 @@ void t4_write_indirect(struct adapter *a
     }
     
     /*
    + * Read a 32-bit PCI Configuration Space register via the PCI-E backdoor
    + * mechanism.  This guarantees that we get the real value even if we're
    + * operating within a Virtual Machine and the Hypervisor is trapping our
    + * Configuration Space accesses.
    + */
    +u32 t4_hw_pci_read_cfg4(adapter_t *adap, int reg)
    +{
    +	t4_write_reg(adap, A_PCIE_CFG_SPACE_REQ,
    +		     F_ENABLE | F_LOCALCFG | V_FUNCTION(adap->pf) |
    +		     V_REGISTER(reg));
    +	return t4_read_reg(adap, A_PCIE_CFG_SPACE_DATA);
    +}
    +
    +/*
    + *	t4_report_fw_error - report firmware error
    + *	@adap: the adapter
    + *
    + *	The adapter firmware can indicate error conditions to the host.
    + *	This routine prints out the reason for the firmware error (as
    + *	reported by the firmware).
    + */
    +static void t4_report_fw_error(struct adapter *adap)
    +{
    +	static const char *reason[] = {
    +		"Crash",			/* PCIE_FW_EVAL_CRASH */
    +		"During Device Preparation",	/* PCIE_FW_EVAL_PREP */
    +		"During Device Configuration",	/* PCIE_FW_EVAL_CONF */
    +		"During Device Initialization",	/* PCIE_FW_EVAL_INIT */
    +		"Unexpected Event",		/* PCIE_FW_EVAL_UNEXPECTEDEVENT */
    +		"Insufficient Airflow",		/* PCIE_FW_EVAL_OVERHEAT */
    +		"Device Shutdown",		/* PCIE_FW_EVAL_DEVICESHUTDOWN */
    +		"Reserved",			/* reserved */
    +	};
    +	u32 pcie_fw;
    +
    +	pcie_fw = t4_read_reg(adap, A_PCIE_FW);
    +	if (!(pcie_fw & F_PCIE_FW_ERR))
    +		CH_ERR(adap, "Firmware error report called with no error\n");
    +	else
    +		CH_ERR(adap, "Firmware reports adapter error: %s\n",
    +		       reason[G_PCIE_FW_EVAL(pcie_fw)]);
    +}
    +
    +/*
      * Get the reply to a mailbox command and store it in @rpl in big-endian order.
      */
     static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit,
    @@ -194,7 +245,6 @@ int t4_wr_mbox_meat(struct adapter *adap
     	u64 res;
     	int i, ms, delay_idx;
     	const __be64 *p = cmd;
    -
     	u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA);
     	u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL);
     
    @@ -247,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap
     		}
     	}
     
    +	/*
    +	 * We timed out waiting for a reply to our mailbox command.  Report
    +	 * the error and also check to see if the firmware reported any
    +	 * errors ...
    +	 */
     	CH_ERR(adap, "command %#x in mailbox %d timed out\n",
     	       *(const u8 *)cmd, mbox);
    +	if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adap);
     	return -ETIMEDOUT;
     }
     
    @@ -281,7 +338,7 @@ int t4_mc_read(struct adapter *adap, u32
     #define MC_DATA(i) MC_BIST_STATUS_REG(A_MC_BIST_STATUS_RDATA, i)
     
     	for (i = 15; i >= 0; i--)
    -		*data++ = htonl(t4_read_reg(adap, MC_DATA(i)));
    +		*data++ = ntohl(t4_read_reg(adap, MC_DATA(i)));
     	if (ecc)
     		*ecc = t4_read_reg64(adap, MC_DATA(16));
     #undef MC_DATA
    @@ -319,7 +376,7 @@ int t4_edc_read(struct adapter *adap, in
     #define EDC_DATA(i) (EDC_BIST_STATUS_REG(A_EDC_BIST_STATUS_RDATA, i) + idx)
     
     	for (i = 15; i >= 0; i--)
    -		*data++ = htonl(t4_read_reg(adap, EDC_DATA(i)));
    +		*data++ = ntohl(t4_read_reg(adap, EDC_DATA(i)));
     	if (ecc)
     		*ecc = t4_read_reg64(adap, EDC_DATA(16));
     #undef EDC_DATA
    @@ -564,7 +621,7 @@ static int get_vpd_keyword_val(const str
     static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
     {
     	int i, ret, addr;
    -	int ec, sn;
    +	int ec, sn, pn, na;
     	u8 vpd[VPD_LEN], csum;
     	const struct t4_vpd_hdr *v;
     
    @@ -600,6 +657,8 @@ static int get_vpd_params(struct adapter
     	}
     	FIND_VPD_KW(ec, "EC");
     	FIND_VPD_KW(sn, "SN");
    +	FIND_VPD_KW(pn, "PN");
    +	FIND_VPD_KW(na, "NA");
     #undef FIND_VPD_KW
     
     	memcpy(p->id, v->id_data, ID_LEN);
    @@ -609,6 +668,10 @@ static int get_vpd_params(struct adapter
     	i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2];
     	memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN));
     	strstrip(p->sn);
    +	memcpy(p->pn, vpd + pn, min(i, PN_LEN));
    +	strstrip((char *)p->pn);
    +	memcpy(p->na, vpd + na, min(i, MACADDR_LEN));
    +	strstrip((char *)p->na);
     
     	return 0;
     }
    @@ -952,7 +1015,7 @@ int t4_load_cfg(struct adapter *adap, co
     	if (ret || size == 0)
     		goto out;
     
    -        /* this will write to the flash up to SF_PAGE_SIZE at a time */
    +	/* this will write to the flash up to SF_PAGE_SIZE at a time */
     	for (i = 0; i< size; i+= SF_PAGE_SIZE) {
     		if ( (size - i) <  SF_PAGE_SIZE) 
     			n = size - i;
    @@ -1054,42 +1117,209 @@ out:
     	return ret;
     }
     
    -/* BIOS boot header */
    -typedef struct boot_header_s {
    -	u8	signature[2];	/* signature */
    -	u8	length;		/* image length (include header) */
    -	u8	offset[4];	/* initialization vector */
    -	u8	reserved[19];	/* reserved */
    -	u8	exheader[2];	/* offset to expansion header */
    -} boot_header_t;
    +/* BIOS boot headers */
    +typedef struct pci_expansion_rom_header {
    +	u8	signature[2]; /* ROM Signature. Should be 0xaa55 */
    +	u8	reserved[22]; /* Reserved per processor Architecture data */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Structure */
    +} pci_exp_rom_header_t; /* PCI_EXPANSION_ROM_HEADER */
    +
    +/* Legacy PCI Expansion ROM Header */
    +typedef struct legacy_pci_expansion_rom_header {
    +	u8	signature[2]; /* ROM Signature. Should be 0xaa55 */
    +	u8	size512; /* Current Image Size in units of 512 bytes */
    +	u8	initentry_point[4];
    +	u8	cksum; /* Checksum computed on the entire Image */
    +	u8	reserved[16]; /* Reserved */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Struture */
    +} legacy_pci_exp_rom_header_t; /* LEGACY_PCI_EXPANSION_ROM_HEADER */
    +
    +/* EFI PCI Expansion ROM Header */
    +typedef struct efi_pci_expansion_rom_header {
    +	u8	signature[2]; // ROM signature. The value 0xaa55
    +	u8	initialization_size[2]; /* Units 512. Includes this header */
    +	u8	efi_signature[4]; /* Signature from EFI image header. 0x0EF1 */
    +	u8	efi_subsystem[2]; /* Subsystem value for EFI image header */
    +	u8	efi_machine_type[2]; /* Machine type from EFI image header */
    +	u8	compression_type[2]; /* Compression type. */
    +		/* 
    +		 * Compression type definition
    +		 * 0x0: uncompressed
    +		 * 0x1: Compressed
    +		 * 0x2-0xFFFF: Reserved
    +		 */
    +	u8	reserved[8]; /* Reserved */
    +	u8	efi_image_header_offset[2]; /* Offset to EFI Image */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Structure */
    +} efi_pci_exp_rom_header_t; /* EFI PCI Expansion ROM Header */
    +
    +/* PCI Data Structure Format */
    +typedef struct pcir_data_structure { /* PCI Data Structure */
    +	u8	signature[4]; /* Signature. The string "PCIR" */
    +	u8	vendor_id[2]; /* Vendor Identification */
    +	u8	device_id[2]; /* Device Identification */
    +	u8	vital_product[2]; /* Pointer to Vital Product Data */
    +	u8	length[2]; /* PCIR Data Structure Length */
    +	u8	revision; /* PCIR Data Structure Revision */
    +	u8	class_code[3]; /* Class Code */
    +	u8	image_length[2]; /* Image Length. Multiple of 512B */
    +	u8	code_revision[2]; /* Revision Level of Code/Data */
    +	u8	code_type; /* Code Type. */
    +		/*
    +		 * PCI Expansion ROM Code Types
    +		 * 0x00: Intel IA-32, PC-AT compatible. Legacy
    +		 * 0x01: Open Firmware standard for PCI. FCODE
    +		 * 0x02: Hewlett-Packard PA RISC. HP reserved
    +		 * 0x03: EFI Image. EFI
    +		 * 0x04-0xFF: Reserved.
    +		 */
    +	u8	indicator; /* Indicator. Identifies the last image in the ROM */
    +	u8	reserved[2]; /* Reserved */
    +} pcir_data_t; /* PCI__DATA_STRUCTURE */
     
    +/* BOOT constants */
     enum {
     	BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */
     	BOOT_SIGNATURE = 0xaa55,   /* signature of BIOS boot ROM */
     	BOOT_SIZE_INC = 512,       /* image size measured in 512B chunks */
    -	BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */
    -	BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment  */
    +	BOOT_MIN_SIZE = sizeof(pci_exp_rom_header_t), /* basic header */
    +	BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC, /* 1 byte * length increment  */
    +	VENDOR_ID = 0x1425, /* Vendor ID */
    +	PCIR_SIGNATURE = 0x52494350 /* PCIR signature */
     };
     
     /*
    + *	modify_device_id - Modifies the device ID of the Boot BIOS image 
    + *	@adatper: the device ID to write.
    + *	@boot_data: the boot image to modify.
    + *
    + *	Write the supplied device ID to the boot BIOS image.
    + */
    +static void modify_device_id(int device_id, u8 *boot_data)
    +{
    +	legacy_pci_exp_rom_header_t *header;
    +	pcir_data_t *pcir_header;
    +	u32 cur_header = 0;
    +
    +	/*
    +	 * Loop through all chained images and change the device ID's
    +	 */
    +	while (1) {
    +		header = (legacy_pci_exp_rom_header_t *) &boot_data[cur_header];
    +		pcir_header = (pcir_data_t *) &boot_data[cur_header +
    +		    le16_to_cpu(*(u16*)header->pcir_offset)];
    +
    +		/*
    +		 * Only modify the Device ID if code type is Legacy or HP.
    +		 * 0x00: Okay to modify
    +		 * 0x01: FCODE. Do not be modify
    +		 * 0x03: Okay to modify
    +		 * 0x04-0xFF: Do not modify
    +		 */
    +		if (pcir_header->code_type == 0x00) {
    +			u8 csum = 0;
    +			int i;
    +
    +			/*
    +			 * Modify Device ID to match current adatper
    +			 */
    +			*(u16*) pcir_header->device_id = device_id;
    +
    +			/*
    +			 * Set checksum temporarily to 0.
    +			 * We will recalculate it later.
    +			 */
    +			header->cksum = 0x0;
    +
    +			/*
    +			 * Calculate and update checksum
    +			 */
    +			for (i = 0; i < (header->size512 * 512); i++)
    +				csum += (u8)boot_data[cur_header + i];
    +
    +			/*
    +			 * Invert summed value to create the checksum
    +			 * Writing new checksum value directly to the boot data
    +			 */
    +			boot_data[cur_header + 7] = -csum;
    +
    +		} else if (pcir_header->code_type == 0x03) {
    +
    +			/*
    +			 * Modify Device ID to match current adatper
    +			 */
    +			*(u16*) pcir_header->device_id = device_id;
    +
    +		}
    +
    +
    +		/*
    +		 * Check indicator element to identify if this is the last
    +		 * image in the ROM.
    +		 */
    +		if (pcir_header->indicator & 0x80)
    +			break;
    +
    +		/*
    +		 * Move header pointer up to the next image in the ROM.
    +		 */
    +		cur_header += header->size512 * 512;
    +	}
    +}
    +
    +/*
      *	t4_load_boot - download boot flash
      *	@adapter: the adapter
      *	@boot_data: the boot image to write
    + *	@boot_addr: offset in flash to write boot_data
      *	@size: image size
      *
      *	Write the supplied boot image to the card's serial flash.
      *	The boot image has the following sections: a 28-byte header and the
      *	boot image.
      */
    -int t4_load_boot(struct adapter *adap, const u8 *boot_data, 
    +int t4_load_boot(struct adapter *adap, u8 *boot_data, 
     		 unsigned int boot_addr, unsigned int size)
     {
    +	pci_exp_rom_header_t *header;
    +	int pcir_offset ;
    +	pcir_data_t *pcir_header;
     	int ret, addr;
    +	uint16_t device_id;
     	unsigned int i;
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***